Dont use instance reference for static references
This commit is contained in:
@@ -116,7 +116,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
|||||||
{
|
{
|
||||||
NBTTagCompound data = Platform.openNbtData( is );
|
NBTTagCompound data = Platform.openNbtData( is );
|
||||||
|
|
||||||
double currentStorage = data.getDouble( this.POWER_NBT_KEY );
|
double currentStorage = data.getDouble( POWER_NBT_KEY );
|
||||||
double maxStorage = this.getAEMaxPower( is );
|
double maxStorage = this.getAEMaxPower( is );
|
||||||
|
|
||||||
switch( op )
|
switch( op )
|
||||||
@@ -126,19 +126,19 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
|||||||
if( currentStorage > maxStorage )
|
if( currentStorage > maxStorage )
|
||||||
{
|
{
|
||||||
double diff = currentStorage - maxStorage;
|
double diff = currentStorage - maxStorage;
|
||||||
data.setDouble( this.POWER_NBT_KEY, maxStorage );
|
data.setDouble( POWER_NBT_KEY, maxStorage );
|
||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
data.setDouble( this.POWER_NBT_KEY, currentStorage );
|
data.setDouble( POWER_NBT_KEY, currentStorage );
|
||||||
return 0;
|
return 0;
|
||||||
case EXTRACT:
|
case EXTRACT:
|
||||||
if( currentStorage > adjustment )
|
if( currentStorage > adjustment )
|
||||||
{
|
{
|
||||||
currentStorage -= adjustment;
|
currentStorage -= adjustment;
|
||||||
data.setDouble( this.POWER_NBT_KEY, currentStorage );
|
data.setDouble( POWER_NBT_KEY, currentStorage );
|
||||||
return adjustment;
|
return adjustment;
|
||||||
}
|
}
|
||||||
data.setDouble( this.POWER_NBT_KEY, 0 );
|
data.setDouble( POWER_NBT_KEY, 0 );
|
||||||
return currentStorage;
|
return currentStorage;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user