From d6b64b3576bca43e8bcf8623a7e0a5c014fdb7fc Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Wed, 19 Feb 2020 21:32:54 +0000 Subject: [PATCH] Move !world.isRemote check to just the block breaking, potentially fixes #359 --- src/main/java/electroblob/wizardry/block/BlockSnare.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/electroblob/wizardry/block/BlockSnare.java b/src/main/java/electroblob/wizardry/block/BlockSnare.java index a10df677..81275b20 100644 --- a/src/main/java/electroblob/wizardry/block/BlockSnare.java +++ b/src/main/java/electroblob/wizardry/block/BlockSnare.java @@ -54,7 +54,8 @@ public class BlockSnare extends Block implements ITileEntityProvider { @Override public void onEntityCollision(World world, BlockPos pos, IBlockState state, Entity entity){ - if(!world.isRemote && entity instanceof EntityLivingBase){ + if(entity instanceof EntityLivingBase){ + if(world.getTileEntity(pos) instanceof TileEntityPlayerSave){ TileEntityPlayerSave tileentity = (TileEntityPlayerSave)world.getTileEntity(pos); @@ -68,7 +69,7 @@ public class BlockSnare extends Block implements ITileEntityProvider { Spells.snare.getProperty(Spell.EFFECT_DURATION).intValue(), Spells.snare.getProperty(Spell.EFFECT_STRENGTH).intValue())); - world.destroyBlock(pos, false); + if(!world.isRemote) world.destroyBlock(pos, false); } } }