Changed access to use this qualifier
This commit is contained in:
@@ -44,7 +44,7 @@ public class AEBaseItem extends Item implements IAEFeature
|
||||
public AEBaseItem( Class c )
|
||||
{
|
||||
this( c, Optional.<String> absent() );
|
||||
canRepair = false;
|
||||
this.canRepair = false;
|
||||
}
|
||||
|
||||
public AEBaseItem( Class<?> c, Optional<String> subName )
|
||||
|
||||
@@ -30,13 +30,13 @@ public class CellConfig extends AppEngInternalInventory
|
||||
public CellConfig(ItemStack is) {
|
||||
super( null, 63 );
|
||||
this.is = is;
|
||||
readFromNBT( Platform.openNbtData( is ), "list" );
|
||||
this.readFromNBT( Platform.openNbtData( is ), "list" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
writeToNBT( Platform.openNbtData( is ), "list" );
|
||||
this.writeToNBT( Platform.openNbtData( this.is ), "list" );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,13 +30,13 @@ public class CellUpgrades extends UpgradeInventory
|
||||
public CellUpgrades(ItemStack is, int upgrades) {
|
||||
super( is.getItem(), null, upgrades );
|
||||
this.is = is;
|
||||
readFromNBT( Platform.openNbtData( is ), "upgrades" );
|
||||
this.readFromNBT( Platform.openNbtData( is ), "upgrades" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
writeToNBT( Platform.openNbtData( is ), "upgrades" );
|
||||
this.writeToNBT( Platform.openNbtData( this.is ), "upgrades" );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,102 +35,102 @@ public class NetworkToolViewer implements INetworkTool
|
||||
|
||||
public NetworkToolViewer(ItemStack is, IGridHost gHost) {
|
||||
this.is = is;
|
||||
gh = gHost;
|
||||
inv = new AppEngInternalInventory( null, 9 );
|
||||
this.gh = gHost;
|
||||
this.inv = new AppEngInternalInventory( null, 9 );
|
||||
if ( is.hasTagCompound() ) // prevent crash when opening network status screen.
|
||||
inv.readFromNBT( Platform.openNbtData( is ), "inv" );
|
||||
this.inv.readFromNBT( Platform.openNbtData( is ), "inv" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return inv.getSizeInventory();
|
||||
return this.inv.getSizeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i)
|
||||
{
|
||||
return inv.getStackInSlot( i );
|
||||
return this.inv.getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j)
|
||||
{
|
||||
return inv.decrStackSize( i, j );
|
||||
return this.inv.decrStackSize( i, j );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i)
|
||||
{
|
||||
return inv.getStackInSlotOnClosing( i );
|
||||
return this.inv.getStackInSlotOnClosing( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack)
|
||||
{
|
||||
inv.setInventorySlotContents( i, itemstack );
|
||||
this.inv.setInventorySlotContents( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
{
|
||||
return inv.getInventoryName();
|
||||
return this.inv.getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return inv.hasCustomInventoryName();
|
||||
return this.inv.hasCustomInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return inv.getInventoryStackLimit();
|
||||
return this.inv.getInventoryStackLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
inv.markDirty();
|
||||
inv.writeToNBT( Platform.openNbtData( is ), "inv" );
|
||||
this.inv.markDirty();
|
||||
this.inv.writeToNBT( Platform.openNbtData( this.is ), "inv" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer)
|
||||
{
|
||||
return inv.isUseableByPlayer( entityplayer );
|
||||
return this.inv.isUseableByPlayer( entityplayer );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
inv.openInventory();
|
||||
this.inv.openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
inv.closeInventory();
|
||||
this.inv.closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
{
|
||||
return inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule
|
||||
return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule
|
||||
&& ((IUpgradeModule) itemstack.getItem()).getType( itemstack ) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return is;
|
||||
return this.is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridHost getGridHost()
|
||||
{
|
||||
return gh;
|
||||
return this.gh;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,14 +46,14 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
|
||||
public PortableCellViewer(ItemStack is) {
|
||||
super( CellInventory.getCell( is, null ) );
|
||||
ips = (IAEItemPowerStorage) is.getItem();
|
||||
target = is;
|
||||
this.ips = (IAEItemPowerStorage) is.getItem();
|
||||
this.target = is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return target;
|
||||
return this.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,9 +62,9 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
amt = usePowerMultiplier.multiply( amt );
|
||||
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
return usePowerMultiplier.divide( Math.min( amt, ips.getAECurrentPower( getItemStack() ) ) );
|
||||
return usePowerMultiplier.divide( Math.min( amt, this.ips.getAECurrentPower( this.getItemStack() ) ) );
|
||||
|
||||
return usePowerMultiplier.divide( ips.extractAEPower( getItemStack(), amt ) );
|
||||
return usePowerMultiplier.divide( this.ips.extractAEPower( this.getItemStack(), amt ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,7 +87,7 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
@Override
|
||||
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( target );
|
||||
NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target );
|
||||
manager.writeToNBT( data );
|
||||
}
|
||||
} );
|
||||
@@ -96,7 +96,7 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
out.registerSetting( Settings.VIEW_MODE, ViewItems.ALL );
|
||||
out.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
|
||||
|
||||
out.readFromNBT( (NBTTagCompound) Platform.openNbtData( target ).copy() );
|
||||
out.readFromNBT( (NBTTagCompound) Platform.openNbtData( this.target ).copy() );
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@ public class QuartzKnifeObj implements IGuiItemObject
|
||||
final ItemStack is;
|
||||
|
||||
public QuartzKnifeObj(ItemStack o) {
|
||||
is = o;
|
||||
this.is = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return is;
|
||||
return this.is;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
public ItemMultiMaterial() {
|
||||
super( ItemMultiMaterial.class );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
setHasSubtypes( true );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
{
|
||||
try
|
||||
{
|
||||
Matcher a = p.matcher( o1 );
|
||||
Matcher b = p.matcher( o2 );
|
||||
Matcher a = this.p.matcher( o1 );
|
||||
Matcher b = this.p.matcher( o2 );
|
||||
if ( a.find() && b.find() )
|
||||
{
|
||||
int ia = Integer.parseInt( a.group( 1 ) );
|
||||
@@ -116,7 +116,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
MaterialType mt = getTypeByStack( stack );
|
||||
MaterialType mt = this.getTypeByStack( stack );
|
||||
if ( mt == null )
|
||||
return;
|
||||
|
||||
@@ -126,7 +126,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
lines.add( c.getString( "InscribeName" ) );
|
||||
}
|
||||
|
||||
Upgrades u = getType( stack );
|
||||
Upgrades u = this.getType( stack );
|
||||
if ( u != null )
|
||||
{
|
||||
List<String> textList = new LinkedList<String>();
|
||||
@@ -174,8 +174,8 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
IStackSrc output = mat.stackSrc = new MaterialStackSrc( mat );
|
||||
|
||||
if ( dmgToMaterial.get( newMaterialNum ) == null )
|
||||
dmgToMaterial.put( newMaterialNum, mat );
|
||||
if ( this.dmgToMaterial.get( newMaterialNum ) == null )
|
||||
this.dmgToMaterial.put( newMaterialNum, mat );
|
||||
else
|
||||
throw new RuntimeException( "Meta Overlap detected." );
|
||||
|
||||
@@ -190,7 +190,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
public void makeUnique()
|
||||
{
|
||||
for (MaterialType mt : ImmutableSet.copyOf( dmgToMaterial.values() ))
|
||||
for (MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ))
|
||||
{
|
||||
if ( mt.getOreName() != null )
|
||||
{
|
||||
@@ -226,7 +226,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
else
|
||||
{
|
||||
if ( mt.itemInstance == this )
|
||||
dmgToMaterial.remove( mt.damageValue );
|
||||
this.dmgToMaterial.remove( mt.damageValue );
|
||||
|
||||
mt.itemInstance = replacement.getItem();
|
||||
mt.damageValue = replacement.getItemDamage();
|
||||
@@ -238,16 +238,16 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
|
||||
public MaterialType getTypeByStack(ItemStack is)
|
||||
{
|
||||
if ( dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
return dmgToMaterial.get( is.getItemDamage() );
|
||||
if ( this.dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
return this.dmgToMaterial.get( is.getItemDamage() );
|
||||
return MaterialType.InvalidType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int dmg)
|
||||
{
|
||||
if ( dmgToMaterial.containsKey( dmg ) )
|
||||
return dmgToMaterial.get( dmg ).IIcon;
|
||||
if ( this.dmgToMaterial.containsKey( dmg ) )
|
||||
return this.dmgToMaterial.get( dmg ).IIcon;
|
||||
return new MissingIcon( this );
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
if ( is == null )
|
||||
return "null";
|
||||
|
||||
MaterialType mt = getTypeByStack( is );
|
||||
MaterialType mt = this.getTypeByStack( is );
|
||||
if ( mt == null )
|
||||
return "null";
|
||||
|
||||
@@ -266,7 +266,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return "item.appliedenergistics2." + nameOf( is );
|
||||
return "item.appliedenergistics2." + this.nameOf( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -277,9 +277,9 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
if ( mat.damageValue != -1 )
|
||||
{
|
||||
ItemStack what = new ItemStack( this, 1, mat.damageValue );
|
||||
if ( getTypeByStack( what ) != MaterialType.InvalidType )
|
||||
if ( this.getTypeByStack( what ) != MaterialType.InvalidType )
|
||||
{
|
||||
String tex = "appliedenergistics2:" + nameOf( what );
|
||||
String tex = "appliedenergistics2:" + this.nameOf( what );
|
||||
mat.IIcon = icoRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
@@ -289,13 +289,13 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack is)
|
||||
{
|
||||
return getTypeByStack( is ).hasCustomEntity();
|
||||
return this.getTypeByStack( is ).hasCustomEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(World w, Entity location, ItemStack itemstack)
|
||||
{
|
||||
Class<? extends Entity> droppedEntity = getTypeByStack( itemstack ).getCustomEntityClass();
|
||||
Class<? extends Entity> droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass();
|
||||
Entity eqi;
|
||||
|
||||
try
|
||||
@@ -321,7 +321,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
@Override
|
||||
public int getBytes(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
switch (this.getTypeByStack( is ))
|
||||
{
|
||||
case Cell1kPart:
|
||||
return 1024;
|
||||
@@ -339,7 +339,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
@Override
|
||||
public boolean isStorageComponent(ItemStack is)
|
||||
{
|
||||
switch (getTypeByStack( is ))
|
||||
switch (this.getTypeByStack( is ))
|
||||
{
|
||||
case Cell1kPart:
|
||||
case Cell4kPart:
|
||||
@@ -354,7 +354,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
|
||||
@Override
|
||||
public Upgrades getType(ItemStack itemstack)
|
||||
{
|
||||
switch (getTypeByStack( itemstack ))
|
||||
switch (this.getTypeByStack( itemstack ))
|
||||
{
|
||||
case CardCapacity:
|
||||
return Upgrades.CAPACITY;
|
||||
|
||||
@@ -100,70 +100,70 @@ public enum MaterialType
|
||||
public MaterialStackSrc stackSrc;
|
||||
|
||||
MaterialType(int metaValue) {
|
||||
damageValue = metaValue;
|
||||
features = EnumSet.of( AEFeature.Core );
|
||||
this.damageValue = metaValue;
|
||||
this.features = EnumSet.of( AEFeature.Core );
|
||||
}
|
||||
|
||||
MaterialType(int metaValue, AEFeature part) {
|
||||
damageValue = metaValue;
|
||||
features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
this.features = EnumSet.of( part );
|
||||
}
|
||||
|
||||
MaterialType(int metaValue, AEFeature part, Class<? extends Entity> c) {
|
||||
features = EnumSet.of( part );
|
||||
damageValue = metaValue;
|
||||
droppedEntity = c;
|
||||
this.features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
this.droppedEntity = c;
|
||||
|
||||
EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true );
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance, 16, 4, true );
|
||||
}
|
||||
|
||||
MaterialType(int metaValue, AEFeature part, String oreDictionary, Class<? extends Entity> c) {
|
||||
features = EnumSet.of( part );
|
||||
damageValue = metaValue;
|
||||
oreName = oreDictionary;
|
||||
droppedEntity = c;
|
||||
EntityRegistry.registerModEntity( droppedEntity, droppedEntity.getSimpleName(), EntityIds.get( droppedEntity ), AppEng.instance, 16, 4, true );
|
||||
this.features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
this.oreName = oreDictionary;
|
||||
this.droppedEntity = c;
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance, 16, 4, true );
|
||||
}
|
||||
|
||||
MaterialType(int metaValue, AEFeature part, String oreDictionary) {
|
||||
features = EnumSet.of( part );
|
||||
damageValue = metaValue;
|
||||
oreName = oreDictionary;
|
||||
this.features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
this.oreName = oreDictionary;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size)
|
||||
{
|
||||
return new ItemStack( itemInstance, size, damageValue );
|
||||
return new ItemStack( this.itemInstance, size, this.damageValue );
|
||||
}
|
||||
|
||||
public EnumSet<AEFeature> getFeature()
|
||||
{
|
||||
return features;
|
||||
return this.features;
|
||||
}
|
||||
|
||||
public String getOreName()
|
||||
{
|
||||
return oreName;
|
||||
return this.oreName;
|
||||
}
|
||||
|
||||
public boolean hasCustomEntity()
|
||||
{
|
||||
return droppedEntity != null;
|
||||
return this.droppedEntity != null;
|
||||
}
|
||||
|
||||
public Class<? extends Entity> getCustomEntityClass()
|
||||
{
|
||||
return droppedEntity;
|
||||
return this.droppedEntity;
|
||||
}
|
||||
|
||||
public boolean isRegistered()
|
||||
{
|
||||
return isRegistered;
|
||||
return this.isRegistered;
|
||||
}
|
||||
|
||||
public void markReady()
|
||||
{
|
||||
isRegistered = true;
|
||||
this.isRegistered = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
|
||||
public ItemCrystalSeed() {
|
||||
super( ItemCrystalSeed.class );
|
||||
setHasSubtypes( true );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setHasSubtypes( true );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
|
||||
EntityRegistry.registerModEntity( EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ),
|
||||
AppEng.instance, 16, 4, true );
|
||||
@@ -102,24 +102,24 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
int damage = getProgress( is );
|
||||
int damage = this.getProgress( is );
|
||||
|
||||
if ( damage < Certus + SINGLE_OFFSET )
|
||||
return getUnlocalizedName() + ".Certus";
|
||||
return this.getUnlocalizedName() + ".Certus";
|
||||
|
||||
if ( damage < Nether + SINGLE_OFFSET )
|
||||
return getUnlocalizedName() + ".Nether";
|
||||
return this.getUnlocalizedName() + ".Nether";
|
||||
|
||||
if ( damage < Fluix + SINGLE_OFFSET )
|
||||
return getUnlocalizedName() + ".Fluix";
|
||||
return this.getUnlocalizedName() + ".Fluix";
|
||||
|
||||
return getUnlocalizedName();
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack triggerGrowth(ItemStack is)
|
||||
{
|
||||
int newDamage = getProgress( is ) + 1;
|
||||
int newDamage = this.getProgress( is ) + 1;
|
||||
|
||||
if ( newDamage == Certus + SINGLE_OFFSET )
|
||||
return AEApi.instance().materials().materialPurifiedCertusQuartzCrystal.stack( is.stackSize );
|
||||
@@ -130,7 +130,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
if ( newDamage > END )
|
||||
return null;
|
||||
|
||||
setProgress( is, newDamage );
|
||||
this.setProgress( is, newDamage );
|
||||
return is;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
lines.add( ButtonToolTips.DoesntDespawn.getLocal() );
|
||||
int progress = getProgress( stack ) % SINGLE_OFFSET;
|
||||
int progress = this.getProgress( stack ) % SINGLE_OFFSET;
|
||||
lines.add( Math.floor( (float) progress / (float) (SINGLE_OFFSET / 100) ) + "%" );
|
||||
|
||||
super.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
@@ -165,7 +165,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass)
|
||||
{
|
||||
return getIconIndex( stack );
|
||||
return this.getIconIndex( stack );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -173,21 +173,21 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
{
|
||||
IIcon list[] = null;
|
||||
|
||||
int damage = getProgress( stack );
|
||||
int damage = this.getProgress( stack );
|
||||
|
||||
if ( damage < Certus + SINGLE_OFFSET )
|
||||
list = certus;
|
||||
list = this.certus;
|
||||
|
||||
else if ( damage < Nether + SINGLE_OFFSET )
|
||||
{
|
||||
damage -= Nether;
|
||||
list = nether;
|
||||
list = this.nether;
|
||||
}
|
||||
|
||||
else if ( damage < Fluix + SINGLE_OFFSET )
|
||||
{
|
||||
damage -= Fluix;
|
||||
list = fluix;
|
||||
list = this.fluix;
|
||||
}
|
||||
|
||||
if ( list == null )
|
||||
@@ -212,17 +212,17 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
{
|
||||
String preFix = "appliedenergistics2:ItemCrystalSeed.";
|
||||
|
||||
certus[0] = ir.registerIcon( preFix + "Certus" );
|
||||
certus[1] = ir.registerIcon( preFix + "Certus2" );
|
||||
certus[2] = ir.registerIcon( preFix + "Certus3" );
|
||||
this.certus[0] = ir.registerIcon( preFix + "Certus" );
|
||||
this.certus[1] = ir.registerIcon( preFix + "Certus2" );
|
||||
this.certus[2] = ir.registerIcon( preFix + "Certus3" );
|
||||
|
||||
nether[0] = ir.registerIcon( preFix + "Nether" );
|
||||
nether[1] = ir.registerIcon( preFix + "Nether2" );
|
||||
nether[2] = ir.registerIcon( preFix + "Nether3" );
|
||||
this.nether[0] = ir.registerIcon( preFix + "Nether" );
|
||||
this.nether[1] = ir.registerIcon( preFix + "Nether2" );
|
||||
this.nether[2] = ir.registerIcon( preFix + "Nether3" );
|
||||
|
||||
fluix[0] = ir.registerIcon( preFix + "Fluix" );
|
||||
fluix[1] = ir.registerIcon( preFix + "Fluix2" );
|
||||
fluix[2] = ir.registerIcon( preFix + "Fluix3" );
|
||||
this.fluix[0] = ir.registerIcon( preFix + "Fluix" );
|
||||
this.fluix[1] = ir.registerIcon( preFix + "Fluix2" );
|
||||
this.fluix[2] = ir.registerIcon( preFix + "Fluix3" );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,8 +47,8 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
|
||||
public ItemEncodedPattern() {
|
||||
super( ItemEncodedPattern.class );
|
||||
setFeature( EnumSet.of( AEFeature.Patterns ) );
|
||||
setMaxStackSize( 1 );
|
||||
this.setFeature( EnumSet.of( AEFeature.Patterns ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
if ( Platform.isClient() )
|
||||
MinecraftForgeClient.registerItemRenderer( this, new ItemEncodedPatternRenderer() );
|
||||
}
|
||||
@@ -78,20 +78,20 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return clearPattern( stack, player );
|
||||
return this.clearPattern( stack, player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World w, EntityPlayer player)
|
||||
{
|
||||
clearPattern( stack, player );
|
||||
this.clearPattern( stack, player );
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
ICraftingPatternDetails details = getPatternForItem( stack, player.worldObj );
|
||||
ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj );
|
||||
|
||||
if ( details == null )
|
||||
{
|
||||
@@ -146,7 +146,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
if ( w == null )
|
||||
return null;
|
||||
|
||||
ICraftingPatternDetails details = getPatternForItem( item, w );
|
||||
ICraftingPatternDetails details = this.getPatternForItem( item, w );
|
||||
|
||||
if ( details == null )
|
||||
return null;
|
||||
|
||||
@@ -39,8 +39,8 @@ public class ItemPaintBall extends AEBaseItem
|
||||
|
||||
public ItemPaintBall() {
|
||||
super( ItemPaintBall.class );
|
||||
setFeature( EnumSet.of( AEFeature.PaintBalls ) );
|
||||
hasSubtypes = true;
|
||||
this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
|
||||
this.hasSubtypes = true;
|
||||
if ( Platform.isClient() )
|
||||
MinecraftForgeClient.registerItemRenderer( this, new PaintBallRender() );
|
||||
}
|
||||
@@ -48,12 +48,12 @@ public class ItemPaintBall extends AEBaseItem
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack is)
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + getExtraName( is );
|
||||
return super.getItemStackDisplayName( is ) + " - " + this.getExtraName( is );
|
||||
}
|
||||
|
||||
public String getExtraName(ItemStack is)
|
||||
{
|
||||
return (is.getItemDamage() >= 20 ? GuiText.Lumen.getLocal() + ' ' : "") + getColor( is );
|
||||
return (is.getItemDamage() >= 20 ? GuiText.Lumen.getLocal() + ' ' : "") + this.getColor( is );
|
||||
}
|
||||
|
||||
public AEColor getColor(ItemStack is)
|
||||
|
||||
@@ -55,8 +55,8 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
|
||||
public ItemFacade() {
|
||||
super( ItemFacade.class );
|
||||
setFeature( EnumSet.of( AEFeature.Facades ) );
|
||||
setHasSubtypes( true );
|
||||
this.setFeature( EnumSet.of( AEFeature.Facades ) );
|
||||
this.setHasSubtypes( true );
|
||||
if ( Platform.isClient() )
|
||||
MinecraftForgeClient.registerItemRenderer( this, BusRenderer.instance );
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
@Override
|
||||
public FacadePart createPartFromItemStack(ItemStack is, ForgeDirection side)
|
||||
{
|
||||
ItemStack in = getTextureItem( is );
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
if ( in != null )
|
||||
return new FacadePart( is, side );
|
||||
return null;
|
||||
@@ -87,23 +87,23 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
|
||||
public List<ItemStack> getFacades()
|
||||
{
|
||||
calculateSubTypes();
|
||||
return subTypes;
|
||||
this.calculateSubTypes();
|
||||
return this.subTypes;
|
||||
}
|
||||
|
||||
public ItemStack getCreativeTabIcon()
|
||||
{
|
||||
calculateSubTypes();
|
||||
if ( subTypes.isEmpty() )
|
||||
this.calculateSubTypes();
|
||||
if ( this.subTypes.isEmpty() )
|
||||
return new ItemStack( Items.cake );
|
||||
return subTypes.get( 0 );
|
||||
return this.subTypes.get( 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item number, CreativeTabs tab, List list)
|
||||
{
|
||||
calculateSubTypes();
|
||||
list.addAll( subTypes );
|
||||
this.calculateSubTypes();
|
||||
list.addAll( this.subTypes );
|
||||
}
|
||||
|
||||
public ItemStack createFromIDs(int[] ids)
|
||||
@@ -118,17 +118,17 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
@Override
|
||||
public ItemStack getTextureItem(ItemStack is)
|
||||
{
|
||||
Block blk = getBlock( is );
|
||||
Block blk = this.getBlock( is );
|
||||
if ( blk != null )
|
||||
return new ItemStack( blk, 1, getMeta( is ) );
|
||||
return new ItemStack( blk, 1, this.getMeta( is ) );
|
||||
return null;
|
||||
}
|
||||
|
||||
private void calculateSubTypes()
|
||||
{
|
||||
if ( subTypes == null )
|
||||
if ( this.subTypes == null )
|
||||
{
|
||||
subTypes = new ArrayList<ItemStack>();
|
||||
this.subTypes = new ArrayList<ItemStack>();
|
||||
for (Object blk : Block.blockRegistry)
|
||||
{
|
||||
Block b = (Block) blk;
|
||||
@@ -140,9 +140,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList );
|
||||
for (ItemStack l : tmpList)
|
||||
{
|
||||
ItemStack facade = createFacadeForItem( l, false );
|
||||
ItemStack facade = this.createFacadeForItem( l, false );
|
||||
if ( facade != null )
|
||||
subTypes.add( facade );
|
||||
this.subTypes.add( facade );
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
@@ -231,7 +231,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStack in = getTextureItem( is );
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
if ( in != null )
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName();
|
||||
@@ -248,7 +248,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
@Override
|
||||
public boolean useAlphaPass(ItemStack is)
|
||||
{
|
||||
ItemStack out = getTextureItem( is );
|
||||
ItemStack out = this.getTextureItem( is );
|
||||
|
||||
if ( out == null || out.getItem() == null )
|
||||
return false;
|
||||
|
||||
@@ -67,9 +67,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
|
||||
public ItemMultiPart() {
|
||||
super( ItemMultiPart.class );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
AEApi.instance().partHelper().setItemBusRenderer( this );
|
||||
setHasSubtypes( true );
|
||||
this.setHasSubtypes( true );
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
int varID = variant == null ? 0 : variant.ordinal();
|
||||
|
||||
// verify
|
||||
for (PartTypeIst p : dmgToPart.values())
|
||||
for (PartTypeIst p : this.dmgToPart.values())
|
||||
{
|
||||
if ( p.part == mat && p.variant == varID )
|
||||
throw new RuntimeException( "Cannot create the same material twice..." );
|
||||
@@ -109,9 +109,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
pti.part = mat;
|
||||
pti.variant = varID;
|
||||
|
||||
if ( dmgToPart.get( newPartNum ) == null )
|
||||
if ( this.dmgToPart.get( newPartNum ) == null )
|
||||
{
|
||||
dmgToPart.put( newPartNum, pti );
|
||||
this.dmgToPart.put( newPartNum, pti );
|
||||
return output;
|
||||
}
|
||||
else
|
||||
@@ -123,7 +123,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
|
||||
public int getDamageByType(PartType t)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> pt : dmgToPart.entrySet())
|
||||
for (Entry<Integer, PartTypeIst> pt : this.dmgToPart.entrySet())
|
||||
{
|
||||
if ( pt.getValue().part == t )
|
||||
return pt.getKey();
|
||||
@@ -136,7 +136,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
if ( is == null )
|
||||
return null;
|
||||
|
||||
PartTypeIst pt = dmgToPart.get( is.getItemDamage() );
|
||||
PartTypeIst pt = this.dmgToPart.get( is.getItemDamage() );
|
||||
if ( pt != null )
|
||||
return pt.part;
|
||||
|
||||
@@ -159,25 +159,25 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return "item.appliedenergistics2." + getName( is );
|
||||
return "item.appliedenergistics2." + this.getName( is );
|
||||
}
|
||||
|
||||
public String getName(ItemStack is)
|
||||
{
|
||||
return AEFeatureHandler.getName( ItemMultiPart.class, getTypeByStack( is ).name() );
|
||||
return AEFeatureHandler.getName( ItemMultiPart.class, this.getTypeByStack( is ).name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack is)
|
||||
{
|
||||
PartType pt = getTypeByStack( is );
|
||||
PartType pt = this.getTypeByStack( is );
|
||||
if ( pt == null )
|
||||
return "Unnamed";
|
||||
|
||||
Enum[] variants = pt.getVariants();
|
||||
|
||||
if ( variants != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + variants[dmgToPart.get( is.getItemDamage() ).variant].toString();
|
||||
return super.getItemStackDisplayName( is ) + " - " + variants[this.dmgToPart.get( is.getItemDamage() ).variant].toString();
|
||||
|
||||
if ( pt.getExtraName() != null )
|
||||
return super.getItemStackDisplayName( is ) + " - " + pt.getExtraName().getLocal();
|
||||
@@ -188,9 +188,9 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
for (Entry<Integer, PartTypeIst> part : dmgToPart.entrySet())
|
||||
for (Entry<Integer, PartTypeIst> part : this.dmgToPart.entrySet())
|
||||
{
|
||||
String tex = "appliedenergistics2:" + getName( new ItemStack( this, 1, part.getKey() ) );
|
||||
String tex = "appliedenergistics2:" + this.getName( new ItemStack( this, 1, part.getKey() ) );
|
||||
part.getValue().ico = par1IconRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
{
|
||||
try
|
||||
{
|
||||
PartType t = getTypeByStack( is );
|
||||
PartType t = this.getTypeByStack( is );
|
||||
if ( t != null )
|
||||
{
|
||||
if ( t.constructor == null )
|
||||
@@ -217,7 +217,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
throw new RuntimeException( "Unable to construct IBusPart from IBusItem : " + getTypeByStack( is ).getPart().getName()
|
||||
throw new RuntimeException( "Unable to construct IBusPart from IBusItem : " + this.getTypeByStack( is ).getPart().getName()
|
||||
+ " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
return null;
|
||||
@@ -226,7 +226,7 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
@Override
|
||||
public void getSubItems(Item number, CreativeTabs tab, List cList)
|
||||
{
|
||||
List<Entry<Integer, PartTypeIst>> types = new ArrayList<Entry<Integer, PartTypeIst>>( dmgToPart.entrySet() );
|
||||
List<Entry<Integer, PartTypeIst>> types = new ArrayList<Entry<Integer, PartTypeIst>>( this.dmgToPart.entrySet() );
|
||||
Collections.sort( types, new Comparator<Entry<Integer, PartTypeIst>>() {
|
||||
|
||||
@Override
|
||||
@@ -243,8 +243,8 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
|
||||
public int variantOf(int itemDamage)
|
||||
{
|
||||
if ( dmgToPart.containsKey( itemDamage ) )
|
||||
return dmgToPart.get( itemDamage ).variant;
|
||||
if ( this.dmgToPart.containsKey( itemDamage ) )
|
||||
return this.dmgToPart.get( itemDamage ).variant;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -253,13 +253,13 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
{
|
||||
boolean importBus = false, exportBus = false, group = false;
|
||||
|
||||
PartType u = getTypeByStack( is );
|
||||
PartType u = this.getTypeByStack( is );
|
||||
|
||||
for (ItemStack stack : others)
|
||||
{
|
||||
if ( stack.getItem() == this )
|
||||
{
|
||||
PartType pt = getTypeByStack( stack );
|
||||
PartType pt = this.getTypeByStack( stack );
|
||||
switch (pt)
|
||||
{
|
||||
case ImportBus:
|
||||
|
||||
@@ -138,10 +138,10 @@ public enum PartType
|
||||
}
|
||||
|
||||
PartType(int baseMetaValue, AEFeature part, Class<? extends IPart> c, GuiText en) {
|
||||
features = EnumSet.of( part );
|
||||
myPart = c;
|
||||
extraName = en;
|
||||
baseDamage = baseMetaValue;
|
||||
this.features = EnumSet.of( part );
|
||||
this.myPart = c;
|
||||
this.extraName = en;
|
||||
this.baseDamage = baseMetaValue;
|
||||
}
|
||||
|
||||
public Enum<AEColor>[] getVariants()
|
||||
@@ -154,17 +154,17 @@ public enum PartType
|
||||
|
||||
public EnumSet<AEFeature> getFeature()
|
||||
{
|
||||
return features;
|
||||
return this.features;
|
||||
}
|
||||
|
||||
public Class<? extends IPart> getPart()
|
||||
{
|
||||
return myPart;
|
||||
return this.myPart;
|
||||
}
|
||||
|
||||
public GuiText getExtraName()
|
||||
{
|
||||
return extraName;
|
||||
return this.extraName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer player )
|
||||
{
|
||||
disassembleDrive( stack, world, player );
|
||||
this.disassembleDrive( stack, world, player );
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
return disassembleDrive( stack, world, player );
|
||||
return this.disassembleDrive( stack, world, player );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,8 +33,8 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
|
||||
|
||||
public ItemCreativeStorageCell() {
|
||||
super( ItemCreativeStorageCell.class );
|
||||
setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.Creative ) );
|
||||
setMaxStackSize( 1 );
|
||||
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.Creative ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,16 +52,16 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
public ItemSpatialStorageCell( MaterialType whichCell, int spatialScale )
|
||||
{
|
||||
super( ItemSpatialStorageCell.class, Optional.of( spatialScale + "Cubed" ) );
|
||||
setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||
setMaxStackSize( 1 );
|
||||
maxRegion = spatialScale;
|
||||
component = whichCell;
|
||||
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
this.maxRegion = spatialScale;
|
||||
this.component = whichCell;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
WorldCoord wc = getStoredSize( stack );
|
||||
WorldCoord wc = this.getStoredSize( stack );
|
||||
if ( wc.x > 0 )
|
||||
lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z );
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
@Override
|
||||
public int getMaxStoredDim( ItemStack is )
|
||||
{
|
||||
return maxRegion;
|
||||
return this.maxRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,7 +123,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
@Override
|
||||
public WorldCoord getMin( ItemStack is )
|
||||
{
|
||||
World w = getWorld( is );
|
||||
World w = this.getWorld( is );
|
||||
if ( w != null )
|
||||
{
|
||||
NBTTagCompound info = ( NBTTagCompound ) w.getWorldInfo().getAdditionalProperty( "storageCell" );
|
||||
@@ -138,7 +138,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
@Override
|
||||
public WorldCoord getMax( ItemStack is )
|
||||
{
|
||||
World w = getWorld( is );
|
||||
World w = this.getWorld( is );
|
||||
if ( w != null )
|
||||
{
|
||||
NBTTagCompound info = ( NBTTagCompound ) w.getWorldInfo().getAdditionalProperty( "storageCell" );
|
||||
@@ -153,26 +153,26 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
@Override
|
||||
public TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition )
|
||||
{
|
||||
WorldCoord scale = getStoredSize( is );
|
||||
WorldCoord scale = this.getStoredSize( is );
|
||||
|
||||
int targetX = max.x - min.x - 1;
|
||||
int targetY = max.y - min.y - 1;
|
||||
int targetZ = max.z - min.z - 1;
|
||||
int maxSize = getMaxStoredDim( is );
|
||||
int maxSize = this.getMaxStoredDim( is );
|
||||
|
||||
int floorBuffer = 64;
|
||||
World destination = getWorld( is );
|
||||
World destination = this.getWorld( is );
|
||||
|
||||
if ( ( scale.x == 0 && scale.y == 0 && scale.z == 0 ) || ( scale.x == targetX && scale.y == targetY && scale.z == targetZ ) )
|
||||
{
|
||||
if ( targetX <= maxSize && targetY <= maxSize && targetZ <= maxSize )
|
||||
{
|
||||
if ( destination == null )
|
||||
destination = createNewWorld( is );
|
||||
destination = this.createNewWorld( is );
|
||||
|
||||
StorageHelper.getInstance()
|
||||
.swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 );
|
||||
setStoredSize( is, targetX, targetY, targetZ );
|
||||
this.setStoredSize( is, targetX, targetY, targetZ );
|
||||
|
||||
return new TransitionResult( true, 0 );
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
public ItemViewCell()
|
||||
{
|
||||
super( ItemViewCell.class );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
setMaxStackSize( 1 );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,8 +45,8 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
|
||||
public ToolBiometricCard() {
|
||||
super( ToolBiometricCard.class );
|
||||
setFeature( EnumSet.of( AEFeature.Security ) );
|
||||
setMaxStackSize( 1 );
|
||||
this.setFeature( EnumSet.of( AEFeature.Security ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
if ( Platform.isClient() )
|
||||
MinecraftForgeClient.registerItemRenderer( this, new ToolBiometricCardRender() );
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack is)
|
||||
{
|
||||
GameProfile username = getProfile( is );
|
||||
GameProfile username = this.getProfile( is );
|
||||
return username != null ? super.getItemStackDisplayName( is ) + " - " + username.getName() : super.getItemStackDisplayName( is );
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
{
|
||||
if ( par2EntityPlayer.capabilities.isCreativeMode )
|
||||
is = par2EntityPlayer.getCurrentEquippedItem();
|
||||
encode( is, (EntityPlayer) target );
|
||||
this.encode( is, (EntityPlayer) target );
|
||||
par2EntityPlayer.swingItem();
|
||||
return true;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
{
|
||||
if ( p.isSneaking() )
|
||||
{
|
||||
encode( is, p );
|
||||
this.encode( is, p );
|
||||
p.swingItem();
|
||||
return is;
|
||||
}
|
||||
@@ -87,18 +87,18 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
|
||||
private void encode(ItemStack is, EntityPlayer p)
|
||||
{
|
||||
GameProfile username = getProfile( is );
|
||||
GameProfile username = this.getProfile( is );
|
||||
|
||||
if (username != null && username.equals(p.getGameProfile()))
|
||||
setProfile( is, null );
|
||||
this.setProfile( is, null );
|
||||
else
|
||||
setProfile( is, p.getGameProfile() );
|
||||
this.setProfile( is, p.getGameProfile() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
EnumSet<SecurityPermissions> perms = getPermissions( stack );
|
||||
EnumSet<SecurityPermissions> perms = this.getPermissions( stack );
|
||||
if ( perms.isEmpty() )
|
||||
lines.add( GuiText.NoPermissions.getLocal() );
|
||||
else
|
||||
@@ -181,6 +181,6 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
@Override
|
||||
public void registerPermissions(ISecurityRegistry register, IPlayerRegistry pr, ItemStack is)
|
||||
{
|
||||
register.addPlayer( pr.getID( getProfile( is ) ), getPermissions( is ) );
|
||||
register.addPlayer( pr.getID( this.getProfile( is ) ), this.getPermissions( is ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
|
||||
public ToolMemoryCard() {
|
||||
super( ToolMemoryCard.class );
|
||||
setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
setMaxStackSize( 1 );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,11 +69,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
lines.add( getLocalizedName( getSettingsName( stack ) + ".name", getSettingsName( stack ) ) );
|
||||
lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) );
|
||||
|
||||
NBTTagCompound data = getData( stack );
|
||||
NBTTagCompound data = this.getData( stack );
|
||||
if ( data.hasKey( "tooltip" ) )
|
||||
lines.add( StatCollector.translateToLocal( getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) );
|
||||
lines.add( StatCollector.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
|
||||
if ( mop == null )
|
||||
{
|
||||
onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 );
|
||||
this.onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
int k = mop.blockZ;
|
||||
|
||||
if ( w.getBlock( i, j, k ).isAir( w, i, j, k ) )
|
||||
onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 );
|
||||
this.onItemUseFirst( it, p, w, 0, 0, 0, -1, 0, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
||||
public ToolChargedStaff()
|
||||
{
|
||||
super( ToolChargedStaff.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.chargedStaffBattery;
|
||||
this.setFeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) );
|
||||
this.maxStoredPower = AEConfig.instance.chargedStaffBattery;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,7 +50,7 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
||||
{
|
||||
if ( this.getAECurrentPower( item ) > 300 )
|
||||
{
|
||||
extractAEPower( item, 300 );
|
||||
this.extractAEPower( item, 300 );
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
for ( int x = 0; x < 2; x++ )
|
||||
|
||||
@@ -100,8 +100,8 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
public ToolColorApplicator()
|
||||
{
|
||||
super( ToolColorApplicator.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.colorApplicatorBattery;
|
||||
this.setFeature( EnumSet.of( AEFeature.ColorApplicator, AEFeature.PoweredTools ) );
|
||||
this.maxStoredPower = AEConfig.instance.colorApplicatorBattery;
|
||||
if ( Platform.isClient() )
|
||||
MinecraftForgeClient.registerItemRenderer( this, new ToolColorApplicatorRender() );
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
Block blk = w.getBlock( x, y, z );
|
||||
double powerPerUse = 100;
|
||||
|
||||
ItemStack paintBall = getColor( is );
|
||||
ItemStack paintBall = this.getColor( is );
|
||||
|
||||
IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
if ( inv != null )
|
||||
@@ -144,12 +144,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
// clean cables.
|
||||
if ( te instanceof IColorableTile )
|
||||
{
|
||||
if ( getAECurrentPower( is ) > powerPerUse && ( ( IColorableTile ) te ).getColor() != AEColor.Transparent )
|
||||
if ( this.getAECurrentPower( is ) > powerPerUse && ( ( IColorableTile ) te ).getColor() != AEColor.Transparent )
|
||||
{
|
||||
if ( ( ( IColorableTile ) te ).recolourBlock( orientation, AEColor.Transparent, p ) )
|
||||
{
|
||||
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
|
||||
extractAEPower( is, powerPerUse );
|
||||
this.extractAEPower( is, powerPerUse );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -158,25 +158,25 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
// clean paint balls..
|
||||
Block testBlk = w.getBlock( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ );
|
||||
TileEntity painted = w.getTileEntity( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ );
|
||||
if ( getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint )
|
||||
if ( this.getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint )
|
||||
{
|
||||
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
|
||||
extractAEPower( is, powerPerUse );
|
||||
this.extractAEPower( is, powerPerUse );
|
||||
( ( TilePaint ) painted ).cleanSide( orientation.getOpposite() );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( paintBall != null )
|
||||
{
|
||||
AEColor color = getColorFromItem( paintBall );
|
||||
AEColor color = this.getColorFromItem( paintBall );
|
||||
|
||||
if ( color != null && getAECurrentPower( is ) > powerPerUse )
|
||||
if ( color != null && this.getAECurrentPower( is ) > powerPerUse )
|
||||
{
|
||||
if ( color != AEColor.Transparent
|
||||
&& recolourBlock( blk, ForgeDirection.getOrientation( side ), w, x, y, z, ForgeDirection.getOrientation( side ), color, p ) )
|
||||
&& this.recolourBlock( blk, ForgeDirection.getOrientation( side ), w, x, y, z, ForgeDirection.getOrientation( side ), color, p ) )
|
||||
{
|
||||
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
|
||||
extractAEPower( is, powerPerUse );
|
||||
this.extractAEPower( is, powerPerUse );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
if ( p.isSneaking() )
|
||||
{
|
||||
cycleColors( is, paintBall, 1 );
|
||||
this.cycleColors( is, paintBall, 1 );
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -197,7 +197,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
{
|
||||
String extra = GuiText.Empty.getLocal();
|
||||
|
||||
AEColor selected = getActiveColor( par1ItemStack );
|
||||
AEColor selected = this.getActiveColor( par1ItemStack );
|
||||
|
||||
if ( selected != null && Platform.isClient() )
|
||||
extra = Platform.gui_localize( selected.unlocalizedName );
|
||||
@@ -207,7 +207,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
public AEColor getActiveColor( ItemStack tol )
|
||||
{
|
||||
return getColorFromItem( getColor( tol ) );
|
||||
return this.getColorFromItem( this.getColor( tol ) );
|
||||
}
|
||||
|
||||
public AEColor getColorFromItem( ItemStack paintBall )
|
||||
@@ -248,7 +248,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return oldColor;
|
||||
}
|
||||
|
||||
return findNextColor( is, null, 0 );
|
||||
return this.findNextColor( is, null, 0 );
|
||||
}
|
||||
|
||||
private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset )
|
||||
@@ -306,7 +306,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
if ( newColor != null )
|
||||
setColor( is, newColor );
|
||||
this.setColor( is, newColor );
|
||||
|
||||
return newColor;
|
||||
}
|
||||
@@ -383,11 +383,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
{
|
||||
if ( paintBall == null )
|
||||
{
|
||||
setColor( is, getColor( is ) );
|
||||
this.setColor( is, this.getColor( is ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor( is, findNextColor( is, paintBall, i ) );
|
||||
this.setColor( is, this.findNextColor( is, paintBall, i ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
@Override
|
||||
public void onWheel( ItemStack is, boolean up )
|
||||
{
|
||||
cycleColors( is, getColor( is ), up ? 1 : -1 );
|
||||
this.cycleColors( is, this.getColor( is ), up ? 1 : -1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
public ToolEntropyManipulator()
|
||||
{
|
||||
super( ToolEntropyManipulator.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.entropyManipulatorBattery;
|
||||
this.setFeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) );
|
||||
this.maxStoredPower = AEConfig.instance.entropyManipulatorBattery;
|
||||
|
||||
coolDown = new Hashtable<Combo, InWorldToolOperationResult>();
|
||||
coolDown.put( new Combo( Blocks.stone, 0 ), new InWorldToolOperationResult( new ItemStack( Blocks.cobblestone ) ) );
|
||||
@@ -124,14 +124,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
public Combo( Block b, int m )
|
||||
{
|
||||
blk = b;
|
||||
meta = m;
|
||||
this.blk = b;
|
||||
this.meta = m;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return blk.hashCode() ^ meta;
|
||||
return this.blk.hashCode() ^ this.meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,10 +139,10 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if ( obj == null )
|
||||
return false;
|
||||
if ( getClass() != obj.getClass() )
|
||||
if ( this.getClass() != obj.getClass() )
|
||||
return false;
|
||||
Combo other = ( Combo ) obj;
|
||||
return blk == other.blk && meta == other.meta;
|
||||
return this.blk == other.blk && this.meta == other.meta;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if ( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
this.extractAEPower( item, 1600 );
|
||||
target.setFire( 8 );
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if ( Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) )
|
||||
{
|
||||
onItemUse( item, p, w, x, y, z, 0, 0.0F, 0.0F, 0.0F );
|
||||
this.onItemUse( item, p, w, x, y, z, 0, 0.0F, 0.0F, 0.0F );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if ( canCool( Blk, Metadata ) )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
this.extractAEPower( item, 1600 );
|
||||
cool( Blk, Metadata, w, x, y, z );
|
||||
return true;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
if ( canHeat( Blk, Metadata ) )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
this.extractAEPower( item, 1600 );
|
||||
heat( Blk, Metadata, w, x, y, z );
|
||||
return true;
|
||||
}
|
||||
@@ -308,7 +308,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
if ( hasFurnaceable && canFurnaceable )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
this.extractAEPower( item, 1600 );
|
||||
InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) );
|
||||
w.playSoundEffect( x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F );
|
||||
|
||||
@@ -340,7 +340,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
if ( w.isAirBlock( x, y, z ) )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
this.extractAEPower( item, 1600 );
|
||||
w.playSoundEffect( x + 0.5D, y + 0.5D, z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F );
|
||||
w.setBlock( x, y, z, Blocks.fire );
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
public ToolMassCannon()
|
||||
{
|
||||
super( ToolMassCannon.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.matterCannonBattery;
|
||||
this.setFeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) );
|
||||
this.maxStoredPower = AEConfig.instance.matterCannonBattery;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,7 +120,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
int shots = 1;
|
||||
|
||||
CellUpgrades cu = ( CellUpgrades ) getUpgradesInventory( item );
|
||||
CellUpgrades cu = ( CellUpgrades ) this.getUpgradesInventory( item );
|
||||
if ( cu != null )
|
||||
shots += cu.getInstalledUpgrades( Upgrades.SPEED );
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
shots = Math.min( shots, ( int ) aeAmmo.getStackSize() );
|
||||
for ( int sh = 0; sh < shots; sh++ )
|
||||
{
|
||||
extractAEPower( item, 1600 );
|
||||
this.extractAEPower( item, 1600 );
|
||||
|
||||
if ( Platform.isClient() )
|
||||
return item;
|
||||
@@ -174,13 +174,13 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
ItemStack type = ( ( IAEItemStack ) aeAmmo ).getItemStack();
|
||||
if ( type.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 );
|
||||
this.shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 );
|
||||
}
|
||||
return item;
|
||||
}
|
||||
else
|
||||
{
|
||||
standardAmmo( penetration, w, p, vec3, vec31, direction, d0, d1, d2 );
|
||||
this.standardAmmo( penetration, w, p, vec3, vec31, direction, d0, d1, d2 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
public ToolPortableCell()
|
||||
{
|
||||
super( ToolPortableCell.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.portableCellBattery;
|
||||
this.setFeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) );
|
||||
this.maxStoredPower = AEConfig.instance.portableCellBattery;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -55,8 +55,8 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
public ToolWirelessTerminal()
|
||||
{
|
||||
super( ToolWirelessTerminal.class, Optional.<String> absent() );
|
||||
setFeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = AEConfig.instance.wirelessTerminalBattery;
|
||||
this.setFeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) );
|
||||
this.maxStoredPower = AEConfig.instance.wirelessTerminalBattery;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -110,7 +110,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
@Override
|
||||
public boolean hasPower( EntityPlayer player, double amt, ItemStack is )
|
||||
{
|
||||
return getAECurrentPower( is ) >= amt;
|
||||
return this.getAECurrentPower( is ) >= amt;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,9 +47,9 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
public AERootPoweredItem( Class c, Optional<String> subName )
|
||||
{
|
||||
super( c, subName );
|
||||
setMaxDamage( 32 );
|
||||
hasSubtypes = false;
|
||||
setFull3D();
|
||||
this.setMaxDamage( 32 );
|
||||
this.hasSubtypes = false;
|
||||
this.setFull3D();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +57,7 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
double internalMaxPower = getAEMaxPower( stack );
|
||||
double internalMaxPower = this.getAEMaxPower( stack );
|
||||
|
||||
if ( tag != null )
|
||||
{
|
||||
@@ -84,8 +84,8 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
|
||||
ItemStack charged = new ItemStack( this, 1 );
|
||||
NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
tag.setDouble( "internalCurrentPower", getAEMaxPower( charged ) );
|
||||
tag.setDouble( "internalMaxPower", getAEMaxPower( charged ) );
|
||||
tag.setDouble( "internalCurrentPower", this.getAEMaxPower( charged ) );
|
||||
tag.setDouble( "internalMaxPower", this.getAEMaxPower( charged ) );
|
||||
list.add( charged );
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
@Override
|
||||
public double getDurabilityForDisplay( ItemStack is )
|
||||
{
|
||||
return 1 - getAECurrentPower( is ) / getAEMaxPower( is );
|
||||
return 1 - this.getAECurrentPower( is ) / this.getAEMaxPower( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,14 +120,14 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
{
|
||||
if ( simulate )
|
||||
{
|
||||
int requiredEU = ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( is ) - getAECurrentPower( is ) );
|
||||
int requiredEU = ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) );
|
||||
if ( amount < requiredEU )
|
||||
return 0;
|
||||
return amount - requiredEU;
|
||||
}
|
||||
else
|
||||
{
|
||||
double powerRemainder = injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
return PowerUnits.AE.convertTo( PowerUnits.EU, powerRemainder );
|
||||
}
|
||||
}
|
||||
@@ -135,21 +135,21 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
@Override
|
||||
public double injectAEPower( ItemStack is, double amt )
|
||||
{
|
||||
return getInternalBattery( is, batteryOperation.INJECT, amt );
|
||||
return this.getInternalBattery( is, batteryOperation.INJECT, amt );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower( ItemStack is, double amt )
|
||||
{
|
||||
return getInternalBattery( is, batteryOperation.EXTRACT, amt );
|
||||
return this.getInternalBattery( is, batteryOperation.EXTRACT, amt );
|
||||
}
|
||||
|
||||
private double getInternalBattery( ItemStack is, batteryOperation op, double adjustment )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
|
||||
double currentStorage = data.getDouble( EnergyVar );
|
||||
double maxStorage = getAEMaxPower( is );
|
||||
double currentStorage = data.getDouble( this.EnergyVar );
|
||||
double maxStorage = this.getAEMaxPower( is );
|
||||
|
||||
switch ( op )
|
||||
{
|
||||
@@ -158,19 +158,19 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
if ( currentStorage > maxStorage )
|
||||
{
|
||||
double diff = currentStorage - maxStorage;
|
||||
data.setDouble( EnergyVar, maxStorage );
|
||||
data.setDouble( this.EnergyVar, maxStorage );
|
||||
return diff;
|
||||
}
|
||||
data.setDouble( EnergyVar, currentStorage );
|
||||
data.setDouble( this.EnergyVar, currentStorage );
|
||||
return 0;
|
||||
case EXTRACT:
|
||||
if ( currentStorage > adjustment )
|
||||
{
|
||||
currentStorage -= adjustment;
|
||||
data.setDouble( EnergyVar, currentStorage );
|
||||
data.setDouble( this.EnergyVar, currentStorage );
|
||||
return adjustment;
|
||||
}
|
||||
data.setDouble( EnergyVar, 0 );
|
||||
data.setDouble( this.EnergyVar, 0 );
|
||||
return currentStorage;
|
||||
default:
|
||||
break;
|
||||
@@ -182,13 +182,13 @@ public class AERootPoweredItem extends AEBaseItem implements IAEItemPowerStorage
|
||||
@Override
|
||||
public double getAEMaxPower( ItemStack is )
|
||||
{
|
||||
return maxStoredPower;
|
||||
return this.maxStoredPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getAECurrentPower( ItemStack is )
|
||||
{
|
||||
return getInternalBattery( is, batteryOperation.STORAGE, 0 );
|
||||
return this.getInternalBattery( is, batteryOperation.STORAGE, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,12 +48,12 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe
|
||||
public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate )
|
||||
{
|
||||
double addedAmt = amount;
|
||||
double limit = getTransferLimit( is );
|
||||
double limit = this.getTransferLimit( is );
|
||||
|
||||
if ( !ignoreTransferLimit && amount > limit )
|
||||
addedAmt = limit;
|
||||
|
||||
return addedAmt - ( ( int ) injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) );
|
||||
return addedAmt - ( ( int ) this.injectExternalPower( PowerUnits.EU, is, addedAmt, simulate ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,22 +65,22 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe
|
||||
@Override
|
||||
public double getCharge( ItemStack is )
|
||||
{
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, getAECurrentPower( is ) );
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAECurrentPower( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse( ItemStack is, double amount )
|
||||
{
|
||||
return getCharge( is ) > amount;
|
||||
return this.getCharge( is ) > amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean use( ItemStack is, double amount, EntityLivingBase entity )
|
||||
{
|
||||
if ( canUse( is, amount ) )
|
||||
if ( this.canUse( is, amount ) )
|
||||
{
|
||||
// use the power..
|
||||
extractAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
this.extractAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -119,7 +119,7 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe
|
||||
@Override
|
||||
public double getMaxCharge( ItemStack itemStack )
|
||||
{
|
||||
return PowerUnits.AE.convertTo( PowerUnits.EU, getAEMaxPower( itemStack ) );
|
||||
return PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( itemStack ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +131,7 @@ public class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpe
|
||||
@Override
|
||||
public double getTransferLimit( ItemStack itemStack )
|
||||
{
|
||||
return Math.max( 32, getMaxCharge( itemStack ) / 200 );
|
||||
return Math.max( 32, this.getMaxCharge( itemStack ) / 200 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,7 +41,7 @@ public class RedstoneFlux extends IC2 implements IEnergyContainerItem
|
||||
@Override
|
||||
public int receiveEnergy( ItemStack is, int maxReceive, boolean simulate )
|
||||
{
|
||||
return maxReceive - ( int ) injectExternalPower( PowerUnits.RF, is, maxReceive, simulate );
|
||||
return maxReceive - ( int ) this.injectExternalPower( PowerUnits.RF, is, maxReceive, simulate );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,13 +53,13 @@ public class RedstoneFlux extends IC2 implements IEnergyContainerItem
|
||||
@Override
|
||||
public int getEnergyStored( ItemStack is )
|
||||
{
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, getAECurrentPower( is ) );
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored( ItemStack is )
|
||||
{
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, getAEMaxPower( is ) );
|
||||
return ( int ) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower( is ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature
|
||||
public ToolQuartzAxe( AEFeature Type )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
this.feature = new ItemFeatureHandler( EnumSet.of( type = Type, AEFeature.QuartzAxe ), this, this, Optional.of( Type.name() ) );
|
||||
this.feature = new ItemFeatureHandler( EnumSet.of( this.type = Type, AEFeature.QuartzAxe ), this, this, Optional.of( Type.name() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,6 +59,6 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( type, a, b );
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
{
|
||||
super( ToolQuartzCuttingKnife.class, Optional.of( Type.name() ) );
|
||||
|
||||
setFeature( EnumSet.of( type = Type, AEFeature.QuartzKnife ) );
|
||||
setMaxDamage( 50 );
|
||||
setMaxStackSize( 1 );
|
||||
this.setFeature( EnumSet.of( this.type = Type, AEFeature.QuartzKnife ) );
|
||||
this.setMaxDamage( 50 );
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,7 +77,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( type, a, b );
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature
|
||||
@Override
|
||||
public IFeatureHandler handler()
|
||||
{
|
||||
return handler;
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,6 +61,6 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( feature, a, b );
|
||||
return Platform.canRepair( this.feature, a, b );
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,6 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( type, a, b );
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
|
||||
this.handler = new ItemFeatureHandler( EnumSet.of( type = Type, AEFeature.QuartzSpade ), this, this, Optional.of( Type.name() ) );
|
||||
this.handler = new ItemFeatureHandler( EnumSet.of( this.type = Type, AEFeature.QuartzSpade ), this, this, Optional.of( Type.name() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFeatureHandler handler()
|
||||
{
|
||||
return handler;
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,6 +60,6 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( type, a, b );
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature
|
||||
public ToolQuartzSword( AEFeature Type )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
feature = new ItemFeatureHandler( EnumSet.of( type = Type, AEFeature.QuartzSword ), this, this, Optional.of( Type.name() ) );
|
||||
this.feature = new ItemFeatureHandler( EnumSet.of( this.type = Type, AEFeature.QuartzSword ), this, this, Optional.of( Type.name() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFeatureHandler handler()
|
||||
{
|
||||
return feature;
|
||||
return this.feature;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,6 +59,6 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( type, a, b );
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user