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
1 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
{
super.onUpdate();
if( !AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) )
if( this.isDead || !AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) )
{
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 );
this.delay = 0;
}
this.delay++;
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 );
IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) );
final Material mat = state.getBlock().getMaterial( state );
if( Platform.isServer() && mat.isLiquid() )
{
this.transformTime++;