From e17b5d23009af3c96e6c75e15304e6080357a66e Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sat, 23 May 2020 21:04:29 +0100 Subject: [PATCH] Remove incorrect !world.isRemote check and redundant constructor, fixes #446 --- src/main/java/electroblob/wizardry/spell/Snare.java | 11 +++-------- .../wizardry/tileentity/TileEntityPlayerSave.java | 4 ---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/electroblob/wizardry/spell/Snare.java b/src/main/java/electroblob/wizardry/spell/Snare.java index 9bf5a698..6f3f04cf 100644 --- a/src/main/java/electroblob/wizardry/spell/Snare.java +++ b/src/main/java/electroblob/wizardry/spell/Snare.java @@ -31,14 +31,9 @@ public class Snare extends SpellRay { @Override protected boolean onBlockHit(World world, BlockPos pos, EnumFacing side, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){ - if(side == EnumFacing.UP && world.isSideSolid(pos, EnumFacing.UP) - && WizardryUtilities.canBlockBeReplaced(world, pos.up())){ - - if(!world.isRemote){ - world.setBlockState(pos.up(), WizardryBlocks.snare.getDefaultState()); - ((TileEntityPlayerSave)world.getTileEntity(pos.up())).setCaster(caster); - } - + if(side == EnumFacing.UP && world.isSideSolid(pos, EnumFacing.UP) && WizardryUtilities.canBlockBeReplaced(world, pos.up())){ + world.setBlockState(pos.up(), WizardryBlocks.snare.getDefaultState()); + ((TileEntityPlayerSave)world.getTileEntity(pos.up())).setCaster(caster); return true; } diff --git a/src/main/java/electroblob/wizardry/tileentity/TileEntityPlayerSave.java b/src/main/java/electroblob/wizardry/tileentity/TileEntityPlayerSave.java index 6e91f534..6964492c 100644 --- a/src/main/java/electroblob/wizardry/tileentity/TileEntityPlayerSave.java +++ b/src/main/java/electroblob/wizardry/tileentity/TileEntityPlayerSave.java @@ -19,10 +19,6 @@ public class TileEntityPlayerSave extends TileEntity { public TileEntityPlayerSave(){} - public TileEntityPlayerSave(EntityLivingBase caster){ - this.casterUUID = caster.getUniqueID(); - } - @Override public void readFromNBT(NBTTagCompound tagCompound){ super.readFromNBT(tagCompound);