Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
protected boolean canPushLine(World world, int x, int y, int z, Direction direction, int maxPushedBlocks) { int xo = x + direction.getOffsetX(); int yo = y + direction.getOffsetY(); int zo = z + direction.getOffsetZ(); int blocks = 0; boolean didCrush = false; while(true) { if (blocks < maxPushedBlocks + 1) { if (yo < 0 || yo >= world.getHeightBlocks()) { return false; } int id = world.getBlockId(xo, yo, zo); if (id != 0) { if (!this.isPushable(id, world, xo, yo, zo, true)) { if (blocks != 1 || !BlockTags.PISTON_CRUSHING.appliesTo(Blocks.getBlock(id)) || !this.tryCrush(world, x, y, z, direction)) { return false; } didCrush = true; } else if (Blocks.blocksList[id].getPistonPushReaction(world, xo, yo, zo) != 1) { if (blocks == maxPushedBlocks) { return false; } xo += direction.getOffsetX(); yo += direction.getOffsetY(); zo += direction.getOffsetZ(); ++blocks; continue; } } } if (!didCrush && blocks == 1) { xo = x + direction.getOffsetX(); yo = y + direction.getOffsetY(); zo = z + direction.getOffsetZ(); Block> block = world.getBlock(xo, yo, zo); if (block == null) { return true; } int blockMeta = world.getBlockMetadata(xo, yo, zo); TileEntity tileEntity = world.getTileEntity(xo, yo, zo); world.removeBlockTileEntity(xo, yo, zo); world.setBlockWithNotify(xo, yo, zo, 0); if (!world.isClientSide) { EntityFallingBlock entityFallingBlock = new EntityFallingBlock(world, (double)xo + (double)0.5F, (double)yo + (double)0.5F, (double)zo + (double)0.5F, block.id(), blockMeta, tileEntity); entityFallingBlock.hasRemovedBlock = true; if (tileEntity instanceof IVehicle) { Entity rider = ((IVehicle)tileEntity).getPassenger(); ((IVehicle)tileEntity).ejectRider(); if (rider != null) { rider.startRiding(entityFallingBlock); } } world.entityJoinedWorld(entityFallingBlock); double speed = (double)2.0F; entityFallingBlock.fling((double)direction.getOffsetX() * (double)2.0F, (double)direction.getOffsetY() * (double)2.0F, (double)direction.getOffsetZ() * (double)2.0F, 1.0F); this.flungBlock = entityFallingBlock; } } return true; } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)