final variables and parameters
seeing some methods it does actually help to enforce the parameters
This commit is contained in:
@@ -48,7 +48,7 @@ public abstract class AEBaseItem extends Item implements IAEFeature
|
||||
this.setNoRepair();
|
||||
}
|
||||
|
||||
public AEBaseItem( Optional<String> subName )
|
||||
public AEBaseItem( final Optional<String> subName )
|
||||
{
|
||||
this.subName = subName;
|
||||
this.fullName = new FeatureNameExtractor( this.getClass(), subName ).get();
|
||||
@@ -72,37 +72,37 @@ public abstract class AEBaseItem extends Item implements IAEFeature
|
||||
// override!
|
||||
}
|
||||
|
||||
public void setFeature( EnumSet<AEFeature> f )
|
||||
public void setFeature( final EnumSet<AEFeature> f )
|
||||
{
|
||||
this.feature = new ItemFeatureHandler( f, this, this, this.subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void addInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayMoreInfo )
|
||||
public final void addInformation( final ItemStack stack, final EntityPlayer player, final List lines, final boolean displayMoreInfo )
|
||||
{
|
||||
this.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void getSubItems( Item sameItem, CreativeTabs creativeTab, List itemStacks )
|
||||
public final void getSubItems( final Item sameItem, final CreativeTabs creativeTab, final List itemStacks )
|
||||
{
|
||||
this.getCheckedSubItems( sameItem, creativeTab, itemStacks );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 )
|
||||
public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
protected void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
super.addInformation( stack, player, lines, displayMoreInfo );
|
||||
}
|
||||
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
super.getSubItems( sameItem, creativeTab, itemStacks );
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CellConfig extends AppEngInternalInventory
|
||||
|
||||
final ItemStack is;
|
||||
|
||||
public CellConfig( ItemStack is )
|
||||
public CellConfig( final ItemStack is )
|
||||
{
|
||||
super( null, 63 );
|
||||
this.is = is;
|
||||
|
||||
@@ -29,7 +29,7 @@ public final class CellUpgrades extends StackUpgradeInventory
|
||||
{
|
||||
final ItemStack is;
|
||||
|
||||
public CellUpgrades( ItemStack is, int upgrades )
|
||||
public CellUpgrades( final ItemStack is, final int upgrades )
|
||||
{
|
||||
super( is, null, upgrades );
|
||||
this.is = is;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class NetworkToolViewer implements INetworkTool
|
||||
final ItemStack is;
|
||||
final IGridHost gh;
|
||||
|
||||
public NetworkToolViewer( ItemStack is, IGridHost gHost )
|
||||
public NetworkToolViewer( final ItemStack is, final IGridHost gHost )
|
||||
{
|
||||
this.is = is;
|
||||
this.gh = gHost;
|
||||
@@ -54,25 +54,25 @@ public class NetworkToolViewer implements INetworkTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot( int i )
|
||||
public ItemStack getStackInSlot( final int i )
|
||||
{
|
||||
return this.inv.getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
public ItemStack decrStackSize( final int i, final int j )
|
||||
{
|
||||
return this.inv.decrStackSize( i, j );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
public ItemStack getStackInSlotOnClosing( final int i )
|
||||
{
|
||||
return this.inv.getStackInSlotOnClosing( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
public void setInventorySlotContents( final int i, final ItemStack itemstack )
|
||||
{
|
||||
this.inv.setInventorySlotContents( i, itemstack );
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class NetworkToolViewer implements INetworkTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
|
||||
{
|
||||
return this.inv.isUseableByPlayer( entityplayer );
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class NetworkToolViewer implements INetworkTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
public boolean isItemValidForSlot( final int i, final ItemStack itemstack )
|
||||
{
|
||||
return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ( (IUpgradeModule) itemstack.getItem() ).getType( itemstack ) != null;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
private final IAEItemPowerStorage ips;
|
||||
private final int inventorySlot;
|
||||
|
||||
public PortableCellViewer( ItemStack is, int slot )
|
||||
public PortableCellViewer( final ItemStack is, final int slot )
|
||||
{
|
||||
super( CellInventory.getCell( is, null ) );
|
||||
this.ips = (IAEItemPowerStorage) is.getItem();
|
||||
@@ -70,7 +70,7 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier )
|
||||
public double extractAEPower( double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier )
|
||||
{
|
||||
amt = usePowerMultiplier.multiply( amt );
|
||||
|
||||
@@ -101,9 +101,9 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
{
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target );
|
||||
final NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target );
|
||||
manager.writeToNBT( data );
|
||||
}
|
||||
} );
|
||||
|
||||
@@ -29,7 +29,7 @@ public class QuartzKnifeObj implements IGuiItemObject
|
||||
|
||||
final ItemStack is;
|
||||
|
||||
public QuartzKnifeObj( ItemStack o )
|
||||
public QuartzKnifeObj( final ItemStack o )
|
||||
{
|
||||
this.is = o;
|
||||
}
|
||||
|
||||
@@ -86,11 +86,11 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
|
||||
MaterialType mt = this.getTypeByStack( stack );
|
||||
final MaterialType mt = this.getTypeByStack( stack );
|
||||
if( mt == null )
|
||||
{
|
||||
return;
|
||||
@@ -98,24 +98,24 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
|
||||
if( mt == MaterialType.NamePress )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( stack );
|
||||
final NBTTagCompound c = Platform.openNbtData( stack );
|
||||
lines.add( c.getString( "InscribeName" ) );
|
||||
}
|
||||
|
||||
Upgrades u = this.getType( stack );
|
||||
final Upgrades u = this.getType( stack );
|
||||
if( u != null )
|
||||
{
|
||||
List<String> textList = new LinkedList<String>();
|
||||
for( Entry<ItemStack, Integer> j : u.getSupported().entrySet() )
|
||||
final List<String> textList = new LinkedList<String>();
|
||||
for( final Entry<ItemStack, Integer> j : u.getSupported().entrySet() )
|
||||
{
|
||||
String name = null;
|
||||
|
||||
int limit = j.getValue();
|
||||
final int limit = j.getValue();
|
||||
|
||||
if( j.getKey().getItem() instanceof IItemGroup )
|
||||
{
|
||||
IItemGroup ig = (IItemGroup) j.getKey().getItem();
|
||||
String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() );
|
||||
final IItemGroup ig = (IItemGroup) j.getKey().getItem();
|
||||
final String str = ig.getUnlocalizedGroupName( u.getSupported().keySet(), j.getKey() );
|
||||
if( str != null )
|
||||
{
|
||||
name = Platform.gui_localize( str ) + ( limit > 1 ? " (" + limit + ')' : "" );
|
||||
@@ -133,14 +133,14 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
}
|
||||
|
||||
Pattern p = Pattern.compile( "(\\d+)[^\\d]" );
|
||||
SlightlyBetterSort s = new SlightlyBetterSort( p );
|
||||
final Pattern p = Pattern.compile( "(\\d+)[^\\d]" );
|
||||
final SlightlyBetterSort s = new SlightlyBetterSort( p );
|
||||
Collections.sort( textList, s );
|
||||
lines.addAll( textList );
|
||||
}
|
||||
}
|
||||
|
||||
public MaterialType getTypeByStack( ItemStack is )
|
||||
public MaterialType getTypeByStack( final ItemStack is )
|
||||
{
|
||||
if( this.dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
{
|
||||
@@ -150,7 +150,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public Upgrades getType( ItemStack itemstack )
|
||||
public Upgrades getType( final ItemStack itemstack )
|
||||
{
|
||||
switch( this.getTypeByStack( itemstack ) )
|
||||
{
|
||||
@@ -171,13 +171,13 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
}
|
||||
|
||||
public IStackSrc createMaterial( MaterialType mat )
|
||||
public IStackSrc createMaterial( final MaterialType mat )
|
||||
{
|
||||
Preconditions.checkState( !mat.isRegistered(), "Cannot create the same material twice." );
|
||||
|
||||
boolean enabled = true;
|
||||
|
||||
for( AEFeature f : mat.getFeature() )
|
||||
for( final AEFeature f : mat.getFeature() )
|
||||
{
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
{
|
||||
mat.itemInstance = this;
|
||||
mat.markReady();
|
||||
int newMaterialNum = mat.damageValue;
|
||||
final int newMaterialNum = mat.damageValue;
|
||||
|
||||
if( this.dmgToMaterial.get( newMaterialNum ) == null )
|
||||
{
|
||||
@@ -206,25 +206,25 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
|
||||
public void makeUnique()
|
||||
{
|
||||
for( MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ) )
|
||||
for( final MaterialType mt : ImmutableSet.copyOf( this.dmgToMaterial.values() ) )
|
||||
{
|
||||
if( mt.getOreName() != null )
|
||||
{
|
||||
ItemStack replacement = null;
|
||||
|
||||
String[] names = mt.getOreName().split( "," );
|
||||
final String[] names = mt.getOreName().split( "," );
|
||||
|
||||
for( String name : names )
|
||||
for( final String name : names )
|
||||
{
|
||||
if( replacement != null )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
List<ItemStack> options = OreDictionary.getOres( name );
|
||||
final List<ItemStack> options = OreDictionary.getOres( name );
|
||||
if( options != null && options.size() > 0 )
|
||||
{
|
||||
for( ItemStack is : options )
|
||||
for( final ItemStack is : options )
|
||||
{
|
||||
if( is != null && is.getItem() != null )
|
||||
{
|
||||
@@ -238,7 +238,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
if( replacement == null || AEConfig.instance.useAEVersion( mt ) )
|
||||
{
|
||||
// continue using the AE2 item.
|
||||
for( String name : names )
|
||||
for( final String name : names )
|
||||
{
|
||||
OreDictionary.registerOre( name, mt.stack( 1 ) );
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage( int dmg )
|
||||
public IIcon getIconFromDamage( final int dmg )
|
||||
{
|
||||
if( this.dmgToMaterial.containsKey( dmg ) )
|
||||
{
|
||||
@@ -268,19 +268,19 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
public String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
return "item.appliedenergistics2." + this.nameOf( is );
|
||||
}
|
||||
|
||||
private String nameOf( ItemStack is )
|
||||
private String nameOf( final ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
MaterialType mt = this.getTypeByStack( is );
|
||||
final MaterialType mt = this.getTypeByStack( is );
|
||||
if( mt == null )
|
||||
{
|
||||
return "null";
|
||||
@@ -290,20 +290,20 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
List<MaterialType> types = Arrays.asList( MaterialType.values() );
|
||||
final List<MaterialType> types = Arrays.asList( MaterialType.values() );
|
||||
Collections.sort( types, new Comparator<MaterialType>()
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( MaterialType o1, MaterialType o2 )
|
||||
public int compare( final MaterialType o1, final MaterialType o2 )
|
||||
{
|
||||
return o1.name().compareTo( o2.name() );
|
||||
}
|
||||
} );
|
||||
|
||||
for( MaterialType mat : types )
|
||||
for( final MaterialType mat : types )
|
||||
{
|
||||
if( mat.damageValue >= 0 && mat.isRegistered() && mat.itemInstance == this )
|
||||
{
|
||||
@@ -313,16 +313,16 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons( IIconRegister icoRegister )
|
||||
public void registerIcons( final IIconRegister icoRegister )
|
||||
{
|
||||
for( MaterialType mat : MaterialType.values() )
|
||||
for( final MaterialType mat : MaterialType.values() )
|
||||
{
|
||||
if( mat.damageValue != -1 )
|
||||
{
|
||||
ItemStack what = new ItemStack( this, 1, mat.damageValue );
|
||||
final ItemStack what = new ItemStack( this, 1, mat.damageValue );
|
||||
if( this.getTypeByStack( what ) != MaterialType.InvalidType )
|
||||
{
|
||||
String tex = "appliedenergistics2:" + this.nameOf( what );
|
||||
final String tex = "appliedenergistics2:" + this.nameOf( what );
|
||||
mat.IIcon = icoRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
@@ -330,16 +330,16 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
final TileEntity te = world.getTileEntity( x, y, z );
|
||||
IInventory upgrades = null;
|
||||
|
||||
if( te instanceof IPartHost )
|
||||
{
|
||||
SelectedPart sp = ( (IPartHost) te ).selectPart( Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
||||
final SelectedPart sp = ( (IPartHost) te ).selectPart( Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
||||
if( sp.part instanceof IUpgradeableHost )
|
||||
{
|
||||
upgrades = ( (ISegmentedInventory) sp.part ).getInventoryByName( "upgrades" );
|
||||
@@ -352,12 +352,12 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
|
||||
if( upgrades != null && is != null && is.getItem() instanceof IUpgradeModule )
|
||||
{
|
||||
IUpgradeModule um = (IUpgradeModule) is.getItem();
|
||||
Upgrades u = um.getType( is );
|
||||
final IUpgradeModule um = (IUpgradeModule) is.getItem();
|
||||
final Upgrades u = um.getType( is );
|
||||
|
||||
if( u != null )
|
||||
{
|
||||
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( upgrades, ForgeDirection.UNKNOWN );
|
||||
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor( upgrades, ForgeDirection.UNKNOWN );
|
||||
if( ad != null )
|
||||
{
|
||||
if( player.worldObj.isRemote )
|
||||
@@ -376,22 +376,22 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity( ItemStack is )
|
||||
public boolean hasCustomEntity( final ItemStack is )
|
||||
{
|
||||
return this.getTypeByStack( is ).hasCustomEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity( World w, Entity location, ItemStack itemstack )
|
||||
public Entity createEntity( final World w, final Entity location, final ItemStack itemstack )
|
||||
{
|
||||
Class<? extends Entity> droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass();
|
||||
Entity eqi;
|
||||
final Class<? extends Entity> droppedEntity = this.getTypeByStack( itemstack ).getCustomEntityClass();
|
||||
final Entity eqi;
|
||||
|
||||
try
|
||||
{
|
||||
eqi = droppedEntity.getConstructor( World.class, double.class, double.class, double.class, ItemStack.class ).newInstance( w, location.posX, location.posY, location.posZ, itemstack );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
throw new IllegalStateException( t );
|
||||
}
|
||||
@@ -409,7 +409,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes( ItemStack is )
|
||||
public int getBytes( final ItemStack is )
|
||||
{
|
||||
switch( this.getTypeByStack( is ) )
|
||||
{
|
||||
@@ -427,7 +427,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageComponent( ItemStack is )
|
||||
public boolean isStorageComponent( final ItemStack is )
|
||||
{
|
||||
switch( this.getTypeByStack( is ) )
|
||||
{
|
||||
@@ -445,26 +445,26 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
||||
{
|
||||
private final Pattern pattern;
|
||||
|
||||
public SlightlyBetterSort( Pattern pattern )
|
||||
public SlightlyBetterSort( final Pattern pattern )
|
||||
{
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare( String o1, String o2 )
|
||||
public int compare( final String o1, final String o2 )
|
||||
{
|
||||
try
|
||||
{
|
||||
Matcher a = this.pattern.matcher( o1 );
|
||||
Matcher b = this.pattern.matcher( o2 );
|
||||
final Matcher a = this.pattern.matcher( o1 );
|
||||
final Matcher b = this.pattern.matcher( o2 );
|
||||
if( a.find() && b.find() )
|
||||
{
|
||||
int ia = Integer.parseInt( a.group( 1 ) );
|
||||
int ib = Integer.parseInt( b.group( 1 ) );
|
||||
final int ia = Integer.parseInt( a.group( 1 ) );
|
||||
final int ib = Integer.parseInt( b.group( 1 ) );
|
||||
return Integer.compare( ia, ib );
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
// ek!
|
||||
}
|
||||
|
||||
@@ -96,19 +96,19 @@ public enum MaterialType
|
||||
private Class<? extends Entity> droppedEntity;
|
||||
private boolean isRegistered = false;
|
||||
|
||||
MaterialType( int metaValue )
|
||||
MaterialType( final int metaValue )
|
||||
{
|
||||
this.damageValue = metaValue;
|
||||
this.features = EnumSet.of( AEFeature.Core );
|
||||
}
|
||||
|
||||
MaterialType( int metaValue, AEFeature part )
|
||||
MaterialType( final int metaValue, final AEFeature part )
|
||||
{
|
||||
this.damageValue = metaValue;
|
||||
this.features = EnumSet.of( part );
|
||||
}
|
||||
|
||||
MaterialType( int metaValue, AEFeature part, Class<? extends Entity> c )
|
||||
MaterialType( final int metaValue, final AEFeature part, final Class<? extends Entity> c )
|
||||
{
|
||||
this.features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
@@ -117,7 +117,7 @@ public enum MaterialType
|
||||
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 )
|
||||
MaterialType( final int metaValue, final AEFeature part, final String oreDictionary, final Class<? extends Entity> c )
|
||||
{
|
||||
this.features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
@@ -126,14 +126,14 @@ public enum MaterialType
|
||||
EntityRegistry.registerModEntity( this.droppedEntity, this.droppedEntity.getSimpleName(), EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4, true );
|
||||
}
|
||||
|
||||
MaterialType( int metaValue, AEFeature part, String oreDictionary )
|
||||
MaterialType( final int metaValue, final AEFeature part, final String oreDictionary )
|
||||
{
|
||||
this.features = EnumSet.of( part );
|
||||
this.damageValue = metaValue;
|
||||
this.oreName = oreDictionary;
|
||||
}
|
||||
|
||||
public ItemStack stack( int size )
|
||||
public ItemStack stack( final int size )
|
||||
{
|
||||
return new ItemStack( this.itemInstance, size, this.damageValue );
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ResolverResult getResolver( int certus2 )
|
||||
public static ResolverResult getResolver( final int certus2 )
|
||||
{
|
||||
ResolverResult resolver = null;
|
||||
|
||||
@@ -91,13 +91,13 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
return resolver;
|
||||
}
|
||||
|
||||
private static ItemStack newStyle( ItemStack itemStack )
|
||||
private static ItemStack newStyle( final ItemStack itemStack )
|
||||
{
|
||||
( (ItemCrystalSeed) itemStack.getItem() ).getProgress( itemStack );
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
private int getProgress( ItemStack is )
|
||||
private int getProgress( final ItemStack is )
|
||||
{
|
||||
if( is.hasTagCompound() )
|
||||
{
|
||||
@@ -105,8 +105,8 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
else
|
||||
{
|
||||
int progress;
|
||||
NBTTagCompound comp = Platform.openNbtData( is );
|
||||
final int progress;
|
||||
final NBTTagCompound comp = Platform.openNbtData( is );
|
||||
comp.setInteger( "progress", progress = is.getItemDamage() );
|
||||
is.setItemDamage( ( is.getItemDamage() / SINGLE_OFFSET ) * SINGLE_OFFSET );
|
||||
return progress;
|
||||
@@ -115,29 +115,29 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ItemStack triggerGrowth( ItemStack is )
|
||||
public ItemStack triggerGrowth( final ItemStack is )
|
||||
{
|
||||
int newDamage = this.getProgress( is ) + 1;
|
||||
final int newDamage = this.getProgress( is ) + 1;
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
final int size = is.stackSize;
|
||||
|
||||
if( newDamage == CERTUS + SINGLE_OFFSET )
|
||||
{
|
||||
for( ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack( size ).asSet() )
|
||||
for( final ItemStack quartzStack : materials.purifiedCertusQuartzCrystal().maybeStack( size ).asSet() )
|
||||
{
|
||||
return quartzStack;
|
||||
}
|
||||
}
|
||||
if( newDamage == NETHER + SINGLE_OFFSET )
|
||||
{
|
||||
for( ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack( size ).asSet() )
|
||||
for( final ItemStack quartzStack : materials.purifiedNetherQuartzCrystal().maybeStack( size ).asSet() )
|
||||
{
|
||||
return quartzStack;
|
||||
}
|
||||
}
|
||||
if( newDamage == FLUIX + SINGLE_OFFSET )
|
||||
{
|
||||
for( ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack( size ).asSet() )
|
||||
for( final ItemStack quartzStack : materials.purifiedFluixCrystal().maybeStack( size ).asSet() )
|
||||
{
|
||||
return quartzStack;
|
||||
}
|
||||
@@ -151,39 +151,39 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
return is;
|
||||
}
|
||||
|
||||
private void setProgress( ItemStack is, int newDamage )
|
||||
private void setProgress( final ItemStack is, final int newDamage )
|
||||
{
|
||||
NBTTagCompound comp = Platform.openNbtData( is );
|
||||
final NBTTagCompound comp = Platform.openNbtData( is );
|
||||
comp.setInteger( "progress", newDamage );
|
||||
is.setItemDamage( is.getItemDamage() / LEVEL_OFFSET * LEVEL_OFFSET );
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMultiplier( Block blk, Material mat )
|
||||
public float getMultiplier( final Block blk, final Material mat )
|
||||
{
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
lines.add( ButtonToolTips.DoesntDespawn.getLocal() );
|
||||
int progress = this.getProgress( stack ) % SINGLE_OFFSET;
|
||||
final int progress = this.getProgress( stack ) % SINGLE_OFFSET;
|
||||
lines.add( Math.floor( (float) progress / (float) ( SINGLE_OFFSET / 100 ) ) + "%" );
|
||||
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEntityLifespan( ItemStack itemStack, World world )
|
||||
public int getEntityLifespan( final ItemStack itemStack, final World world )
|
||||
{
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
public String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
int damage = this.getProgress( is );
|
||||
final int damage = this.getProgress( is );
|
||||
|
||||
if( damage < CERTUS + SINGLE_OFFSET )
|
||||
{
|
||||
@@ -210,25 +210,25 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDamaged( ItemStack stack )
|
||||
public boolean isDamaged( final ItemStack stack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxDamage( ItemStack stack )
|
||||
public int getMaxDamage( final ItemStack stack )
|
||||
{
|
||||
return FINAL_STAGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon( ItemStack stack, int pass )
|
||||
public IIcon getIcon( final ItemStack stack, final int pass )
|
||||
{
|
||||
return this.getIconIndex( stack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconIndex( ItemStack stack )
|
||||
public IIcon getIconIndex( final ItemStack stack )
|
||||
{
|
||||
IIcon[] list = null;
|
||||
|
||||
@@ -270,9 +270,9 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons( IIconRegister ir )
|
||||
public void registerIcons( final IIconRegister ir )
|
||||
{
|
||||
String preFix = "appliedenergistics2:ItemCrystalSeed.";
|
||||
final String preFix = "appliedenergistics2:ItemCrystalSeed.";
|
||||
|
||||
this.certus[0] = ir.registerIcon( preFix + "Certus" );
|
||||
this.certus[1] = ir.registerIcon( preFix + "Certus2" );
|
||||
@@ -288,15 +288,15 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity( ItemStack stack )
|
||||
public boolean hasCustomEntity( final ItemStack stack )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity( World world, Entity location, ItemStack itemstack )
|
||||
public Entity createEntity( final World world, final Entity location, final ItemStack itemstack )
|
||||
{
|
||||
EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack );
|
||||
final EntityGrowingCrystal egc = new EntityGrowingCrystal( world, location.posX, location.posY, location.posZ, itemstack );
|
||||
|
||||
egc.motionX = location.motionX;
|
||||
egc.motionY = location.motionY;
|
||||
@@ -311,7 +311,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
// lvl 0
|
||||
itemStacks.add( newStyle( new ItemStack( this, 1, CERTUS ) ) );
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack stack, World w, EntityPlayer player )
|
||||
public ItemStack onItemRightClick( final ItemStack stack, final World w, final EntityPlayer player )
|
||||
{
|
||||
this.clearPattern( stack, player );
|
||||
|
||||
@@ -68,12 +68,12 @@ 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 )
|
||||
public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return this.clearPattern( stack, player );
|
||||
}
|
||||
|
||||
private boolean clearPattern( ItemStack stack, EntityPlayer player )
|
||||
private boolean clearPattern( final ItemStack stack, final EntityPlayer player )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
@@ -82,13 +82,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
return false;
|
||||
}
|
||||
|
||||
InventoryPlayer inv = player.inventory;
|
||||
final InventoryPlayer inv = player.inventory;
|
||||
|
||||
for( int s = 0; s < player.inventory.getSizeInventory(); s++ )
|
||||
{
|
||||
if( inv.getStackInSlot( s ) == stack )
|
||||
{
|
||||
for( ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).asSet() )
|
||||
for( final ItemStack blankPattern : AEApi.instance().definitions().materials().blankPattern().maybeStack( stack.stackSize ).asSet() )
|
||||
{
|
||||
inv.setInventorySlotContents( s, blankPattern );
|
||||
}
|
||||
@@ -102,9 +102,9 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj );
|
||||
final ICraftingPatternDetails details = this.getPatternForItem( stack, player.worldObj );
|
||||
|
||||
if( details == null )
|
||||
{
|
||||
@@ -112,17 +112,17 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isCrafting = details.isCraftable();
|
||||
final boolean isCrafting = details.isCraftable();
|
||||
|
||||
IAEItemStack[] in = details.getCondensedInputs();
|
||||
IAEItemStack[] out = details.getCondensedOutputs();
|
||||
final IAEItemStack[] in = details.getCondensedInputs();
|
||||
final IAEItemStack[] out = details.getCondensedOutputs();
|
||||
|
||||
String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": ";
|
||||
String and = ' ' + GuiText.And.getLocal() + ' ';
|
||||
String with = GuiText.With.getLocal() + ": ";
|
||||
final String label = ( isCrafting ? GuiText.Crafts.getLocal() : GuiText.Creates.getLocal() ) + ": ";
|
||||
final String and = ' ' + GuiText.And.getLocal() + ' ';
|
||||
final String with = GuiText.With.getLocal() + ": ";
|
||||
|
||||
boolean first = true;
|
||||
for( IAEItemStack anOut : out )
|
||||
for( final IAEItemStack anOut : out )
|
||||
{
|
||||
if( anOut == null )
|
||||
{
|
||||
@@ -134,7 +134,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
}
|
||||
|
||||
first = true;
|
||||
for( IAEItemStack anIn : in )
|
||||
for( final IAEItemStack anIn : in )
|
||||
{
|
||||
if( anIn == null )
|
||||
{
|
||||
@@ -147,19 +147,19 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICraftingPatternDetails getPatternForItem( ItemStack is, World w )
|
||||
public ICraftingPatternDetails getPatternForItem( final ItemStack is, final World w )
|
||||
{
|
||||
try
|
||||
{
|
||||
return new PatternHelper( is, w );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getOutput( ItemStack item )
|
||||
public ItemStack getOutput( final ItemStack item )
|
||||
{
|
||||
ItemStack out = SIMPLE_CACHE.get( item );
|
||||
if( out != null )
|
||||
@@ -167,13 +167,13 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
return out;
|
||||
}
|
||||
|
||||
World w = CommonHelper.proxy.getWorld();
|
||||
final World w = CommonHelper.proxy.getWorld();
|
||||
if( w == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ICraftingPatternDetails details = this.getPatternForItem( item, w );
|
||||
final ICraftingPatternDetails details = this.getPatternForItem( item, w );
|
||||
|
||||
if( details == null )
|
||||
{
|
||||
|
||||
@@ -52,17 +52,17 @@ public class ItemPaintBall extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack is )
|
||||
public String getItemStackDisplayName( final ItemStack is )
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + this.getExtraName( is );
|
||||
}
|
||||
|
||||
public String getExtraName( ItemStack is )
|
||||
public String getExtraName( final ItemStack is )
|
||||
{
|
||||
return ( is.getItemDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is );
|
||||
}
|
||||
|
||||
public AEColor getColor( ItemStack is )
|
||||
public AEColor getColor( final ItemStack is )
|
||||
{
|
||||
int dmg = is.getItemDamage();
|
||||
if( dmg >= DAMAGE_THRESHOLD )
|
||||
@@ -79,9 +79,9 @@ public class ItemPaintBall extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
for( AEColor c : AEColor.values() )
|
||||
for( final AEColor c : AEColor.values() )
|
||||
{
|
||||
if( c != AEColor.Transparent )
|
||||
{
|
||||
@@ -89,7 +89,7 @@ public class ItemPaintBall extends AEBaseItem
|
||||
}
|
||||
}
|
||||
|
||||
for( AEColor c : AEColor.values() )
|
||||
for( final AEColor c : AEColor.values() )
|
||||
{
|
||||
if( c != AEColor.Transparent )
|
||||
{
|
||||
@@ -98,9 +98,9 @@ public class ItemPaintBall extends AEBaseItem
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isLumen( ItemStack is )
|
||||
public boolean isLumen( final ItemStack is )
|
||||
{
|
||||
int dmg = is.getItemDamage();
|
||||
final int dmg = is.getItemDamage();
|
||||
return dmg >= DAMAGE_THRESHOLD;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,23 +78,23 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return AEApi.instance().partHelper().placeBus( is, x, y, z, side, player, w );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack is )
|
||||
public String getItemStackDisplayName( final ItemStack is )
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
final ItemStack in = this.getTextureItem( is );
|
||||
if( in != null )
|
||||
{
|
||||
return super.getItemStackDisplayName( is ) + " - " + in.getDisplayName();
|
||||
}
|
||||
}
|
||||
catch( Throwable ignored )
|
||||
catch( final Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
this.calculateSubTypes();
|
||||
itemStacks.addAll( this.subTypes );
|
||||
@@ -114,25 +114,25 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
if( this.subTypes == null )
|
||||
{
|
||||
this.subTypes = new ArrayList<ItemStack>( 1000 );
|
||||
for( Object blk : Block.blockRegistry )
|
||||
for( final Object blk : Block.blockRegistry )
|
||||
{
|
||||
Block b = (Block) blk;
|
||||
final Block b = (Block) blk;
|
||||
try
|
||||
{
|
||||
Item item = Item.getItemFromBlock( b );
|
||||
final Item item = Item.getItemFromBlock( b );
|
||||
|
||||
List<ItemStack> tmpList = new ArrayList<ItemStack>( 100 );
|
||||
final List<ItemStack> tmpList = new ArrayList<ItemStack>( 100 );
|
||||
b.getSubBlocks( item, b.getCreativeTabToDisplayOn(), tmpList );
|
||||
for( ItemStack l : tmpList )
|
||||
for( final ItemStack l : tmpList )
|
||||
{
|
||||
ItemStack facade = this.createFacadeForItem( l, false );
|
||||
final ItemStack facade = this.createFacadeForItem( l, false );
|
||||
if( facade != null )
|
||||
{
|
||||
this.subTypes.add( facade );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
// just absorb..
|
||||
}
|
||||
@@ -145,26 +145,26 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack createFacadeForItem( ItemStack l, boolean returnItem )
|
||||
public ItemStack createFacadeForItem( final ItemStack l, final boolean returnItem )
|
||||
{
|
||||
if( l == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Block b = Block.getBlockFromItem( l.getItem() );
|
||||
final Block b = Block.getBlockFromItem( l.getItem() );
|
||||
if( b == null || l.hasTagCompound() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int metadata = l.getItem().getMetadata( l.getItemDamage() );
|
||||
final int metadata = l.getItem().getMetadata( l.getItemDamage() );
|
||||
|
||||
boolean hasTile = b.hasTileEntity( metadata );
|
||||
boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass;
|
||||
boolean disableOre = b instanceof OreQuartz;
|
||||
final boolean hasTile = b.hasTileEntity( metadata );
|
||||
final boolean enableGlass = b instanceof BlockGlass || b instanceof BlockStainedGlass;
|
||||
final boolean disableOre = b instanceof OreQuartz;
|
||||
|
||||
boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
|
||||
final boolean defaultValue = ( b.isOpaqueCube() && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
|
||||
if( FacadeConfig.instance.checkEnabled( b, metadata, defaultValue ) )
|
||||
{
|
||||
if( returnItem )
|
||||
@@ -172,13 +172,13 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
return l;
|
||||
}
|
||||
|
||||
ItemStack is = new ItemStack( this );
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
int[] ds = new int[2];
|
||||
final ItemStack is = new ItemStack( this );
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
final int[] ds = new int[2];
|
||||
ds[0] = Item.getIdFromItem( l.getItem() );
|
||||
ds[1] = metadata;
|
||||
data.setIntArray( "x", ds );
|
||||
UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() );
|
||||
final UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor( l.getItem() );
|
||||
data.setString( "modid", ui.modId );
|
||||
data.setString( "itemname", ui.name );
|
||||
is.setTagCompound( data );
|
||||
@@ -188,9 +188,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public FacadePart createPartFromItemStack( ItemStack is, ForgeDirection side )
|
||||
public FacadePart createPartFromItemStack( final ItemStack is, final ForgeDirection side )
|
||||
{
|
||||
ItemStack in = this.getTextureItem( is );
|
||||
final ItemStack in = this.getTextureItem( is );
|
||||
if( in != null )
|
||||
{
|
||||
return new FacadePart( is, side );
|
||||
@@ -199,9 +199,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getTextureItem( ItemStack is )
|
||||
public ItemStack getTextureItem( final ItemStack is )
|
||||
{
|
||||
Block blk = this.getBlock( is );
|
||||
final Block blk = this.getBlock( is );
|
||||
if( blk != null )
|
||||
{
|
||||
return new ItemStack( blk, 1, this.getMeta( is ) );
|
||||
@@ -210,12 +210,12 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMeta( ItemStack is )
|
||||
public int getMeta( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
final NBTTagCompound data = is.getTagCompound();
|
||||
if( data != null )
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
final int[] blk = data.getIntArray( "x" );
|
||||
if( blk != null && blk.length == 2 )
|
||||
{
|
||||
return blk[1];
|
||||
@@ -225,9 +225,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock( ItemStack is )
|
||||
public Block getBlock( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound data = is.getTagCompound();
|
||||
final NBTTagCompound data = is.getTagCompound();
|
||||
if( data != null )
|
||||
{
|
||||
if( data.hasKey( "modid" ) && data.hasKey( "itemname" ) )
|
||||
@@ -236,7 +236,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] blk = data.getIntArray( "x" );
|
||||
final int[] blk = data.getIntArray( "x" );
|
||||
if( blk != null && blk.length == 2 )
|
||||
{
|
||||
return Block.getBlockById( blk[0] );
|
||||
@@ -262,11 +262,11 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
return this.subTypes.get( 0 );
|
||||
}
|
||||
|
||||
public ItemStack createFromIDs( int[] ids )
|
||||
public ItemStack createFromIDs( final int[] ids )
|
||||
{
|
||||
for( ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack facadeStack : AEApi.instance().definitions().items().facade().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
NBTTagCompound facadeTag = new NBTTagCompound();
|
||||
final NBTTagCompound facadeTag = new NBTTagCompound();
|
||||
facadeTag.setIntArray( "x", ids.clone() );
|
||||
facadeStack.setTagCompound( facadeTag );
|
||||
|
||||
@@ -277,16 +277,16 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useAlphaPass( ItemStack is )
|
||||
public boolean useAlphaPass( final ItemStack is )
|
||||
{
|
||||
ItemStack out = this.getTextureItem( is );
|
||||
final ItemStack out = this.getTextureItem( is );
|
||||
|
||||
if( out == null || out.getItem() == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Block blk = Block.getBlockFromItem( out.getItem() );
|
||||
final Block blk = Block.getBlockFromItem( out.getItem() );
|
||||
if( blk != null && blk.canRenderInPass( 1 ) )
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -73,7 +73,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
private final NameResolver nameResolver;
|
||||
private final Map<Integer, PartTypeWithVariant> registered;
|
||||
|
||||
public ItemMultiPart( IPartHelper partHelper )
|
||||
public ItemMultiPart( final IPartHelper partHelper )
|
||||
{
|
||||
Preconditions.checkNotNull( partHelper );
|
||||
|
||||
@@ -88,7 +88,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final ItemStackSrc createPart( PartType mat )
|
||||
public final ItemStackSrc createPart( final PartType mat )
|
||||
{
|
||||
Preconditions.checkNotNull( mat );
|
||||
|
||||
@@ -96,7 +96,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public ItemStackSrc createPart( PartType mat, AEColor color )
|
||||
public ItemStackSrc createPart( final PartType mat, final AEColor color )
|
||||
{
|
||||
Preconditions.checkNotNull( mat );
|
||||
Preconditions.checkNotNull( color );
|
||||
@@ -107,13 +107,13 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
private ItemStackSrc createPart( PartType mat, int varID )
|
||||
private ItemStackSrc createPart( final PartType mat, final int varID )
|
||||
{
|
||||
assert mat != null;
|
||||
assert varID >= 0;
|
||||
|
||||
// verify
|
||||
for( PartTypeWithVariant p : this.registered.values() )
|
||||
for( final PartTypeWithVariant p : this.registered.values() )
|
||||
{
|
||||
if( p.part == mat && p.variant == varID )
|
||||
{
|
||||
@@ -122,12 +122,12 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
boolean enabled = true;
|
||||
for( AEFeature f : mat.getFeature() )
|
||||
for( final AEFeature f : mat.getFeature() )
|
||||
{
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
}
|
||||
|
||||
for( IntegrationType integrationType : mat.getIntegrations() )
|
||||
for( final IntegrationType integrationType : mat.getIntegrations() )
|
||||
{
|
||||
enabled &= IntegrationRegistry.INSTANCE.isEnabled( integrationType );
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
return output;
|
||||
}
|
||||
|
||||
private void processMetaOverlap( boolean enabled, int partDamage, PartType mat, PartTypeWithVariant pti )
|
||||
private void processMetaOverlap( final boolean enabled, final int partDamage, final PartType mat, final PartTypeWithVariant pti )
|
||||
{
|
||||
assert partDamage >= 0;
|
||||
assert mat != null;
|
||||
@@ -161,11 +161,11 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
}
|
||||
|
||||
public int getDamageByType( PartType t )
|
||||
public int getDamageByType( final PartType t )
|
||||
{
|
||||
Preconditions.checkNotNull( t );
|
||||
|
||||
for( Entry<Integer, PartTypeWithVariant> pt : this.registered.entrySet() )
|
||||
for( final Entry<Integer, PartTypeWithVariant> pt : this.registered.entrySet() )
|
||||
{
|
||||
if( pt.getValue().part == t )
|
||||
{
|
||||
@@ -183,7 +183,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage( int dmg )
|
||||
public IIcon getIconFromDamage( final int dmg )
|
||||
{
|
||||
final PartTypeWithVariant registeredType = this.registered.get( dmg );
|
||||
if( registeredType != null )
|
||||
@@ -196,7 +196,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( this.getTypeByStack( is ) == PartType.InvalidType )
|
||||
{
|
||||
@@ -207,13 +207,13 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
public String getUnlocalizedName( final ItemStack is )
|
||||
{
|
||||
return "item.appliedenergistics2." + this.getName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack is )
|
||||
public String getItemStackDisplayName( final ItemStack is )
|
||||
{
|
||||
final PartType pt = this.getTypeByStack( is );
|
||||
|
||||
@@ -238,28 +238,28 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons( IIconRegister iconRegister )
|
||||
public void registerIcons( final IIconRegister iconRegister )
|
||||
{
|
||||
for( Entry<Integer, PartTypeWithVariant> part : this.registered.entrySet() )
|
||||
for( final Entry<Integer, PartTypeWithVariant> part : this.registered.entrySet() )
|
||||
{
|
||||
String tex = "appliedenergistics2:" + this.getName( new ItemStack( this, 1, part.getKey() ) );
|
||||
final String tex = "appliedenergistics2:" + this.getName( new ItemStack( this, 1, part.getKey() ) );
|
||||
part.getValue().ico = iconRegister.registerIcon( tex );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
List<Entry<Integer, PartTypeWithVariant>> types = new ArrayList<Entry<Integer, PartTypeWithVariant>>( this.registered.entrySet() );
|
||||
final List<Entry<Integer, PartTypeWithVariant>> types = new ArrayList<Entry<Integer, PartTypeWithVariant>>( this.registered.entrySet() );
|
||||
Collections.sort( types, REGISTERED_COMPARATOR );
|
||||
|
||||
for( Entry<Integer, PartTypeWithVariant> part : types )
|
||||
for( final Entry<Integer, PartTypeWithVariant> part : types )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, part.getKey() ) );
|
||||
}
|
||||
}
|
||||
|
||||
public String getName( ItemStack is )
|
||||
public String getName( final ItemStack is )
|
||||
{
|
||||
Preconditions.checkNotNull( is );
|
||||
|
||||
@@ -270,7 +270,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public PartType getTypeByStack( ItemStack is )
|
||||
public PartType getTypeByStack( final ItemStack is )
|
||||
{
|
||||
Preconditions.checkNotNull( is );
|
||||
|
||||
@@ -285,7 +285,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IPart createPartFromItemStack( ItemStack is )
|
||||
public IPart createPartFromItemStack( final ItemStack is )
|
||||
{
|
||||
final PartType type = this.getTypeByStack( is );
|
||||
final Class<? extends IPart> part = type.getPart();
|
||||
@@ -303,25 +303,25 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
|
||||
return type.constructor.newInstance( is );
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
catch( final InstantiationException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
catch( IllegalAccessException e )
|
||||
catch( final IllegalAccessException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
catch( InvocationTargetException e )
|
||||
catch( final InvocationTargetException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
catch( NoSuchMethodException e )
|
||||
catch( final NoSuchMethodException e )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to construct IBusPart from IBusItem : " + part.getName() + " ; Possibly didn't have correct constructor( ItemStack )", e );
|
||||
}
|
||||
}
|
||||
|
||||
public int variantOf( int itemDamage )
|
||||
public int variantOf( final int itemDamage )
|
||||
{
|
||||
final PartTypeWithVariant registeredPartType = this.registered.get( itemDamage );
|
||||
if( registeredPartType != null )
|
||||
@@ -334,19 +334,19 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
public String getUnlocalizedGroupName( final Set<ItemStack> others, final ItemStack is )
|
||||
{
|
||||
boolean importBus = false;
|
||||
boolean exportBus = false;
|
||||
boolean group = false;
|
||||
|
||||
PartType u = this.getTypeByStack( is );
|
||||
final PartType u = this.getTypeByStack( is );
|
||||
|
||||
for( ItemStack stack : others )
|
||||
for( final ItemStack stack : others )
|
||||
{
|
||||
if( stack.getItem() == this )
|
||||
{
|
||||
PartType pt = this.getTypeByStack( stack );
|
||||
final PartType pt = this.getTypeByStack( stack );
|
||||
switch( pt )
|
||||
{
|
||||
case ImportBus:
|
||||
@@ -384,7 +384,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
@SideOnly( Side.CLIENT )
|
||||
private IIcon ico;
|
||||
|
||||
private PartTypeWithVariant( PartType part, int variant )
|
||||
private PartTypeWithVariant( final PartType part, final int variant )
|
||||
{
|
||||
assert part != null;
|
||||
assert variant >= 0;
|
||||
@@ -407,7 +407,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
private static final class RegisteredComparator implements Comparator<Entry<Integer, PartTypeWithVariant>>
|
||||
{
|
||||
@Override
|
||||
public int compare( Entry<Integer, PartTypeWithVariant> o1, Entry<Integer, PartTypeWithVariant> o2 )
|
||||
public int compare( final Entry<Integer, PartTypeWithVariant> o1, final Entry<Integer, PartTypeWithVariant> o2 )
|
||||
{
|
||||
return o1.getValue().part.name().compareTo( o2.getValue().part.name() );
|
||||
}
|
||||
|
||||
@@ -171,12 +171,12 @@ public enum PartType
|
||||
private final GuiText extraName;
|
||||
public Constructor<? extends IPart> constructor;
|
||||
|
||||
PartType( int baseMetaValue, Set<AEFeature> features, Set<IntegrationType> integrations, Class<? extends IPart> c )
|
||||
PartType( final int baseMetaValue, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c )
|
||||
{
|
||||
this( baseMetaValue, features, integrations, c, null );
|
||||
}
|
||||
|
||||
PartType( int baseMetaValue, Set<AEFeature> features, Set<IntegrationType> integrations, Class<? extends IPart> c, GuiText en )
|
||||
PartType( final int baseMetaValue, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en )
|
||||
{
|
||||
this.features = Collections.unmodifiableSet( features );
|
||||
this.integrations = Collections.unmodifiableSet( integrations );
|
||||
|
||||
@@ -63,7 +63,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
private final int perType;
|
||||
private final double idleDrain;
|
||||
|
||||
public ItemBasicStorageCell( MaterialType whichCell, int kilobytes )
|
||||
public ItemBasicStorageCell( final MaterialType whichCell, final int kilobytes )
|
||||
{
|
||||
super( Optional.of( kilobytes + "k" ) );
|
||||
|
||||
@@ -97,14 +97,14 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if( inventory instanceof ICellInventoryHandler )
|
||||
{
|
||||
ICellInventoryHandler handler = (ICellInventoryHandler) inventory;
|
||||
ICellInventory cellInventory = handler.getCellInv();
|
||||
final ICellInventoryHandler handler = (ICellInventoryHandler) inventory;
|
||||
final ICellInventory cellInventory = handler.getCellInv();
|
||||
|
||||
if( cellInventory != null )
|
||||
{
|
||||
@@ -114,7 +114,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
|
||||
if( handler.isPreformatted() )
|
||||
{
|
||||
String list = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal();
|
||||
final String list = ( handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded ).getLocal();
|
||||
|
||||
if( handler.isFuzzy() )
|
||||
{
|
||||
@@ -130,31 +130,31 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes( ItemStack cellItem )
|
||||
public int getBytes( final ItemStack cellItem )
|
||||
{
|
||||
return this.totalBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int BytePerType( ItemStack cell )
|
||||
public int BytePerType( final ItemStack cell )
|
||||
{
|
||||
return this.perType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytesPerType( ItemStack cellItem )
|
||||
public int getBytesPerType( final ItemStack cellItem )
|
||||
{
|
||||
return this.perType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes( ItemStack cellItem )
|
||||
public int getTotalTypes( final ItemStack cellItem )
|
||||
{
|
||||
return 63;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition )
|
||||
public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell( ItemStack i )
|
||||
public boolean isStorageCell( final ItemStack i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -178,57 +178,57 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
public String getUnlocalizedGroupName( final Set<ItemStack> others, final ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
public boolean isEditable( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
public IInventory getUpgradesInventory( final ItemStack is )
|
||||
{
|
||||
return new CellUpgrades( is, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
public IInventory getConfigInventory( final ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
public FuzzyMode getFuzzyMode( final ItemStack is )
|
||||
{
|
||||
String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
try
|
||||
{
|
||||
return FuzzyMode.valueOf( fz );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer player )
|
||||
public ItemStack onItemRightClick( final ItemStack stack, final World world, final EntityPlayer player )
|
||||
{
|
||||
this.disassembleDrive( stack, world, player );
|
||||
return stack;
|
||||
}
|
||||
|
||||
private boolean disassembleDrive( ItemStack stack, World world, EntityPlayer player )
|
||||
private boolean disassembleDrive( final ItemStack stack, final World world, final EntityPlayer player )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
@@ -237,18 +237,18 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
return false;
|
||||
}
|
||||
|
||||
InventoryPlayer playerInventory = player.inventory;
|
||||
IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
final InventoryPlayer playerInventory = player.inventory;
|
||||
final IMEInventoryHandler inv = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
if( inv != null && playerInventory.getCurrentItem() == stack )
|
||||
{
|
||||
InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
IItemList<IAEItemStack> list = inv.getAvailableItems( StorageChannel.ITEMS.createList() );
|
||||
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
final IItemList<IAEItemStack> list = inv.getAvailableItems( StorageChannel.ITEMS.createList() );
|
||||
if( list.isEmpty() && ia != null )
|
||||
{
|
||||
playerInventory.setInventorySlotContents( playerInventory.currentItem, null );
|
||||
|
||||
// drop core
|
||||
ItemStack extraB = ia.addItems( this.component.stack( 1 ) );
|
||||
final ItemStack extraB = ia.addItems( this.component.stack( 1 ) );
|
||||
if( extraB != null )
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice( extraB, false );
|
||||
@@ -267,7 +267,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
// drop empty storage cell case
|
||||
for( ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack storageCellStack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
final ItemStack extraA = ia.addItems( storageCellStack );
|
||||
if( extraA != null )
|
||||
@@ -289,15 +289,15 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return this.disassembleDrive( stack, world, player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem( ItemStack itemStack )
|
||||
public ItemStack getContainerItem( final ItemStack itemStack )
|
||||
{
|
||||
for( ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
|
||||
for( final ItemStack stack : AEApi.instance().definitions().materials().emptyStorageCell().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem( ItemStack stack )
|
||||
public boolean hasContainerItem( final ItemStack stack )
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting );
|
||||
}
|
||||
|
||||
@@ -41,31 +41,31 @@ public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenc
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
public boolean isEditable( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
public IInventory getUpgradesInventory( final ItemStack is )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
public IInventory getConfigInventory( final ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
public FuzzyMode getFuzzyMode( final ItemStack is )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
{
|
||||
private final int maxRegion;
|
||||
|
||||
public ItemSpatialStorageCell( int spatialScale )
|
||||
public ItemSpatialStorageCell( final int spatialScale )
|
||||
{
|
||||
super( Optional.of( spatialScale + "Cubed" ) );
|
||||
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
|
||||
@@ -55,9 +55,9 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
WorldCoord wc = this.getStoredSize( stack );
|
||||
final WorldCoord wc = this.getStoredSize( stack );
|
||||
if( wc.x > 0 )
|
||||
{
|
||||
lines.add( GuiText.StoredSize.getLocal() + ": " + wc.x + " x " + wc.y + " x " + wc.z );
|
||||
@@ -65,24 +65,24 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpatialStorage( ItemStack is )
|
||||
public boolean isSpatialStorage( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxStoredDim( ItemStack is )
|
||||
public int getMaxStoredDim( final ItemStack is )
|
||||
{
|
||||
return this.maxRegion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld( ItemStack is )
|
||||
public World getWorld( final ItemStack is )
|
||||
{
|
||||
if( is.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound c = is.getTagCompound();
|
||||
int dim = c.getInteger( "StorageDim" );
|
||||
final NBTTagCompound c = is.getTagCompound();
|
||||
final int dim = c.getInteger( "StorageDim" );
|
||||
World w = DimensionManager.getWorld( dim );
|
||||
if( w == null )
|
||||
{
|
||||
@@ -102,14 +102,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldCoord getStoredSize( ItemStack is )
|
||||
public WorldCoord getStoredSize( final ItemStack is )
|
||||
{
|
||||
if( is.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound c = is.getTagCompound();
|
||||
final NBTTagCompound c = is.getTagCompound();
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
int dim = c.getInteger( "StorageDim" );
|
||||
final int dim = c.getInteger( "StorageDim" );
|
||||
return WorldData.instance().dimensionData().getStoredSize( dim );
|
||||
}
|
||||
else
|
||||
@@ -121,12 +121,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldCoord getMin( ItemStack is )
|
||||
public WorldCoord getMin( final ItemStack is )
|
||||
{
|
||||
World w = this.getWorld( is );
|
||||
final World w = this.getWorld( is );
|
||||
if( w != null )
|
||||
{
|
||||
NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
|
||||
final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
|
||||
if( info != null )
|
||||
{
|
||||
return new WorldCoord( info.getInteger( "minX" ), info.getInteger( "minY" ), info.getInteger( "minZ" ) );
|
||||
@@ -136,12 +136,12 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldCoord getMax( ItemStack is )
|
||||
public WorldCoord getMax( final ItemStack is )
|
||||
{
|
||||
World w = this.getWorld( is );
|
||||
final World w = this.getWorld( is );
|
||||
if( w != null )
|
||||
{
|
||||
NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
|
||||
final NBTTagCompound info = (NBTTagCompound) w.getWorldInfo().getAdditionalProperty( "storageCell" );
|
||||
if( info != null )
|
||||
{
|
||||
return new WorldCoord( info.getInteger( "maxX" ), info.getInteger( "maxY" ), info.getInteger( "maxZ" ) );
|
||||
@@ -151,14 +151,14 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition )
|
||||
public TransitionResult doSpatialTransition( final ItemStack is, final World w, final WorldCoord min, final WorldCoord max, final boolean doTransition )
|
||||
{
|
||||
WorldCoord scale = this.getStoredSize( is );
|
||||
final 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 = this.getMaxStoredDim( is );
|
||||
final int targetX = max.x - min.x - 1;
|
||||
final int targetY = max.y - min.y - 1;
|
||||
final int targetZ = max.z - min.z - 1;
|
||||
final int maxSize = this.getMaxStoredDim( is );
|
||||
|
||||
World destination = this.getWorld( is );
|
||||
|
||||
@@ -171,7 +171,7 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
destination = this.createNewWorld( is );
|
||||
}
|
||||
|
||||
int floorBuffer = 64;
|
||||
final int floorBuffer = 64;
|
||||
StorageHelper.getInstance().swapRegions( w, destination, min.x + 1, min.y + 1, min.z + 1, 1, floorBuffer + 1, 1, targetX - 1, targetY - 1, targetZ - 1 );
|
||||
this.setStoredSize( is, targetX, targetY, targetZ );
|
||||
|
||||
@@ -182,22 +182,22 @@ public class ItemSpatialStorageCell extends AEBaseItem implements ISpatialStorag
|
||||
return new TransitionResult( false, 0 );
|
||||
}
|
||||
|
||||
public World createNewWorld( ItemStack is )
|
||||
public World createNewWorld( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
int newDim = DimensionManager.getNextFreeDimId();
|
||||
final NBTTagCompound c = Platform.openNbtData( is );
|
||||
final int newDim = DimensionManager.getNextFreeDimId();
|
||||
c.setInteger( "StorageDim", newDim );
|
||||
WorldData.instance().dimensionData().addStorageCell( newDim );
|
||||
DimensionManager.initDimension( newDim );
|
||||
return DimensionManager.getWorld( newDim );
|
||||
}
|
||||
|
||||
private void setStoredSize( ItemStack is, int targetX, int targetY, int targetZ )
|
||||
private void setStoredSize( final ItemStack is, final int targetX, final int targetY, final int targetZ )
|
||||
{
|
||||
if( is.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound c = is.getTagCompound();
|
||||
int dim = c.getInteger( "StorageDim" );
|
||||
final NBTTagCompound c = is.getTagCompound();
|
||||
final int dim = c.getInteger( "StorageDim" );
|
||||
c.setInteger( "sizeX", targetX );
|
||||
c.setInteger( "sizeY", targetY );
|
||||
c.setInteger( "sizeZ", targetZ );
|
||||
|
||||
@@ -51,13 +51,13 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
public static IPartitionList<IAEItemStack> createFilter( ItemStack[] list )
|
||||
public static IPartitionList<IAEItemStack> createFilter( final ItemStack[] list )
|
||||
{
|
||||
IPartitionList<IAEItemStack> myPartitionList = null;
|
||||
|
||||
MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
|
||||
final MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
|
||||
|
||||
for( ItemStack currentViewCell : list )
|
||||
for( final ItemStack currentViewCell : list )
|
||||
{
|
||||
if( currentViewCell == null )
|
||||
{
|
||||
@@ -66,22 +66,22 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
|
||||
if( ( currentViewCell.getItem() instanceof ItemViewCell ) )
|
||||
{
|
||||
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
|
||||
|
||||
ICellWorkbenchItem vc = (ICellWorkbenchItem) currentViewCell.getItem();
|
||||
IInventory upgrades = vc.getUpgradesInventory( currentViewCell );
|
||||
IInventory config = vc.getConfigInventory( currentViewCell );
|
||||
FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell );
|
||||
final ICellWorkbenchItem vc = (ICellWorkbenchItem) currentViewCell.getItem();
|
||||
final IInventory upgrades = vc.getUpgradesInventory( currentViewCell );
|
||||
final IInventory config = vc.getConfigInventory( currentViewCell );
|
||||
final FuzzyMode fzMode = vc.getFuzzyMode( currentViewCell );
|
||||
|
||||
boolean hasInverter = false;
|
||||
boolean hasFuzzy = false;
|
||||
|
||||
for( int x = 0; x < upgrades.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack is = upgrades.getStackInSlot( x );
|
||||
final ItemStack is = upgrades.getStackInSlot( x );
|
||||
if( is != null && is.getItem() instanceof IUpgradeModule )
|
||||
{
|
||||
Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is );
|
||||
final Upgrades u = ( (IUpgradeModule) is.getItem() ).getType( is );
|
||||
if( u != null )
|
||||
{
|
||||
switch( u )
|
||||
@@ -100,7 +100,7 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
|
||||
for( int x = 0; x < config.getSizeInventory(); x++ )
|
||||
{
|
||||
ItemStack is = config.getStackInSlot( x );
|
||||
final ItemStack is = config.getStackInSlot( x );
|
||||
if( is != null )
|
||||
{
|
||||
priorityList.add( AEItemStack.create( is ) );
|
||||
@@ -127,39 +127,39 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
public boolean isEditable( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
public IInventory getUpgradesInventory( final ItemStack is )
|
||||
{
|
||||
return new CellUpgrades( is, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
public IInventory getConfigInventory( final ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
public FuzzyMode getFuzzyMode( final ItemStack is )
|
||||
{
|
||||
String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
try
|
||||
{
|
||||
return FuzzyMode.valueOf( fz );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack is, World w, EntityPlayer p )
|
||||
public ItemStack onItemRightClick( final ItemStack is, final World w, final EntityPlayer p )
|
||||
{
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean itemInteractionForEntity( ItemStack is, EntityPlayer par2EntityPlayer, EntityLivingBase target )
|
||||
public boolean itemInteractionForEntity( ItemStack is, final EntityPlayer par2EntityPlayer, final EntityLivingBase target )
|
||||
{
|
||||
if( target instanceof EntityPlayer && !par2EntityPlayer.isSneaking() )
|
||||
{
|
||||
@@ -86,15 +86,15 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack is )
|
||||
public String getItemStackDisplayName( final ItemStack is )
|
||||
{
|
||||
GameProfile username = this.getProfile( is );
|
||||
final GameProfile username = this.getProfile( is );
|
||||
return username != null ? super.getItemStackDisplayName( is ) + " - " + username.getName() : super.getItemStackDisplayName( is );
|
||||
}
|
||||
|
||||
private void encode( ItemStack is, EntityPlayer p )
|
||||
private void encode( final ItemStack is, final EntityPlayer p )
|
||||
{
|
||||
GameProfile username = this.getProfile( is );
|
||||
final GameProfile username = this.getProfile( is );
|
||||
|
||||
if( username != null && username.equals( p.getGameProfile() ) )
|
||||
{
|
||||
@@ -107,13 +107,13 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfile( ItemStack itemStack, GameProfile profile )
|
||||
public void setProfile( final ItemStack itemStack, final GameProfile profile )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( itemStack );
|
||||
final NBTTagCompound tag = Platform.openNbtData( itemStack );
|
||||
|
||||
if( profile != null )
|
||||
{
|
||||
NBTTagCompound pNBT = new NBTTagCompound();
|
||||
final NBTTagCompound pNBT = new NBTTagCompound();
|
||||
NBTUtil.func_152460_a( pNBT, profile );
|
||||
tag.setTag( "profile", pNBT );
|
||||
}
|
||||
@@ -124,9 +124,9 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile getProfile( ItemStack is )
|
||||
public GameProfile getProfile( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( is );
|
||||
final NBTTagCompound tag = Platform.openNbtData( is );
|
||||
if( tag.hasKey( "profile" ) )
|
||||
{
|
||||
return NBTUtil.func_152459_a( tag.getCompoundTag( "profile" ) );
|
||||
@@ -135,12 +135,12 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<SecurityPermissions> getPermissions( ItemStack is )
|
||||
public EnumSet<SecurityPermissions> getPermissions( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( is );
|
||||
EnumSet<SecurityPermissions> result = EnumSet.noneOf( SecurityPermissions.class );
|
||||
final NBTTagCompound tag = Platform.openNbtData( is );
|
||||
final EnumSet<SecurityPermissions> result = EnumSet.noneOf( SecurityPermissions.class );
|
||||
|
||||
for( SecurityPermissions sp : SecurityPermissions.values() )
|
||||
for( final SecurityPermissions sp : SecurityPermissions.values() )
|
||||
{
|
||||
if( tag.getBoolean( sp.name() ) )
|
||||
{
|
||||
@@ -152,16 +152,16 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission( ItemStack is, SecurityPermissions permission )
|
||||
public boolean hasPermission( final ItemStack is, final SecurityPermissions permission )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( is );
|
||||
final NBTTagCompound tag = Platform.openNbtData( is );
|
||||
return tag.getBoolean( permission.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePermission( ItemStack itemStack, SecurityPermissions permission )
|
||||
public void removePermission( final ItemStack itemStack, final SecurityPermissions permission )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( itemStack );
|
||||
final NBTTagCompound tag = Platform.openNbtData( itemStack );
|
||||
if( tag.hasKey( permission.name() ) )
|
||||
{
|
||||
tag.removeTag( permission.name() );
|
||||
@@ -169,22 +169,22 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPermission( ItemStack itemStack, SecurityPermissions permission )
|
||||
public void addPermission( final ItemStack itemStack, final SecurityPermissions permission )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( itemStack );
|
||||
final NBTTagCompound tag = Platform.openNbtData( itemStack );
|
||||
tag.setBoolean( permission.name(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPermissions( ISecurityRegistry register, IPlayerRegistry pr, ItemStack is )
|
||||
public void registerPermissions( final ISecurityRegistry register, final IPlayerRegistry pr, final ItemStack is )
|
||||
{
|
||||
register.addPlayer( pr.getID( this.getProfile( is ) ), this.getPermissions( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
EnumSet<SecurityPermissions> perms = this.getPermissions( stack );
|
||||
final EnumSet<SecurityPermissions> perms = this.getPermissions( stack );
|
||||
if( perms.isEmpty() )
|
||||
{
|
||||
lines.add( GuiText.NoPermissions.getLocal() );
|
||||
@@ -193,7 +193,7 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
{
|
||||
String msg = null;
|
||||
|
||||
for( SecurityPermissions sp : perms )
|
||||
for( final SecurityPermissions sp : perms )
|
||||
{
|
||||
if( msg == null )
|
||||
{
|
||||
|
||||
@@ -46,11 +46,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) );
|
||||
|
||||
NBTTagCompound data = this.getData( stack );
|
||||
final NBTTagCompound data = this.getData( stack );
|
||||
if( data.hasKey( "tooltip" ) )
|
||||
{
|
||||
lines.add( StatCollector.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) );
|
||||
@@ -64,18 +64,18 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
*
|
||||
* @return localized name
|
||||
*/
|
||||
private String getLocalizedName( String... name )
|
||||
private String getLocalizedName( final String... name )
|
||||
{
|
||||
for( String n : name )
|
||||
for( final String n : name )
|
||||
{
|
||||
String l = StatCollector.translateToLocal( n );
|
||||
final String l = StatCollector.translateToLocal( n );
|
||||
if( !l.equals( n ) )
|
||||
{
|
||||
return l;
|
||||
}
|
||||
}
|
||||
|
||||
for( String n : name )
|
||||
for( final String n : name )
|
||||
{
|
||||
return n;
|
||||
}
|
||||
@@ -84,25 +84,25 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMemoryCardContents( ItemStack is, String settingsName, NBTTagCompound data )
|
||||
public void setMemoryCardContents( final ItemStack is, final String settingsName, final NBTTagCompound data )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
final NBTTagCompound c = Platform.openNbtData( is );
|
||||
c.setString( "Config", settingsName );
|
||||
c.setTag( "Data", data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSettingsName( ItemStack is )
|
||||
public String getSettingsName( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
String name = c.getString( "Config" );
|
||||
final NBTTagCompound c = Platform.openNbtData( is );
|
||||
final String name = c.getString( "Config" );
|
||||
return name == null || name.isEmpty() ? GuiText.Blank.getUnlocalized() : name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getData( ItemStack is )
|
||||
public NBTTagCompound getData( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound c = Platform.openNbtData( is );
|
||||
final NBTTagCompound c = Platform.openNbtData( is );
|
||||
NBTTagCompound o = c.getCompoundTag( "Data" );
|
||||
if( o == null )
|
||||
{
|
||||
@@ -112,7 +112,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyUser( EntityPlayer player, MemoryCardMessages msg )
|
||||
public void notifyUser( final EntityPlayer player, final MemoryCardMessages msg )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -138,11 +138,11 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hx, float hy, float hz )
|
||||
public boolean onItemUse( final ItemStack is, final EntityPlayer player, final World w, final int x, final int y, final int z, final int side, final float hx, final float hy, final float hz )
|
||||
{
|
||||
if( player.isSneaking() && !w.isRemote )
|
||||
{
|
||||
IMemoryCard mem = (IMemoryCard) is.getItem();
|
||||
final IMemoryCard mem = (IMemoryCard) is.getItem();
|
||||
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
|
||||
is.setTagCompound( null );
|
||||
return true;
|
||||
@@ -154,7 +154,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSneakBypassUse( World world, int x, int y, int z, EntityPlayer player )
|
||||
public boolean doesSneakBypassUse( final World world, final int x, final int y, final int z, final EntityPlayer player )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,18 +69,18 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiItemObject getGuiObject( ItemStack is, World world, int x, int y, int z )
|
||||
public IGuiItemObject getGuiObject( final ItemStack is, final World world, final int x, final int y, final int z )
|
||||
{
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
final TileEntity te = world.getTileEntity( x, y, z );
|
||||
return new NetworkToolViewer( is, (IGridHost) ( te instanceof IGridHost ? te : null ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p )
|
||||
public ItemStack onItemRightClick( final ItemStack it, final World w, final EntityPlayer p )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
MovingObjectPosition mop = ClientHelper.proxy.getMOP();
|
||||
final MovingObjectPosition mop = ClientHelper.proxy.getMOP();
|
||||
|
||||
if( mop == null )
|
||||
{
|
||||
@@ -88,9 +88,9 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = mop.blockX;
|
||||
int j = mop.blockY;
|
||||
int k = mop.blockZ;
|
||||
final int i = mop.blockX;
|
||||
final int j = mop.blockY;
|
||||
final int k = mop.blockZ;
|
||||
|
||||
if( w.getBlock( i, j, k ).isAir( w, i, j, k ) )
|
||||
{
|
||||
@@ -103,13 +103,13 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
MovingObjectPosition mop = new MovingObjectPosition( x, y, z, side, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
final MovingObjectPosition mop = new MovingObjectPosition( x, y, z, side, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
||||
final TileEntity te = world.getTileEntity( x, y, z );
|
||||
if( te instanceof IPartHost )
|
||||
{
|
||||
SelectedPart part = ( (IPartHost) te ).selectPart( mop.hitVec );
|
||||
final SelectedPart part = ( (IPartHost) te ).selectPart( mop.hitVec );
|
||||
if( part.part != null )
|
||||
{
|
||||
if( part.part instanceof INetworkToolAgent && !( (INetworkToolAgent) part.part ).showNetworkInfo( mop ) )
|
||||
@@ -131,12 +131,12 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSneakBypassUse( World world, int x, int y, int z, EntityPlayer player )
|
||||
public boolean doesSneakBypassUse( final World world, final int x, final int y, final int z, final EntityPlayer player )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean serverSideToolLogic( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean serverSideToolLogic( final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( side >= 0 )
|
||||
{
|
||||
@@ -145,10 +145,10 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
return false;
|
||||
}
|
||||
|
||||
Block b = w.getBlock( x, y, z );
|
||||
final Block b = w.getBlock( x, y, z );
|
||||
if( b != null && !p.isSneaking() )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
final TileEntity te = w.getTileEntity( x, y, z );
|
||||
if( !( te instanceof IGridHost ) )
|
||||
{
|
||||
if( b.rotateBlock( w, x, y, z, ForgeDirection.getOrientation( side ) ) )
|
||||
@@ -167,7 +167,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
final TileEntity te = w.getTileEntity( x, y, z );
|
||||
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
@@ -194,19 +194,19 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench( ItemStack is, EntityPlayer player, int x, int y, int z )
|
||||
public boolean canWrench( final ItemStack is, final EntityPlayer player, final int x, final int y, final int z )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench( EntityPlayer player, int x, int y, int z )
|
||||
public boolean canWrench( final EntityPlayer player, final int x, final int y, final int z )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrenchUsed( EntityPlayer player, int x, int y, int z )
|
||||
public void wrenchUsed( final EntityPlayer player, final int x, final int y, final int z )
|
||||
{
|
||||
player.swingItem();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter )
|
||||
public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 300 )
|
||||
{
|
||||
@@ -54,9 +54,9 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
||||
{
|
||||
for( int x = 0; x < 2; x++ )
|
||||
{
|
||||
float dx = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minX );
|
||||
float dy = (float) ( Platform.getRandomFloat() * target.height + target.boundingBox.minY );
|
||||
float dz = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minZ );
|
||||
final float dx = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minX );
|
||||
final float dy = (float) ( Platform.getRandomFloat() * target.height + target.boundingBox.minY );
|
||||
final float dz = (float) ( Platform.getRandomFloat() * target.width + target.boundingBox.minZ );
|
||||
ServerHelper.proxy.sendToAllNearExcept( null, dx, dy, dz, 32.0, target.worldObj, new PacketLightning( dx, dy, dz ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
static
|
||||
{
|
||||
|
||||
for( AEColor col : AEColor.values() )
|
||||
for( final AEColor col : AEColor.values() )
|
||||
{
|
||||
if( col == AEColor.Transparent )
|
||||
{
|
||||
@@ -116,16 +116,16 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUse( final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
Block blk = w.getBlock( x, y, z );
|
||||
final Block blk = w.getBlock( x, y, z );
|
||||
|
||||
ItemStack paintBall = this.getColor( is );
|
||||
|
||||
IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
if( inv != null )
|
||||
{
|
||||
IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() );
|
||||
final IAEItemStack option = inv.extractItems( AEItemStack.create( paintBall ), Actionable.SIMULATE, new BaseActionSource() );
|
||||
|
||||
if( option != null )
|
||||
{
|
||||
@@ -142,11 +142,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return false;
|
||||
}
|
||||
|
||||
double powerPerUse = 100;
|
||||
final double powerPerUse = 100;
|
||||
if( paintBall != null && paintBall.getItem() instanceof ItemSnowball )
|
||||
{
|
||||
ForgeDirection orientation = ForgeDirection.getOrientation( side );
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
final ForgeDirection orientation = ForgeDirection.getOrientation( side );
|
||||
final TileEntity te = w.getTileEntity( x, y, z );
|
||||
// clean cables.
|
||||
if( te instanceof IColorableTile )
|
||||
{
|
||||
@@ -162,8 +162,8 @@ 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 );
|
||||
final Block testBlk = w.getBlock( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ );
|
||||
final TileEntity painted = w.getTileEntity( x + orientation.offsetX, y + orientation.offsetY, z + orientation.offsetZ );
|
||||
if( this.getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint )
|
||||
{
|
||||
inv.extractItems( AEItemStack.create( paintBall ), Actionable.MODULATE, new BaseActionSource() );
|
||||
@@ -174,7 +174,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
else if( paintBall != null )
|
||||
{
|
||||
AEColor color = this.getColorFromItem( paintBall );
|
||||
final AEColor color = this.getColorFromItem( paintBall );
|
||||
|
||||
if( color != null && this.getAECurrentPower( is ) > powerPerUse )
|
||||
{
|
||||
@@ -197,11 +197,11 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( ItemStack par1ItemStack )
|
||||
public String getItemStackDisplayName( final ItemStack par1ItemStack )
|
||||
{
|
||||
String extra = GuiText.Empty.getLocal();
|
||||
|
||||
AEColor selected = this.getActiveColor( par1ItemStack );
|
||||
final AEColor selected = this.getActiveColor( par1ItemStack );
|
||||
|
||||
if( selected != null && Platform.isClient() )
|
||||
{
|
||||
@@ -211,12 +211,12 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return super.getItemStackDisplayName( par1ItemStack ) + " - " + extra;
|
||||
}
|
||||
|
||||
public AEColor getActiveColor( ItemStack tol )
|
||||
public AEColor getActiveColor( final ItemStack tol )
|
||||
{
|
||||
return this.getColorFromItem( this.getColor( tol ) );
|
||||
}
|
||||
|
||||
public AEColor getColorFromItem( ItemStack paintBall )
|
||||
public AEColor getColorFromItem( final ItemStack paintBall )
|
||||
{
|
||||
if( paintBall == null )
|
||||
{
|
||||
@@ -230,14 +230,14 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
if( paintBall.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
ItemPaintBall ipb = (ItemPaintBall) paintBall.getItem();
|
||||
final ItemPaintBall ipb = (ItemPaintBall) paintBall.getItem();
|
||||
return ipb.getColor( paintBall );
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] id = OreDictionary.getOreIDs( paintBall );
|
||||
final int[] id = OreDictionary.getOreIDs( paintBall );
|
||||
|
||||
for( int oreID : id )
|
||||
for( final int oreID : id )
|
||||
{
|
||||
if( ORE_TO_COLOR.containsKey( oreID ) )
|
||||
{
|
||||
@@ -249,13 +249,13 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getColor( ItemStack is )
|
||||
public ItemStack getColor( final ItemStack is )
|
||||
{
|
||||
NBTTagCompound c = is.getTagCompound();
|
||||
final NBTTagCompound c = is.getTagCompound();
|
||||
if( c != null && c.hasKey( "color" ) )
|
||||
{
|
||||
NBTTagCompound color = c.getCompoundTag( "color" );
|
||||
ItemStack oldColor = ItemStack.loadItemStackFromNBT( color );
|
||||
final NBTTagCompound color = c.getCompoundTag( "color" );
|
||||
final ItemStack oldColor = ItemStack.loadItemStackFromNBT( color );
|
||||
if( oldColor != null )
|
||||
{
|
||||
return oldColor;
|
||||
@@ -265,17 +265,17 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return this.findNextColor( is, null, 0 );
|
||||
}
|
||||
|
||||
private ItemStack findNextColor( ItemStack is, ItemStack anchor, int scrollOffset )
|
||||
private ItemStack findNextColor( final ItemStack is, final ItemStack anchor, final int scrollOffset )
|
||||
{
|
||||
ItemStack newColor = null;
|
||||
|
||||
IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> inv = AEApi.instance().registries().cell().getCellInventory( is, null, StorageChannel.ITEMS );
|
||||
if( inv != null )
|
||||
{
|
||||
IItemList<IAEItemStack> itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
final IItemList<IAEItemStack> itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
if( anchor == null )
|
||||
{
|
||||
IAEItemStack firstItem = itemList.getFirstItem();
|
||||
final IAEItemStack firstItem = itemList.getFirstItem();
|
||||
if( firstItem != null )
|
||||
{
|
||||
newColor = firstItem.getItemStack();
|
||||
@@ -283,9 +283,9 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkedList<IAEItemStack> list = new LinkedList<IAEItemStack>();
|
||||
final LinkedList<IAEItemStack> list = new LinkedList<IAEItemStack>();
|
||||
|
||||
for( IAEItemStack i : itemList )
|
||||
for( final IAEItemStack i : itemList )
|
||||
{
|
||||
list.add( i );
|
||||
}
|
||||
@@ -294,7 +294,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
{
|
||||
|
||||
@Override
|
||||
public int compare( IAEItemStack a, IAEItemStack b )
|
||||
public int compare( final IAEItemStack a, final IAEItemStack b )
|
||||
{
|
||||
return ItemSorters.compareInt( a.getItemDamage(), b.getItemDamage() );
|
||||
}
|
||||
@@ -337,26 +337,26 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return newColor;
|
||||
}
|
||||
|
||||
public void setColor( ItemStack is, ItemStack newColor )
|
||||
public void setColor( final ItemStack is, final ItemStack newColor )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
final NBTTagCompound data = Platform.openNbtData( is );
|
||||
if( newColor == null )
|
||||
{
|
||||
data.removeTag( "color" );
|
||||
}
|
||||
else
|
||||
{
|
||||
NBTTagCompound color = new NBTTagCompound();
|
||||
final NBTTagCompound color = new NBTTagCompound();
|
||||
newColor.writeToNBT( color );
|
||||
data.setTag( "color", color );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean recolourBlock( Block blk, ForgeDirection side, World w, int x, int y, int z, ForgeDirection orientation, AEColor newColor, EntityPlayer p )
|
||||
private boolean recolourBlock( final Block blk, final ForgeDirection side, final World w, final int x, final int y, final int z, final ForgeDirection orientation, final AEColor newColor, final EntityPlayer p )
|
||||
{
|
||||
if( blk == Blocks.carpet )
|
||||
{
|
||||
int meta = w.getBlockMetadata( x, y, z );
|
||||
final int meta = w.getBlockMetadata( x, y, z );
|
||||
if( newColor.ordinal() == meta )
|
||||
{
|
||||
return false;
|
||||
@@ -371,7 +371,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
if( blk == Blocks.stained_glass )
|
||||
{
|
||||
int meta = w.getBlockMetadata( x, y, z );
|
||||
final int meta = w.getBlockMetadata( x, y, z );
|
||||
if( newColor.ordinal() == meta )
|
||||
{
|
||||
return false;
|
||||
@@ -386,7 +386,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
if( blk == Blocks.stained_glass_pane )
|
||||
{
|
||||
int meta = w.getBlockMetadata( x, y, z );
|
||||
final int meta = w.getBlockMetadata( x, y, z );
|
||||
if( newColor.ordinal() == meta )
|
||||
{
|
||||
return false;
|
||||
@@ -401,7 +401,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
if( blk == Blocks.stained_hardened_clay )
|
||||
{
|
||||
int meta = w.getBlockMetadata( x, y, z );
|
||||
final int meta = w.getBlockMetadata( x, y, z );
|
||||
if( newColor.ordinal() == meta )
|
||||
{
|
||||
return false;
|
||||
@@ -417,7 +417,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
return blk.recolourBlock( w, x, y, z, side, newColor.ordinal() );
|
||||
}
|
||||
|
||||
public void cycleColors( ItemStack is, ItemStack paintBall, int i )
|
||||
public void cycleColors( final ItemStack is, final ItemStack paintBall, final int i )
|
||||
{
|
||||
if( paintBall == null )
|
||||
{
|
||||
@@ -430,15 +430,15 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv();
|
||||
final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv();
|
||||
if( cd != null )
|
||||
{
|
||||
lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
|
||||
@@ -448,37 +448,37 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes( ItemStack cellItem )
|
||||
public int getBytes( final ItemStack cellItem )
|
||||
{
|
||||
return 512;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int BytePerType( ItemStack cell )
|
||||
public int BytePerType( final ItemStack cell )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytesPerType( ItemStack cellItem )
|
||||
public int getBytesPerType( final ItemStack cellItem )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes( ItemStack cellItem )
|
||||
public int getTotalTypes( final ItemStack cellItem )
|
||||
{
|
||||
return 27;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition )
|
||||
public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition )
|
||||
{
|
||||
if( requestedAddition != null )
|
||||
{
|
||||
int[] id = OreDictionary.getOreIDs( requestedAddition.getItemStack() );
|
||||
final int[] id = OreDictionary.getOreIDs( requestedAddition.getItemStack() );
|
||||
|
||||
for( int x : id )
|
||||
for( final int x : id )
|
||||
{
|
||||
if( ORE_TO_COLOR.containsKey( x ) )
|
||||
{
|
||||
@@ -503,7 +503,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell( ItemStack i )
|
||||
public boolean isStorageCell( final ItemStack i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -515,51 +515,51 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
public String getUnlocalizedGroupName( final Set<ItemStack> others, final ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
public boolean isEditable( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
public IInventory getUpgradesInventory( final ItemStack is )
|
||||
{
|
||||
return new CellUpgrades( is, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
public IInventory getConfigInventory( final ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
public FuzzyMode getFuzzyMode( final ItemStack is )
|
||||
{
|
||||
String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
try
|
||||
{
|
||||
return FuzzyMode.valueOf( fz );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWheel( ItemStack is, boolean up )
|
||||
public void onWheel( final ItemStack is, final boolean up )
|
||||
{
|
||||
this.cycleColors( is, this.getColor( is ), up ? 1 : -1 );
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.flowing_lava, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.obsidian ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.grass, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.dirt ) ) );
|
||||
|
||||
List<ItemStack> snowBalls = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> snowBalls = new ArrayList<ItemStack>();
|
||||
snowBalls.add( new ItemStack( Items.snowball ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.flowing_water, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( null, snowBalls ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.water, OreDictionary.WILDCARD_VALUE ), new InWorldToolOperationResult( new ItemStack( Blocks.ice ) ) );
|
||||
@@ -98,7 +98,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
private final Block blockID;
|
||||
private final int metadata;
|
||||
|
||||
public InWorldToolOperationIngredient( Block blockID, int metadata )
|
||||
public InWorldToolOperationIngredient( final Block blockID, final int metadata )
|
||||
{
|
||||
this.blockID = blockID;
|
||||
this.metadata = metadata;
|
||||
@@ -111,7 +111,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
public boolean equals( final Object obj )
|
||||
{
|
||||
if( obj == null )
|
||||
{
|
||||
@@ -121,12 +121,12 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj;
|
||||
final InWorldToolOperationIngredient other = (InWorldToolOperationIngredient) obj;
|
||||
return this.blockID == other.blockID && this.metadata == other.metadata;
|
||||
}
|
||||
}
|
||||
|
||||
private void heat( Block blockID, int metadata, World w, int x, int y, int z )
|
||||
private void heat( final Block blockID, final int metadata, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( blockID, metadata ) );
|
||||
|
||||
@@ -150,7 +150,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canHeat( Block blockID, int metadata )
|
||||
private boolean canHeat( final Block blockID, final int metadata )
|
||||
{
|
||||
InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( blockID, metadata ) );
|
||||
|
||||
@@ -162,7 +162,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
return r != null;
|
||||
}
|
||||
|
||||
private void cool( Block blockID, int metadata, World w, int x, int y, int z )
|
||||
private void cool( final Block blockID, final int metadata, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( blockID, metadata ) );
|
||||
|
||||
@@ -186,7 +186,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canCool( Block blockID, int metadata )
|
||||
private boolean canCool( final Block blockID, final int metadata )
|
||||
{
|
||||
InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( blockID, metadata ) );
|
||||
|
||||
@@ -199,7 +199,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity( ItemStack item, EntityLivingBase target, EntityLivingBase hitter )
|
||||
public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
@@ -211,9 +211,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p )
|
||||
public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer p )
|
||||
{
|
||||
MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true );
|
||||
final MovingObjectPosition target = this.getMovingObjectPositionFromPlayer( w, p, true );
|
||||
|
||||
if( target == null )
|
||||
{
|
||||
@@ -223,9 +223,9 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if( target.typeOfHit == MovingObjectType.BLOCK )
|
||||
{
|
||||
int x = target.blockX;
|
||||
int y = target.blockY;
|
||||
int z = target.blockZ;
|
||||
final int x = target.blockX;
|
||||
final int y = target.blockY;
|
||||
final int z = target.blockZ;
|
||||
|
||||
if( w.getBlock( x, y, z ).getMaterial() == Material.lava || w.getBlock( x, y, z ).getMaterial() == Material.water )
|
||||
{
|
||||
@@ -241,7 +241,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack item, EntityPlayer p, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUse( final ItemStack item, final EntityPlayer p, final World w, int x, int y, int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
@@ -250,8 +250,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
return false;
|
||||
}
|
||||
|
||||
Block blockID = w.getBlock( x, y, z );
|
||||
int metadata = w.getBlockMetadata( x, y, z );
|
||||
final Block blockID = w.getBlock( x, y, z );
|
||||
final int metadata = w.getBlockMetadata( x, y, z );
|
||||
|
||||
if( p.isSneaking() )
|
||||
{
|
||||
@@ -285,14 +285,14 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack[] stack = Platform.getBlockDrops( w, x, y, z );
|
||||
List<ItemStack> out = new ArrayList<ItemStack>();
|
||||
final ItemStack[] stack = Platform.getBlockDrops( w, x, y, z );
|
||||
final List<ItemStack> out = new ArrayList<ItemStack>();
|
||||
boolean hasFurnaceable = false;
|
||||
boolean canFurnaceable = true;
|
||||
|
||||
for( ItemStack i : stack )
|
||||
for( final ItemStack i : stack )
|
||||
{
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult( i );
|
||||
final ItemStack result = FurnaceRecipes.smelting().getSmeltingResult( i );
|
||||
|
||||
if( result != null )
|
||||
{
|
||||
@@ -316,7 +316,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
if( hasFurnaceable && canFurnaceable )
|
||||
{
|
||||
this.extractAEPower( item, 1600 );
|
||||
InWorldToolOperationResult or = InWorldToolOperationResult.getBlockOperationResult( out.toArray( new ItemStack[out.size()] ) );
|
||||
final 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 );
|
||||
|
||||
if( or.BlockItem == null )
|
||||
@@ -337,7 +337,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
else
|
||||
{
|
||||
ForgeDirection dir = ForgeDirection.getOrientation( side );
|
||||
final ForgeDirection dir = ForgeDirection.getOrientation( side );
|
||||
x += dir.offsetX;
|
||||
y += dir.offsetY;
|
||||
z += dir.offsetZ;
|
||||
|
||||
@@ -95,15 +95,15 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv();
|
||||
final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv();
|
||||
if( cd != null )
|
||||
{
|
||||
lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
|
||||
@@ -113,22 +113,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer p )
|
||||
public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer p )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
int shots = 1;
|
||||
|
||||
CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item );
|
||||
final CellUpgrades cu = (CellUpgrades) this.getUpgradesInventory( item );
|
||||
if( cu != null )
|
||||
{
|
||||
shots += cu.getInstalledUpgrades( Upgrades.SPEED );
|
||||
}
|
||||
|
||||
IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS );
|
||||
final IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS );
|
||||
if( inv != null )
|
||||
{
|
||||
IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
final IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
|
||||
IAEStack aeAmmo = itemList.getFirstItem();
|
||||
if( aeAmmo instanceof IAEItemStack )
|
||||
{
|
||||
@@ -143,7 +143,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
aeAmmo.setStackSize( 1 );
|
||||
ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack();
|
||||
final ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack();
|
||||
if( ammo == null )
|
||||
{
|
||||
return item;
|
||||
@@ -156,29 +156,29 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
return item;
|
||||
}
|
||||
|
||||
float f = 1.0F;
|
||||
float f1 = p.prevRotationPitch + ( p.rotationPitch - p.prevRotationPitch ) * f;
|
||||
float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f;
|
||||
double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f;
|
||||
double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.yOffset;
|
||||
double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f;
|
||||
Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI );
|
||||
float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI );
|
||||
float f5 = -MathHelper.cos( -f1 * 0.017453292F );
|
||||
float f6 = MathHelper.sin( -f1 * 0.017453292F );
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = 32.0D;
|
||||
final float f = 1.0F;
|
||||
final float f1 = p.prevRotationPitch + ( p.rotationPitch - p.prevRotationPitch ) * f;
|
||||
final float f2 = p.prevRotationYaw + ( p.rotationYaw - p.prevRotationYaw ) * f;
|
||||
final double d0 = p.prevPosX + ( p.posX - p.prevPosX ) * f;
|
||||
final double d1 = p.prevPosY + ( p.posY - p.prevPosY ) * f + 1.62D - p.yOffset;
|
||||
final double d2 = p.prevPosZ + ( p.posZ - p.prevPosZ ) * f;
|
||||
final Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
final float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI );
|
||||
final float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI );
|
||||
final float f5 = -MathHelper.cos( -f1 * 0.017453292F );
|
||||
final float f6 = MathHelper.sin( -f1 * 0.017453292F );
|
||||
final float f7 = f4 * f5;
|
||||
final float f8 = f3 * f5;
|
||||
final double d3 = 32.0D;
|
||||
|
||||
Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 );
|
||||
Vec3 direction = Vec3.createVectorHelper( f7 * d3, f6 * d3, f8 * d3 );
|
||||
final Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 );
|
||||
final Vec3 direction = Vec3.createVectorHelper( f7 * d3, f6 * d3, f8 * d3 );
|
||||
direction.normalize();
|
||||
|
||||
float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f;
|
||||
final float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f;
|
||||
if( penetration <= 0 )
|
||||
{
|
||||
ItemStack type = ( (IAEItemStack) aeAmmo ).getItemStack();
|
||||
final ItemStack type = ( (IAEItemStack) aeAmmo ).getItemStack();
|
||||
if( type.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
this.shootPaintBalls( type, w, p, vec3, vec31, direction, d0, d1, d2 );
|
||||
@@ -204,17 +204,17 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
return item;
|
||||
}
|
||||
|
||||
private void shootPaintBalls( ItemStack type, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 )
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
double closest = 9999999.0D;
|
||||
|
||||
for( int l = 0; l < list.size(); ++l )
|
||||
{
|
||||
Entity entity1 = (Entity) list.get( l );
|
||||
final Entity entity1 = (Entity) list.get( l );
|
||||
|
||||
if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) )
|
||||
{
|
||||
@@ -226,14 +226,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
continue;
|
||||
}
|
||||
|
||||
float f1 = 0.3F;
|
||||
final float f1 = 0.3F;
|
||||
|
||||
AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 );
|
||||
MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 );
|
||||
final AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 );
|
||||
final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 );
|
||||
|
||||
if( movingObjectPosition != null )
|
||||
{
|
||||
double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec );
|
||||
final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec );
|
||||
|
||||
if( nd < closest )
|
||||
{
|
||||
@@ -247,7 +247,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, false );
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
final Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
if( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest )
|
||||
{
|
||||
pos = new MovingObjectPosition( entity );
|
||||
@@ -261,27 +261,27 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord, (float) direction.yCoord, (float) direction.zCoord, (byte) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) );
|
||||
}
|
||||
catch( Exception err )
|
||||
catch( final Exception err )
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
|
||||
if( pos != null && type != null && type.getItem() instanceof ItemPaintBall )
|
||||
{
|
||||
ItemPaintBall ipb = (ItemPaintBall) type.getItem();
|
||||
final ItemPaintBall ipb = (ItemPaintBall) type.getItem();
|
||||
|
||||
AEColor col = ipb.getColor( type );
|
||||
final AEColor col = ipb.getColor( type );
|
||||
// boolean lit = ipb.isLumen( type );
|
||||
|
||||
if( pos.typeOfHit == MovingObjectType.ENTITY )
|
||||
{
|
||||
int id = pos.entityHit.getEntityId();
|
||||
PlayerColor marker = new PlayerColor( id, col, 20 * 30 );
|
||||
final int id = pos.entityHit.getEntityId();
|
||||
final PlayerColor marker = new PlayerColor( id, col, 20 * 30 );
|
||||
TickHandler.INSTANCE.getPlayerColors().put( id, marker );
|
||||
|
||||
if( pos.entityHit instanceof EntitySheep )
|
||||
{
|
||||
EntitySheep sh = (EntitySheep) pos.entityHit;
|
||||
final EntitySheep sh = (EntitySheep) pos.entityHit;
|
||||
sh.setFleeceColor( col.ordinal() );
|
||||
}
|
||||
|
||||
@@ -290,27 +290,27 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
else if( pos.typeOfHit == MovingObjectType.BLOCK )
|
||||
{
|
||||
ForgeDirection side = ForgeDirection.getOrientation( pos.sideHit );
|
||||
final ForgeDirection side = ForgeDirection.getOrientation( pos.sideHit );
|
||||
|
||||
int x = pos.blockX + side.offsetX;
|
||||
int y = pos.blockY + side.offsetY;
|
||||
int z = pos.blockZ + side.offsetZ;
|
||||
final int x = pos.blockX + side.offsetX;
|
||||
final int y = pos.blockY + side.offsetY;
|
||||
final int z = pos.blockZ + side.offsetZ;
|
||||
|
||||
if( !Platform.hasPermissions( new DimensionalCoord( w, x, y, z ), p ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Block whatsThere = w.getBlock( x, y, z );
|
||||
final Block whatsThere = w.getBlock( x, y, z );
|
||||
if( whatsThere.isReplaceable( w, x, y, z ) && w.isAirBlock( x, y, z ) )
|
||||
{
|
||||
for( Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock().asSet() )
|
||||
for( final Block paintBlock : AEApi.instance().definitions().blocks().paint().maybeBlock().asSet() )
|
||||
{
|
||||
w.setBlock( x, y, z, paintBlock, 0, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
final TileEntity te = w.getTileEntity( x, y, z );
|
||||
if( te instanceof TilePaint )
|
||||
{
|
||||
pos.hitVec.xCoord -= x;
|
||||
@@ -322,22 +322,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
}
|
||||
|
||||
private void standardAmmo( float penetration, World w, EntityPlayer p, Vec3 vec3, Vec3 vec31, Vec3 direction, double d0, double d1, double d2 )
|
||||
private void standardAmmo( float penetration, final World w, final EntityPlayer p, final Vec3 vec3, final Vec3 vec31, final Vec3 direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
boolean hasDestroyed = true;
|
||||
while( penetration > 0 && hasDestroyed )
|
||||
{
|
||||
hasDestroyed = false;
|
||||
|
||||
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );
|
||||
final AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ), Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ), Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );
|
||||
|
||||
Entity entity = null;
|
||||
List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
|
||||
double closest = 9999999.0D;
|
||||
|
||||
for( int l = 0; l < list.size(); ++l )
|
||||
{
|
||||
Entity entity1 = (Entity) list.get( l );
|
||||
final Entity entity1 = (Entity) list.get( l );
|
||||
|
||||
if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) )
|
||||
{
|
||||
@@ -349,14 +349,14 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
continue;
|
||||
}
|
||||
|
||||
float f1 = 0.3F;
|
||||
final float f1 = 0.3F;
|
||||
|
||||
AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 );
|
||||
MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 );
|
||||
final AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 );
|
||||
final MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 );
|
||||
|
||||
if( movingObjectPosition != null )
|
||||
{
|
||||
double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec );
|
||||
final double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec );
|
||||
|
||||
if( nd < closest )
|
||||
{
|
||||
@@ -368,7 +368,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
}
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
final Vec3 vec = Vec3.createVectorHelper( d0, d1, d2 );
|
||||
MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, true );
|
||||
if( entity != null && pos != null && pos.hitVec.squareDistanceTo( vec ) > closest )
|
||||
{
|
||||
@@ -383,22 +383,22 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
CommonHelper.proxy.sendToAllNearExcept( null, d0, d1, d2, 128, w, new PacketMatterCannon( d0, d1, d2, (float) direction.xCoord, (float) direction.yCoord, (float) direction.zCoord, (byte) ( pos == null ? 32 : pos.hitVec.squareDistanceTo( vec ) + 1 ) ) );
|
||||
}
|
||||
catch( Exception err )
|
||||
catch( final Exception err )
|
||||
{
|
||||
AELog.error( err );
|
||||
}
|
||||
|
||||
if( pos != null )
|
||||
{
|
||||
DamageSource dmgSrc = DamageSource.causePlayerDamage( p );
|
||||
final DamageSource dmgSrc = DamageSource.causePlayerDamage( p );
|
||||
dmgSrc.damageType = "masscannon";
|
||||
|
||||
if( pos.typeOfHit == MovingObjectType.ENTITY )
|
||||
{
|
||||
int dmg = (int) Math.ceil( penetration / 20.0f );
|
||||
final int dmg = (int) Math.ceil( penetration / 20.0f );
|
||||
if( pos.entityHit instanceof EntityLivingBase )
|
||||
{
|
||||
EntityLivingBase el = (EntityLivingBase) pos.entityHit;
|
||||
final EntityLivingBase el = (EntityLivingBase) pos.entityHit;
|
||||
penetration -= dmg;
|
||||
el.knockBack( p, 0, -direction.xCoord, -direction.zCoord );
|
||||
// el.knockBack( p, 0, vec3.xCoord,
|
||||
@@ -427,11 +427,11 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
else
|
||||
{
|
||||
Block b = w.getBlock( pos.blockX, pos.blockY, pos.blockZ );
|
||||
final Block b = w.getBlock( pos.blockX, pos.blockY, pos.blockZ );
|
||||
// int meta = w.getBlockMetadata(
|
||||
// pos.blockX, pos.blockY, pos.blockZ );
|
||||
|
||||
float hardness = b.getBlockHardness( w, pos.blockX, pos.blockY, pos.blockZ ) * 9.0f;
|
||||
final float hardness = b.getBlockHardness( w, pos.blockX, pos.blockY, pos.blockZ ) * 9.0f;
|
||||
if( hardness >= 0.0 )
|
||||
{
|
||||
if( penetration > hardness && Platform.hasPermissions( new DimensionalCoord( w, pos.blockX, pos.blockY, pos.blockZ ), p ) )
|
||||
@@ -450,71 +450,71 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
public boolean isEditable( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
public IInventory getUpgradesInventory( final ItemStack is )
|
||||
{
|
||||
return new CellUpgrades( is, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
public IInventory getConfigInventory( final ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
public FuzzyMode getFuzzyMode( final ItemStack is )
|
||||
{
|
||||
String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
try
|
||||
{
|
||||
return FuzzyMode.valueOf( fz );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes( ItemStack cellItem )
|
||||
public int getBytes( final ItemStack cellItem )
|
||||
{
|
||||
return 512;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int BytePerType( ItemStack cell )
|
||||
public int BytePerType( final ItemStack cell )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytesPerType( ItemStack cellItem )
|
||||
public int getBytesPerType( final ItemStack cellItem )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes( ItemStack cellItem )
|
||||
public int getTotalTypes( final ItemStack cellItem )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition )
|
||||
public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition )
|
||||
{
|
||||
float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() );
|
||||
final float pen = AEApi.instance().registries().matterCannon().getPenetration( requestedAddition.getItemStack() );
|
||||
if( pen > 0 )
|
||||
{
|
||||
return false;
|
||||
@@ -535,7 +535,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell( ItemStack i )
|
||||
public boolean isStorageCell( final ItemStack i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player )
|
||||
public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer player )
|
||||
{
|
||||
Platform.openGUI( player, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_PORTABLE_CELL );
|
||||
return item;
|
||||
@@ -80,15 +80,15 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
|
||||
IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
final IMEInventory<IAEItemStack> cdi = AEApi.instance().registries().cell().getCellInventory( stack, null, StorageChannel.ITEMS );
|
||||
|
||||
if( cdi instanceof CellInventoryHandler )
|
||||
{
|
||||
ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv();
|
||||
final ICellInventory cd = ( (ICellInventoryHandler) cdi ).getCellInv();
|
||||
if( cd != null )
|
||||
{
|
||||
lines.add( cd.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cd.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal() );
|
||||
@@ -98,31 +98,31 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes( ItemStack cellItem )
|
||||
public int getBytes( final ItemStack cellItem )
|
||||
{
|
||||
return 512;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int BytePerType( ItemStack cell )
|
||||
public int BytePerType( final ItemStack cell )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytesPerType( ItemStack cellItem )
|
||||
public int getBytesPerType( final ItemStack cellItem )
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes( ItemStack cellItem )
|
||||
public int getTotalTypes( final ItemStack cellItem )
|
||||
{
|
||||
return 27;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed( ItemStack cellItem, IAEItemStack requestedAddition )
|
||||
public boolean isBlackListed( final ItemStack cellItem, final IAEItemStack requestedAddition )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell( ItemStack i )
|
||||
public boolean isStorageCell( final ItemStack i )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -146,51 +146,51 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedGroupName( Set<ItemStack> others, ItemStack is )
|
||||
public String getUnlocalizedGroupName( final Set<ItemStack> others, final ItemStack is )
|
||||
{
|
||||
return GuiText.StorageCells.getUnlocalized();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable( ItemStack is )
|
||||
public boolean isEditable( final ItemStack is )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory( ItemStack is )
|
||||
public IInventory getUpgradesInventory( final ItemStack is )
|
||||
{
|
||||
return new CellUpgrades( is, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory( ItemStack is )
|
||||
public IInventory getConfigInventory( final ItemStack is )
|
||||
{
|
||||
return new CellConfig( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode( ItemStack is )
|
||||
public FuzzyMode getFuzzyMode( final ItemStack is )
|
||||
{
|
||||
String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
final String fz = Platform.openNbtData( is ).getString( "FuzzyMode" );
|
||||
try
|
||||
{
|
||||
return FuzzyMode.valueOf( fz );
|
||||
}
|
||||
catch( Throwable t )
|
||||
catch( final Throwable t )
|
||||
{
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode( ItemStack is, FuzzyMode fzMode )
|
||||
public void setFuzzyMode( final ItemStack is, final FuzzyMode fzMode )
|
||||
{
|
||||
Platform.openNbtData( is ).setString( "FuzzyMode", fzMode.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiItemObject getGuiObject( ItemStack is, World w, int x, int y, int z )
|
||||
public IGuiItemObject getGuiObject( final ItemStack is, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
return new PortableCellViewer( is, x );
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack item, World w, EntityPlayer player )
|
||||
public ItemStack onItemRightClick( final ItemStack item, final World w, final EntityPlayer player )
|
||||
{
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( item, w, player );
|
||||
return item;
|
||||
@@ -73,16 +73,16 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
super.addCheckedInformation( stack, player, lines, displayMoreInfo );
|
||||
|
||||
if( stack.hasTagCompound() )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( stack );
|
||||
final NBTTagCompound tag = Platform.openNbtData( stack );
|
||||
if( tag != null )
|
||||
{
|
||||
String encKey = tag.getString( "encryptionKey" );
|
||||
final String encKey = tag.getString( "encryptionKey" );
|
||||
|
||||
if( encKey == null || encKey.isEmpty() )
|
||||
{
|
||||
@@ -101,19 +101,19 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHandle( ItemStack is )
|
||||
public boolean canHandle( final ItemStack is )
|
||||
{
|
||||
return AEApi.instance().definitions().items().wirelessTerminal().isSameAs( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usePower( EntityPlayer player, double amount, ItemStack is )
|
||||
public boolean usePower( final EntityPlayer player, final double amount, final ItemStack is )
|
||||
{
|
||||
return this.extractAEPower( is, amount ) >= amount - 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPower( EntityPlayer player, double amt, ItemStack is )
|
||||
public boolean hasPower( final EntityPlayer player, final double amt, final ItemStack is )
|
||||
{
|
||||
return this.getAECurrentPower( is ) >= amt;
|
||||
}
|
||||
@@ -125,9 +125,9 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
{
|
||||
|
||||
@Override
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( target );
|
||||
final NBTTagCompound data = Platform.openNbtData( target );
|
||||
manager.writeToNBT( data );
|
||||
}
|
||||
} );
|
||||
@@ -141,16 +141,16 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncryptionKey( ItemStack item )
|
||||
public String getEncryptionKey( final ItemStack item )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
final NBTTagCompound tag = Platform.openNbtData( item );
|
||||
return tag.getString( "encryptionKey" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncryptionKey( ItemStack item, String encKey, String name )
|
||||
public void setEncryptionKey( final ItemStack item, final String encKey, final String name )
|
||||
{
|
||||
NBTTagCompound tag = Platform.openNbtData( item );
|
||||
final NBTTagCompound tag = Platform.openNbtData( item );
|
||||
tag.setString( "encryptionKey", encKey );
|
||||
tag.setString( "name", name );
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.google.common.base.Optional;
|
||||
|
||||
public abstract class AEBasePoweredItem extends RedstoneFlux
|
||||
{
|
||||
public AEBasePoweredItem( double powerCapacity, Optional<String> subName )
|
||||
public AEBasePoweredItem( final double powerCapacity, final Optional<String> subName )
|
||||
{
|
||||
super( powerCapacity, subName );
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
private static final String POWER_NBT_KEY = "internalCurrentPower";
|
||||
private final double powerCapacity;
|
||||
|
||||
public AERootPoweredItem( double powerCapacity, Optional<String> subName )
|
||||
public AERootPoweredItem( final double powerCapacity, final Optional<String> subName )
|
||||
{
|
||||
super( subName );
|
||||
this.setMaxDamage( 32 );
|
||||
@@ -54,18 +54,18 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayMoreInfo )
|
||||
public void addCheckedInformation( final ItemStack stack, final EntityPlayer player, final List<String> lines, final boolean displayMoreInfo )
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
final NBTTagCompound tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
double internalMaxPower = this.getAEMaxPower( stack );
|
||||
final double internalMaxPower = this.getAEMaxPower( stack );
|
||||
|
||||
if( tag != null )
|
||||
{
|
||||
internalCurrentPower = tag.getDouble( "internalCurrentPower" );
|
||||
}
|
||||
|
||||
double percent = internalCurrentPower / internalMaxPower;
|
||||
final double percent = internalCurrentPower / internalMaxPower;
|
||||
|
||||
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getCheckedSubItems( Item sameItem, CreativeTabs creativeTab, List<ItemStack> itemStacks )
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
super.getCheckedSubItems( sameItem, creativeTab, itemStacks );
|
||||
|
||||
@@ -96,29 +96,29 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay( ItemStack is )
|
||||
public double getDurabilityForDisplay( final ItemStack is )
|
||||
{
|
||||
return 1 - this.getAECurrentPower( is ) / this.getAEMaxPower( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDamaged( ItemStack stack )
|
||||
public boolean isDamaged( final ItemStack stack )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage( ItemStack stack, int damage )
|
||||
public void setDamage( final ItemStack stack, final int damage )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private double getInternalBattery( ItemStack is, batteryOperation op, double adjustment )
|
||||
private double getInternalBattery( final ItemStack is, final batteryOperation op, final double adjustment )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( is );
|
||||
final NBTTagCompound data = Platform.openNbtData( is );
|
||||
|
||||
double currentStorage = data.getDouble( POWER_NBT_KEY );
|
||||
double maxStorage = this.getAEMaxPower( is );
|
||||
final double maxStorage = this.getAEMaxPower( is );
|
||||
|
||||
switch( op )
|
||||
{
|
||||
@@ -126,7 +126,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
currentStorage += adjustment;
|
||||
if( currentStorage > maxStorage )
|
||||
{
|
||||
double diff = currentStorage - maxStorage;
|
||||
final double diff = currentStorage - maxStorage;
|
||||
data.setDouble( POWER_NBT_KEY, maxStorage );
|
||||
return diff;
|
||||
}
|
||||
@@ -151,11 +151,11 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
/**
|
||||
* inject external
|
||||
*/
|
||||
double injectExternalPower( PowerUnits input, ItemStack is, double amount, boolean simulate )
|
||||
double injectExternalPower( final PowerUnits input, final ItemStack is, final double amount, final boolean simulate )
|
||||
{
|
||||
if( simulate )
|
||||
{
|
||||
int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) );
|
||||
final int requiredEU = (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( is ) - this.getAECurrentPower( is ) );
|
||||
if( amount < requiredEU )
|
||||
{
|
||||
return 0;
|
||||
@@ -164,37 +164,37 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
else
|
||||
{
|
||||
double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
final double powerRemainder = this.injectAEPower( is, PowerUnits.EU.convertTo( PowerUnits.AE, amount ) );
|
||||
return PowerUnits.AE.convertTo( PowerUnits.EU, powerRemainder );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectAEPower( ItemStack is, double amt )
|
||||
public double injectAEPower( final ItemStack is, final double amt )
|
||||
{
|
||||
return this.getInternalBattery( is, batteryOperation.INJECT, amt );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower( ItemStack is, double amt )
|
||||
public double extractAEPower( final ItemStack is, final double amt )
|
||||
{
|
||||
return this.getInternalBattery( is, batteryOperation.EXTRACT, amt );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getAEMaxPower( ItemStack is )
|
||||
public double getAEMaxPower( final ItemStack is )
|
||||
{
|
||||
return this.powerCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getAECurrentPower( ItemStack is )
|
||||
public double getAECurrentPower( final ItemStack is )
|
||||
{
|
||||
return this.getInternalBattery( is, batteryOperation.STORAGE, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessRestriction getPowerFlow( ItemStack is )
|
||||
public AccessRestriction getPowerFlow( final ItemStack is )
|
||||
{
|
||||
return AccessRestriction.WRITE;
|
||||
}
|
||||
|
||||
@@ -38,16 +38,16 @@ import appeng.transformer.annotations.Integration.Method;
|
||||
@InterfaceList( value = { @Interface( iface = "ic2.api.item.ISpecialElectricItem", iname = IntegrationType.IC2 ), @Interface( iface = "ic2.api.item.IElectricItemManager", iname = IntegrationType.IC2 ) } )
|
||||
public abstract class IC2 extends AERootPoweredItem implements IElectricItemManager, ISpecialElectricItem
|
||||
{
|
||||
public IC2( double powerCapacity, Optional<String> subName )
|
||||
public IC2( final double powerCapacity, final Optional<String> subName )
|
||||
{
|
||||
super( powerCapacity, subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double charge( ItemStack is, double amount, int tier, boolean ignoreTransferLimit, boolean simulate )
|
||||
public double charge( final ItemStack is, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean simulate )
|
||||
{
|
||||
double addedAmt = amount;
|
||||
double limit = this.getTransferLimit( is );
|
||||
final double limit = this.getTransferLimit( is );
|
||||
|
||||
if( !ignoreTransferLimit && amount > limit )
|
||||
{
|
||||
@@ -58,25 +58,25 @@ public abstract class IC2 extends AERootPoweredItem implements IElectricItemMana
|
||||
}
|
||||
|
||||
@Override
|
||||
public double discharge( ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate )
|
||||
public double discharge( final ItemStack itemStack, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean externally, final boolean simulate )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCharge( ItemStack is )
|
||||
public double getCharge( final ItemStack is )
|
||||
{
|
||||
return (int) PowerUnits.AE.convertTo( PowerUnits.EU, this.getAECurrentPower( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUse( ItemStack is, double amount )
|
||||
public boolean canUse( final ItemStack is, final double amount )
|
||||
{
|
||||
return this.getCharge( is ) > amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean use( ItemStack is, double amount, EntityLivingBase entity )
|
||||
public boolean use( final ItemStack is, final double amount, final EntityLivingBase entity )
|
||||
{
|
||||
if( this.canUse( is, amount ) )
|
||||
{
|
||||
@@ -88,56 +88,56 @@ public abstract class IC2 extends AERootPoweredItem implements IElectricItemMana
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chargeFromArmor( ItemStack itemStack, EntityLivingBase entity )
|
||||
public void chargeFromArmor( final ItemStack itemStack, final EntityLivingBase entity )
|
||||
{
|
||||
// wtf?
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolTip( ItemStack itemStack )
|
||||
public String getToolTip( final ItemStack itemStack )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy( ItemStack itemStack )
|
||||
public boolean canProvideEnergy( final ItemStack itemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem( ItemStack itemStack )
|
||||
public Item getChargedItem( final ItemStack itemStack )
|
||||
{
|
||||
return itemStack.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem( ItemStack itemStack )
|
||||
public Item getEmptyItem( final ItemStack itemStack )
|
||||
{
|
||||
return itemStack.getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxCharge( ItemStack itemStack )
|
||||
public double getMaxCharge( final ItemStack itemStack )
|
||||
{
|
||||
return PowerUnits.AE.convertTo( PowerUnits.EU, this.getAEMaxPower( itemStack ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier( ItemStack itemStack )
|
||||
public int getTier( final ItemStack itemStack )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTransferLimit( ItemStack itemStack )
|
||||
public double getTransferLimit( final ItemStack itemStack )
|
||||
{
|
||||
return Math.max( 32, this.getMaxCharge( itemStack ) / 200 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method( iname = IntegrationType.IC2 )
|
||||
public IElectricItemManager getManager( ItemStack itemStack )
|
||||
public IElectricItemManager getManager( final ItemStack itemStack )
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -33,31 +33,31 @@ import appeng.transformer.annotations.Integration.Interface;
|
||||
@Interface( iface = "cofh.api.energy.IEnergyContainerItem", iname = IntegrationType.RFItem )
|
||||
public abstract class RedstoneFlux extends IC2 implements IEnergyContainerItem
|
||||
{
|
||||
public RedstoneFlux( double powerCapacity, Optional<String> subName )
|
||||
public RedstoneFlux( final double powerCapacity, final Optional<String> subName )
|
||||
{
|
||||
super( powerCapacity, subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy( ItemStack is, int maxReceive, boolean simulate )
|
||||
public int receiveEnergy( final ItemStack is, final int maxReceive, final boolean simulate )
|
||||
{
|
||||
return maxReceive - (int) this.injectExternalPower( PowerUnits.RF, is, maxReceive, simulate );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy( ItemStack container, int maxExtract, boolean simulate )
|
||||
public int extractEnergy( final ItemStack container, final int maxExtract, final boolean simulate )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored( ItemStack is )
|
||||
public int getEnergyStored( final ItemStack is )
|
||||
{
|
||||
return (int) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower( is ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored( ItemStack is )
|
||||
public int getMaxEnergyStored( final ItemStack is )
|
||||
{
|
||||
return (int) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower( is ) );
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature
|
||||
private final AEFeature type;
|
||||
private final IFeatureHandler feature;
|
||||
|
||||
public ToolQuartzAxe( AEFeature type )
|
||||
public ToolQuartzAxe( final AEFeature type )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
this.feature = new ItemFeatureHandler( EnumSet.of( this.type = type, AEFeature.QuartzAxe ), this, this, Optional.of( type.name() ) );
|
||||
@@ -57,7 +57,7 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
public boolean getIsRepairable( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
{
|
||||
private final AEFeature type;
|
||||
|
||||
public ToolQuartzCuttingKnife( AEFeature type )
|
||||
public ToolQuartzCuttingKnife( final AEFeature type )
|
||||
{
|
||||
super( Optional.of( type.name() ) );
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse( ItemStack is, EntityPlayer p, World w, int x, int y, int z, int s, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUse( final ItemStack is, final EntityPlayer p, final World w, final int x, final int y, final int z, final int s, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick( ItemStack it, World w, EntityPlayer p )
|
||||
public ItemStack onItemRightClick( final ItemStack it, final World w, final EntityPlayer p )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -73,13 +73,13 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid( ItemStack par1ItemStack )
|
||||
public boolean doesContainerItemLeaveCraftingGrid( final ItemStack par1ItemStack )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
public boolean getIsRepairable( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
@@ -91,20 +91,20 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem( ItemStack itemStack )
|
||||
public ItemStack getContainerItem( final ItemStack itemStack )
|
||||
{
|
||||
itemStack.setItemDamage( itemStack.getItemDamage() + 1 );
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem( ItemStack stack )
|
||||
public boolean hasContainerItem( final ItemStack stack )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGuiItemObject getGuiObject( ItemStack is, World world, int x, int y, int z )
|
||||
public IGuiItemObject getGuiObject( final ItemStack is, final World world, final int x, final int y, final int z )
|
||||
{
|
||||
return new QuartzKnifeObj( is );
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature
|
||||
private final AEFeature feature;
|
||||
private final IFeatureHandler handler;
|
||||
|
||||
public ToolQuartzHoe( AEFeature feature )
|
||||
public ToolQuartzHoe( final AEFeature feature )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
public boolean getIsRepairable( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( this.feature, a, b );
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature
|
||||
private final AEFeature type;
|
||||
private final IFeatureHandler feature;
|
||||
|
||||
public ToolQuartzPickaxe( AEFeature type )
|
||||
public ToolQuartzPickaxe( final AEFeature type )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
public boolean getIsRepairable( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature
|
||||
private final AEFeature type;
|
||||
private final IFeatureHandler handler;
|
||||
|
||||
public ToolQuartzSpade( AEFeature type )
|
||||
public ToolQuartzSpade( final AEFeature type )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
public boolean getIsRepairable( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature
|
||||
private final AEFeature type;
|
||||
private final IFeatureHandler feature;
|
||||
|
||||
public ToolQuartzSword( AEFeature type )
|
||||
public ToolQuartzSword( final AEFeature type )
|
||||
{
|
||||
super( ToolMaterial.IRON );
|
||||
this.feature = new ItemFeatureHandler( EnumSet.of( this.type = type, AEFeature.QuartzSword ), this, this, Optional.of( type.name() ) );
|
||||
@@ -57,7 +57,7 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable( ItemStack a, ItemStack b )
|
||||
public boolean getIsRepairable( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
return Platform.canRepair( this.type, a, b );
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ import appeng.util.Platform;
|
||||
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWrench
|
||||
{
|
||||
|
||||
public ToolQuartzWrench( AEFeature type )
|
||||
public ToolQuartzWrench( final AEFeature type )
|
||||
{
|
||||
super( Optional.of( type.name() ) );
|
||||
|
||||
@@ -54,9 +54,9 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public boolean onItemUseFirst( final ItemStack is, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
Block b = world.getBlock( x, y, z );
|
||||
final Block b = world.getBlock( x, y, z );
|
||||
if( b != null && !player.isSneaking() && Platform.hasPermissions( new DimensionalCoord( world, x, y, z ), player ) )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
@@ -64,7 +64,7 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren
|
||||
return !world.isRemote;
|
||||
}
|
||||
|
||||
ForgeDirection mySide = ForgeDirection.getOrientation( side );
|
||||
final ForgeDirection mySide = ForgeDirection.getOrientation( side );
|
||||
if( b.rotateBlock( world, x, y, z, mySide ) )
|
||||
{
|
||||
b.onNeighborBlockChange( world, x, y, z, Platform.AIR_BLOCK );
|
||||
@@ -77,25 +77,25 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench, IToolWren
|
||||
|
||||
@Override
|
||||
// public boolean shouldPassSneakingClickToBlock(World w, int x, int y, int z)
|
||||
public boolean doesSneakBypassUse( World world, int x, int y, int z, EntityPlayer player )
|
||||
public boolean doesSneakBypassUse( final World world, final int x, final int y, final int z, final EntityPlayer player )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench( ItemStack is, EntityPlayer player, int x, int y, int z )
|
||||
public boolean canWrench( final ItemStack is, final EntityPlayer player, final int x, final int y, final int z )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrench( EntityPlayer player, int x, int y, int z )
|
||||
public boolean canWrench( final EntityPlayer player, final int x, final int y, final int z )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrenchUsed( EntityPlayer player, int x, int y, int z )
|
||||
public void wrenchUsed( final EntityPlayer player, final int x, final int y, final int z )
|
||||
{
|
||||
player.swingItem();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user