From 3d3806c20ba2d37d21a1c852dbadfaaf8a5ee7ee Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Tue, 3 Nov 2020 01:08:11 +0000 Subject: [PATCH] Prevent receptacles dropping on neighbour change when attached to an imbuement altar, fixes #520 --- .../java/electroblob/wizardry/block/BlockReceptacle.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/electroblob/wizardry/block/BlockReceptacle.java b/src/main/java/electroblob/wizardry/block/BlockReceptacle.java index 6c7868a5..1f5fda87 100644 --- a/src/main/java/electroblob/wizardry/block/BlockReceptacle.java +++ b/src/main/java/electroblob/wizardry/block/BlockReceptacle.java @@ -132,6 +132,13 @@ public class BlockReceptacle extends BlockTorch implements ITileEntityProvider { return super.checkForDrop(world, pos, state); } + @Override + protected boolean onNeighborChangeInternal(World world, BlockPos pos, IBlockState state){ + // This is so stupid, BlockTorch DUPLICATES the code that checks for valid placement in the super method instead + // of checking the existing methods... + return !this.checkForDrop(world, pos, state); // Literally all we need. None of the rubbish in super. + } + @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer){