Fixed a crash when breaking an Ender IO conduit with the Destructor. Fixes #1813

This commit is contained in:
raoulvdberge
2018-06-14 16:58:35 +02:00
parent 67f07a8f5d
commit e8f97d5006
2 changed files with 10 additions and 1 deletions

View File

@@ -26,6 +26,8 @@ import net.minecraft.tileentity.TileEntityShulkerBox;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
@@ -102,7 +104,13 @@ public class NetworkNodeDestructor extends NetworkNode implements IComparable, I
IBlockState frontBlockState = world.getBlockState(front);
Block frontBlock = frontBlockState.getBlock();
ItemStack frontStack = frontBlock.getPickBlock(frontBlockState, null, world, front, null);
ItemStack frontStack = frontBlock.getPickBlock(
frontBlockState,
new RayTraceResult(new Vec3d(pos.getX(), pos.getY(), pos.getZ()), getDirection().getOpposite()),
world,
front,
FakePlayerFactory.getMinecraft((WorldServer) world)
);
if (!frontStack.isEmpty()) {
if (IFilterable.canTake(itemFilters, mode, compare, frontStack) && frontBlockState.getBlockHardness(world, front) != -1.0) {