Fixes #2684: Avoid transforming charged quartz when dead.

This commit is contained in:
yueh 2016-12-17 23:04:35 +01:00
parent a14cf2204d
commit 8700a79ca6

View file

@ -64,7 +64,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
{ {
super.onUpdate(); super.onUpdate();
if( !AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) ) if( this.isDead || !AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) )
{ {
return; return;
} }
@ -74,14 +74,16 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
CommonHelper.proxy.spawnEffect( EffectType.Lightning, this.worldObj, this.posX, this.posY, this.posZ, null ); CommonHelper.proxy.spawnEffect( EffectType.Lightning, this.worldObj, this.posX, this.posY, this.posZ, null );
this.delay = 0; this.delay = 0;
} }
this.delay++; this.delay++;
final int j = MathHelper.floor_double( this.posX ); final int j = MathHelper.floor_double( this.posX );
final int i = MathHelper.floor_double( (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D ); final int i = MathHelper.floor_double( ( this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY ) / 2.0D );
final int k = MathHelper.floor_double( this.posZ ); final int k = MathHelper.floor_double( this.posZ );
IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) ); IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) );
final Material mat = state.getBlock().getMaterial( state ); final Material mat = state.getBlock().getMaterial( state );
if( Platform.isServer() && mat.isLiquid() ) if( Platform.isServer() && mat.isLiquid() )
{ {
this.transformTime++; this.transformTime++;