Sync tile entities with casters properly, and tidy up a few other related things

This commit is contained in:
Electroblob77
2020-05-24 22:09:09 +01:00
parent e17b5d2300
commit 94f4e680af
8 changed files with 35 additions and 26 deletions
@@ -32,8 +32,10 @@ public class Snare extends SpellRay {
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())){
world.setBlockState(pos.up(), WizardryBlocks.snare.getDefaultState());
((TileEntityPlayerSave)world.getTileEntity(pos.up())).setCaster(caster);
if(!world.isRemote){
world.setBlockState(pos.up(), WizardryBlocks.snare.getDefaultState());
((TileEntityPlayerSave)world.getTileEntity(pos.up())).setCaster(caster);
}
return true;
}