2020-04-16 04:42:42 +02:00
|
|
|
package de.ellpeck.prettypipes.pipe;
|
2020-04-13 21:48:35 +02:00
|
|
|
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
2020-10-17 14:29:37 +02:00
|
|
|
import de.ellpeck.prettypipes.Registry;
|
2020-04-14 01:38:48 +02:00
|
|
|
import de.ellpeck.prettypipes.Utility;
|
2020-05-17 21:05:41 +02:00
|
|
|
import de.ellpeck.prettypipes.items.IModule;
|
2020-04-14 04:21:28 +02:00
|
|
|
import de.ellpeck.prettypipes.network.PipeNetwork;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraft.block.*;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.block.material.Material;
|
2020-04-14 14:10:58 +02:00
|
|
|
import net.minecraft.entity.LivingEntity;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
2020-09-22 19:14:07 +02:00
|
|
|
import net.minecraft.fluid.FluidState;
|
2020-04-18 00:45:19 +02:00
|
|
|
import net.minecraft.fluid.Fluids;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.item.BlockItemUseContext;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.state.EnumProperty;
|
|
|
|
import net.minecraft.state.StateContainer;
|
2020-04-18 00:45:19 +02:00
|
|
|
import net.minecraft.state.properties.BlockStateProperties;
|
|
|
|
import net.minecraft.tags.FluidTags;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.ActionResultType;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.util.Direction;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraft.util.Hand;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraft.util.math.BlockRayTraceResult;
|
2020-10-17 00:58:31 +02:00
|
|
|
import net.minecraft.util.math.shapes.IBooleanFunction;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.util.math.shapes.ISelectionContext;
|
|
|
|
import net.minecraft.util.math.shapes.VoxelShape;
|
|
|
|
import net.minecraft.util.math.shapes.VoxelShapes;
|
|
|
|
import net.minecraft.world.IBlockReader;
|
2020-04-16 20:03:18 +02:00
|
|
|
import net.minecraft.world.IWorld;
|
2020-04-13 21:48:35 +02:00
|
|
|
import net.minecraft.world.World;
|
2020-04-14 01:38:48 +02:00
|
|
|
import net.minecraftforge.fml.network.NetworkHooks;
|
|
|
|
import net.minecraftforge.items.CapabilityItemHandler;
|
|
|
|
import net.minecraftforge.items.IItemHandler;
|
2020-05-17 21:05:41 +02:00
|
|
|
import net.minecraftforge.items.ItemHandlerHelper;
|
2020-10-17 14:52:35 +02:00
|
|
|
import org.apache.commons.lang3.mutable.MutableObject;
|
2020-10-17 00:58:31 +02:00
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2020-04-13 21:48:35 +02:00
|
|
|
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
2020-10-17 14:52:35 +02:00
|
|
|
import java.util.function.Function;
|
2020-04-13 21:48:35 +02:00
|
|
|
|
2020-10-17 14:29:37 +02:00
|
|
|
public class PipeBlock extends ContainerBlock {
|
2020-04-13 21:48:35 +02:00
|
|
|
|
|
|
|
public static final Map<Direction, EnumProperty<ConnectionType>> DIRECTIONS = new HashMap<>();
|
2020-10-17 00:58:31 +02:00
|
|
|
private static final Map<Pair<BlockState, BlockState>, VoxelShape> SHAPE_CACHE = new HashMap<>();
|
2020-10-17 14:52:35 +02:00
|
|
|
private static final Map<Pair<BlockState, BlockState>, VoxelShape> COLL_SHAPE_CACHE = new HashMap<>();
|
2020-04-13 21:48:35 +02:00
|
|
|
private static final VoxelShape CENTER_SHAPE = makeCuboidShape(5, 5, 5, 11, 11, 11);
|
2020-04-13 22:54:18 +02:00
|
|
|
public static final Map<Direction, VoxelShape> DIR_SHAPES = ImmutableMap.<Direction, VoxelShape>builder()
|
2020-04-13 21:48:35 +02:00
|
|
|
.put(Direction.UP, makeCuboidShape(5, 10, 5, 11, 16, 11))
|
|
|
|
.put(Direction.DOWN, makeCuboidShape(5, 0, 5, 11, 6, 11))
|
|
|
|
.put(Direction.NORTH, makeCuboidShape(5, 5, 0, 11, 11, 6))
|
|
|
|
.put(Direction.SOUTH, makeCuboidShape(5, 5, 10, 11, 11, 16))
|
|
|
|
.put(Direction.EAST, makeCuboidShape(10, 5, 5, 16, 11, 11))
|
|
|
|
.put(Direction.WEST, makeCuboidShape(0, 5, 5, 6, 11, 11))
|
|
|
|
.build();
|
|
|
|
|
|
|
|
static {
|
|
|
|
for (Direction dir : Direction.values())
|
2020-09-22 19:14:07 +02:00
|
|
|
DIRECTIONS.put(dir, EnumProperty.create(dir.getName2(), ConnectionType.class));
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public PipeBlock() {
|
|
|
|
super(Block.Properties.create(Material.ROCK).hardnessAndResistance(2).sound(SoundType.STONE).notSolid());
|
|
|
|
|
2020-04-18 00:45:19 +02:00
|
|
|
BlockState state = this.getDefaultState().with(BlockStateProperties.WATERLOGGED, false);
|
2020-04-13 21:48:35 +02:00
|
|
|
for (EnumProperty<ConnectionType> prop : DIRECTIONS.values())
|
|
|
|
state = state.with(prop, ConnectionType.DISCONNECTED);
|
|
|
|
this.setDefaultState(state);
|
|
|
|
}
|
|
|
|
|
2020-04-14 01:38:48 +02:00
|
|
|
@Override
|
2020-04-16 04:42:42 +02:00
|
|
|
public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult result) {
|
2020-04-14 01:38:48 +02:00
|
|
|
PipeTileEntity tile = Utility.getTileEntity(PipeTileEntity.class, worldIn, pos);
|
|
|
|
if (tile == null)
|
|
|
|
return ActionResultType.PASS;
|
2020-05-17 15:29:10 +02:00
|
|
|
if (!tile.canHaveModules())
|
2020-04-15 18:35:00 +02:00
|
|
|
return ActionResultType.PASS;
|
2020-05-17 21:05:41 +02:00
|
|
|
ItemStack stack = player.getHeldItem(handIn);
|
|
|
|
if (stack.getItem() instanceof IModule) {
|
|
|
|
ItemStack copy = stack.copy();
|
|
|
|
copy.setCount(1);
|
|
|
|
ItemStack remain = ItemHandlerHelper.insertItem(tile.modules, copy, false);
|
|
|
|
if (remain.isEmpty()) {
|
|
|
|
stack.shrink(1);
|
|
|
|
return ActionResultType.SUCCESS;
|
|
|
|
}
|
2020-05-28 14:47:25 +02:00
|
|
|
} else if (handIn == Hand.MAIN_HAND && stack.isEmpty()) {
|
|
|
|
if (!worldIn.isRemote)
|
|
|
|
NetworkHooks.openGui((ServerPlayerEntity) player, tile, pos);
|
|
|
|
return ActionResultType.SUCCESS;
|
2020-05-17 21:05:41 +02:00
|
|
|
}
|
2020-05-28 14:47:25 +02:00
|
|
|
return ActionResultType.PASS;
|
2020-04-14 01:38:48 +02:00
|
|
|
}
|
|
|
|
|
2020-04-13 21:48:35 +02:00
|
|
|
@Override
|
|
|
|
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
|
|
|
builder.add(DIRECTIONS.values().toArray(new EnumProperty[0]));
|
2020-04-18 00:45:19 +02:00
|
|
|
builder.add(BlockStateProperties.WATERLOGGED);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-09-22 19:14:07 +02:00
|
|
|
public FluidState getFluidState(BlockState state) {
|
2020-04-18 00:45:19 +02:00
|
|
|
return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) {
|
2020-04-13 22:54:18 +02:00
|
|
|
BlockState newState = this.createState(worldIn, pos, state);
|
2020-04-14 01:38:48 +02:00
|
|
|
if (newState != state) {
|
2020-04-13 21:48:35 +02:00
|
|
|
worldIn.setBlockState(pos, newState);
|
2020-04-14 01:38:48 +02:00
|
|
|
onStateChanged(worldIn, pos, newState);
|
|
|
|
}
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
2020-04-13 22:54:18 +02:00
|
|
|
return this.createState(context.getWorld(), context.getPos(), this.getDefaultState());
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
|
|
|
|
2020-04-18 00:45:19 +02:00
|
|
|
@Override
|
|
|
|
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos) {
|
|
|
|
if (stateIn.get(BlockStateProperties.WATERLOGGED))
|
|
|
|
worldIn.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn));
|
|
|
|
return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
|
|
|
|
}
|
|
|
|
|
2020-04-14 14:10:58 +02:00
|
|
|
@Override
|
|
|
|
public void onBlockPlacedBy(World worldIn, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) {
|
|
|
|
onStateChanged(worldIn, pos, state);
|
|
|
|
}
|
|
|
|
|
2020-04-13 21:48:35 +02:00
|
|
|
@Override
|
|
|
|
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
2020-10-17 14:52:35 +02:00
|
|
|
return this.cacheAndGetShape(state, worldIn, pos, s -> s.getShape(worldIn, pos, context), SHAPE_CACHE, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
|
|
|
return this.cacheAndGetShape(state, worldIn, pos, s -> s.getCollisionShape(worldIn, pos, context), COLL_SHAPE_CACHE, s -> {
|
|
|
|
// make the shape a bit higher so we can jump up onto a higher block
|
|
|
|
MutableObject<VoxelShape> newShape = new MutableObject<>(VoxelShapes.empty());
|
|
|
|
s.forEachBox((x1, y1, z1, x2, y2, z2) -> newShape.setValue(VoxelShapes.combine(VoxelShapes.create(x1, y1, z1, x2, y2 + 3 / 16F, z2), newShape.getValue(), IBooleanFunction.OR)));
|
|
|
|
return newShape.getValue().simplify();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
private VoxelShape cacheAndGetShape(BlockState state, IBlockReader worldIn, BlockPos pos, Function<BlockState, VoxelShape> coverShapeSelector, Map<Pair<BlockState, BlockState>, VoxelShape> cache, Function<VoxelShape, VoxelShape> shapeModifier) {
|
2020-10-17 00:58:31 +02:00
|
|
|
VoxelShape coverShape = null;
|
|
|
|
BlockState cover = null;
|
|
|
|
PipeTileEntity tile = Utility.getTileEntity(PipeTileEntity.class, worldIn, pos);
|
|
|
|
if (tile != null && tile.cover != null) {
|
|
|
|
cover = tile.cover;
|
|
|
|
// try catch since the block might expect to find itself at the position
|
|
|
|
try {
|
2020-10-17 14:52:35 +02:00
|
|
|
coverShape = coverShapeSelector.apply(cover);
|
2020-10-17 00:58:31 +02:00
|
|
|
} catch (Exception ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Pair<BlockState, BlockState> key = Pair.of(state, cover);
|
2020-10-17 14:52:35 +02:00
|
|
|
VoxelShape shape = cache.get(key);
|
2020-10-17 00:58:31 +02:00
|
|
|
if (shape == null) {
|
|
|
|
shape = CENTER_SHAPE;
|
|
|
|
for (Map.Entry<Direction, EnumProperty<ConnectionType>> entry : DIRECTIONS.entrySet()) {
|
|
|
|
if (state.get(entry.getValue()).isConnected())
|
|
|
|
shape = VoxelShapes.or(shape, DIR_SHAPES.get(entry.getKey()));
|
|
|
|
}
|
2020-10-17 14:52:35 +02:00
|
|
|
if (shapeModifier != null)
|
|
|
|
shape = shapeModifier.apply(shape);
|
2020-10-17 00:58:31 +02:00
|
|
|
if (coverShape != null)
|
|
|
|
shape = VoxelShapes.or(shape, coverShape);
|
2020-10-17 14:52:35 +02:00
|
|
|
cache.put(key, shape);
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
|
|
|
return shape;
|
|
|
|
}
|
|
|
|
|
2020-04-16 19:47:09 +02:00
|
|
|
private BlockState createState(World world, BlockPos pos, BlockState curr) {
|
2020-04-13 22:54:18 +02:00
|
|
|
BlockState state = this.getDefaultState();
|
2020-09-22 19:14:07 +02:00
|
|
|
FluidState fluid = world.getFluidState(pos);
|
2020-04-18 00:45:19 +02:00
|
|
|
if (fluid.isTagged(FluidTags.WATER) && fluid.getLevel() == 8)
|
|
|
|
state = state.with(BlockStateProperties.WATERLOGGED, true);
|
|
|
|
|
2020-04-16 19:47:09 +02:00
|
|
|
for (Direction dir : Direction.values()) {
|
|
|
|
EnumProperty<ConnectionType> prop = DIRECTIONS.get(dir);
|
2020-08-28 00:33:34 +02:00
|
|
|
ConnectionType type = this.getConnectionType(world, pos, dir, state);
|
2020-04-16 19:47:09 +02:00
|
|
|
// don't reconnect on blocked faces
|
2020-04-20 16:20:33 +02:00
|
|
|
if (type.isConnected() && curr.get(prop) == ConnectionType.BLOCKED)
|
|
|
|
type = ConnectionType.BLOCKED;
|
|
|
|
state = state.with(prop, type);
|
2020-04-13 22:54:18 +02:00
|
|
|
}
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
2020-08-28 00:33:34 +02:00
|
|
|
protected ConnectionType getConnectionType(World world, BlockPos pos, Direction direction, BlockState state) {
|
2020-04-13 22:54:18 +02:00
|
|
|
BlockPos offset = pos.offset(direction);
|
|
|
|
if (!world.isBlockLoaded(offset))
|
|
|
|
return ConnectionType.DISCONNECTED;
|
2020-10-24 15:00:11 +02:00
|
|
|
Direction opposite = direction.getOpposite();
|
2020-04-15 18:35:00 +02:00
|
|
|
TileEntity tile = world.getTileEntity(offset);
|
|
|
|
if (tile != null) {
|
2020-10-24 15:00:11 +02:00
|
|
|
IPipeConnectable connectable = tile.getCapability(Registry.pipeConnectableCapability, opposite).orElse(null);
|
2020-10-17 14:29:37 +02:00
|
|
|
if (connectable != null)
|
|
|
|
return connectable.getConnectionType(pos, direction);
|
2020-10-24 15:00:11 +02:00
|
|
|
IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, opposite).orElse(null);
|
2020-04-15 18:35:00 +02:00
|
|
|
if (handler != null)
|
|
|
|
return ConnectionType.CONNECTED;
|
2020-04-14 01:38:48 +02:00
|
|
|
}
|
2020-10-24 15:00:11 +02:00
|
|
|
IItemHandler blockHandler = Utility.getBlockItemHandler(world, offset, opposite);
|
|
|
|
if (blockHandler != null)
|
|
|
|
return ConnectionType.CONNECTED;
|
2020-10-17 14:29:37 +02:00
|
|
|
BlockState offState = world.getBlockState(offset);
|
2020-04-16 19:47:09 +02:00
|
|
|
if (hasLegsTo(world, offState, offset, direction)) {
|
|
|
|
if (DIRECTIONS.values().stream().noneMatch(d -> state.get(d) == ConnectionType.LEGS))
|
|
|
|
return ConnectionType.LEGS;
|
|
|
|
}
|
2020-04-15 18:35:00 +02:00
|
|
|
return ConnectionType.DISCONNECTED;
|
2020-04-13 22:54:18 +02:00
|
|
|
}
|
|
|
|
|
2020-08-28 00:29:44 +02:00
|
|
|
protected static boolean hasLegsTo(World world, BlockState state, BlockPos pos, Direction direction) {
|
2020-04-16 19:47:09 +02:00
|
|
|
if (state.getBlock() instanceof WallBlock || state.getBlock() instanceof FenceBlock)
|
|
|
|
return direction == Direction.DOWN;
|
|
|
|
if (state.getMaterial() == Material.ROCK || state.getMaterial() == Material.IRON)
|
2020-09-22 19:14:07 +02:00
|
|
|
return hasEnoughSolidSide(world, pos, direction.getOpposite());
|
2020-04-16 19:47:09 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-04-14 01:38:48 +02:00
|
|
|
public static void onStateChanged(World world, BlockPos pos, BlockState newState) {
|
2020-10-14 18:53:02 +02:00
|
|
|
// wait a few ticks before checking if we have to drop our modules, so that things like iron -> gold chest work
|
2020-04-15 18:35:00 +02:00
|
|
|
PipeTileEntity tile = Utility.getTileEntity(PipeTileEntity.class, world, pos);
|
2020-10-14 18:53:02 +02:00
|
|
|
if (tile != null)
|
|
|
|
tile.moduleDropCheck = 5;
|
2020-04-14 04:21:28 +02:00
|
|
|
|
|
|
|
PipeNetwork network = PipeNetwork.get(world);
|
|
|
|
int connections = 0;
|
2020-04-19 17:38:13 +02:00
|
|
|
boolean force = false;
|
2020-04-15 18:35:00 +02:00
|
|
|
for (Direction dir : Direction.values()) {
|
|
|
|
ConnectionType value = newState.get(DIRECTIONS.get(dir));
|
2020-04-14 04:21:28 +02:00
|
|
|
if (!value.isConnected())
|
|
|
|
continue;
|
|
|
|
connections++;
|
2020-04-19 17:38:13 +02:00
|
|
|
BlockState otherState = world.getBlockState(pos.offset(dir));
|
|
|
|
// force a node if we're connecting to a different block (inventory etc.)
|
|
|
|
if (otherState.getBlock() != newState.getBlock()) {
|
|
|
|
force = true;
|
2020-04-14 04:21:28 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-04-19 17:38:13 +02:00
|
|
|
if (force || connections > 2) {
|
2020-04-14 04:21:28 +02:00
|
|
|
network.addNode(pos, newState);
|
|
|
|
} else {
|
|
|
|
network.removeNode(pos);
|
|
|
|
}
|
|
|
|
network.onPipeChanged(pos, newState);
|
2020-04-14 01:38:48 +02:00
|
|
|
}
|
2020-04-13 21:48:35 +02:00
|
|
|
|
2020-04-14 01:38:48 +02:00
|
|
|
@Override
|
|
|
|
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
|
|
|
|
if (state.getBlock() != newState.getBlock()) {
|
2020-04-14 04:21:28 +02:00
|
|
|
PipeNetwork network = PipeNetwork.get(worldIn);
|
|
|
|
network.removeNode(pos);
|
|
|
|
network.onPipeChanged(pos, state);
|
2020-04-14 01:38:48 +02:00
|
|
|
super.onReplaced(state, worldIn, pos, newState, isMoving);
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
2020-04-14 01:38:48 +02:00
|
|
|
}
|
2020-04-13 21:48:35 +02:00
|
|
|
|
2020-10-20 16:09:38 +02:00
|
|
|
@Override
|
|
|
|
public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) {
|
2021-01-06 22:31:37 +01:00
|
|
|
dropItems(worldIn, pos, player);
|
2020-10-20 16:09:38 +02:00
|
|
|
super.onBlockHarvested(worldIn, pos, state, player);
|
|
|
|
}
|
|
|
|
|
2020-05-03 15:33:56 +02:00
|
|
|
@Override
|
|
|
|
public boolean hasComparatorInputOverride(BlockState state) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getComparatorInputOverride(BlockState blockState, World worldIn, BlockPos pos) {
|
|
|
|
PipeTileEntity pipe = Utility.getTileEntity(PipeTileEntity.class, worldIn, pos);
|
|
|
|
if (pipe == null)
|
|
|
|
return 0;
|
|
|
|
return Math.min(15, pipe.getItems().size());
|
|
|
|
}
|
|
|
|
|
2020-04-14 01:38:48 +02:00
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public TileEntity createNewTileEntity(IBlockReader worldIn) {
|
|
|
|
return new PipeTileEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BlockRenderType getRenderType(BlockState state) {
|
|
|
|
return BlockRenderType.MODEL;
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|
2021-01-06 22:31:37 +01:00
|
|
|
|
|
|
|
public static void dropItems(World worldIn, BlockPos pos, PlayerEntity player) {
|
|
|
|
PipeTileEntity tile = Utility.getTileEntity(PipeTileEntity.class, worldIn, pos);
|
|
|
|
if (tile != null) {
|
|
|
|
Utility.dropInventory(tile, tile.modules);
|
|
|
|
for (IPipeItem item : tile.getItems())
|
|
|
|
item.drop(worldIn, item.getContent());
|
|
|
|
if (tile.cover != null)
|
|
|
|
tile.removeCover(player, Hand.MAIN_HAND);
|
|
|
|
}
|
|
|
|
}
|
2020-04-13 21:48:35 +02:00
|
|
|
}
|