From 11ae3bc820cf903bb8b602d69ffbab706be0f2fc Mon Sep 17 00:00:00 2001 From: tterrag Date: Sun, 29 Mar 2020 12:05:07 -0400 Subject: [PATCH] Port all instances of Block.onBlockActivated --- .../chassis/AbstractChassisBlock.java | 16 +++++------ .../piston/MechanicalPistonBlock.java | 18 ++++++------ .../contraptions/pulley/PulleyBlock.java | 8 +++--- .../crafter/MechanicalCrafterBlock.java | 28 +++++++++---------- .../components/crank/HandCrankBlock.java | 4 +-- .../components/deployer/DeployerBlock.java | 8 +++--- .../components/millstone/MillstoneBlock.java | 10 +++---- .../contraptions/processing/BasinBlock.java | 6 ++-- .../redstone/AnalogLeverBlock.java | 6 ++-- .../sequencer/SequencedGearshiftBlock.java | 6 ++-- .../contraptions/relays/belt/BeltBlock.java | 26 ++++++++--------- .../logistics/block/RedstoneLinkBlock.java | 6 ++-- .../logistics/block/belts/FunnelBlock.java | 4 +-- .../logistics/block/diodes/LatchBlock.java | 8 ++++-- .../block/diodes/ToggleLatchBlock.java | 8 +++--- .../block/inventories/FlexcrateBlock.java | 4 +-- .../schematics/block/SchematicTableBlock.java | 4 +-- .../schematics/block/SchematicannonBlock.java | 4 +-- 18 files changed, 88 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java index b7682a3e4..80f5ccb3e 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/chassis/AbstractChassisBlock.java @@ -42,14 +42,14 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock { public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) - return false; + return ActionResultType.PASS; ItemStack heldItem = player.getHeldItem(handIn); boolean isSlimeBall = heldItem.getItem().isIn(Tags.Items.SLIMEBALLS); BooleanProperty affectedSide = getGlueableSide(state, hit.getFace()); if (affectedSide == null) - return false; + return ActionResultType.PASS; if (isSlimeBall && state.get(affectedSide)) { for (Direction face : Direction.values()) { @@ -58,7 +58,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock { if (worldIn.isRemote) { Vec3d vec = hit.getHitVec(); worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0); - return true; + return ActionResultType.SUCCESS; } worldIn.playSound(null, pos, AllSoundEvents.SLIME_ADDED.get(), SoundCategory.BLOCKS, .5f, 1); state = state.with(glueableSide, true); @@ -66,22 +66,22 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock { } if (!worldIn.isRemote) worldIn.setBlockState(pos, state); - return true; + return ActionResultType.SUCCESS; } if ((!heldItem.isEmpty() || !player.isSneaking()) && !isSlimeBall) - return false; + return ActionResultType.PASS; if (state.get(affectedSide) == isSlimeBall) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) { Vec3d vec = hit.getHitVec(); worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0); - return true; + return ActionResultType.SUCCESS; } worldIn.playSound(null, pos, AllSoundEvents.SLIME_ADDED.get(), SoundCategory.BLOCKS, .5f, 1); worldIn.setBlockState(pos, state.with(affectedSide, isSlimeBall)); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java index bbd56e6ac..b82344e37 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/piston/MechanicalPistonBlock.java @@ -55,34 +55,34 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) - return false; + return ActionResultType.PASS; if (player.isSneaking()) - return false; + return ActionResultType.PASS; if (!player.getHeldItem(handIn).getItem().isIn(Tags.Items.SLIMEBALLS)) { if (player.getHeldItem(handIn).isEmpty()) { withTileEntityDo(worldIn, pos, te -> te.assembleNextTick = true); - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } if (state.get(STATE) != PistonState.RETRACTED) - return false; + return ActionResultType.PASS; Direction direction = state.get(FACING); if (hit.getFace() != direction) - return false; + return ActionResultType.PASS; if (((MechanicalPistonBlock) state.getBlock()).isSticky) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) { Vec3d vec = hit.getHitVec(); worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0); - return true; + return ActionResultType.SUCCESS; } worldIn.playSound(null, pos, AllSoundEvents.SLIME_ADDED.get(), SoundCategory.BLOCKS, .5f, 1); if (!player.isCreative()) player.getHeldItem(handIn).shrink(1); worldIn.setBlockState(pos, AllBlocks.STICKY_MECHANICAL_PISTON.get().getDefaultState().with(FACING, direction) .with(AXIS_ALONG_FIRST_COORDINATE, state.get(AXIS_ALONG_FIRST_COORDINATE))); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java index 54681a560..0a790c022 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/contraptions/pulley/PulleyBlock.java @@ -46,14 +46,14 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements IWithTile public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) - return false; + return ActionResultType.PASS; if (player.isSneaking()) - return false; + return ActionResultType.PASS; if (player.getHeldItem(handIn).isEmpty()) { withTileEntityDo(worldIn, pos, te -> te.assembleNextTick = true); - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java index edf2e1795..d1eb44e22 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crafter/MechanicalCrafterBlock.java @@ -166,7 +166,7 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock TileEntity te = worldIn.getTileEntity(pos); if (!(te instanceof MechanicalCrafterTileEntity)) - return false; + return ActionResultType.PASS; MechanicalCrafterTileEntity crafter = (MechanicalCrafterTileEntity) te; boolean wrenched = AllItems.WRENCH.typeOf(heldItem); @@ -174,59 +174,59 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock if (crafter.phase != Phase.IDLE && !wrenched) { crafter.ejectWholeGrid(); - return true; + return ActionResultType.SUCCESS; } if (crafter.phase == Phase.IDLE && !isHand && !wrenched) { if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; if (AllItems.SLOT_COVER.typeOf(heldItem)) { if (crafter.covered) - return false; + return ActionResultType.PASS; crafter.covered = true; crafter.markDirty(); crafter.sendData(); if (!player.isCreative()) heldItem.shrink(1); - return true; + return ActionResultType.SUCCESS; } LazyOptional capability = crafter.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY); if (!capability.isPresent()) - return false; + return ActionResultType.PASS; ItemStack remainder = ItemHandlerHelper.insertItem(capability.orElse(new ItemStackHandler()), heldItem.copy(), false); if (remainder.getCount() != heldItem.getCount()) player.setHeldItem(handIn, remainder); - return true; + return ActionResultType.SUCCESS; } ItemStack inSlot = crafter.inventory.getStackInSlot(0); if (inSlot.isEmpty()) { if (crafter.covered && !wrenched) { if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; crafter.covered = false; crafter.markDirty(); crafter.sendData(); if (!player.isCreative()) player.inventory.placeItemBackInInventory(worldIn, AllItems.SLOT_COVER.asStack()); - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } if (!isHand && !ItemHandlerHelper.canItemStacksStack(heldItem, inSlot)) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; player.inventory.placeItemBackInInventory(worldIn, inSlot); crafter.inventory.setStackInSlot(0, ItemStack.EMPTY); - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } // @Override // TODO 1.15 register layer diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java index 933d5376f..5acd86159 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/crank/HandCrankBlock.java @@ -39,10 +39,10 @@ public class HandCrankBlock extends DirectionalKineticBlock implements IWithTile boolean handEmpty = player.getHeldItem(handIn).isEmpty(); if (!handEmpty && player.isSneaking()) - return false; + return ActionResultType.PASS; withTileEntityDo(worldIn, pos, te -> te.turn(player.isSneaking())); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java index e3eb12a26..4539c3ca3 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerBlock.java @@ -86,12 +86,12 @@ public class DeployerBlock extends DirectionalAxisKineticBlock BlockRayTraceResult hit) { ItemStack heldByPlayer = player.getHeldItem(handIn).copy(); if (AllItems.WRENCH.typeOf(heldByPlayer)) - return false; + return ActionResultType.PASS; if (hit.getFace() != state.get(FACING)) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; withTileEntityDo(worldIn, pos, te -> { ItemStack heldByDeployer = te.player.getHeldItemMainhand().copy(); @@ -103,7 +103,7 @@ public class DeployerBlock extends DirectionalAxisKineticBlock te.sendData(); }); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java index fd7d0a0a7..df5e007d5 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/millstone/MillstoneBlock.java @@ -58,15 +58,15 @@ public class MillstoneBlock extends KineticBlock { public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.getHeldItem(handIn).isEmpty()) - return false; + return ActionResultType.PASS; if (worldIn.getTileEntity(pos) == null) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; TileEntity tileEntity = worldIn.getTileEntity(pos); if (!(tileEntity instanceof MillstoneTileEntity)) - return false; + return ActionResultType.PASS; MillstoneTileEntity millstone = (MillstoneTileEntity) tileEntity; IItemHandlerModifiable inv = millstone.outputInv; @@ -76,7 +76,7 @@ public class MillstoneBlock extends KineticBlock { } millstone.markDirty(); millstone.sendData(); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java index 7427e615a..6e3c8a42b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/processing/BasinBlock.java @@ -52,9 +52,9 @@ public class BasinBlock extends Block implements IWithTileEntity () -> { displayScreen((SequencedGearshiftTileEntity) worldIn.getTileEntity(pos)); }); - return true; + return ActionResultType.SUCCESS; } @OnlyIn(value = Dist.CLIENT) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java index 65bea8d50..cad9a5023 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/belt/BeltBlock.java @@ -202,7 +202,7 @@ public class BeltBlock extends HorizontalKineticBlock public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (player.isSneaking() || !player.isAllowEdit()) - return false; + return ActionResultType.PASS; ItemStack heldItem = player.getHeldItem(handIn); boolean isShaft = heldItem.getItem() == AllBlocks.SHAFT.get().asItem(); boolean isCasing = heldItem.getItem() == AllBlocks.BRASS_CASING.get().asItem(); @@ -211,7 +211,7 @@ public class BeltBlock extends HorizontalKineticBlock if (isDye) { if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; withTileEntityDo(worldIn, pos, te -> { DyeColor dyeColor = DyeColor.getColor(heldItem); if (dyeColor == null) @@ -220,20 +220,20 @@ public class BeltBlock extends HorizontalKineticBlock }); if (!player.isCreative()) heldItem.shrink(1); - return true; + return ActionResultType.SUCCESS; } TileEntity te = worldIn.getTileEntity(pos); if (te == null || !(te instanceof BeltTileEntity)) - return false; + return ActionResultType.PASS; BeltTileEntity belt = (BeltTileEntity) te; if (isHand) { BeltTileEntity controllerBelt = belt.getControllerTE(); if (controllerBelt == null) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; controllerBelt.getInventory().forEachWithin(belt.index + .5f, .55f, (transportedItemStack) -> { player.inventory.placeItemBackInInventory(worldIn, transportedItemStack.stack); return Collections.emptyList(); @@ -242,28 +242,28 @@ public class BeltBlock extends HorizontalKineticBlock if (isShaft) { if (state.get(PART) != Part.MIDDLE) - return false; + return ActionResultType.PASS; if (worldIn.isRemote) - return true; + return ActionResultType.SUCCESS; if (!player.isCreative()) heldItem.shrink(1); worldIn.setBlockState(pos, state.with(PART, Part.PULLEY), 2); belt.attachKinetics(); - return true; + return ActionResultType.SUCCESS; } if (isCasing) { if (state.get(CASING)) - return false; + return ActionResultType.PASS; if (state.get(SLOPE) == Slope.VERTICAL) - return false; + return ActionResultType.PASS; if (!player.isCreative()) heldItem.shrink(1); worldIn.setBlockState(pos, state.with(CASING, true), 2); - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/RedstoneLinkBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/RedstoneLinkBlock.java index 993092afb..e95cf3f52 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/RedstoneLinkBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/RedstoneLinkBlock.java @@ -122,7 +122,7 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock { if (player.isSneaking()) { RedstoneLinkTileEntity te = (RedstoneLinkTileEntity) worldIn.getTileEntity(pos); if (te == null) - return false; + return ActionResultType.PASS; if (!worldIn.isRemote) { Boolean wasReceiver = state.get(RECEIVER); @@ -133,10 +133,10 @@ public class RedstoneLinkBlock extends ProperDirectionalBlock { } else te.transmit(false); } - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java index c43e055b2..5f3f70f1a 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/belts/FunnelBlock.java @@ -192,10 +192,10 @@ public class FunnelBlock extends AttachedLogisticalBlock implements IBeltAttachm if (!ItemStack.areItemStacksEqual(remainder, heldItem)) player.setHeldItem(handIn, remainder); }); - return true; + return ActionResultType.SUCCESS; } - return false; + return ActionResultType.PASS; } public boolean process(BeltTileEntity belt, TransportedItemStack transported, BeltAttachmentState state) { diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java index a1dbe7134..4591a9730 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/LatchBlock.java @@ -6,6 +6,8 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer.Builder; +import net.minecraft.util.ActionResult; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; @@ -81,12 +83,12 @@ public class LatchBlock extends ToggleLatchBlock { } @Override - protected boolean activated(World worldIn, BlockPos pos, BlockState state) { + protected ActionResultType activated(World worldIn, BlockPos pos, BlockState state) { if (state.get(POWERED) != state.get(POWERED_SIDE)) - return false; + return ActionResultType.PASS; if (!worldIn.isRemote) worldIn.setBlockState(pos, state.cycle(POWERING), 2); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java index dfc96ecd7..8a7d93071 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/diodes/ToggleLatchBlock.java @@ -46,9 +46,9 @@ public class ToggleLatchBlock extends RedstoneDiodeBlock { public ActionResultType onUse(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!player.isAllowEdit()) - return false; + return ActionResultType.PASS; if (player.isSneaking()) - return false; + return ActionResultType.PASS; return activated(worldIn, pos, state); } @@ -66,10 +66,10 @@ public class ToggleLatchBlock extends RedstoneDiodeBlock { worldIn.setBlockState(pos, newState.cycle(POWERING), 2); } - protected boolean activated(World worldIn, BlockPos pos, BlockState state) { + protected ActionResultType activated(World worldIn, BlockPos pos, BlockState state) { if (!worldIn.isRemote) worldIn.setBlockState(pos, state.cycle(POWERING), 2); - return true; + return ActionResultType.SUCCESS; } @Override diff --git a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java index 67e58253f..9bc4660d6 100644 --- a/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java +++ b/src/main/java/com/simibubi/create/modules/logistics/block/inventories/FlexcrateBlock.java @@ -117,7 +117,7 @@ public class FlexcrateBlock extends ProperDirectionalBlock { BlockRayTraceResult hit) { if (worldIn.isRemote) { - return true; + return ActionResultType.SUCCESS; } else { TileEntity te = worldIn.getTileEntity(pos); if (te instanceof FlexcrateTileEntity) { @@ -125,7 +125,7 @@ public class FlexcrateBlock extends ProperDirectionalBlock { fte = fte.getMainCrate(); NetworkHooks.openGui((ServerPlayerEntity) player, fte, fte::sendToContainer); } - return true; + return ActionResultType.SUCCESS; } } diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableBlock.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableBlock.java index ef94a94b7..d012260b5 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableBlock.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicTableBlock.java @@ -65,12 +65,12 @@ public class SchematicTableBlock extends HorizontalBlock { BlockRayTraceResult hit) { if (worldIn.isRemote) { - return true; + return ActionResultType.SUCCESS; } else { SchematicTableTileEntity te = (SchematicTableTileEntity) worldIn.getTileEntity(pos); if (te != null) NetworkHooks.openGui((ServerPlayerEntity) player, te, te::sendToContainer); - return true; + return ActionResultType.SUCCESS; } } diff --git a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java index 6df828393..0a43bf660 100644 --- a/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java +++ b/src/main/java/com/simibubi/create/modules/schematics/block/SchematicannonBlock.java @@ -60,7 +60,7 @@ public class SchematicannonBlock extends Block { BlockRayTraceResult hit) { if (worldIn.isRemote) { - return true; + return ActionResultType.SUCCESS; } else { SchematicannonTileEntity te = (SchematicannonTileEntity) worldIn.getTileEntity(pos); if (te != null) @@ -70,7 +70,7 @@ public class SchematicannonBlock extends Block { player.inventory.setInventorySlotContents(player.inventory.currentItem, ItemStack.EMPTY); } NetworkHooks.openGui((ServerPlayerEntity) player, te, te::sendToContainer); - return true; + return ActionResultType.SUCCESS; } }