Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,17 +18,20 @@
|
||||
|
||||
package appeng.items.contents;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class CellConfig extends AppEngInternalInventory
|
||||
{
|
||||
|
||||
final ItemStack is;
|
||||
|
||||
public CellConfig(ItemStack is) {
|
||||
public CellConfig( ItemStack is )
|
||||
{
|
||||
super( null, 63 );
|
||||
this.is = is;
|
||||
this.readFromNBT( Platform.openNbtData( is ), "list" );
|
||||
@@ -39,5 +42,4 @@ public class CellConfig extends AppEngInternalInventory
|
||||
{
|
||||
this.writeToNBT( Platform.openNbtData( this.is ), "list" );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.items.contents;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -27,6 +28,7 @@ import appeng.api.networking.IGridHost;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class NetworkToolViewer implements INetworkTool
|
||||
{
|
||||
|
||||
@@ -34,11 +36,12 @@ public class NetworkToolViewer implements INetworkTool
|
||||
final ItemStack is;
|
||||
final IGridHost gh;
|
||||
|
||||
public NetworkToolViewer(ItemStack is, IGridHost gHost) {
|
||||
public NetworkToolViewer( ItemStack is, IGridHost gHost )
|
||||
{
|
||||
this.is = is;
|
||||
this.gh = gHost;
|
||||
this.inv = new AppEngInternalInventory( null, 9 );
|
||||
if ( is.hasTagCompound() ) // prevent crash when opening network status screen.
|
||||
if( is.hasTagCompound() ) // prevent crash when opening network status screen.
|
||||
this.inv.readFromNBT( Platform.openNbtData( is ), "inv" );
|
||||
}
|
||||
|
||||
@@ -49,25 +52,25 @@ public class NetworkToolViewer implements INetworkTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i)
|
||||
public ItemStack getStackInSlot( int i )
|
||||
{
|
||||
return this.inv.getStackInSlot( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j)
|
||||
public ItemStack decrStackSize( int i, int j )
|
||||
{
|
||||
return this.inv.decrStackSize( i, j );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i)
|
||||
public ItemStack getStackInSlotOnClosing( int i )
|
||||
{
|
||||
return this.inv.getStackInSlotOnClosing( i );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack)
|
||||
public void setInventorySlotContents( int i, ItemStack itemstack )
|
||||
{
|
||||
this.inv.setInventorySlotContents( i, itemstack );
|
||||
}
|
||||
@@ -98,7 +101,7 @@ public class NetworkToolViewer implements INetworkTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer)
|
||||
public boolean isUseableByPlayer( EntityPlayer entityplayer )
|
||||
{
|
||||
return this.inv.isUseableByPlayer( entityplayer );
|
||||
}
|
||||
@@ -116,10 +119,9 @@ public class NetworkToolViewer implements INetworkTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
public boolean isItemValidForSlot( int i, ItemStack itemstack )
|
||||
{
|
||||
return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule
|
||||
&& ((IUpgradeModule) itemstack.getItem()).getType( itemstack ) != null;
|
||||
return this.inv.isItemValidForSlot( i, itemstack ) && itemstack.getItem() instanceof IUpgradeModule && ( (IUpgradeModule) itemstack.getItem() ).getType( itemstack ) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,5 +135,4 @@ public class NetworkToolViewer implements INetworkTool
|
||||
{
|
||||
return this.gh;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.items.contents;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -39,13 +40,15 @@ import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implements IPortableCell
|
||||
{
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
|
||||
public PortableCellViewer(ItemStack is) {
|
||||
public PortableCellViewer( ItemStack is )
|
||||
{
|
||||
super( CellInventory.getCell( is, null ) );
|
||||
this.ips = (IAEItemPowerStorage) is.getItem();
|
||||
this.target = is;
|
||||
@@ -58,11 +61,11 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier)
|
||||
public double extractAEPower( double amt, Actionable mode, PowerMultiplier usePowerMultiplier )
|
||||
{
|
||||
amt = usePowerMultiplier.multiply( amt );
|
||||
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
if( mode == Actionable.SIMULATE )
|
||||
{
|
||||
return usePowerMultiplier.divide( Math.min( amt, this.ips.getAECurrentPower( this.target ) ) );
|
||||
}
|
||||
@@ -85,10 +88,11 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
@Override
|
||||
public IConfigManager getConfigManager()
|
||||
{
|
||||
final ConfigManager out = new ConfigManager( new IConfigManagerHost() {
|
||||
final ConfigManager out = new ConfigManager( new IConfigManagerHost()
|
||||
{
|
||||
|
||||
@Override
|
||||
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
|
||||
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
|
||||
{
|
||||
NBTTagCompound data = Platform.openNbtData( PortableCellViewer.this.target );
|
||||
manager.writeToNBT( data );
|
||||
@@ -102,5 +106,4 @@ public class PortableCellViewer extends MEMonitorHandler<IAEItemStack> implement
|
||||
out.readFromNBT( (NBTTagCompound) Platform.openNbtData( this.target ).copy() );
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,16 +18,19 @@
|
||||
|
||||
package appeng.items.contents;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
|
||||
|
||||
public class QuartzKnifeObj implements IGuiItemObject
|
||||
{
|
||||
|
||||
final ItemStack is;
|
||||
|
||||
public QuartzKnifeObj(ItemStack o) {
|
||||
public QuartzKnifeObj( ItemStack o )
|
||||
{
|
||||
this.is = o;
|
||||
}
|
||||
|
||||
@@ -36,5 +39,4 @@ public class QuartzKnifeObj implements IGuiItemObject
|
||||
{
|
||||
return this.is;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user