Merge pull request #1936 from yueh/feature-hide-fields

Make all fields private and creates necessary getters/setters
This commit is contained in:
yueh 2015-10-30 19:02:00 +01:00
commit c83946420e
463 changed files with 5669 additions and 3756 deletions

View File

@ -75,7 +75,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
protected boolean isInventory = false;
private IFeatureHandler handler;
@SideOnly( Side.CLIENT )
BlockRenderInfo renderInfo;
private BlockRenderInfo renderInfo;
protected AEBaseBlock( final Material mat )
{
@ -155,7 +155,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return BaseBlockRender.class;
}
public IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
IIcon unmappedGetIcon( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
return super.getIcon( w, x, y, z, s );
}
@ -276,15 +276,15 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
{
this.setBlockBounds( (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.a, ld.b );
final MovingObjectPosition r = super.collisionRayTrace( w, x, y, z, ld.getA(), ld.getB() );
this.setBlockBounds( 0, 0, 0, 1, 1, 1 );
if( r != null )
{
final double xLen = ( ld.a.xCoord - r.hitVec.xCoord );
final double yLen = ( ld.a.yCoord - r.hitVec.yCoord );
final double zLen = ( ld.a.zCoord - r.hitVec.zCoord );
final double xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
@ -528,7 +528,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
super.getSubBlocks( item, tabs, itemStacks );
}
int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s )
private int mapRotation( final IBlockAccess w, final int x, final int y, final int z, final int s )
{
final IOrientable ori = this.getOrientable( w, x, y, z );
@ -611,7 +611,7 @@ public abstract class AEBaseBlock extends Block implements IAEFeature
return this.getUnlocalizedName();
}
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
{
}

View File

@ -63,7 +63,7 @@ public class AEBaseSlabBlock extends BlockSlab implements IAEFeature
this.features = !this.field_150004_a ? new SlabBlockFeatureHandler( features, this ) : null;
}
public AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
private AEBaseSlabBlock setSlabs( final AEBaseSlabBlock slabs )
{
this.slabs = slabs;
return this;

View File

@ -98,7 +98,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements IAEFeature,
ReflectionHelper.setPrivateValue( Block.class, this, b, "isTileProvider" );
}
public boolean hasBlockTileEntity()
private boolean hasBlockTileEntity()
{
return this.tileEntityType != null;
}

View File

@ -47,7 +47,7 @@ import appeng.util.Platform;
public class BlockCraftingUnit extends AEBaseTileBlock
{
public static final int FLAG_FORMED = 8;
static final int FLAG_FORMED = 8;
public BlockCraftingUnit()
{

View File

@ -41,7 +41,7 @@ import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock
{
public static boolean booleanAlphaPass = false;
private static boolean booleanAlphaPass = false;
public BlockMolecularAssembler()
{
@ -62,7 +62,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
@Override
public boolean canRenderInPass( final int pass )
{
booleanAlphaPass = pass == 1;
setBooleanAlphaPass( pass == 1 );
return pass == 0 || pass == 1;
}
@ -84,4 +84,14 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
}
return false;
}
public static boolean isBooleanAlphaPass()
{
return booleanAlphaPass;
}
private static void setBooleanAlphaPass( final boolean booleanAlphaPass )
{
BlockMolecularAssembler.booleanAlphaPass = booleanAlphaPass;
}
}

View File

@ -71,7 +71,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, x, y, z );
if( cga != null && cga.hasPower && CommonHelper.proxy.shouldAddParticles( r ) )
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
{
final double d0 = r.nextFloat() - 0.5F;
final double d1 = r.nextFloat() - 0.5F;

View File

@ -66,7 +66,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setHardness( 0F );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance(), 16, 4, true );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
}
@Override

View File

@ -64,6 +64,7 @@ import appeng.core.CommonHelper;
import appeng.core.features.AECableBusFeatureHandler;
import appeng.core.features.AEFeature;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.Reflected;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
import appeng.integration.abstraction.IFMP;
@ -82,13 +83,19 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
public static Class<? extends TileEntity> noTesrTile;
public static Class<? extends TileEntity> tesrTile;
private static Class<? extends TileEntity> noTesrTile;
private static Class<? extends TileEntity> tesrTile;
/**
* Immibis MB Support.
*
* It will look for a field named ImmibisMicroblocks_TransformableBlockMarker or
* ImmibisMicroblocks_TransformableTileEntityMarker, modifiers, type, etc can be ignored.
*/
boolean ImmibisMicroblocks_TransformableBlockMarker = true;
int myColorMultiplier = 0xffffff;
@Reflected
private static final boolean ImmibisMicroblocks_TransformableBlockMarker = true;
private int myColorMultiplier = 0xffffff;
public BlockCableBus()
{
@ -396,7 +403,7 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
if( te instanceof TileCableBus )
{
out = ( (TileCableBus) te ).cb;
out = ( (TileCableBus) te ).getCableBus();
}
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
{
@ -516,4 +523,14 @@ public class BlockCableBus extends AEBaseTileBlock implements IRedNetConnection
{
this.myColorMultiplier = color;
}
public static Class<? extends TileEntity> getTesrTile()
{
return BlockCableBus.tesrTile;
}
public static Class<? extends TileEntity> getNoTesrTile()
{
return BlockCableBus.noTesrTile;
}
}

View File

@ -150,12 +150,12 @@ public class OreQuartz extends AEBaseBlock
}
}
public void setBoostBrightnessLow( final int boostBrightnessLow )
void setBoostBrightnessLow( final int boostBrightnessLow )
{
this.boostBrightnessLow = boostBrightnessLow;
}
public void setBoostBrightnessHigh( final int boostBrightnessHigh )
void setBoostBrightnessHigh( final int boostBrightnessHigh )
{
this.boostBrightnessHigh = boostBrightnessHigh;
}

View File

@ -128,7 +128,7 @@ public class ClientHelper extends ServerHelper
@Override
public void bindTileEntitySpecialRenderer( final Class tile, final AEBaseBlock blk )
{
final BaseBlockRender bbr = blk.getRendererInstance().rendererInstance;
final BaseBlockRender bbr = blk.getRendererInstance().getRendererInstance();
if( bbr.hasTESR() && tile != null )
{
ClientRegistry.bindTileEntitySpecialRenderer( tile, new TESRWrapper( bbr ) );

View File

@ -83,17 +83,16 @@ import appeng.integration.abstraction.INEI;
public abstract class AEBaseGui extends GuiContainer
{
public static boolean switchingGuis;
protected final List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
private static boolean switchingGuis;
private final List<InternalSlotME> meSlots = new LinkedList<InternalSlotME>();
// drag y
final Set<Slot> drag_click = new HashSet<Slot>();
final AppEngRenderItem aeRenderItem = new AppEngRenderItem();
protected GuiScrollbar myScrollBar = null;
boolean disableShiftClick = false;
Stopwatch dbl_clickTimer = Stopwatch.createStarted();
ItemStack dbl_whichItem;
Slot bl_clicked;
boolean useNEI = false;
private final Set<Slot> drag_click = new HashSet<Slot>();
private final AppEngRenderItem aeRenderItem = new AppEngRenderItem();
private GuiScrollbar scrollBar = null;
private boolean disableShiftClick = false;
private Stopwatch dbl_clickTimer = Stopwatch.createStarted();
private ItemStack dbl_whichItem;
private Slot bl_clicked;
private boolean subGui;
public AEBaseGui( final Container container )
@ -161,9 +160,9 @@ public abstract class AEBaseGui extends GuiContainer
super.drawScreen( mouseX, mouseY, btn );
final boolean hasClicked = Mouse.isButtonDown( 0 );
if( hasClicked && this.myScrollBar != null )
if( hasClicked && this.scrollBar != null )
{
this.myScrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
this.scrollBar.click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
}
for( final Object c : this.buttonList )
@ -289,9 +288,9 @@ public abstract class AEBaseGui extends GuiContainer
final int oy = this.guiTop; // (height - ySize) / 2;
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
if( this.myScrollBar != null )
if( this.scrollBar != null )
{
this.myScrollBar.draw( this );
this.scrollBar.draw( this );
}
this.drawFG( ox, oy, x, y );
@ -317,14 +316,14 @@ public abstract class AEBaseGui extends GuiContainer
{
if( fs.isEnabled() )
{
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
}
else
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 0.4F );
GL11.glEnable( GL11.GL_BLEND );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glPopAttrib();
}
@ -490,7 +489,7 @@ public abstract class AEBaseGui extends GuiContainer
if( action != null )
{
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).mySlot.id );
final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).getSlot().getId() );
NetworkHandler.instance.sendToServer( p );
}
@ -680,13 +679,13 @@ public abstract class AEBaseGui extends GuiContainer
final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
}
else if( i != 0 && this.myScrollBar != null )
else if( i != 0 && this.scrollBar != null )
{
this.myScrollBar.wheel( i );
this.scrollBar.wheel( i );
}
}
protected void mouseWheelEvent( final int x, final int y, final int wheel )
private void mouseWheelEvent( final int x, final int y, final int wheel )
{
final Slot slot = this.getSlot( x, y );
if( slot instanceof SlotME )
@ -744,22 +743,17 @@ public abstract class AEBaseGui extends GuiContainer
{
if( this.inventorySlots instanceof AEBaseContainer )
{
return ( (AEBaseContainer) this.inventorySlots ).customName != null;
return ( (AEBaseContainer) this.inventorySlots ).getCustomName() != null;
}
return false;
}
private String getInventoryName()
{
return ( (AEBaseContainer) this.inventorySlots ).customName;
return ( (AEBaseContainer) this.inventorySlots ).getCustomName();
}
public void a( final Slot s )
{
this.drawSlot( s );
}
public void drawSlot( final Slot s )
private void drawSlot( final Slot s )
{
if( s instanceof SlotME )
{
@ -779,7 +773,7 @@ public abstract class AEBaseGui extends GuiContainer
this.zLevel = 0.0F;
itemRender.zLevel = 0.0F;
this.aeRenderItem.aeStack = ( (SlotME) s ).getAEStack();
this.aeRenderItem.setAeStack( ( (SlotME) s ).getAEStack() );
this.safeDrawSlot( s );
}
@ -841,7 +835,7 @@ public abstract class AEBaseGui extends GuiContainer
if( is != null && s instanceof AppEngSlot )
{
if( ( (AppEngSlot) s ).isValid == hasCalculatedValidness.NotAvailable )
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.NotAvailable )
{
boolean isValid = s.isItemValid( is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
if( isValid && s instanceof SlotRestrictedInput )
@ -855,10 +849,10 @@ public abstract class AEBaseGui extends GuiContainer
AELog.error( err );
}
}
( (AppEngSlot) s ).isValid = isValid ? hasCalculatedValidness.Valid : hasCalculatedValidness.Invalid;
( (AppEngSlot) s ).setIsValid( isValid ? hasCalculatedValidness.Valid : hasCalculatedValidness.Invalid );
}
if( ( (AppEngSlot) s ).isValid == hasCalculatedValidness.Invalid )
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.Invalid )
{
this.zLevel = 100.0F;
itemRender.zLevel = 100.0F;
@ -874,7 +868,7 @@ public abstract class AEBaseGui extends GuiContainer
if( s instanceof AppEngSlot )
{
( (AppEngSlot) s ).isDisplay = true;
( (AppEngSlot) s ).setDisplay( true );
this.safeDrawSlot( s );
}
else
@ -933,4 +927,29 @@ public abstract class AEBaseGui extends GuiContainer
{
this.drawSlot( s );
}
protected GuiScrollbar getScrollBar()
{
return this.scrollBar;
}
protected void setScrollBar( final GuiScrollbar myScrollBar )
{
this.scrollBar = myScrollBar;
}
protected List<InternalSlotME> getMeSlots()
{
return this.meSlots;
}
public static final synchronized boolean isSwitchingGuis()
{
return switchingGuis;
}
public static final synchronized void setSwitchingGuis( final boolean switchingGuis )
{
AEBaseGui.switchingGuis = switchingGuis;
}
}

View File

@ -47,19 +47,17 @@ import appeng.util.Platform;
public class GuiCellWorkbench extends GuiUpgradeable
{
final ContainerCellWorkbench workbench;
final TileCellWorkbench tcw;
private final ContainerCellWorkbench workbench;
GuiImgButton clear;
GuiImgButton partition;
GuiToggleButton copyMode;
private GuiImgButton clear;
private GuiImgButton partition;
private GuiToggleButton copyMode;
public GuiCellWorkbench( final InventoryPlayer inventoryPlayer, final TileCellWorkbench te )
{
super( new ContainerCellWorkbench( inventoryPlayer, te ) );
this.workbench = (ContainerCellWorkbench) this.inventorySlots;
this.ySize = 251;
this.tcw = te;
}
@Override
@ -135,7 +133,7 @@ public class GuiCellWorkbench extends GuiUpgradeable
@Override
protected void handleButtonVisibility()
{
this.copyMode.setState( this.workbench.copyMode == CopyMode.CLEAR_ON_REMOVE );
this.copyMode.setState( this.workbench.getCopyMode() == CopyMode.CLEAR_ON_REMOVE );
boolean hasFuzzy = false;
final IInventory inv = this.workbench.getCellUpgradeInventory();

View File

@ -35,7 +35,7 @@ import appeng.tile.storage.TileChest;
public class GuiChest extends AEBaseGui
{
GuiTabButton priority;
private GuiTabButton priority;
public GuiChest( final InventoryPlayer inventoryPlayer, final TileChest te )
{

View File

@ -39,9 +39,9 @@ import appeng.tile.misc.TileCondenser;
public class GuiCondenser extends AEBaseGui
{
final ContainerCondenser cvc;
GuiProgressBar pb;
GuiImgButton mode;
private final ContainerCondenser cvc;
private GuiProgressBar pb;
private GuiImgButton mode;
public GuiCondenser( final InventoryPlayer inventoryPlayer, final TileCondenser te )
{
@ -70,7 +70,7 @@ public class GuiCondenser extends AEBaseGui
this.pb = new GuiProgressBar( this.cvc, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal() );
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.output );
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.getOutput() );
this.buttonList.add( this.pb );
this.buttonList.add( this.mode );
@ -82,8 +82,8 @@ public class GuiCondenser extends AEBaseGui
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
this.mode.set( this.cvc.output );
this.mode.fillVar = String.valueOf( this.cvc.output.requiredPower );
this.mode.set( this.cvc.getOutput() );
this.mode.setFillVar( String.valueOf( this.cvc.getOutput().requiredPower ) );
}
@Override

View File

@ -58,28 +58,30 @@ import appeng.util.Platform;
public class GuiCraftConfirm extends AEBaseGui
{
final ContainerCraftConfirm ccc;
private final ContainerCraftConfirm ccc;
final int rows = 5;
private final int rows = 5;
final IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
final IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
final IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
private final IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
private final IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
private final IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
final List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
private final List<IAEItemStack> visual = new ArrayList<IAEItemStack>();
GuiBridge OriginalGui;
GuiButton cancel;
GuiButton start;
GuiButton selectCPU;
int tooltip = -1;
private GuiBridge OriginalGui;
private GuiButton cancel;
private GuiButton start;
private GuiButton selectCPU;
private int tooltip = -1;
public GuiCraftConfirm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( new ContainerCraftConfirm( inventoryPlayer, te ) );
this.xSize = 238;
this.ySize = 206;
this.myScrollBar = new GuiScrollbar();
final GuiScrollbar scrollbar = new GuiScrollbar();
this.setScrollBar( scrollbar );
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
@ -106,7 +108,7 @@ public class GuiCraftConfirm extends AEBaseGui
boolean isAutoStart()
{
return ( (ContainerCraftConfirm) this.inventorySlots ).autoStart;
return ( (ContainerCraftConfirm) this.inventorySlots ).isAutoStart();
}
@Override
@ -135,7 +137,7 @@ public class GuiCraftConfirm extends AEBaseGui
{
this.updateCPUButtonText();
this.start.enabled = !( this.ccc.noCPU || this.isSimulation() );
this.start.enabled = !( this.ccc.hasNoCPU() || this.isSimulation() );
this.selectCPU.enabled = !this.isSimulation();
final int gx = ( this.width - this.xSize ) / 2;
@ -175,20 +177,20 @@ public class GuiCraftConfirm extends AEBaseGui
private void updateCPUButtonText()
{
String btnTextText = GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic.getLocal();
if( this.ccc.selectedCpu >= 0 )// && status.selectedCpu < status.cpus.size() )
if( this.ccc.getSelectedCpu() >= 0 )// && status.selectedCpu < status.cpus.size() )
{
if( this.ccc.myName.length() > 0 )
if( this.ccc.getName().length() > 0 )
{
final String name = this.ccc.myName.substring( 0, Math.min( 20, this.ccc.myName.length() ) );
final String name = this.ccc.getName().substring( 0, Math.min( 20, this.ccc.getName().length() ) );
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
}
else
{
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.selectedCpu;
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.getSelectedCpu();
}
}
if( this.ccc.noCPU )
if( this.ccc.hasNoCPU() )
{
btnTextText = GuiText.NoCraftingCPUs.getLocal();
}
@ -196,15 +198,15 @@ public class GuiCraftConfirm extends AEBaseGui
this.selectCPU.displayString = btnTextText;
}
boolean isSimulation()
private boolean isSimulation()
{
return ( (ContainerCraftConfirm) this.inventorySlots ).simulation;
return ( (ContainerCraftConfirm) this.inventorySlots ).isSimulation();
}
@Override
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
final long BytesUsed = this.ccc.bytesUsed;
final long BytesUsed = this.ccc.getUsedBytes();
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
this.fontRendererObj.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
@ -217,7 +219,7 @@ public class GuiCraftConfirm extends AEBaseGui
}
else
{
dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
dsp = this.ccc.getCpuAvailableBytes() > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.getCpuAvailableBytes() + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.getCpuCoProcessors() ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
}
final int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
@ -229,7 +231,7 @@ public class GuiCraftConfirm extends AEBaseGui
int y = 0;
final int xo = 9;
final int yo = 22;
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
final int viewStart = this.getScrollBar().getCurrentScroll() * 3;
final int viewEnd = viewStart + 3 * this.rows;
String dspToolTip = "";
@ -399,8 +401,8 @@ public class GuiCraftConfirm extends AEBaseGui
{
final int size = this.visual.size();
this.myScrollBar.setTop( 19 ).setLeft( 218 ).setHeight( 114 );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
this.getScrollBar().setTop( 19 ).setLeft( 218 ).setHeight( 114 );
this.getScrollBar().setRange( 0, ( size + 2 ) / 3 - this.rows, 1 );
}
public void postUpdate( final List<IAEItemStack> list, final byte ref )

View File

@ -103,7 +103,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
this.craftingCpu = container;
this.ySize = GUI_HEIGHT;
this.xSize = GUI_WIDTH;
this.myScrollBar = new GuiScrollbar();
final GuiScrollbar scrollbar = new GuiScrollbar();
this.setScrollBar( scrollbar );
}
public void clearItems()
@ -145,8 +147,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
final int size = this.visual.size();
this.myScrollBar.setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
this.myScrollBar.setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
this.getScrollBar().setTop( SCROLLBAR_TOP ).setLeft( SCROLLBAR_LEFT ).setHeight( SCROLLBAR_HEIGHT );
this.getScrollBar().setRange( 0, ( size + 2 ) / 3 - DISPLAYED_ROWS, 1 );
}
@Override
@ -193,9 +195,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
String title = this.getGuiDisplayName( GuiText.CraftingStatus.getLocal() );
if( this.craftingCpu.eta > 0 && !this.visual.isEmpty() )
if( this.craftingCpu.getEstimatedTime() > 0 && !this.visual.isEmpty() )
{
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.eta, TimeUnit.NANOSECONDS );
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert( this.craftingCpu.getEstimatedTime(), TimeUnit.NANOSECONDS );
final String etaTimeText = DurationFormatUtils.formatDuration( etaInMilliseconds, GuiText.ETAFormat.getLocal() );
title += " - " + etaTimeText;
}
@ -204,7 +206,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
int x = 0;
int y = 0;
final int viewStart = this.myScrollBar.getCurrentScroll() * 3;
final int viewStart = this.getScrollBar().getCurrentScroll() * 3;
final int viewEnd = viewStart + 3 * 6;
String dspToolTip = "";

View File

@ -52,12 +52,12 @@ import appeng.parts.reporting.PartTerminal;
public class GuiCraftingStatus extends GuiCraftingCPU
{
final ContainerCraftingStatus status;
GuiButton selectCPU;
private final ContainerCraftingStatus status;
private GuiButton selectCPU;
GuiTabButton originalGuiBtn;
GuiBridge originalGui;
ItemStack myIcon = null;
private GuiTabButton originalGuiBtn;
private GuiBridge originalGui;
private ItemStack myIcon = null;
public GuiCraftingStatus( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
@ -143,7 +143,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU
if( this.myIcon != null )
{
this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, this.myIcon, this.myIcon.getDisplayName(), itemRender ) );
this.originalGuiBtn.hideEdge = 13;
this.originalGuiBtn.setHideEdge( 13 );
}
}

View File

@ -39,12 +39,12 @@ import appeng.helpers.InventoryAction;
public class GuiCraftingTerm extends GuiMEMonitorable
{
GuiImgButton clearBtn;
private GuiImgButton clearBtn;
public GuiCraftingTerm( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new ContainerCraftingTerm( inventoryPlayer, te ) );
this.reservedSpace = 73;
this.setReservedSpace( 73 );
}
@Override
@ -77,14 +77,14 @@ public class GuiCraftingTerm extends GuiMEMonitorable
{
super.initGui();
this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) );
this.clearBtn.halfSize = true;
this.clearBtn.setHalfSize( true );
}
@Override
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 );
this.fontRendererObj.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
}
@Override

View File

@ -35,7 +35,7 @@ import appeng.tile.storage.TileDrive;
public class GuiDrive extends AEBaseGui
{
GuiTabButton priority;
private GuiTabButton priority;
public GuiDrive( final InventoryPlayer inventoryPlayer, final TileDrive te )
{

View File

@ -41,8 +41,8 @@ import appeng.parts.automation.PartFormationPlane;
public class GuiFormationPlane extends GuiUpgradeable
{
GuiTabButton priority;
GuiImgButton placeMode;
private GuiTabButton priority;
private GuiImgButton placeMode;
public GuiFormationPlane( final InventoryPlayer inventoryPlayer, final PartFormationPlane te )
{
@ -70,12 +70,12 @@ public class GuiFormationPlane extends GuiUpgradeable
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
this.fuzzyMode.set( this.cvb.getFuzzyMode() );
}
if( this.placeMode != null )
{
this.placeMode.set( ( (ContainerFormationPlane) this.cvb ).placeMode );
this.placeMode.set( ( (ContainerFormationPlane) this.cvb ).getPlaceMode() );
}
}

View File

@ -42,8 +42,8 @@ import appeng.tile.storage.TileIOPort;
public class GuiIOPort extends GuiUpgradeable
{
GuiImgButton fullMode;
GuiImgButton operationMode;
private GuiImgButton fullMode;
private GuiImgButton operationMode;
public GuiIOPort( final InventoryPlayer inventoryPlayer, final TileIOPort te )
{
@ -71,17 +71,17 @@ public class GuiIOPort extends GuiUpgradeable
if( this.redstoneMode != null )
{
this.redstoneMode.set( this.cvb.rsMode );
this.redstoneMode.set( this.cvb.getRedStoneMode() );
}
if( this.operationMode != null )
{
this.operationMode.set( ( (ContainerIOPort) this.cvb ).opMode );
this.operationMode.set( ( (ContainerIOPort) this.cvb ).getOperationMode() );
}
if( this.fullMode != null )
{
this.fullMode.set( ( (ContainerIOPort) this.cvb ).fMode );
this.fullMode.set( ( (ContainerIOPort) this.cvb ).getFullMode() );
}
}

View File

@ -33,8 +33,8 @@ import appeng.tile.misc.TileInscriber;
public class GuiInscriber extends AEBaseGui
{
final ContainerInscriber cvc;
GuiProgressBar pb;
private final ContainerInscriber cvc;
private GuiProgressBar pb;
public GuiInscriber( final InventoryPlayer inventoryPlayer, final TileInscriber te )
{
@ -44,7 +44,7 @@ public class GuiInscriber extends AEBaseGui
this.xSize = this.hasToolbox() ? 246 : 211;
}
protected boolean hasToolbox()
private boolean hasToolbox()
{
return ( (ContainerUpgradeable) this.inventorySlots ).hasToolbox();
}
@ -86,7 +86,7 @@ public class GuiInscriber extends AEBaseGui
}
}
protected boolean drawUpgrades()
private boolean drawUpgrades()
{
return true;
}

View File

@ -41,9 +41,9 @@ import appeng.helpers.IInterfaceHost;
public class GuiInterface extends GuiUpgradeable
{
GuiTabButton priority;
GuiImgButton BlockMode;
GuiToggleButton interfaceMode;
private GuiTabButton priority;
private GuiImgButton BlockMode;
private GuiToggleButton interfaceMode;
public GuiInterface( final InventoryPlayer inventoryPlayer, final IInterfaceHost te )
{
@ -69,12 +69,12 @@ public class GuiInterface extends GuiUpgradeable
{
if( this.BlockMode != null )
{
this.BlockMode.set( ( (ContainerInterface) this.cvb ).bMode );
this.BlockMode.set( ( (ContainerInterface) this.cvb ).getBlockingMode() );
}
if( this.interfaceMode != null )
{
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).iTermMode == YesNo.YES );
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).getInterfaceTerminalMode() == YesNo.YES );
}
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );

View File

@ -55,7 +55,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
private static final int LINES_ON_PAGE = 6;
// TODO: copied from GuiMEMonitorable. It looks not changed, maybe unneeded?
final int offsetX = 9;
private final int offsetX = 9;
private final HashMap<Long, ClientDCInternalInv> byId = new HashMap<Long, ClientDCInternalInv>();
private final HashMultimap<String, ClientDCInternalInv> byName = HashMultimap.create();
@ -70,7 +70,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
public GuiInterfaceTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceTerminal te )
{
super( new ContainerInterfaceTerminal( inventoryPlayer, te ) );
this.myScrollBar = new GuiScrollbar();
final GuiScrollbar scrollbar = new GuiScrollbar();
this.setScrollBar( scrollbar );
this.xSize = 195;
this.ySize = 222;
}
@ -80,9 +82,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
{
super.initGui();
this.myScrollBar.setLeft( 175 );
this.myScrollBar.setHeight( 106 );
this.myScrollBar.setTop( 18 );
this.getScrollBar().setLeft( 175 );
this.getScrollBar().setHeight( 106 );
this.getScrollBar().setTop( 18 );
this.searchField = new MEGuiTextField( this.fontRendererObj, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 );
this.searchField.setEnableBackgroundDrawing( false );
@ -98,7 +100,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
final int ex = this.myScrollBar.getCurrentScroll();
final int ex = this.getScrollBar().getCurrentScroll();
final Iterator<Object> o = this.inventorySlots.inventorySlots.iterator();
while( o.hasNext() )
@ -116,7 +118,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
if( lineObj instanceof ClientDCInternalInv )
{
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
for( int z = 0; z < inv.inv.getSizeInventory(); z++ )
for( int z = 0; z < inv.getInventory().getSizeInventory(); z++ )
{
this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z, z * 18 + 8, 1 + offset ) );
}
@ -162,7 +164,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
int offset = 17;
final int ex = this.myScrollBar.getCurrentScroll();
final int ex = this.getScrollBar().getCurrentScroll();
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
{
@ -172,7 +174,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
GL11.glColor4f( 1, 1, 1, 1 );
final int width = inv.inv.getSizeInventory() * 18;
final int width = inv.getInventory().getSizeInventory() * 18;
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
}
offset += 18;
@ -224,12 +226,12 @@ public class GuiInterfaceTerminal extends AEBaseGui
final NBTTagCompound invData = in.getCompoundTag( key );
final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
for( int x = 0; x < current.inv.getSizeInventory(); x++ )
for( int x = 0; x < current.getInventory().getSizeInventory(); x++ )
{
final String which = Integer.toString( x );
if( invData.hasKey( which ) )
{
current.inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) );
current.getInventory().setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) );
}
}
}
@ -276,7 +278,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
// Search if the current inventory holds a pattern containing the search term.
if( !found && !searchFilterLowerCase.isEmpty() )
{
for( final ItemStack itemStack : entry.inv )
for( final ItemStack itemStack : entry.getInventory() )
{
found = this.itemStackMatchesSearchTerm( itemStack, searchFilterLowerCase );
if( found )
@ -317,7 +319,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
this.lines.addAll( clientInventories );
}
this.myScrollBar.setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 );
this.getScrollBar().setRange( 0, this.lines.size() - LINES_ON_PAGE, 2 );
}
private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm )

View File

@ -47,19 +47,19 @@ import appeng.parts.automation.PartLevelEmitter;
public class GuiLevelEmitter extends GuiUpgradeable
{
GuiNumberBox level;
private GuiNumberBox level;
GuiButton plus1;
GuiButton plus10;
GuiButton plus100;
GuiButton plus1000;
GuiButton minus1;
GuiButton minus10;
GuiButton minus100;
GuiButton minus1000;
private GuiButton plus1;
private GuiButton plus10;
private GuiButton plus100;
private GuiButton plus1000;
private GuiButton minus1;
private GuiButton minus10;
private GuiButton minus100;
private GuiButton minus1000;
GuiImgButton levelMode;
GuiImgButton craftingMode;
private GuiImgButton levelMode;
private GuiImgButton craftingMode;
public GuiLevelEmitter( final InventoryPlayer inventoryPlayer, final PartLevelEmitter te )
{
@ -131,12 +131,12 @@ public class GuiLevelEmitter extends GuiUpgradeable
if( this.craftingMode != null )
{
this.craftingMode.set( ( (ContainerLevelEmitter) this.cvb ).cmType );
this.craftingMode.set( ( (ContainerLevelEmitter) this.cvb ).getCraftingMode() );
}
if( this.levelMode != null )
{
this.levelMode.set( ( (ContainerLevelEmitter) this.cvb ).lvType );
this.levelMode.set( ( (ContainerLevelEmitter) this.cvb ).getLevelMode() );
}
}

View File

@ -34,8 +34,8 @@ import appeng.tile.crafting.TileMolecularAssembler;
public class GuiMAC extends GuiUpgradeable
{
final ContainerMAC container;
GuiProgressBar pb;
private final ContainerMAC container;
private GuiProgressBar pb;
public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te )
{

View File

@ -71,30 +71,31 @@ import appeng.util.Platform;
public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfigManagerHost
{
public static int CraftingGridOffsetX;
public static int CraftingGridOffsetY;
public static int craftingGridOffsetX;
public static int craftingGridOffsetY;
private static String memoryText = "";
final ItemRepo repo;
final int offsetX = 9;
final int lowerTextureOffset = 0;
final IConfigManager configSrc;
final boolean viewCell;
final ItemStack[] myCurrentViewCells = new ItemStack[5];
final ContainerMEMonitorable monitorableContainer;
GuiTabButton craftingStatusBtn;
MEGuiTextField searchField;
GuiText myName;
int perRow = 9;
int reservedSpace = 0;
boolean customSortOrder = true;
int rows = 0;
int maxRows = Integer.MAX_VALUE;
int standardSize;
GuiImgButton ViewBox;
GuiImgButton SortByBox;
GuiImgButton SortDirBox;
GuiImgButton searchBoxSettings;
GuiImgButton terminalStyleBox;
private final ItemRepo repo;
private final int offsetX = 9;
private final int lowerTextureOffset = 0;
private final IConfigManager configSrc;
private final boolean viewCell;
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
private final ContainerMEMonitorable monitorableContainer;
private GuiTabButton craftingStatusBtn;
private MEGuiTextField searchField;
private GuiText myName;
private int perRow = 9;
private int reservedSpace = 0;
private boolean customSortOrder = true;
private int rows = 0;
private int maxRows = Integer.MAX_VALUE;
private int standardSize;
private GuiImgButton ViewBox;
private GuiImgButton SortByBox;
private GuiImgButton SortDirBox;
private GuiImgButton searchBoxSettings;
private GuiImgButton terminalStyleBox;
public GuiMEMonitorable( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
@ -105,8 +106,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
{
super( c );
this.myScrollBar = new GuiScrollbar();
this.repo = new ItemRepo( this.myScrollBar, this );
final GuiScrollbar scrollbar = new GuiScrollbar();
this.setScrollBar( scrollbar );
this.repo = new ItemRepo( scrollbar, this );
this.xSize = 185;
this.ySize = 204;
@ -119,7 +122,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.standardSize = this.xSize;
this.configSrc = ( (IConfigurableObject) this.inventorySlots ).getConfigManager();
( this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots ).gui = this;
( this.monitorableContainer = (ContainerMEMonitorable) this.inventorySlots ).setGui( this );
this.viewCell = te instanceof IViewCellStorage;
@ -158,8 +161,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
private void setScrollBar()
{
this.myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( this.rows * 18 - 2 );
this.myScrollBar.setRange( 0, ( this.repo.size() + this.perRow - 1 ) / this.perRow - this.rows, Math.max( 1, this.rows / 6 ) );
this.getScrollBar().setTop( 18 ).setLeft( 175 ).setHeight( this.rows * 18 - 2 );
this.getScrollBar().setRange( 0, ( this.repo.size() + this.perRow - 1 ) / this.perRow - this.rows, Math.max( 1, this.rows / 6 ) );
}
@Override
@ -204,13 +207,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
{
this.re_init();
this.reinitalize();
}
}
}
}
public void re_init()
private void reinitalize()
{
this.buttonList.clear();
this.initGui();
@ -249,12 +252,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.rows = 3;
}
this.meSlots.clear();
this.getMeSlots().clear();
for( int y = 0; y < this.rows; y++ )
{
for( int x = 0; x < this.perRow; x++ )
{
this.meSlots.add( new InternalSlotME( this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18 ) );
this.getMeSlots().add( new InternalSlotME( this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18 ) );
}
}
@ -311,7 +314,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( this.viewCell || this instanceof GuiWirelessTerm )
{
this.buttonList.add( this.craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus.getLocal(), itemRender ) );
this.craftingStatusBtn.hideEdge = 13;
this.craftingStatusBtn.setHideEdge( 13 );
}
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
@ -321,13 +324,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( this.isSubGui() )
{
this.searchField.setText( memoryText );
this.repo.searchString = memoryText;
this.repo.setSearchString( memoryText );
this.repo.updateView();
this.setScrollBar();
}
CraftingGridOffsetX = Integer.MAX_VALUE;
CraftingGridOffsetY = Integer.MAX_VALUE;
craftingGridOffsetX = Integer.MAX_VALUE;
craftingGridOffsetY = Integer.MAX_VALUE;
for( final Object s : this.inventorySlots.inventorySlots )
{
@ -344,14 +347,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
final Slot g = (Slot) s;
if( g.xDisplayPosition > 0 && g.yDisplayPosition > 0 )
{
CraftingGridOffsetX = Math.min( CraftingGridOffsetX, g.xDisplayPosition );
CraftingGridOffsetY = Math.min( CraftingGridOffsetY, g.yDisplayPosition );
craftingGridOffsetX = Math.min( craftingGridOffsetX, g.xDisplayPosition );
craftingGridOffsetY = Math.min( craftingGridOffsetY, g.yDisplayPosition );
}
}
}
CraftingGridOffsetX -= 25;
CraftingGridOffsetY -= 6;
craftingGridOffsetX -= 25;
craftingGridOffsetY -= 6;
}
@Override
@ -374,7 +377,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( btn == 1 && this.searchField.isMouseIn( xCoord, yCoord ) )
{
this.searchField.setText( "" );
this.repo.searchString = "";
this.repo.setSearchString( "" );
this.repo.updateView();
this.setScrollBar();
}
@ -416,10 +419,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
for( int i = 0; i < 5; i++ )
{
if( this.myCurrentViewCells[i] != this.monitorableContainer.cellView[i].getStack() )
if( this.myCurrentViewCells[i] != this.monitorableContainer.getCellViewSlot( i ).getStack() )
{
update = true;
this.myCurrentViewCells[i] = this.monitorableContainer.cellView[i].getStack();
this.myCurrentViewCells[i] = this.monitorableContainer.getCellViewSlot( i ).getStack();
}
}
@ -453,7 +456,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
protected void repositionSlot( final AppEngSlot s )
{
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
s.yDisplayPosition = s.getY() + this.ySize - 78 - 5;
}
@Override
@ -468,7 +471,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( this.searchField.textboxKeyTyped( character, key ) )
{
this.repo.searchString = this.searchField.getText();
this.repo.setSearchString( this.searchField.getText() );
this.repo.updateView();
this.setScrollBar();
}
@ -482,7 +485,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
@Override
public void updateScreen()
{
this.repo.setPower( this.monitorableContainer.hasPower );
this.repo.setPower( this.monitorableContainer.isPowered() );
super.updateScreen();
}
@ -524,4 +527,34 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.repo.updateView();
}
int getReservedSpace()
{
return this.reservedSpace;
}
void setReservedSpace( final int reservedSpace )
{
this.reservedSpace = reservedSpace;
}
public boolean isCustomSortOrder()
{
return this.customSortOrder;
}
void setCustomSortOrder( final boolean customSortOrder )
{
this.customSortOrder = customSortOrder;
}
public int getStandardSize()
{
return this.standardSize;
}
void setStandardSize( final int standardSize )
{
this.standardSize = standardSize;
}
}

View File

@ -50,19 +50,21 @@ import appeng.util.Platform;
public class GuiNetworkStatus extends AEBaseGui implements ISortSource
{
final ItemRepo repo;
final int rows = 4;
GuiImgButton units;
int tooltip = -1;
private final ItemRepo repo;
private final int rows = 4;
private GuiImgButton units;
private int tooltip = -1;
public GuiNetworkStatus( final InventoryPlayer inventoryPlayer, final INetworkTool te )
{
super( new ContainerNetworkStatus( inventoryPlayer, te ) );
final GuiScrollbar scrollbar = new GuiScrollbar();
this.setScrollBar( scrollbar );
this.repo = new ItemRepo( scrollbar, this );
this.ySize = 153;
this.xSize = 195;
this.myScrollBar = new GuiScrollbar();
this.repo = new ItemRepo( this.myScrollBar, this );
this.repo.rowSize = 5;
this.repo.setRowSize( 5 );
}
@Override
@ -132,11 +134,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
this.fontRendererObj.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.currentPower, false ), 13, 16, 4210752 );
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.maxPower, false ), 13, 26, 4210752 );
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.getCurrentPower(), false ), 13, 16, 4210752 );
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.getMaxPower(), false ), 13, 26, 4210752 );
this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.avgAddition, true ), 13, 143 - 10, 4210752 );
this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.powerUsage, true ), 13, 143 - 20, 4210752 );
this.fontRendererObj.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.getAverageAddition(), true ), 13, 143 - 10, 4210752 );
this.fontRendererObj.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.getPowerUsage(), true ), 13, 143 - 20, 4210752 );
final int sectionLength = 30;
@ -229,8 +231,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
private void setScrollBar()
{
final int size = this.repo.size();
this.myScrollBar.setTop( 39 ).setLeft( 175 ).setHeight( 78 );
this.myScrollBar.setRange( 0, ( size + 4 ) / 5 - this.rows, 1 );
this.getScrollBar().setTop( 39 ).setLeft( 175 ).setHeight( 78 );
this.getScrollBar().setRange( 0, ( size + 4 ) / 5 - this.rows, 1 );
}
// @Override - NEI

View File

@ -37,7 +37,7 @@ import appeng.core.sync.packets.PacketValueConfig;
public class GuiNetworkTool extends AEBaseGui
{
GuiToggleButton tFacades;
private GuiToggleButton tFacades;
public GuiNetworkTool( final InventoryPlayer inventoryPlayer, final INetworkTool te )
{
@ -78,7 +78,7 @@ public class GuiNetworkTool extends AEBaseGui
{
if( this.tFacades != null )
{
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).facadeMode );
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).isFacadeMode() );
}
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );

View File

@ -61,7 +61,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
{
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
this.container = (ContainerPatternTerm) this.inventorySlots;
this.reservedSpace = 81;
this.setReservedSpace( 81 );
}
@Override
@ -110,15 +110,15 @@ public class GuiPatternTerm extends GuiMEMonitorable
this.buttonList.add( this.tabProcessButton );
this.substitutionsEnabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED );
this.substitutionsEnabledBtn.halfSize = true;
this.substitutionsEnabledBtn.setHalfSize( true );
this.buttonList.add( this.substitutionsEnabledBtn );
this.substitutionsDisabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED );
this.substitutionsDisabledBtn.halfSize = true;
this.substitutionsDisabledBtn.setHalfSize( true );
this.buttonList.add( this.substitutionsDisabledBtn );
this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE );
this.clearBtn.halfSize = true;
this.clearBtn.setHalfSize( true );
this.buttonList.add( this.clearBtn );
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
@ -128,7 +128,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
@Override
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
if( !this.container.craftingMode )
if( !this.container.isCraftingMode() )
{
this.tabCraftButton.visible = false;
this.tabProcessButton.visible = true;
@ -151,13 +151,13 @@ public class GuiPatternTerm extends GuiMEMonitorable
}
super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.reservedSpace, 4210752 );
this.fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.getReservedSpace(), 4210752 );
}
@Override
protected String getBackground()
{
if( this.container.craftingMode )
if( this.container.isCraftingMode() )
{
return "guis/pattern.png";
}
@ -169,11 +169,11 @@ public class GuiPatternTerm extends GuiMEMonitorable
{
if( s.isPlayerSide() )
{
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
s.yDisplayPosition = s.getY() + this.ySize - 78 - 5;
}
else
{
s.yDisplayPosition = s.defY + this.ySize - 78 - 3;
s.yDisplayPosition = s.getY() + this.ySize - 78 - 3;
}
}
}

View File

@ -53,19 +53,19 @@ import appeng.tile.storage.TileDrive;
public class GuiPriority extends AEBaseGui
{
GuiNumberBox priority;
GuiTabButton originalGuiBtn;
private GuiNumberBox priority;
private GuiTabButton originalGuiBtn;
GuiButton plus1;
GuiButton plus10;
GuiButton plus100;
GuiButton plus1000;
GuiButton minus1;
GuiButton minus10;
GuiButton minus100;
GuiButton minus1000;
private GuiButton plus1;
private GuiButton plus10;
private GuiButton plus100;
private GuiButton plus1000;
private GuiButton minus1;
private GuiButton minus10;
private GuiButton minus100;
private GuiButton minus1000;
GuiBridge OriginalGui;
private GuiBridge OriginalGui;
public GuiPriority( final InventoryPlayer inventoryPlayer, final IPriorityHost te )
{

View File

@ -36,7 +36,7 @@ import appeng.items.contents.QuartzKnifeObj;
public class GuiQuartzKnife extends AEBaseGui
{
GuiTextField name;
private GuiTextField name;
public GuiQuartzKnife( final InventoryPlayer inventoryPlayer, final QuartzKnifeObj te )
{

View File

@ -37,21 +37,21 @@ import appeng.core.sync.packets.PacketValueConfig;
public class GuiSecurity extends GuiMEMonitorable
{
GuiToggleButton inject;
GuiToggleButton extract;
GuiToggleButton craft;
GuiToggleButton build;
GuiToggleButton security;
private GuiToggleButton inject;
private GuiToggleButton extract;
private GuiToggleButton craft;
private GuiToggleButton build;
private GuiToggleButton security;
public GuiSecurity( final InventoryPlayer inventoryPlayer, final ITerminalHost te )
{
super( inventoryPlayer, te, new ContainerSecurity( inventoryPlayer, te ) );
this.customSortOrder = false;
this.reservedSpace = 33;
this.setCustomSortOrder( false );
this.setReservedSpace( 33 );
// increase size so that the slot is over the gui.
this.xSize += 56;
this.standardSize = this.xSize;
this.setStandardSize( this.xSize );
}
@Override
@ -116,7 +116,7 @@ public class GuiSecurity extends GuiMEMonitorable
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
super.drawFG( offsetX, offsetY, mouseX, mouseY );
this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.reservedSpace, 4210752 );
this.fontRendererObj.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
}
@Override
@ -124,11 +124,11 @@ public class GuiSecurity extends GuiMEMonitorable
{
final ContainerSecurity cs = (ContainerSecurity) this.inventorySlots;
this.inject.setState( ( cs.security & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
this.extract.setState( ( cs.security & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
this.craft.setState( ( cs.security & ( 1 << SecurityPermissions.CRAFT.ordinal() ) ) > 0 );
this.build.setState( ( cs.security & ( 1 << SecurityPermissions.BUILD.ordinal() ) ) > 0 );
this.security.setState( ( cs.security & ( 1 << SecurityPermissions.SECURITY.ordinal() ) ) > 0 );
this.inject.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.INJECT.ordinal() ) ) > 0 );
this.extract.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.EXTRACT.ordinal() ) ) > 0 );
this.craft.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.CRAFT.ordinal() ) ) > 0 );
this.build.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.BUILD.ordinal() ) ) > 0 );
this.security.setState( ( cs.getPermissionMode() & ( 1 << SecurityPermissions.SECURITY.ordinal() ) ) > 0 );
return "guis/security.png";
}

View File

@ -37,8 +37,8 @@ import appeng.util.Platform;
public class GuiSpatialIOPort extends AEBaseGui
{
final ContainerSpatialIOPort container;
GuiImgButton units;
private final ContainerSpatialIOPort container;
private GuiImgButton units;
public GuiSpatialIOPort( final InventoryPlayer inventoryPlayer, final TileSpatialIOPort te )
{
@ -73,10 +73,10 @@ public class GuiSpatialIOPort extends AEBaseGui
@Override
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.currentPower, false ), 13, 21, 4210752 );
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.maxPower, false ), 13, 31, 4210752 );
this.fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.reqPower, false ), 13, 78, 4210752 );
this.fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + ( ( (float) this.container.eff ) / 100 ) + '%', 13, 88, 4210752 );
this.fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getCurrentPower(), false ), 13, 21, 4210752 );
this.fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getMaxPower(), false ), 13, 31, 4210752 );
this.fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getRequiredPower(), false ), 13, 78, 4210752 );
this.fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + ( ( (float) this.container.getEfficency() ) / 100 ) + '%', 13, 88, 4210752 );
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 );

View File

@ -47,11 +47,11 @@ import appeng.parts.misc.PartStorageBus;
public class GuiStorageBus extends GuiUpgradeable
{
GuiImgButton rwMode;
GuiImgButton storageFilter;
GuiTabButton priority;
GuiImgButton partition;
GuiImgButton clear;
private GuiImgButton rwMode;
private GuiImgButton storageFilter;
private GuiTabButton priority;
private GuiImgButton partition;
private GuiImgButton clear;
public GuiStorageBus( final InventoryPlayer inventoryPlayer, final PartStorageBus te )
{
@ -85,17 +85,17 @@ public class GuiStorageBus extends GuiUpgradeable
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
this.fuzzyMode.set( this.cvb.getFuzzyMode() );
}
if( this.storageFilter != null )
{
this.storageFilter.set( ( (ContainerStorageBus) this.cvb ).storageFilter );
this.storageFilter.set( ( (ContainerStorageBus) this.cvb ).getStorageFilter() );
}
if( this.rwMode != null )
{
this.rwMode.set( ( (ContainerStorageBus) this.cvb ).rwMode );
this.rwMode.set( ( (ContainerStorageBus) this.cvb ).getReadWriteMode() );
}
}

View File

@ -44,13 +44,13 @@ import appeng.parts.automation.PartImportBus;
public class GuiUpgradeable extends AEBaseGui
{
final ContainerUpgradeable cvb;
final IUpgradeableHost bc;
protected final ContainerUpgradeable cvb;
protected final IUpgradeableHost bc;
GuiImgButton redstoneMode;
GuiImgButton fuzzyMode;
GuiImgButton craftMode;
GuiImgButton schedulingMode;
protected GuiImgButton redstoneMode;
protected GuiImgButton fuzzyMode;
protected GuiImgButton craftMode;
protected GuiImgButton schedulingMode;
public GuiUpgradeable( final InventoryPlayer inventoryPlayer, final IUpgradeableHost te )
{
@ -100,22 +100,22 @@ public class GuiUpgradeable extends AEBaseGui
if( this.redstoneMode != null )
{
this.redstoneMode.set( this.cvb.rsMode );
this.redstoneMode.set( this.cvb.getRedStoneMode() );
}
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
this.fuzzyMode.set( this.cvb.getFuzzyMode() );
}
if( this.craftMode != null )
{
this.craftMode.set( this.cvb.cMode );
this.craftMode.set( this.cvb.getCraftingMode() );
}
if( this.schedulingMode != null )
{
this.schedulingMode.set( this.cvb.schedulingMode );
this.schedulingMode.set( this.cvb.getSchedulingMode() );
}
}

View File

@ -34,8 +34,8 @@ import appeng.tile.misc.TileVibrationChamber;
public class GuiVibrationChamber extends AEBaseGui
{
final ContainerVibrationChamber cvc;
GuiProgressBar pb;
private final ContainerVibrationChamber cvc;
private GuiProgressBar pb;
public GuiVibrationChamber( final InventoryPlayer inventoryPlayer, final TileVibrationChamber te )
{
@ -59,7 +59,7 @@ public class GuiVibrationChamber extends AEBaseGui
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
this.pb.setFullMsg( this.cvc.aePerTick * this.cvc.getCurrentProgress() / 100 + " AE/t" );
this.pb.setFullMsg( this.cvc.getAePerTick() * this.cvc.getCurrentProgress() / 100 + " AE/t" );
if( this.cvc.getCurrentProgress() > 0 )
{

View File

@ -37,7 +37,7 @@ import appeng.util.Platform;
public class GuiWireless extends AEBaseGui
{
GuiImgButton units;
private GuiImgButton units;
public GuiWireless( final InventoryPlayer inventoryPlayer, final TileWireless te )
{
@ -76,10 +76,10 @@ public class GuiWireless extends AEBaseGui
final ContainerWireless cw = (ContainerWireless) this.inventorySlots;
if( cw.range > 0 )
if( cw.getRange() > 0 )
{
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m";
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true );
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.getRange() / 10.0 ) + " m";
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.getDrain(), true );
final int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) );
final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );

View File

@ -30,7 +30,6 @@ public class GuiWirelessTerm extends GuiMEPortableCell
public GuiWirelessTerm( final InventoryPlayer inventoryPlayer, final IPortableCell te )
{
super( inventoryPlayer, te );
this.maxRows = Integer.MAX_VALUE;
}
@Override

View File

@ -59,8 +59,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
private static final Pattern PATTERN_NEW_LINE = Pattern.compile( "\\n", Pattern.LITERAL );
private static Map<EnumPair, ButtonAppearance> appearances;
private final Enum buttonSetting;
public boolean halfSize = false;
public String fillVar;
private boolean halfSize = false;
private String fillVar;
private Enum currentValue;
public GuiImgButton( final int x, final int y, final Enum idx, final Enum val )
@ -362,7 +362,27 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
}
static class EnumPair
public boolean isHalfSize()
{
return this.halfSize;
}
public void setHalfSize( final boolean halfSize )
{
this.halfSize = halfSize;
}
public String getFillVar()
{
return this.fillVar;
}
public void setFillVar( final String fillVar )
{
this.fillVar = fillVar;
}
private static final class EnumPair
{
final Enum setting;

View File

@ -26,7 +26,7 @@ import net.minecraft.client.gui.GuiTextField;
public class GuiNumberBox extends GuiTextField
{
final Class type;
private final Class type;
public GuiNumberBox( final FontRenderer fontRenderer, final int x, final int y, final int width, final int height, final Class type )
{

View File

@ -53,7 +53,7 @@ public class GuiScrollbar implements IScrollSource
}
}
public int getRange()
private int getRange()
{
return this.maxScroll - this.minScroll;
}

View File

@ -36,7 +36,7 @@ public class GuiTabButton extends GuiButton implements ITooltip
{
private final RenderItem itemRenderer;
private final String message;
public int hideEdge = 0;
private int hideEdge = 0;
private int myIcon = -1;
private ItemStack myItem;
@ -152,4 +152,14 @@ public class GuiTabButton extends GuiButton implements ITooltip
{
return this.visible;
}
public int getHideEdge()
{
return this.hideEdge;
}
public void setHideEdge( final int hideEdge )
{
this.hideEdge = hideEdge;
}
}

View File

@ -30,14 +30,15 @@ import appeng.util.ItemSorters;
public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
{
public final String unlocalizedName;
public final AppEngInternalInventory inv;
public final long id;
public final long sortBy;
private final String unlocalizedName;
private final AppEngInternalInventory inventory;
private final long id;
private final long sortBy;
public ClientDCInternalInv( final int size, final long id, final long sortBy, final String unlocalizedName )
{
this.inv = new AppEngInternalInventory( null, size );
this.inventory = new AppEngInternalInventory( null, size );
this.unlocalizedName = unlocalizedName;
this.id = id;
this.sortBy = sortBy;
@ -58,4 +59,14 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv>
{
return ItemSorters.compareLong( this.sortBy, o.sortBy );
}
public AppEngInternalInventory getInventory()
{
return this.inventory;
}
public long getId()
{
return this.id;
}
}

View File

@ -27,9 +27,9 @@ import appeng.api.storage.data.IAEItemStack;
public class InternalSlotME
{
public final int offset;
public final int xPos;
public final int yPos;
private final int offset;
private final int xPos;
private final int yPos;
private final ItemRepo repo;
public InternalSlotME( final ItemRepo def, final int offset, final int displayX, final int displayY )
@ -40,18 +40,28 @@ public class InternalSlotME
this.yPos = displayY;
}
public ItemStack getStack()
ItemStack getStack()
{
return this.repo.getItem( this.offset );
}
public IAEItemStack getAEStack()
IAEItemStack getAEStack()
{
return this.repo.getReferenceItem( this.offset );
}
public boolean hasPower()
boolean hasPower()
{
return this.repo.hasPower();
}
int getxPosition()
{
return this.xPos;
}
int getyPosition()
{
return this.yPos;
}
}

View File

@ -25,6 +25,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Pattern;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.ReflectionHelper;
@ -55,10 +57,10 @@ public class ItemRepo
private final IScrollSource src;
private final ISortSource sortSrc;
public int rowSize = 9;
private int rowSize = 9;
public String searchString = "";
IPartitionList<IAEItemStack> myPartitionList;
private String searchString = "";
private IPartitionList<IAEItemStack> myPartitionList;
private String innerSearch = "";
private String NEIWord = null;
private boolean hasPower;
@ -218,7 +220,7 @@ public class ItemRepo
final Enum SortBy = this.sortSrc.getSortBy();
final Enum SortDir = this.sortSrc.getSortDir();
ItemSorters.Direction = (appeng.api.config.SortDir) SortDir;
ItemSorters.setDirection( (appeng.api.config.SortDir) SortDir );
ItemSorters.init();
if( SortBy == SortOrder.MOD )
@ -287,4 +289,24 @@ public class ItemRepo
{
this.hasPower = hasPower;
}
public int getRowSize()
{
return this.rowSize;
}
public void setRowSize( final int rowSize )
{
this.rowSize = rowSize;
}
public String getSearchString()
{
return this.searchString;
}
public void setSearchString( @Nonnull final String searchString )
{
this.searchString = searchString;
}
}

View File

@ -31,11 +31,11 @@ import appeng.util.Platform;
public class SlotDisconnected extends AppEngSlot
{
public final ClientDCInternalInv mySlot;
private final ClientDCInternalInv mySlot;
public SlotDisconnected( final ClientDCInternalInv me, final int which, final int x, final int y )
{
super( me.inv, which, x, y );
super( me.getInventory(), which, x, y );
this.mySlot = me;
}
@ -104,4 +104,9 @@ public class SlotDisconnected extends AppEngSlot
{
return false;
}
public ClientDCInternalInv getSlot()
{
return this.mySlot;
}
}

View File

@ -30,11 +30,11 @@ import appeng.api.storage.data.IAEItemStack;
public class SlotME extends Slot
{
public final InternalSlotME mySlot;
private final InternalSlotME mySlot;
public SlotME( final InternalSlotME me )
{
super( null, 0, me.xPos, me.yPos );
super( null, 0, me.getxPosition(), me.getyPosition() );
this.mySlot = me;
}

View File

@ -19,6 +19,8 @@
package appeng.client.render;
import javax.annotation.Nonnull;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.FontRenderer;
@ -46,7 +48,7 @@ public class AppEngRenderItem extends RenderItem
private static final ISlimReadableNumberConverter SLIM_CONVERTER = ReadableNumberConverter.INSTANCE;
private static final IWideReadableNumberConverter WIDE_CONVERTER = ReadableNumberConverter.INSTANCE;
public IAEItemStack aeStack;
private IAEItemStack aeStack = null;
@Override
public void renderItemOverlayIntoGUI( final FontRenderer fontRenderer, final TextureManager textureManager, final ItemStack is, final int par4, final int par5, final String par6Str )
@ -141,4 +143,14 @@ public class AppEngRenderItem extends RenderItem
return WIDE_CONVERTER.toWideReadableForm( originalSize );
}
}
public IAEItemStack getAeStack()
{
return this.aeStack;
}
public void setAeStack( @Nonnull final IAEItemStack aeStack )
{
this.aeStack = aeStack;
}
}

View File

@ -76,7 +76,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
setOriMap();
}
public static void setOriMap()
private static void setOriMap()
{
// pointed up...
ORIENTATION_MAP[0][3][1] = 0;
@ -275,7 +275,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
return ( r << 16 ) | ( g << 8 ) | b;
}
public double getTesrRenderDistance()
double getTesrRenderDistance()
{
return this.renderDistance;
}
@ -312,7 +312,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
}
public static int getOrientation( final ForgeDirection in, final ForgeDirection forward, final ForgeDirection up )
static int getOrientation( final ForgeDirection in, final ForgeDirection forward, final ForgeDirection up )
{
if( in == null || in == ForgeDirection.UNKNOWN // 1
|| forward == null || forward == ForgeDirection.UNKNOWN // 2
@ -391,7 +391,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
}
}
public IIcon firstNotNull( final IIcon... s )
private IIcon firstNotNull( final IIcon... s )
{
for( final IIcon o : s )
{

View File

@ -29,7 +29,7 @@ import appeng.client.texture.TmpFlippableIcon;
public class BlockRenderInfo
{
public final BaseBlockRender rendererInstance;
private final BaseBlockRender rendererInstance;
private final TmpFlippableIcon tmpTopIcon = new TmpFlippableIcon();
private final TmpFlippableIcon tmpBottomIcon = new TmpFlippableIcon();
private final TmpFlippableIcon tmpSouthIcon = new TmpFlippableIcon();
@ -132,8 +132,13 @@ public class BlockRenderInfo
return this.topIcon;
}
public boolean isValid()
boolean isValid()
{
return this.topIcon != null && this.bottomIcon != null && this.southIcon != null && this.northIcon != null && this.eastIcon != null && this.westIcon != null;
}
public BaseBlockRender getRendererInstance()
{
return this.rendererInstance;
}
}

View File

@ -253,7 +253,7 @@ public final class BusRenderHelper implements IPartRenderHelper
this.renderingForPass = pass;
}
public boolean renderThis()
private boolean renderThis()
{
if( this.renderingForPass == this.currentPass || this.noAlphaPass )
{
@ -266,23 +266,23 @@ public final class BusRenderHelper implements IPartRenderHelper
@Override
public void normalRendering()
{
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer;
rbw.calculations = true;
rbw.useTextures = true;
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.getRenderer();
rbw.setCalculations( true );
rbw.setUseTextures( true );
rbw.enableAO = false;
}
@Override
public ISimplifiedBundle useSimplifiedRendering( final int x, final int y, final int z, final IBoxProvider p, final ISimplifiedBundle sim )
{
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.renderer;
final RenderBlocksWorkaround rbw = BusRenderer.INSTANCE.getRenderer();
if( sim != null && this.maybeBlock.isPresent() && rbw.similarLighting( this.maybeBlock.get(), rbw.blockAccess, x, y, z, sim ) )
{
rbw.populate( sim );
rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.calculations = false;
rbw.useTextures = false;
rbw.setFaces( EnumSet.allOf( ForgeDirection.class ) );
rbw.setCalculations( false );
rbw.setUseTextures( false );
return sim;
}
@ -290,8 +290,8 @@ public final class BusRenderHelper implements IPartRenderHelper
{
final boolean allFaces = rbw.renderAllFaces;
rbw.renderAllFaces = true;
rbw.calculations = true;
rbw.faces.clear();
rbw.setCalculations( true );
rbw.getFaces().clear();
this.bbc.started = false;
if( p == null )
@ -339,10 +339,10 @@ public final class BusRenderHelper implements IPartRenderHelper
rbw.renderStandardBlock( block, x, y, z );
}
rbw.faces = EnumSet.allOf( ForgeDirection.class );
rbw.setFaces( EnumSet.allOf( ForgeDirection.class ) );
rbw.renderAllFaces = allFaces;
rbw.calculations = false;
rbw.useTextures = false;
rbw.setCalculations( false );
rbw.setUseTextures( false );
return rbw.getLightingCache();
}
@ -392,7 +392,7 @@ public final class BusRenderHelper implements IPartRenderHelper
}
}
public ForgeDirection mapRotation( final ForgeDirection dir )
private ForgeDirection mapRotation( final ForgeDirection dir )
{
final ForgeDirection forward = this.az;
final ForgeDirection up = this.ay;
@ -518,7 +518,7 @@ public final class BusRenderHelper implements IPartRenderHelper
@Override
public void setFacesToRender( final EnumSet<ForgeDirection> faces )
{
BusRenderer.INSTANCE.renderer.renderFaces = faces;
BusRenderer.INSTANCE.getRenderer().setRenderFaces( faces );
}
@Override

View File

@ -51,7 +51,7 @@ public class BusRenderer implements IItemRenderer
public static final BusRenderer INSTANCE = new BusRenderer();
private static final Map<Integer, IPart> RENDER_PART = new HashMap<Integer, IPart>();
public final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
private final RenderBlocksWorkaround renderer = new RenderBlocksWorkaround();
@Override
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )
@ -120,13 +120,13 @@ public class BusRenderer implements IItemRenderer
BusRenderHelper.INSTANCE.setBounds( 0, 0, 0, 1, 1, 1 );
BusRenderHelper.INSTANCE.setTexture( null );
BusRenderHelper.INSTANCE.setInvColor( 0xffffff );
this.renderer.blockAccess = ClientHelper.proxy.getWorld();
this.getRenderer().blockAccess = ClientHelper.proxy.getWorld();
BusRenderHelper.INSTANCE.setOrientation( ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0;
this.renderer.useInventoryTint = false;
this.renderer.overrideBlockTexture = null;
this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = this.getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0;
this.getRenderer().useInventoryTint = false;
this.getRenderer().overrideBlockTexture = null;
if( item.getItem() instanceof IFacadeItem )
{
@ -141,7 +141,7 @@ public class BusRenderer implements IItemRenderer
if( fp != null )
{
fp.renderInventory( BusRenderHelper.INSTANCE, this.renderer );
fp.renderInventory( BusRenderHelper.INSTANCE, this.getRenderer() );
}
}
else
@ -155,18 +155,18 @@ public class BusRenderer implements IItemRenderer
GL11.glTranslatef( 0.0f, 0.0f, -0.04f * ( 8 - depth ) - 0.06f );
}
ip.renderInventory( BusRenderHelper.INSTANCE, this.renderer );
ip.renderInventory( BusRenderHelper.INSTANCE, this.getRenderer() );
}
}
this.renderer.uvRotateBottom = this.renderer.uvRotateEast = this.renderer.uvRotateNorth = this.renderer.uvRotateSouth = this.renderer.uvRotateTop = this.renderer.uvRotateWest = 0;
this.getRenderer().uvRotateBottom = this.getRenderer().uvRotateEast = this.getRenderer().uvRotateNorth = this.getRenderer().uvRotateSouth = this.getRenderer().uvRotateTop = this.getRenderer().uvRotateWest = 0;
GL11.glPopAttrib();
GL11.glPopMatrix();
}
@Nullable
public IPart getRenderer( final ItemStack is, final IPartItem c )
private IPart getRenderer( final ItemStack is, final IPartItem c )
{
final int id = ( Item.getIdFromItem( is.getItem() ) << Platform.DEF_OFFSET ) | is.getItemDamage();
@ -182,4 +182,9 @@ public class BusRenderer implements IItemRenderer
return part;
}
public RenderBlocksWorkaround getRenderer()
{
return this.renderer;
}
}

View File

@ -48,7 +48,7 @@ public class CableRenderHelper
public void renderStatic( final CableBusContainer cableBusContainer, final IFacadeContainer iFacadeContainer )
{
final TileEntity te = cableBusContainer.getTile();
final RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.renderer;
final RenderBlocksWorkaround renderer = BusRenderer.INSTANCE.getRenderer();
if( renderer.overrideBlockTexture != null )
{
@ -73,9 +73,9 @@ public class CableRenderHelper
part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.INSTANCE, renderer );
renderer.faces = EnumSet.allOf( ForgeDirection.class );
renderer.calculations = true;
renderer.useTextures = true;
renderer.setFaces( EnumSet.allOf( ForgeDirection.class ) );
renderer.setCalculations( true );
renderer.setUseTextures( true );
}
}
@ -153,10 +153,10 @@ public class CableRenderHelper
}
}
renderer.isFacade = false;
renderer.setFacade( false );
renderer.enableAO = false;
renderer.setTexture( null );
renderer.calculations = true;
renderer.setCalculations( true );
}
}
@ -261,7 +261,7 @@ public class CableRenderHelper
}
BusRenderHelper.INSTANCE.setOrientation( ax, ay, az );
part.renderDynamic( x, y, z, BusRenderHelper.INSTANCE, BusRenderer.INSTANCE.renderer );
part.renderDynamic( x, y, z, BusRenderHelper.INSTANCE, BusRenderer.INSTANCE.getRenderer() );
}
}
}

View File

@ -22,6 +22,7 @@ package appeng.client.render;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
@ -41,18 +42,18 @@ import appeng.core.AELog;
public class RenderBlocksWorkaround extends RenderBlocks
{
final int[] lightHashTmp = new int[27];
public boolean calculations = true;
public EnumSet<ForgeDirection> renderFaces = EnumSet.allOf( ForgeDirection.class );
public EnumSet<ForgeDirection> faces = EnumSet.allOf( ForgeDirection.class );
public boolean isFacade = false;
public boolean useTextures = true;
public float opacity = 1.0f;
Field fBrightness;
Field fColor;
private final int[] lightHashTmp = new int[27];
private boolean calculations = true;
private EnumSet<ForgeDirection> renderFaces = EnumSet.allOf( ForgeDirection.class );
private EnumSet<ForgeDirection> faces = EnumSet.allOf( ForgeDirection.class );
private boolean isFacade = false;
private boolean useTextures = true;
private float opacity = 1.0f;
private Field fBrightness = null;
private Field fColor = null;
private LightingCache lightState = new LightingCache();
public int getCurrentColor()
private int getCurrentColor()
{
try
{
@ -76,7 +77,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
}
public int getCurrentBrightness()
private int getCurrentBrightness()
{
try
{
@ -100,7 +101,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
}
}
public void setTexture( final IIcon ico )
void setTexture( final IIcon ico )
{
this.lightState.rXPos = this.lightState.rXNeg = this.lightState.rYPos = this.lightState.rYNeg = this.lightState.rZPos = this.lightState.rZNeg = ico;
}
@ -115,31 +116,31 @@ public class RenderBlocksWorkaround extends RenderBlocks
this.lightState.rZNeg = rZNeg;
}
public boolean renderStandardBlockNoCalculations( final Block b, final int x, final int y, final int z )
private boolean renderStandardBlockNoCalculations( final Block b, final int x, final int y, final int z )
{
Tessellator.instance.setBrightness( this.lightState.bXPos );
this.restoreAO( this.lightState.aoXPos, this.lightState.foXPos );
this.renderFaceXPos( b, x, y, z, this.useTextures ? this.lightState.rXPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) );
this.renderFaceXPos( b, x, y, z, this.isUseTextures() ? this.lightState.rXPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.EAST.ordinal() ) );
Tessellator.instance.setBrightness( this.lightState.bXNeg );
this.restoreAO( this.lightState.aoXNeg, this.lightState.foXNeg );
this.renderFaceXNeg( b, x, y, z, this.useTextures ? this.lightState.rXNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) );
this.renderFaceXNeg( b, x, y, z, this.isUseTextures() ? this.lightState.rXNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.WEST.ordinal() ) );
Tessellator.instance.setBrightness( this.lightState.bYPos );
this.restoreAO( this.lightState.aoYPos, this.lightState.foYPos );
this.renderFaceYPos( b, x, y, z, this.useTextures ? this.lightState.rYPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) );
this.renderFaceYPos( b, x, y, z, this.isUseTextures() ? this.lightState.rYPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.UP.ordinal() ) );
Tessellator.instance.setBrightness( this.lightState.bYNeg );
this.restoreAO( this.lightState.aoYNeg, this.lightState.foYNeg );
this.renderFaceYNeg( b, x, y, z, this.useTextures ? this.lightState.rYNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) );
this.renderFaceYNeg( b, x, y, z, this.isUseTextures() ? this.lightState.rYNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.DOWN.ordinal() ) );
Tessellator.instance.setBrightness( this.lightState.bZPos );
this.restoreAO( this.lightState.aoZPos, this.lightState.foZPos );
this.renderFaceZPos( b, x, y, z, this.useTextures ? this.lightState.rZPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) );
this.renderFaceZPos( b, x, y, z, this.isUseTextures() ? this.lightState.rZPos : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.SOUTH.ordinal() ) );
Tessellator.instance.setBrightness( this.lightState.bZNeg );
this.restoreAO( this.lightState.aoZNeg, this.lightState.foZNeg );
this.renderFaceZNeg( b, x, y, z, this.useTextures ? this.lightState.rZNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) );
this.renderFaceZNeg( b, x, y, z, this.isUseTextures() ? this.lightState.rZNeg : this.getBlockIcon( b, this.blockAccess, x, y, z, ForgeDirection.NORTH.ordinal() ) );
return true;
}
@ -150,7 +151,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
this.brightnessBottomRight = z[1];
this.brightnessTopLeft = z[2];
this.brightnessTopRight = z[3];
Tessellator.instance.setColorRGBA_I( z[4], (int) ( this.opacity * 255 ) );
Tessellator.instance.setColorRGBA_I( z[4], (int) ( this.getOpacity() * 255 ) );
this.colorRedTopLeft = c[0];
this.colorGreenTopLeft = c[1];
@ -193,7 +194,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
{
try
{
if( this.calculations )
if( this.isCalculations() )
{
this.lightState.lightHash = this.getLightingHash( blk, this.blockAccess, x, y, z );
return super.renderStandardBlock( blk, x, y, z );
@ -217,14 +218,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
@Override
public void renderFaceYNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
{
if( this.faces.contains( ForgeDirection.DOWN ) )
if( this.getFaces().contains( ForgeDirection.DOWN ) )
{
if( !this.renderFaces.contains( ForgeDirection.DOWN ) )
if( !this.getRenderFaces().contains( ForgeDirection.DOWN ) )
{
return;
}
if( this.isFacade )
if( this.isFacade() )
{
final Tessellator tessellator = Tessellator.instance;
@ -275,14 +276,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
@Override
public void renderFaceYPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
{
if( this.faces.contains( ForgeDirection.UP ) )
if( this.getFaces().contains( ForgeDirection.UP ) )
{
if( !this.renderFaces.contains( ForgeDirection.UP ) )
if( !this.getRenderFaces().contains( ForgeDirection.UP ) )
{
return;
}
if( this.isFacade )
if( this.isFacade() )
{
final Tessellator tessellator = Tessellator.instance;
@ -333,14 +334,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
@Override
public void renderFaceZNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
{
if( this.faces.contains( ForgeDirection.NORTH ) )
if( this.getFaces().contains( ForgeDirection.NORTH ) )
{
if( !this.renderFaces.contains( ForgeDirection.NORTH ) )
if( !this.getRenderFaces().contains( ForgeDirection.NORTH ) )
{
return;
}
if( this.isFacade )
if( this.isFacade() )
{
final Tessellator tessellator = Tessellator.instance;
@ -391,14 +392,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
@Override
public void renderFaceZPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
{
if( this.faces.contains( ForgeDirection.SOUTH ) )
if( this.getFaces().contains( ForgeDirection.SOUTH ) )
{
if( !this.renderFaces.contains( ForgeDirection.SOUTH ) )
if( !this.getRenderFaces().contains( ForgeDirection.SOUTH ) )
{
return;
}
if( this.isFacade )
if( this.isFacade() )
{
final Tessellator tessellator = Tessellator.instance;
@ -449,14 +450,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
@Override
public void renderFaceXNeg( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
{
if( this.faces.contains( ForgeDirection.WEST ) )
if( this.getFaces().contains( ForgeDirection.WEST ) )
{
if( !this.renderFaces.contains( ForgeDirection.WEST ) )
if( !this.getRenderFaces().contains( ForgeDirection.WEST ) )
{
return;
}
if( this.isFacade )
if( this.isFacade() )
{
final Tessellator tessellator = Tessellator.instance;
@ -507,14 +508,14 @@ public class RenderBlocksWorkaround extends RenderBlocks
@Override
public void renderFaceXPos( final Block par1Block, final double par2, final double par4, final double par6, final IIcon par8Icon )
{
if( this.faces.contains( ForgeDirection.EAST ) )
if( this.getFaces().contains( ForgeDirection.EAST ) )
{
if( !this.renderFaces.contains( ForgeDirection.EAST ) )
if( !this.getRenderFaces().contains( ForgeDirection.EAST ) )
{
return;
}
if( this.isFacade )
if( this.isFacade() )
{
final Tessellator tessellator = Tessellator.instance;
@ -586,7 +587,7 @@ public class RenderBlocksWorkaround extends RenderBlocks
final int out = ( high << 16 ) | low;
Tessellator.instance.setColorRGBA_F( r, g, b, this.opacity );
Tessellator.instance.setColorRGBA_F( r, g, b, this.getOpacity() );
Tessellator.instance.setBrightness( out );
}
@ -626,6 +627,66 @@ public class RenderBlocksWorkaround extends RenderBlocks
return new LightingCache( this.lightState );
}
Set<ForgeDirection> getFaces()
{
return this.faces;
}
public void setFaces( final EnumSet<ForgeDirection> faces )
{
this.faces = faces;
}
private boolean isCalculations()
{
return this.calculations;
}
public void setCalculations( final boolean calculations )
{
this.calculations = calculations;
}
private boolean isUseTextures()
{
return this.useTextures;
}
void setUseTextures( final boolean useTextures )
{
this.useTextures = useTextures;
}
private boolean isFacade()
{
return this.isFacade;
}
public void setFacade( final boolean isFacade )
{
this.isFacade = isFacade;
}
private float getOpacity()
{
return this.opacity;
}
public void setOpacity( final float opacity )
{
this.opacity = opacity;
}
private EnumSet<ForgeDirection> getRenderFaces()
{
return this.renderFaces;
}
void setRenderFaces( final EnumSet<ForgeDirection> renderFaces )
{
this.renderFaces = renderFaces;
}
private static class LightingCache implements ISimplifiedBundle
{

View File

@ -39,7 +39,7 @@ import appeng.tile.AEBaseTile;
public class TESRWrapper extends TileEntitySpecialRenderer
{
public final RenderBlocks renderBlocksInstance = new RenderBlocks();
private final RenderBlocks renderBlocksInstance = new RenderBlocks();
private final BaseBlockRender blkRender;
private final double maxDistance;

View File

@ -41,10 +41,10 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
{
public static final WorldRender INSTANCE = new WorldRender();
public final HashMap<AEBaseBlock, BaseBlockRender> blockRenders = new HashMap<AEBaseBlock, BaseBlockRender>();
final int renderID = RenderingRegistry.getNextAvailableRenderId();
private final HashMap<AEBaseBlock, BaseBlockRender> blockRenders = new HashMap<AEBaseBlock, BaseBlockRender>();
private final int renderID = RenderingRegistry.getNextAvailableRenderId();
private final RenderBlocks renderer = new RenderBlocks();
boolean hasError = false;
private boolean hasError = false;
private WorldRender()
{
@ -83,10 +83,10 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
private BaseBlockRender getRender( final AEBaseBlock block )
{
return block.getRendererInstance().rendererInstance;
return block.getRendererInstance().getRendererInstance();
}
public void renderItemBlock( final ItemStack item, final ItemRenderType type, final Object[] data )
void renderItemBlock( final ItemStack item, final ItemRenderType type, final Object[] data )
{
final Block blk = Block.getBlockFromItem( item.getItem() );
if( blk instanceof AEBaseBlock )

View File

@ -107,7 +107,7 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
{
final TileMolecularAssembler tma = maBlock.getTileEntity( world, x, y, z );
if( BlockMolecularAssembler.booleanAlphaPass )
if( BlockMolecularAssembler.isBooleanAlphaPass() )
{
if( tma.isPowered() )
{
@ -126,14 +126,14 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
return false;
}
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
renderer = BusRenderer.INSTANCE.renderer;
BusRenderer.INSTANCE.getRenderer().blockAccess = renderer.blockAccess;
renderer = BusRenderer.INSTANCE.getRenderer();
this.preRenderInWorld( maBlock, world, x, y, z, renderer );
tma.lightCache = BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.lightCache );
tma.setLightCache( BusRenderHelper.INSTANCE.useSimplifiedRendering( x, y, z, this, tma.getLightCache() ) );
BusRenderer.INSTANCE.renderer.isFacade = true;
BusRenderer.INSTANCE.getRenderer().setFacade( true );
final IOrientable te = this.getOrientable( maBlock, world, x, y, z );
final ForgeDirection fdy = te.getUp();
@ -192,14 +192,14 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
maBlock.getRendererInstance().setTemporaryRenderIcon( null );
renderer.renderAllFaces = false;
BusRenderer.INSTANCE.renderer.isFacade = false;
BusRenderer.INSTANCE.getRenderer().setFacade( false );
this.postRenderInWorld( renderer );
return true;
}
public void renderCableAt( final double thickness, final IBlockAccess world, final int x, final int y, final int z, final BlockMolecularAssembler block, final RenderBlocks renderer, final double pull, final boolean covered )
private void renderCableAt( final double thickness, final IBlockAccess world, final int x, final int y, final int z, final BlockMolecularAssembler block, final RenderBlocks renderer, final double pull, final boolean covered )
{
IIcon texture = null;
@ -248,7 +248,7 @@ public class RenderBlockAssembler extends BaseBlockRender<BlockMolecularAssemble
block.getRendererInstance().setTemporaryRenderIcon( null );
}
IIcon getConnectedCable( final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection side, final boolean covered )
private IIcon getConnectedCable( final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection side, final boolean covered )
{
final int tileYPos = y + side.offsetY;
if( -1 < tileYPos && tileYPos < 256 )

View File

@ -82,9 +82,9 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
if( formed && renderer.overrideBlockTexture == null )
{
renderer = BusRenderer.INSTANCE.renderer;
renderer = BusRenderer.INSTANCE.getRenderer();
final BusRenderHelper i = BusRenderHelper.INSTANCE;
BusRenderer.INSTANCE.renderer.isFacade = true;
BusRenderer.INSTANCE.getRenderer().setFacade( true );
renderer.blockAccess = w;
i.setPass( 0 );
@ -92,7 +92,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
try
{
ct.lightCache = i.useSimplifiedRendering( x, y, z, null, ct.lightCache );
ct.setLightCache( i.useSimplifiedRendering( x, y, z, null, ct.getLightCache() ) );
}
catch( final Throwable ignored )
{
@ -131,7 +131,7 @@ public class RenderBlockCraftingCPU<B extends BlockCraftingUnit, T extends TileC
this.handleSide( blk, meta, x, y, z, i, renderer, ct.getForward() == side ? theIcon : nonForward, LocalEmit, isMonitor, side, w );
}
BusRenderer.INSTANCE.renderer.isFacade = false;
BusRenderer.INSTANCE.getRenderer().setFacade( false );
i.setFacesToRender( EnumSet.allOf( ForgeDirection.class ) );
i.normalRendering();

View File

@ -63,10 +63,10 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
{
final IAEItemStack ais = tile.getJobProgress();
if( tile.dspList == null )
if( tile.getDisplayList() == null )
{
tile.updateList = true;
tile.dspList = GLAllocation.generateDisplayLists( 1 );
tile.setUpdateList( true );
tile.setDisplayList( GLAllocation.generateDisplayLists( 1 ) );
}
if( ais != null )
@ -74,16 +74,16 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU<BlockC
GL11.glPushMatrix();
GL11.glTranslated( x + 0.5, y + 0.5, z + 0.5 );
if( tile.updateList )
if( tile.isUpdateList() )
{
tile.updateList = false;
GL11.glNewList( tile.dspList, GL11.GL_COMPILE_AND_EXECUTE );
tile.setUpdateList( false );
GL11.glNewList( tile.getDisplayList(), GL11.GL_COMPILE_AND_EXECUTE );
this.tesrRenderScreen( tess, tile, ais );
GL11.glEndList();
}
else
{
GL11.glCallList( tile.dspList );
GL11.glCallList( tile.getDisplayList() );
}
GL11.glPopMatrix();

View File

@ -89,7 +89,7 @@ public class RenderBlockCrank extends BaseBlockRender<BlockCrank, TileCrank>
this.applyTESRRotation( x, y, z, tile.getForward(), tile.getUp() );
GL11.glTranslated( 0.5, 0, 0.5 );
GL11.glRotatef( tile.visibleRotation, 0, 1, 0 );
GL11.glRotatef( tile.getVisibleRotation(), 0, 1, 0 );
GL11.glTranslated( -0.5, 0, -0.5 );
tess.setTranslation( -tile.xCoord, -tile.yCoord, -tile.zCoord );

View File

@ -169,13 +169,13 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
long absoluteProgress = 0;
if( tile.smash )
if( tile.isSmash() )
{
final long currentTime = System.currentTimeMillis();
absoluteProgress = currentTime - tile.clientStart;
absoluteProgress = currentTime - tile.getClientStart();
if( absoluteProgress > 800 )
{
tile.smash = false;
tile.setSmash( false );
}
}
@ -261,7 +261,7 @@ public class RenderBlockInscriber extends BaseBlockRender<BlockInscriber, TileIn
}
}
public void renderItem( ItemStack sis, final float o, final AEBaseBlock block, final AEBaseTile tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
private void renderItem( ItemStack sis, final float o, final AEBaseBlock block, final AEBaseTile tile, final Tessellator tess, final double x, final double y, final double z, final float f, final RenderBlocks renderer )
{
if( sis != null )
{

View File

@ -79,19 +79,19 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
final int lumen = 14 << 20 | 14 << 4;
for( final Splotch s : tp.getDots() )
{
if( !validSides.contains( s.side ) )
if( !validSides.contains( s.getSide() ) )
{
continue;
}
if( s.lumen )
if( s.isLumen() )
{
tess.setColorOpaque_I( s.color.whiteVariant );
tess.setColorOpaque_I( s.getColor().whiteVariant );
tess.setBrightness( lumen );
}
else
{
tess.setColorOpaque_I( s.color.mediumVariant );
tess.setColorOpaque_I( s.getColor().mediumVariant );
tess.setBrightness( brightness );
}
@ -106,13 +106,13 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
pos_x = Math.max( buffer, Math.min( 1.0 - buffer, pos_x ) );
pos_y = Math.max( buffer, Math.min( 1.0 - buffer, pos_y ) );
if( s.side == ForgeDirection.SOUTH || s.side == ForgeDirection.NORTH )
if( s.getSide() == ForgeDirection.SOUTH || s.getSide() == ForgeDirection.NORTH )
{
pos_x += x;
pos_y += y;
}
else if( s.side == ForgeDirection.UP || s.side == ForgeDirection.DOWN )
else if( s.getSide() == ForgeDirection.UP || s.getSide() == ForgeDirection.DOWN )
{
pos_x += x;
pos_y += z;
@ -126,7 +126,7 @@ public class RenderBlockPaint extends BaseBlockRender<BlockPaint, TilePaint>
final IIcon ico = icoSet[s.getSeed() % icoSet.length];
switch( s.side )
switch( s.getSide() )
{
case UP:
offset = 1.0 - offset;

View File

@ -44,7 +44,7 @@ public class RenderBlockQuartzAccelerator extends BaseBlockRender<BlockQuartzGro
final TileEntity te = world.getTileEntity( x, y, z );
if( te instanceof TileQuartzGrowthAccelerator )
{
if( ( (TileQuartzGrowthAccelerator) te ).hasPower )
if( ( (TileQuartzGrowthAccelerator) te ).isPowered() )
{
final IIcon top_Bottom = ExtraBlockTextures.BlockQuartzGrowthAcceleratorOn.getIcon();
final IIcon side = ExtraBlockTextures.BlockQuartzGrowthAcceleratorSideOn.getIcon();

View File

@ -85,7 +85,7 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
@Override
public void renderTile( final BlockSkyChest block, final TileSkyChest skyChest, final Tessellator tess, final double x, final double y, final double z, final float partialTick, final RenderBlocks renderer )
{
if( skyChest == null )
if( skyChest == null )
{
return;
}
@ -109,28 +109,28 @@ public class RenderBlockSkyChest extends BaseBlockRender<BlockSkyChest, TileSkyC
GL11.glTranslatef( -0.0F, -1.0F, -1.0F );
final long now = System.currentTimeMillis();
final long distance = now - skyChest.lastEvent;
final long distance = now - skyChest.getLastEvent();
if( skyChest.playerOpen > 0 )
if( skyChest.getPlayerOpen() > 0 )
{
skyChest.lidAngle += distance * 0.0001;
skyChest.setLidAngle( skyChest.getLidAngle() + distance * 0.0001f );
}
else
{
skyChest.lidAngle -= distance * 0.0001;
skyChest.setLidAngle( skyChest.getLidAngle() - distance * 0.0001f );
}
if( skyChest.lidAngle > 0.5f )
if( skyChest.getLidAngle() > 0.5f )
{
skyChest.lidAngle = 0.5f;
skyChest.setLidAngle( 0.5f );
}
if( skyChest.lidAngle < 0.0f )
if( skyChest.getLidAngle() < 0.0f )
{
skyChest.lidAngle = 0.0f;
skyChest.setLidAngle( 0.0f );
}
float lidAngle = skyChest.lidAngle;
float lidAngle = skyChest.getLidAngle();
lidAngle = 1.0F - lidAngle;
lidAngle = 1.0F - lidAngle * lidAngle * lidAngle;

View File

@ -44,8 +44,7 @@ import appeng.tile.misc.TileSkyCompass;
public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, TileSkyCompass>
{
final ModelCompass model = new ModelCompass();
float r = 0;
private final ModelCompass model = new ModelCompass();
public RenderBlockSkyCompass()
{
@ -133,9 +132,9 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
}
}
if( cr.hasResult )
if( cr.isValidResult() )
{
if( cr.spin )
if( cr.isSpin() )
{
now %= 100000;
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
@ -146,13 +145,13 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
{
final float offRads = rYaw / 180.0f * (float) Math.PI;
final float adjustment = (float) Math.PI * 0.74f;
this.model.renderAll( (float) this.flipidiy( cr.rad + offRads + adjustment ) );
this.model.renderAll( (float) this.flipidiy( cr.getRad() + offRads + adjustment ) );
}
else
{
final float offRads = rYaw / 180.0f * (float) Math.PI;
final float adjustment = (float) Math.PI * -0.74f;
this.model.renderAll( (float) this.flipidiy( cr.rad + offRads + adjustment ) );
this.model.renderAll( (float) this.flipidiy( cr.getRad() + offRads + adjustment ) );
}
}
}
@ -216,16 +215,16 @@ public class RenderBlockSkyCompass extends BaseBlockRender<BlockSkyCompass, Tile
cr = new CompassResult( false, true, 0 );
}
if( cr.hasResult )
if( cr.isValidResult() )
{
if( cr.spin )
if( cr.isSpin() )
{
now %= 100000;
this.model.renderAll( ( now / 50000.0f ) * (float) Math.PI * 500.0f );
}
else
{
this.model.renderAll( (float) ( skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy( cr.rad ) : cr.rad ) );
this.model.renderAll( (float) ( skyCompass.getForward() == ForgeDirection.DOWN ? this.flipidiy( cr.getRad() ) : cr.getRad() ) );
}
}
else

View File

@ -113,8 +113,8 @@ public class RenderBlockWireless extends BaseBlockRender<BlockWireless, TileWire
this.blk = blk;
if( tw != null )
{
this.hasChan = ( tw.clientFlags & ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG ) ) == ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG );
this.hasPower = ( tw.clientFlags & TileWireless.POWERED_FLAG ) == TileWireless.POWERED_FLAG;
this.hasChan = ( tw.getClientFlags() & ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG ) ) == ( TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG );
this.hasPower = ( tw.getClientFlags() & TileWireless.POWERED_FLAG ) == TileWireless.POWERED_FLAG;
final BlockRenderInfo ri = blk.getRendererInstance();

View File

@ -38,7 +38,7 @@ import appeng.tile.AEBaseTile;
public class RenderQuartzGlass extends BaseBlockRender<BlockQuartzGlass, AEBaseTile>
{
static byte[][][] offsets;
private static byte[][][] offsets;
public RenderQuartzGlass()
{

View File

@ -54,11 +54,11 @@ public class RendererCableBus extends BaseBlockRender<BlockCableBus, TileCableBu
if( t instanceof TileCableBus )
{
BusRenderer.INSTANCE.renderer.renderAllFaces = true;
BusRenderer.INSTANCE.renderer.blockAccess = renderer.blockAccess;
BusRenderer.INSTANCE.renderer.overrideBlockTexture = renderer.overrideBlockTexture;
( (TileCableBus) t ).cb.renderStatic( x, y, z );
BusRenderer.INSTANCE.renderer.renderAllFaces = false;
BusRenderer.INSTANCE.getRenderer().renderAllFaces = true;
BusRenderer.INSTANCE.getRenderer().blockAccess = renderer.blockAccess;
BusRenderer.INSTANCE.getRenderer().overrideBlockTexture = renderer.overrideBlockTexture;
( (TileCableBus) t ).getCableBus().renderStatic( x, y, z );
BusRenderer.INSTANCE.getRenderer().renderAllFaces = false;
}
return BusRenderHelper.INSTANCE.getItemsRendered() > 0;
@ -69,8 +69,8 @@ public class RendererCableBus extends BaseBlockRender<BlockCableBus, TileCableBu
{
if( cableBus != null )
{
BusRenderer.INSTANCE.renderer.overrideBlockTexture = null;
cableBus.cb.renderDynamic( x, y, z );
BusRenderer.INSTANCE.getRenderer().overrideBlockTexture = null;
cableBus.getCableBus().renderDynamic( x, y, z );
}
}
}

View File

@ -32,10 +32,9 @@ import appeng.entity.EntityFloatingItem;
public class AssemblerFX extends EntityFX
{
final IAEItemStack item;
final EntityFloatingItem fi;
final float speed;
float time = 0;
private final EntityFloatingItem fi;
private final float speed;
private float time = 0;
public AssemblerFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b, final float speed, final IAEItemStack is )
{
@ -43,7 +42,6 @@ public class AssemblerFX extends EntityFX
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
this.item = is;
this.speed = speed;
this.fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() );
w.spawnEntityInWorld( this.fi );

View File

@ -28,9 +28,9 @@ public class LightningArcFX extends LightningFX
{
private static final Random RANDOM_GENERATOR = new Random();
final double rx;
final double ry;
final double rz;
private final double rx;
private final double ry;
private final double rz;
public LightningArcFX( final World w, final double x, final double y, final double z, final double ex, final double ey, final double ez, final double r, final double g, final double b )
{
@ -47,17 +47,19 @@ public class LightningArcFX extends LightningFX
@Override
protected void regen()
{
final double i = 1.0 / ( this.steps - 1 );
final double i = 1.0 / ( this.getSteps() - 1 );
final double lastDirectionX = this.rx * i;
final double lastDirectionY = this.ry * i;
final double lastDirectionZ = this.rz * i;
final double len = Math.sqrt( lastDirectionX * lastDirectionX + lastDirectionY * lastDirectionY + lastDirectionZ * lastDirectionZ );
for( int s = 0; s < this.steps; s++ )
for( int s = 0; s < this.getSteps(); s++ )
{
this.Steps[s][0] = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
this.Steps[s][1] = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
this.Steps[s][2] = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
final double[][] localSteps = this.getPrecomputedSteps();
localSteps[s][0] = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
localSteps[s][1] = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
localSteps[s][2] = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * len * 1.2 ) / 2.0;
}
}
}

View File

@ -33,12 +33,12 @@ public class LightningFX extends EntityFX
{
private static final Random RANDOM_GENERATOR = new Random();
final int steps = this.getSteps();
final double[][] Steps;
private static final int STEPS = 5;
private final double[][] precomputedSteps;
private final double[] vertices = new double[3];
private final double[] verticesWithUV = new double[3];
float currentPoint = 0;
boolean hasData = false;
private boolean hasData = false;
public LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b )
{
@ -49,7 +49,7 @@ public class LightningFX extends EntityFX
protected LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b, final int maxAge )
{
super( w, x, y, z, r, g, b );
this.Steps = new double[this.steps][3];
this.precomputedSteps = new double[LightningFX.STEPS][3];
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
@ -62,17 +62,17 @@ public class LightningFX extends EntityFX
double lastDirectionX = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
double lastDirectionY = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
double lastDirectionZ = ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9;
for( int s = 0; s < this.steps; s++ )
for( int s = 0; s < LightningFX.STEPS; s++ )
{
this.Steps[s][0] = lastDirectionX = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.Steps[s][1] = lastDirectionY = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.Steps[s][2] = lastDirectionZ = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.precomputedSteps[s][0] = lastDirectionX = ( lastDirectionX + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.precomputedSteps[s][1] = lastDirectionY = ( lastDirectionY + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
this.precomputedSteps[s][2] = lastDirectionZ = ( lastDirectionZ + ( RANDOM_GENERATOR.nextDouble() - 0.5 ) * 0.9 ) / 2.0;
}
}
private int getSteps()
protected int getSteps()
{
return 5;
return LightningFX.STEPS;
}
@Override
@ -140,11 +140,11 @@ public class LightningFX extends EntityFX
double y = ( this.prevPosY + ( this.posY - this.prevPosY ) * l - interpPosY ) - offY;
double z = ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * l - interpPosZ ) - offZ;
for( int s = 0; s < this.steps; s++ )
for( int s = 0; s < LightningFX.STEPS; s++ )
{
final double xN = x + this.Steps[s][0];
final double yN = y + this.Steps[s][1];
final double zN = z + this.Steps[s][2];
final double xN = x + this.precomputedSteps[s][0];
final double yN = y + this.precomputedSteps[s][1];
final double zN = z + this.precomputedSteps[s][2];
final double xD = xN - x;
final double yD = yN - y;
@ -169,7 +169,7 @@ public class LightningFX extends EntityFX
oz = ( xD * 0 ) - ( 1 * yD );
}
final double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) this.steps - (double) s ) / this.steps ) * scale );
final double ss = Math.sqrt( ox * ox + oy * oy + oz * oz ) / ( ( ( (double) LightningFX.STEPS - (double) s ) / LightningFX.STEPS ) * scale );
ox /= ss;
oy /= ss;
oz /= ss;
@ -217,4 +217,9 @@ public class LightningFX extends EntityFX
this.verticesWithUV[x] = b[x];
}
}
protected double[][] getPrecomputedSteps()
{
return this.precomputedSteps;
}
}

View File

@ -34,8 +34,8 @@ import appeng.items.misc.ItemEncodedPattern;
public class ItemEncodedPatternRenderer implements IItemRenderer
{
final RenderItem ri = new RenderItem();
boolean recursive;
private final RenderItem ri = new RenderItem();
private boolean recursive = false;
@Override
public boolean handleRenderType( final ItemStack item, final ItemRenderType type )

View File

@ -26,14 +26,14 @@ import net.minecraft.client.model.ModelRenderer;
public class ModelCompass extends ModelBase
{
final ModelRenderer Ring1;
final ModelRenderer Ring2;
final ModelRenderer Ring3;
final ModelRenderer Ring4;
final ModelRenderer Middle;
final ModelRenderer Base;
private final ModelRenderer Ring1;
private final ModelRenderer Ring2;
private final ModelRenderer Ring3;
private final ModelRenderer Ring4;
private final ModelRenderer Middle;
private final ModelRenderer Base;
final ModelRenderer Pointer;
private final ModelRenderer Pointer;
public ModelCompass()
{

View File

@ -89,7 +89,7 @@ public enum ExtraBlockTextures
BlockPaint2( "BlockPaint2" ), BlockPaint3( "BlockPaint3" );
private final String name;
public IIcon IIcon;
private IIcon IIcon;
ExtraBlockTextures( final String name )
{

View File

@ -39,7 +39,7 @@ public enum ExtraItemTextures
ToolColorApplicatorTip_Light( "ToolColorApplicatorTip_Light" );
private final String name;
public IIcon IIcon;
private IIcon IIcon;
ExtraItemTextures( final String name )
{

View File

@ -19,15 +19,17 @@
package appeng.client.texture;
import javax.annotation.Nonnull;
import net.minecraft.util.IIcon;
public class FlippableIcon implements IIcon
{
protected IIcon original;
boolean flip_u;
boolean flip_v;
private IIcon original;
private boolean flip_u;
private boolean flip_v;
public FlippableIcon( final IIcon o )
{
@ -36,87 +38,87 @@ public class FlippableIcon implements IIcon
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
}
this.original = o;
this.flip_u = false;
this.flip_v = false;
this.setOriginal( o );
this.setFlipU( false );
this.setFlipV( false );
}
@Override
public int getIconWidth()
{
return this.original.getIconWidth();
return this.getOriginal().getIconWidth();
}
@Override
public int getIconHeight()
{
return this.original.getIconHeight();
return this.getOriginal().getIconHeight();
}
@Override
public float getMinU()
{
if( this.flip_u )
if( this.isFlipU() )
{
return this.original.getMaxU();
return this.getOriginal().getMaxU();
}
return this.original.getMinU();
return this.getOriginal().getMinU();
}
@Override
public float getMaxU()
{
if( this.flip_u )
if( this.isFlipU() )
{
return this.original.getMinU();
return this.getOriginal().getMinU();
}
return this.original.getMaxU();
return this.getOriginal().getMaxU();
}
@Override
public float getInterpolatedU( final double px )
{
if( this.flip_u )
if( this.isFlipU() )
{
return this.original.getInterpolatedU( 16 - px );
return this.getOriginal().getInterpolatedU( 16 - px );
}
return this.original.getInterpolatedU( px );
return this.getOriginal().getInterpolatedU( px );
}
@Override
public float getMinV()
{
if( this.flip_v )
if( this.isFlipV() )
{
return this.original.getMaxV();
return this.getOriginal().getMaxV();
}
return this.original.getMinV();
return this.getOriginal().getMinV();
}
@Override
public float getMaxV()
{
if( this.flip_v )
if( this.isFlipV() )
{
return this.original.getMinV();
return this.getOriginal().getMinV();
}
return this.original.getMaxV();
return this.getOriginal().getMaxV();
}
@Override
public float getInterpolatedV( final double px )
{
if( this.flip_v )
if( this.isFlipV() )
{
return this.original.getInterpolatedV( 16 - px );
return this.getOriginal().getInterpolatedV( 16 - px );
}
return this.original.getInterpolatedV( px );
return this.getOriginal().getInterpolatedV( px );
}
@Override
public String getIconName()
{
return this.original.getIconName();
return this.getOriginal().getIconName();
}
public IIcon getOriginal()
@ -126,14 +128,39 @@ public class FlippableIcon implements IIcon
public void setFlip( final boolean u, final boolean v )
{
this.flip_u = u;
this.flip_v = v;
this.setFlipU( u );
this.setFlipV( v );
}
public int setFlip( final int orientation )
{
this.flip_u = ( orientation & 8 ) == 8;
this.flip_v = ( orientation & 16 ) == 16;
this.setFlipU( ( orientation & 8 ) == 8 );
this.setFlipV( ( orientation & 16 ) == 16 );
return orientation & 7;
}
boolean isFlipU()
{
return this.flip_u;
}
void setFlipU( final boolean flipU )
{
this.flip_u = flipU;
}
boolean isFlipV()
{
return this.flip_v;
}
void setFlipV( final boolean flipV )
{
this.flip_v = flipV;
}
public void setOriginal( @Nonnull final IIcon original )
{
this.original = original;
}
}

View File

@ -31,7 +31,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class MissingIcon implements IIcon
{
final boolean isBlock;
private final boolean isBlock;
public MissingIcon( final Object forWhat )
{
@ -45,7 +45,7 @@ public class MissingIcon implements IIcon
}
@SideOnly( Side.CLIENT )
public IIcon getMissing()
private IIcon getMissing()
{
return ( (TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture( this.isBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture ) ).getAtlasSprite( "missingno" );
}

View File

@ -28,8 +28,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class OffsetIcon implements IIcon
{
final float offsetX;
final float offsetY;
private final float offsetX;
private final float offsetY;
private final IIcon p;

View File

@ -28,7 +28,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class TaughtIcon implements IIcon
{
final float tightness;
private final float tightness;
private final IIcon icon;

View File

@ -33,6 +33,7 @@ public class TmpFlippableIcon extends FlippableIcon
super( NULL_ICON );
}
@Override
public void setOriginal( IIcon i )
{
this.setFlip( false, false );
@ -40,14 +41,14 @@ public class TmpFlippableIcon extends FlippableIcon
while( i instanceof FlippableIcon )
{
final FlippableIcon fi = (FlippableIcon) i;
if( fi.flip_u )
if( fi.isFlipU() )
{
this.flip_u = !this.flip_u;
this.setFlipU( !this.isFlipU() );
}
if( fi.flip_v )
if( fi.isFlipV() )
{
this.flip_v = !this.flip_v;
this.setFlipV( !this.isFlipV() );
}
i = fi.getOriginal();
@ -55,11 +56,11 @@ public class TmpFlippableIcon extends FlippableIcon
if( i == null )
{
this.original = NULL_ICON;
super.setOriginal( NULL_ICON );
}
else
{
this.original = i;
super.setOriginal( i );
}
}
}

View File

@ -85,22 +85,22 @@ import appeng.util.item.AEItemStack;
public abstract class AEBaseContainer extends Container
{
protected final InventoryPlayer invPlayer;
protected final BaseActionSource mySrc;
protected final HashSet<Integer> locked = new HashSet<Integer>();
final TileEntity tileEntity;
final IPart part;
final IGuiItemObject obj;
final List<PacketPartialItem> dataChunks = new LinkedList<PacketPartialItem>();
final HashMap<Integer, SyncData> syncData = new HashMap<Integer, SyncData>();
public boolean isContainerValid = true;
public String customName;
public ContainerOpenContext openContext;
protected IMEInventoryHandler<IAEItemStack> cellInv;
protected IEnergySource powerSrc;
boolean sentCustomName;
int ticksSinceCheck = 900;
IAEItemStack clientRequestedTargetItem = null;
private final InventoryPlayer invPlayer;
private final BaseActionSource mySrc;
private final HashSet<Integer> locked = new HashSet<Integer>();
private final TileEntity tileEntity;
private final IPart part;
private final IGuiItemObject obj;
private final List<PacketPartialItem> dataChunks = new LinkedList<PacketPartialItem>();
private final HashMap<Integer, SyncData> syncData = new HashMap<Integer, SyncData>();
private boolean isContainerValid = true;
private String customName;
private ContainerOpenContext openContext;
private IMEInventoryHandler<IAEItemStack> cellInv;
private IEnergySource powerSrc;
private boolean sentCustomName;
private int ticksSinceCheck = 900;
private IAEItemStack clientRequestedTargetItem = null;
public AEBaseContainer( final InventoryPlayer ip, final TileEntity myTile, final IPart myPart )
{
@ -278,7 +278,7 @@ public abstract class AEBaseContainer extends Container
this.clientRequestedTargetItem = stack == null ? null : stack.copy();
}
public BaseActionSource getSource()
public BaseActionSource getActionSource()
{
return this.mySrc;
}
@ -297,7 +297,7 @@ public abstract class AEBaseContainer extends Container
}
this.ticksSinceCheck = 0;
this.isContainerValid = this.isContainerValid && this.hasAccess( security, requirePower );
this.setValidContainer( this.isValidContainer() && this.hasAccess( security, requirePower ) );
}
protected boolean hasAccess( final SecurityPermissions perm, final boolean requirePower )
@ -322,7 +322,7 @@ public abstract class AEBaseContainer extends Container
}
final ISecurityGrid sg = g.getCache( ISecurityGrid.class );
if( sg.hasPermission( this.invPlayer.player, perm ) )
if( sg.hasPermission( this.getInventoryPlayer().player, perm ) )
{
return true;
}
@ -357,7 +357,7 @@ public abstract class AEBaseContainer extends Container
public InventoryPlayer getPlayerInv()
{
return this.invPlayer;
return this.getInventoryPlayer();
}
public TileEntity getTileEntity()
@ -422,7 +422,7 @@ public abstract class AEBaseContainer extends Container
if( newSlot instanceof AppEngSlot )
{
final AppEngSlot s = (AppEngSlot) newSlot;
s.myContainer = this;
s.setContainer( this );
return super.addSlotToContainer( newSlot );
}
else
@ -724,7 +724,7 @@ public abstract class AEBaseContainer extends Container
@Override
public boolean canInteractWith( final EntityPlayer entityplayer )
{
if( this.isContainerValid )
if( this.isValidContainer() )
{
if( this.tileEntity instanceof IInventory )
{
@ -738,7 +738,7 @@ public abstract class AEBaseContainer extends Container
@Override
public boolean canDragIntoSlot( final Slot s )
{
return ( (AppEngSlot) s ).isDraggable;
return ( (AppEngSlot) s ).isDraggable();
}
public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id )
@ -852,7 +852,7 @@ public abstract class AEBaseContainer extends Container
switch( action )
{
case SHIFT_CLICK:
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return;
}
@ -873,7 +873,7 @@ public abstract class AEBaseContainer extends Container
ais.setStackSize( ais.getStackSize() - myItem.stackSize );
}
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredExtraction( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais != null )
{
adp.addItems( ais.getItemStack() );
@ -881,7 +881,7 @@ public abstract class AEBaseContainer extends Container
}
break;
case ROLL_DOWN:
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return;
}
@ -895,7 +895,7 @@ public abstract class AEBaseContainer extends Container
ais.setStackSize( 1 );
final IAEItemStack extracted = ais.copy();
ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredInsert( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais == null )
{
final InventoryAdaptor ia = new AdaptorPlayerHand( player );
@ -903,7 +903,7 @@ public abstract class AEBaseContainer extends Container
final ItemStack fail = ia.removeItems( 1, extracted.getItemStack(), null );
if( fail == null )
{
this.cellInv.extractItems( extracted, Actionable.MODULATE, this.mySrc );
this.getCellInventory().extractItems( extracted, Actionable.MODULATE, this.getActionSource() );
}
this.updateHeld( player );
@ -913,7 +913,7 @@ public abstract class AEBaseContainer extends Container
break;
case ROLL_UP:
case PICKUP_SINGLE:
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return;
}
@ -939,7 +939,7 @@ public abstract class AEBaseContainer extends Container
{
IAEItemStack ais = slotItem.copy();
ais.setStackSize( 1 );
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredExtraction( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais != null )
{
final InventoryAdaptor ia = new AdaptorPlayerHand( player );
@ -947,7 +947,7 @@ public abstract class AEBaseContainer extends Container
final ItemStack fail = ia.addItems( ais.getItemStack() );
if( fail != null )
{
this.cellInv.injectItems( ais, Actionable.MODULATE, this.mySrc );
this.getCellInventory().injectItems( ais, Actionable.MODULATE, this.getActionSource() );
}
this.updateHeld( player );
@ -956,7 +956,7 @@ public abstract class AEBaseContainer extends Container
}
break;
case PICKUP_OR_SET_DOWN:
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return;
}
@ -967,7 +967,7 @@ public abstract class AEBaseContainer extends Container
{
IAEItemStack ais = slotItem.copy();
ais.setStackSize( ais.getItemStack().getMaxStackSize() );
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredExtraction( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais != null )
{
player.inventory.setItemStack( ais.getItemStack() );
@ -982,7 +982,7 @@ public abstract class AEBaseContainer extends Container
else
{
IAEItemStack ais = AEApi.instance().storage().createItemStack( player.inventory.getItemStack() );
ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredInsert( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais != null )
{
player.inventory.setItemStack( ais.getItemStack() );
@ -996,7 +996,7 @@ public abstract class AEBaseContainer extends Container
break;
case SPLIT_OR_PLACE_SINGLE:
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return;
}
@ -1008,13 +1008,13 @@ public abstract class AEBaseContainer extends Container
IAEItemStack ais = slotItem.copy();
final long maxSize = ais.getItemStack().getMaxStackSize();
ais.setStackSize( maxSize );
ais = this.cellInv.extractItems( ais, Actionable.SIMULATE, this.mySrc );
ais = this.getCellInventory().extractItems( ais, Actionable.SIMULATE, this.getActionSource() );
if( ais != null )
{
final long stackSize = Math.min( maxSize, ais.getStackSize() );
ais.setStackSize( ( stackSize + 1 ) >> 1 );
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredExtraction( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
}
if( ais != null )
@ -1032,7 +1032,7 @@ public abstract class AEBaseContainer extends Container
{
IAEItemStack ais = AEApi.instance().storage().createItemStack( player.inventory.getItemStack() );
ais.setStackSize( 1 );
ais = Platform.poweredInsert( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredInsert( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais == null )
{
final ItemStack is = player.inventory.getItemStack();
@ -1057,7 +1057,7 @@ public abstract class AEBaseContainer extends Container
break;
case MOVE_REGION:
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return;
}
@ -1081,7 +1081,7 @@ public abstract class AEBaseContainer extends Container
ais.setStackSize( ais.getStackSize() - myItem.stackSize );
}
ais = Platform.poweredExtraction( this.powerSrc, this.cellInv, ais, this.mySrc );
ais = Platform.poweredExtraction( this.getPowerSource(), this.getCellInventory(), ais, this.getActionSource() );
if( ais != null )
{
adp.addItems( ais.getItemStack() );
@ -1114,13 +1114,13 @@ public abstract class AEBaseContainer extends Container
}
}
public ItemStack shiftStoreItem( final ItemStack input )
private ItemStack shiftStoreItem( final ItemStack input )
{
if( this.powerSrc == null || this.cellInv == null )
if( this.getPowerSource() == null || this.getCellInventory() == null )
{
return input;
}
final IAEItemStack ais = Platform.poweredInsert( this.powerSrc, this.cellInv, AEApi.instance().storage().createItemStack( input ), this.mySrc );
final IAEItemStack ais = Platform.poweredInsert( this.getPowerSource(), this.getCellInventory(), AEApi.instance().storage().createItemStack( input ), this.getActionSource() );
if( ais == null )
{
return null;
@ -1134,7 +1134,7 @@ public abstract class AEBaseContainer extends Container
this.detectAndSendChanges();
}
protected void sendCustomName()
private void sendCustomName()
{
if( !this.sentCustomName )
{
@ -1167,14 +1167,14 @@ public abstract class AEBaseContainer extends Container
{
if( name.hasCustomName() )
{
this.customName = name.getCustomName();
this.setCustomName( name.getCustomName() );
}
if( this.customName != null )
if( this.getCustomName() != null )
{
try
{
NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.customName ), (EntityPlayerMP) this.invPlayer.player );
NetworkHandler.instance.sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ), (EntityPlayerMP) this.getInventoryPlayer().player );
}
catch( final IOException e )
{
@ -1208,12 +1208,12 @@ public abstract class AEBaseContainer extends Container
// can take?
if( isA != null && !a.canTakeStack( this.invPlayer.player ) )
if( isA != null && !a.canTakeStack( this.getInventoryPlayer().player ) )
{
return;
}
if( isB != null && !b.canTakeStack( this.invPlayer.player ) )
if( isB != null && !b.canTakeStack( this.getInventoryPlayer().player ) )
{
return;
}
@ -1280,4 +1280,59 @@ public abstract class AEBaseContainer extends Container
{
return true;
}
public IMEInventoryHandler<IAEItemStack> getCellInventory()
{
return this.cellInv;
}
public void setCellInventory( final IMEInventoryHandler<IAEItemStack> cellInv )
{
this.cellInv = cellInv;
}
public String getCustomName()
{
return this.customName;
}
public void setCustomName( final String customName )
{
this.customName = customName;
}
public InventoryPlayer getInventoryPlayer()
{
return this.invPlayer;
}
public boolean isValidContainer()
{
return this.isContainerValid;
}
public void setValidContainer( final boolean isContainerValid )
{
this.isContainerValid = isContainerValid;
}
public ContainerOpenContext getOpenContext()
{
return this.openContext;
}
public void setOpenContext( final ContainerOpenContext openContext )
{
this.openContext = openContext;
}
public IEnergySource getPowerSource()
{
return this.powerSrc;
}
public void setPowerSource( final IEnergySource powerSrc )
{
this.powerSrc = powerSrc;
}
}

View File

@ -29,12 +29,12 @@ import appeng.api.parts.IPart;
public class ContainerOpenContext
{
public final boolean isItem;
public World w;
public int x;
public int y;
public int z;
public ForgeDirection side;
private final boolean isItem;
private World w;
private int x;
private int y;
private int z;
private ForgeDirection side;
public ContainerOpenContext( final Object myItem )
{
@ -48,6 +48,56 @@ public class ContainerOpenContext
{
return null;
}
return this.w.getTileEntity( this.x, this.y, this.z );
return this.getWorld().getTileEntity( this.getX(), this.getY(), this.getZ() );
}
public ForgeDirection getSide()
{
return this.side;
}
public void setSide( final ForgeDirection side )
{
this.side = side;
}
private int getZ()
{
return this.z;
}
public void setZ( final int z )
{
this.z = z;
}
private int getY()
{
return this.y;
}
public void setY( final int y )
{
this.y = y;
}
private int getX()
{
return this.x;
}
public void setX( final int x )
{
this.x = x;
}
private World getWorld()
{
return this.w;
}
public void setWorld( final World w )
{
this.w = w;
}
}

View File

@ -19,11 +19,18 @@
package appeng.container.guisync;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotates that this field should be synchronized between the server and client.
* Requires the field to be public.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.FIELD )
public @interface GuiSync
{

View File

@ -55,7 +55,6 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
public CopyMode copyMode = CopyMode.CLEAR_ON_REMOVE;
private ItemStack prevStack = null;
private int lastUpgrades = 0;
private ItemStack LastCell;
public ContainerCellWorkbench( final InventoryPlayer ip, final TileCellWorkbench te )
{
@ -72,12 +71,12 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
}
}
public void nextCopyMode()
public void nextWorkBenchCopyMode()
{
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, Platform.nextEnum( this.getCopyMode() ) );
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, Platform.nextEnum( this.getWorkBenchCopyMode() ) );
}
public CopyMode getCopyMode()
private CopyMode getWorkBenchCopyMode()
{
return (CopyMode) this.workBench.getConfigManager().getSetting( Settings.COPY_MODE );
}
@ -91,10 +90,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
@Override
protected void setupConfig()
{
final IInventory cell = this.upgradeable.getInventoryByName( "cell" );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.invPlayer ) );
final IInventory cell = this.getUpgradeable().getInventoryByName( "cell" );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getInventoryPlayer() ) );
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
final IInventory upgradeInventory = new Upgrades();
// null, 3 * 8 );
@ -115,7 +114,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
for( int z = 0; z < 8; z++ )
{
final int iSLot = zz * 8 + z;
this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.invPlayer ) );
this.addSlotToContainer( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this.getInventoryPlayer() ) );
}
}
/*
@ -148,7 +147,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
{
if( this.workBench.getWorldObj().getTileEntity( this.workBench.xCoord, this.workBench.yCoord, this.workBench.zCoord ) != this.workBench )
{
this.isContainerValid = false;
this.setValidContainer( false );
}
for( final Object crafter : this.crafters )
@ -170,8 +169,8 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
}
}
this.copyMode = this.getCopyMode();
this.fzMode = this.getFuzzyMode();
this.setCopyMode( this.getWorkBenchCopyMode() );
this.setFuzzyMode( this.getWorkBenchFuzzyMode() );
}
this.prevStack = is;
@ -196,7 +195,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
{
if( field.equals( "copyMode" ) )
{
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, this.copyMode );
this.workBench.getConfigManager().putSetting( Settings.COPY_MODE, this.getCopyMode() );
}
super.onUpdate( field, oldValue, newValue );
@ -204,7 +203,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
public void clear()
{
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
for( int x = 0; x < inv.getSizeInventory(); x++ )
{
inv.setInventorySlotContents( x, null );
@ -212,7 +211,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
this.detectAndSendChanges();
}
private FuzzyMode getFuzzyMode()
private FuzzyMode getWorkBenchFuzzyMode()
{
final ICellWorkbenchItem cwi = this.workBench.getCell();
if( cwi != null )
@ -224,9 +223,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
public void partition()
{
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( this.upgradeable.getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS );
final IMEInventory<IAEItemStack> cellInv = AEApi.instance().registries().cell().getCellInventory( this.getUpgradeable().getInventoryByName( "cell" ).getStackInSlot( 0 ), null, StorageChannel.ITEMS );
Iterator<IAEItemStack> i = new NullIterator<IAEItemStack>();
if( cellInv != null )
@ -252,6 +251,16 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
this.detectAndSendChanges();
}
public CopyMode getCopyMode()
{
return this.copyMode;
}
private void setCopyMode( final CopyMode copyMode )
{
this.copyMode = copyMode;
}
private class Upgrades implements IInventory
{

View File

@ -29,14 +29,14 @@ import appeng.tile.storage.TileChest;
public class ContainerChest extends AEBaseContainer
{
final TileChest chest;
private final TileChest chest;
public ContainerChest( final InventoryPlayer ip, final TileChest chest )
{
super( ip, chest, null );
this.chest = chest;
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest, 1, 80, 37, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest, 1, 80, 37, this.getInventoryPlayer() ) );
this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 );
}

View File

@ -35,7 +35,7 @@ import appeng.util.Platform;
public class ContainerCondenser extends AEBaseContainer implements IProgressProvider
{
final TileCondenser condenser;
private final TileCondenser condenser;
@GuiSync( 0 )
public long requiredEnergy = 0;
@GuiSync( 1 )
@ -64,8 +64,8 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
final double requiredEnergy = this.condenser.getRequiredPower();
this.requiredEnergy = requiredEnergy == 0 ? (int) maxStorage : (int) Math.min( requiredEnergy, maxStorage );
this.storedPower = (int) this.condenser.storedPower;
this.output = (CondenserOutput) this.condenser.getConfigManager().getSetting( Settings.CONDENSER_OUTPUT );
this.storedPower = (int) this.condenser.getStoredPower();
this.setOutput( (CondenserOutput) this.condenser.getConfigManager().getSetting( Settings.CONDENSER_OUTPUT ) );
}
super.detectAndSendChanges();
@ -82,4 +82,14 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
{
return (int) this.requiredEnergy;
}
public CondenserOutput getOutput()
{
return this.output;
}
private void setOutput( final CondenserOutput output )
{
this.output = output;
}
}

View File

@ -19,6 +19,8 @@
package appeng.container.implementations;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.world.World;
@ -38,17 +40,15 @@ import appeng.tile.inventory.AppEngInternalInventory;
public class ContainerCraftAmount extends AEBaseContainer
{
public final Slot craftingItem;
final ITerminalHost priHost;
public IAEItemStack whatToMake;
private final Slot craftingItem;
private IAEItemStack itemToCreate;
public ContainerCraftAmount( final InventoryPlayer ip, final ITerminalHost te )
{
super( ip, te );
this.priHost = te;
this.craftingItem = new SlotInaccessible( new AppEngInternalInventory( null, 1 ), 0, 34, 53 );
this.addSlotToContainer( this.craftingItem );
this.addSlotToContainer( this.getCraftingItem() );
}
@Override
@ -73,4 +73,19 @@ public class ContainerCraftAmount extends AEBaseContainer
{
return new PlayerSource( this.getPlayerInv().player, (IActionHost) this.getTarget() );
}
public Slot getCraftingItem()
{
return this.craftingItem;
}
public IAEItemStack getItemToCraft()
{
return this.itemToCreate;
}
public void setItemToCraft( @Nonnull final IAEItemStack itemToCreate )
{
this.itemToCreate = itemToCreate;
}
}

View File

@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.Future;
import javax.annotation.Nonnull;
import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.EntityPlayer;
@ -67,10 +69,9 @@ import appeng.util.Platform;
public class ContainerCraftConfirm extends AEBaseContainer
{
public final ArrayList<CraftingCPURecord> cpus = new ArrayList<CraftingCPURecord>();
final ITerminalHost priHost;
public Future<ICraftingJob> job;
public ICraftingJob result;
private final ArrayList<CraftingCPURecord> cpus = new ArrayList<CraftingCPURecord>();
private Future<ICraftingJob> job;
private ICraftingJob result;
@GuiSync( 0 )
public long bytesUsed;
@GuiSync( 1 )
@ -87,45 +88,43 @@ public class ContainerCraftConfirm extends AEBaseContainer
public boolean noCPU = true;
@GuiSync( 7 )
public String myName = "";
protected long cpuIdx = Long.MIN_VALUE;
public ContainerCraftConfirm( final InventoryPlayer ip, final ITerminalHost te )
{
super( ip, te );
this.priHost = te;
}
public void cycleCpu( final boolean next )
{
if( next )
{
this.selectedCpu++;
this.setSelectedCpu( this.getSelectedCpu() + 1 );
}
else
{
this.selectedCpu--;
this.setSelectedCpu( this.getSelectedCpu() - 1 );
}
if( this.selectedCpu < -1 )
if( this.getSelectedCpu() < -1 )
{
this.selectedCpu = this.cpus.size() - 1;
this.setSelectedCpu( this.cpus.size() - 1 );
}
else if( this.selectedCpu >= this.cpus.size() )
else if( this.getSelectedCpu() >= this.cpus.size() )
{
this.selectedCpu = -1;
this.setSelectedCpu( -1 );
}
if( this.selectedCpu == -1 )
if( this.getSelectedCpu() == -1 )
{
this.cpuBytesAvail = 0;
this.cpuCoProcessors = 0;
this.myName = "";
this.setCpuAvailableBytes( 0 );
this.setCpuCoProcessors( 0 );
this.setName( "" );
}
else
{
this.myName = this.cpus.get( this.selectedCpu ).myName;
this.cpuBytesAvail = this.cpus.get( this.selectedCpu ).size;
this.cpuCoProcessors = this.cpus.get( this.selectedCpu ).processors;
this.setName( this.cpus.get( this.getSelectedCpu() ).getName() );
this.setCpuAvailableBytes( this.cpus.get( this.getSelectedCpu() ).getSize() );
this.setCpuCoProcessors( this.cpus.get( this.getSelectedCpu() ).getProcessors() );
}
}
@ -147,7 +146,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
boolean found = false;
for( final CraftingCPURecord ccr : this.cpus )
{
if( ccr.cpu == c )
if( ccr.getCpu() == c )
{
found = true;
}
@ -180,20 +179,20 @@ public class ContainerCraftConfirm extends AEBaseContainer
this.sendCPUs();
}
this.noCPU = this.cpus.isEmpty();
this.setNoCPU( this.cpus.isEmpty() );
super.detectAndSendChanges();
if( this.job != null && this.job.isDone() )
if( this.getJob() != null && this.getJob().isDone() )
{
try
{
this.result = this.job.get();
this.result = this.getJob().get();
if( !this.result.isSimulation() )
{
this.simulation = false;
if( this.autoStart )
this.setSimulation( false );
if( this.isAutoStart() )
{
this.startJob();
return;
@ -201,7 +200,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
}
else
{
this.simulation = true;
this.setSimulation( true );
}
try
@ -213,7 +212,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
final IItemList<IAEItemStack> plan = AEApi.instance().storage().createItemList();
this.result.populatePlan( plan );
this.bytesUsed = this.result.getByteTotal();
this.setUsedBytes( this.result.getByteTotal() );
for( final IAEItemStack out : plan )
{
@ -233,7 +232,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
if( c != null && this.result.isSimulation() )
{
m = o.copy();
o = items.extractItems( o, Actionable.SIMULATE, this.mySrc );
o = items.extractItems( o, Actionable.SIMULATE, this.getActionSource() );
if( o == null )
{
@ -282,16 +281,16 @@ public class ContainerCraftConfirm extends AEBaseContainer
{
this.getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) );
AELog.error( e );
this.isContainerValid = false;
this.setValidContainer( false );
this.result = null;
}
this.job = null;
this.setJob( null );
}
this.verifyPermissions( SecurityPermissions.CRAFT, false );
}
public IGrid getGrid()
private IGrid getGrid()
{
final IActionHost h = ( (IActionHost) this.getTarget() );
return h.getActionableNode().getGrid();
@ -299,25 +298,25 @@ public class ContainerCraftConfirm extends AEBaseContainer
private boolean cpuMatches( final ICraftingCPU c )
{
return c.getAvailableStorage() >= this.bytesUsed && !c.isBusy();
return c.getAvailableStorage() >= this.getUsedBytes() && !c.isBusy();
}
private void sendCPUs()
{
Collections.sort( this.cpus );
if( this.selectedCpu >= this.cpus.size() )
if( this.getSelectedCpu() >= this.cpus.size() )
{
this.selectedCpu = -1;
this.cpuBytesAvail = 0;
this.cpuCoProcessors = 0;
this.myName = "";
this.setSelectedCpu( -1 );
this.setCpuAvailableBytes( 0 );
this.setCpuCoProcessors( 0 );
this.setName( "" );
}
else if( this.selectedCpu != -1 )
else if( this.getSelectedCpu() != -1 )
{
this.myName = this.cpus.get( this.selectedCpu ).myName;
this.cpuBytesAvail = this.cpus.get( this.selectedCpu ).size;
this.cpuCoProcessors = this.cpus.get( this.selectedCpu ).processors;
this.setName( this.cpus.get( this.getSelectedCpu() ).getName() );
this.setCpuAvailableBytes( this.cpus.get( this.getSelectedCpu() ).getSize() );
this.setCpuCoProcessors( this.cpus.get( this.getSelectedCpu() ).getProcessors() );
}
}
@ -346,22 +345,22 @@ public class ContainerCraftConfirm extends AEBaseContainer
originalGui = GuiBridge.GUI_PATTERN_TERMINAL;
}
if( this.result != null && !this.simulation )
if( this.result != null && !this.isSimulation() )
{
final ICraftingGrid cc = this.getGrid().getCache( ICraftingGrid.class );
final ICraftingLink g = cc.submitJob( this.result, null, this.selectedCpu == -1 ? null : this.cpus.get( this.selectedCpu ).cpu, true, this.getActionSrc() );
this.autoStart = false;
if( g != null && originalGui != null && this.openContext != null )
final ICraftingLink g = cc.submitJob( this.result, null, this.getSelectedCpu() == -1 ? null : this.cpus.get( this.getSelectedCpu() ).getCpu(), true, this.getActionSrc() );
this.setAutoStart( false );
if( g != null && originalGui != null && this.getOpenContext() != null )
{
NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.invPlayer.player );
NetworkHandler.instance.sendTo( new PacketSwitchGuis( originalGui ), (EntityPlayerMP) this.getInventoryPlayer().player );
final TileEntity te = this.openContext.getTile();
Platform.openGUI( this.invPlayer.player, te, this.openContext.side, originalGui );
final TileEntity te = this.getOpenContext().getTile();
Platform.openGUI( this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui );
}
}
}
public BaseActionSource getActionSrc()
private BaseActionSource getActionSrc()
{
return new PlayerSource( this.getPlayerInv().player, (IActionHost) this.getTarget() );
}
@ -370,10 +369,10 @@ public class ContainerCraftConfirm extends AEBaseContainer
public void removeCraftingFromCrafters( final ICrafting c )
{
super.removeCraftingFromCrafters( c );
if( this.job != null )
if( this.getJob() != null )
{
this.job.cancel( true );
this.job = null;
this.getJob().cancel( true );
this.setJob( null );
}
}
@ -381,10 +380,10 @@ public class ContainerCraftConfirm extends AEBaseContainer
public void onContainerClosed( final EntityPlayer par1EntityPlayer )
{
super.onContainerClosed( par1EntityPlayer );
if( this.job != null )
if( this.getJob() != null )
{
this.job.cancel( true );
this.job = null;
this.getJob().cancel( true );
this.setJob( null );
}
}
@ -392,4 +391,94 @@ public class ContainerCraftConfirm extends AEBaseContainer
{
return this.getPlayerInv().player.worldObj;
}
public boolean isAutoStart()
{
return this.autoStart;
}
public void setAutoStart( final boolean autoStart )
{
this.autoStart = autoStart;
}
public long getUsedBytes()
{
return this.bytesUsed;
}
private void setUsedBytes( final long bytesUsed )
{
this.bytesUsed = bytesUsed;
}
public long getCpuAvailableBytes()
{
return this.cpuBytesAvail;
}
private void setCpuAvailableBytes( final long cpuBytesAvail )
{
this.cpuBytesAvail = cpuBytesAvail;
}
public int getCpuCoProcessors()
{
return this.cpuCoProcessors;
}
private void setCpuCoProcessors( final int cpuCoProcessors )
{
this.cpuCoProcessors = cpuCoProcessors;
}
public int getSelectedCpu()
{
return this.selectedCpu;
}
private void setSelectedCpu( final int selectedCpu )
{
this.selectedCpu = selectedCpu;
}
public String getName()
{
return this.myName;
}
private void setName( @Nonnull final String myName )
{
this.myName = myName;
}
public boolean hasNoCPU()
{
return this.noCPU;
}
private void setNoCPU( final boolean noCPU )
{
this.noCPU = noCPU;
}
public boolean isSimulation()
{
return this.simulation;
}
private void setSimulation( final boolean simulation )
{
this.simulation = simulation;
}
private Future<ICraftingJob> getJob()
{
return this.job;
}
public void setJob( final Future<ICraftingJob> job )
{
this.job = job;
}
}

View File

@ -54,11 +54,10 @@ import appeng.util.Platform;
public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorHandlerReceiver<IAEItemStack>, ICustomNameObject
{
final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
protected IGrid network;
CraftingCPUCluster monitor = null;
String cpuName = null;
int delay = 40;
private final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
private IGrid network;
private CraftingCPUCluster monitor = null;
private String cpuName = null;
@GuiSync( 0 )
public long eta = -1;
@ -82,34 +81,34 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
this.setCPU( (ICraftingCPU) ( (IAEMultiBlock) te ).getCluster() );
}
if( this.network == null && Platform.isServer() )
if( this.getNetwork() == null && Platform.isServer() )
{
this.isContainerValid = false;
this.setValidContainer( false );
}
}
private void findNode( final IGridHost host, final ForgeDirection d )
{
if( this.network == null )
if( this.getNetwork() == null )
{
final IGridNode node = host.getGridNode( d );
if( node != null )
{
this.network = node.getGrid();
this.setNetwork( node.getGrid() );
}
}
}
protected void setCPU( final ICraftingCPU c )
{
if( c == this.monitor )
if( c == this.getMonitor() )
{
return;
}
if( this.monitor != null )
if( this.getMonitor() != null )
{
this.monitor.removeListener( this );
this.getMonitor().removeListener( this );
}
for( final Object g : this.crafters )
@ -130,27 +129,27 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
if( c instanceof CraftingCPUCluster )
{
this.cpuName = c.getName();
this.monitor = (CraftingCPUCluster) c;
this.setMonitor( (CraftingCPUCluster) c );
this.list.resetStatus();
this.monitor.getListOfItem( this.list, CraftingItemList.ALL );
this.monitor.addListener( this, null );
this.eta = 0;
this.getMonitor().getListOfItem( this.list, CraftingItemList.ALL );
this.getMonitor().addListener( this, null );
this.setEstimatedTime( 0 );
}
else
{
this.monitor = null;
this.setMonitor( null );
this.cpuName = "";
this.eta = -1;
this.setEstimatedTime( -1 );
}
}
public void cancelCrafting()
{
if( this.monitor != null )
if( this.getMonitor() != null )
{
this.monitor.cancel();
this.getMonitor().cancel();
}
this.eta = -1;
this.setEstimatedTime( -1 );
}
@Override
@ -158,9 +157,9 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
{
super.removeCraftingFromCrafters( c );
if( this.crafters.isEmpty() && this.monitor != null )
if( this.crafters.isEmpty() && this.getMonitor() != null )
{
this.monitor.removeListener( this );
this.getMonitor().removeListener( this );
}
}
@ -168,26 +167,26 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
public void onContainerClosed( final EntityPlayer player )
{
super.onContainerClosed( player );
if( this.monitor != null )
if( this.getMonitor() != null )
{
this.monitor.removeListener( this );
this.getMonitor().removeListener( this );
}
}
@Override
public void detectAndSendChanges()
{
if( Platform.isServer() && this.monitor != null && !this.list.isEmpty() )
if( Platform.isServer() && this.getMonitor() != null && !this.list.isEmpty() )
{
try
{
if( this.eta >= 0 )
if( this.getEstimatedTime() >= 0 )
{
final long elapsedTime = this.monitor.getElapsedTime();
final double remainingItems = this.monitor.getRemainingItemCount();
final double startItems = this.monitor.getStartItemCount();
final long elapsedTime = this.getMonitor().getElapsedTime();
final double remainingItems = this.getMonitor().getRemainingItemCount();
final double startItems = this.getMonitor().getStartItemCount();
final long eta = (long) ( elapsedTime / Math.max( 1d, ( startItems - remainingItems ) ) * remainingItems );
this.eta = eta;
this.setEstimatedTime( eta );
}
final PacketMEInventoryUpdate a = new PacketMEInventoryUpdate( (byte) 0 );
@ -196,9 +195,9 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
for( final IAEItemStack out : this.list )
{
a.appendItem( this.monitor.getItemStack( out, CraftingItemList.STORAGE ) );
b.appendItem( this.monitor.getItemStack( out, CraftingItemList.ACTIVE ) );
c.appendItem( this.monitor.getItemStack( out, CraftingItemList.PENDING ) );
a.appendItem( this.getMonitor().getItemStack( out, CraftingItemList.STORAGE ) );
b.appendItem( this.getMonitor().getItemStack( out, CraftingItemList.ACTIVE ) );
c.appendItem( this.getMonitor().getItemStack( out, CraftingItemList.PENDING ) );
}
this.list.resetStatus();
@ -266,4 +265,34 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
{
return this.cpuName != null && this.cpuName.length() > 0;
}
public long getEstimatedTime()
{
return this.eta;
}
private void setEstimatedTime( final long eta )
{
this.eta = eta;
}
CraftingCPUCluster getMonitor()
{
return this.monitor;
}
private void setMonitor( final CraftingCPUCluster monitor )
{
this.monitor = monitor;
}
IGrid getNetwork()
{
return this.network;
}
private void setNetwork( final IGrid network )
{
this.network = network;
}
}

View File

@ -21,6 +21,7 @@ package appeng.container.implementations;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.ImmutableSet;
@ -35,7 +36,7 @@ import appeng.container.guisync.GuiSync;
public class ContainerCraftingStatus extends ContainerCraftingCPU
{
public final ArrayList<CraftingCPURecord> cpus = new ArrayList<CraftingCPURecord>();
private final List<CraftingCPURecord> cpus = new ArrayList<CraftingCPURecord>();
@GuiSync( 5 )
public int selectedCpu = -1;
@GuiSync( 6 )
@ -51,7 +52,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
@Override
public void detectAndSendChanges()
{
final ICraftingGrid cc = this.network.getCache( ICraftingGrid.class );
final ICraftingGrid cc = this.getNetwork().getCache( ICraftingGrid.class );
final ImmutableSet<ICraftingCPU> cpuSet = cc.getCpus();
int matches = 0;
@ -61,7 +62,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
boolean found = false;
for( final CraftingCPURecord ccr : this.cpus )
{
if( ccr.cpu == c )
if( ccr.getCpu() == c )
{
found = true;
}
@ -115,7 +116,7 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
}
else if( this.selectedCpu != -1 )
{
this.myName = this.cpus.get( this.selectedCpu ).myName;
this.myName = this.cpus.get( this.selectedCpu ).getName();
}
if( this.selectedCpu == -1 && this.cpus.size() > 0 )
@ -125,9 +126,9 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
if( this.selectedCpu != -1 )
{
if( this.cpus.get( this.selectedCpu ).cpu != this.monitor )
if( this.cpus.get( this.selectedCpu ).getCpu() != this.getMonitor() )
{
this.setCPU( this.cpus.get( this.selectedCpu ).cpu );
this.setCPU( this.cpus.get( this.selectedCpu ).getCpu() );
}
}
else
@ -168,8 +169,8 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
}
else
{
this.myName = this.cpus.get( this.selectedCpu ).myName;
this.setCPU( this.cpus.get( this.selectedCpu ).cpu );
this.myName = this.cpus.get( this.selectedCpu ).getName();
this.setCPU( this.cpus.get( this.selectedCpu ).getCpu() );
}
}
}

View File

@ -39,10 +39,10 @@ import appeng.tile.inventory.InvOperation;
public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IContainerCraftingPacket
{
public final PartCraftingTerminal ct;
final AppEngInternalInventory output = new AppEngInternalInventory( this, 1 );
final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
final SlotCraftingTerm outputSlot;
private final PartCraftingTerminal ct;
private final AppEngInternalInventory output = new AppEngInternalInventory( this, 1 );
private final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
private final SlotCraftingTerm outputSlot;
public ContainerCraftingTerm( final InventoryPlayer ip, final ITerminalHost monitorable )
{
@ -59,7 +59,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
}
}
this.addSlotToContainer( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.mySrc, this.powerSrc, monitorable, crafting, crafting, this.output, 131, -72 + 18, this ) );
this.addSlotToContainer( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.getActionSource(), this.getPowerSource(), monitorable, crafting, crafting, this.output, 131, -72 + 18, this ) );
this.bindPlayerInventory( ip, 0, 0 );
@ -100,7 +100,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
{
if( name.equals( "player" ) )
{
return this.invPlayer;
return this.getInventoryPlayer();
}
return this.ct.getInventoryByName( name );
}

View File

@ -29,18 +29,15 @@ import appeng.tile.storage.TileDrive;
public class ContainerDrive extends AEBaseContainer
{
final TileDrive drive;
public ContainerDrive( final InventoryPlayer ip, final TileDrive drive )
{
super( ip, drive, null );
this.drive = drive;
for( int y = 0; y < 5; y++ )
{
for( int x = 0; x < 2; x++ )
{
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive, x + y * 2, 71 + x * 18, 14 + y * 18, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive, x + y * 2, 71 + x * 18, 14 + y * 18, this.getInventoryPlayer() ) );
}
}

View File

@ -38,15 +38,12 @@ import appeng.util.Platform;
public class ContainerFormationPlane extends ContainerUpgradeable
{
final PartFormationPlane storageBus;
@GuiSync( 6 )
public YesNo placeMode;
public ContainerFormationPlane( final InventoryPlayer ip, final PartFormationPlane te )
{
super( ip, te );
this.storageBus = te;
}
@Override
@ -61,7 +58,7 @@ public class ContainerFormationPlane extends ContainerUpgradeable
final int xo = 8;
final int yo = 23 + 6;
final IInventory config = this.upgradeable.getInventoryByName( "config" );
final IInventory config = this.getUpgradeable().getInventoryByName( "config" );
for( int y = 0; y < 7; y++ )
{
for( int x = 0; x < 9; x++ )
@ -77,12 +74,12 @@ public class ContainerFormationPlane extends ContainerUpgradeable
}
}
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.invPlayer ) ).setNotDraggable() );
final IInventory upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer() ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getInventoryPlayer() ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getInventoryPlayer() ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getInventoryPlayer() ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getInventoryPlayer() ) ).setNotDraggable() );
}
@Override
@ -104,8 +101,8 @@ public class ContainerFormationPlane extends ContainerUpgradeable
if( Platform.isServer() )
{
this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.placeMode = (YesNo) this.upgradeable.getConfigManager().getSetting( Settings.PLACE_BLOCK );
this.setFuzzyMode( (FuzzyMode) this.getUpgradeable().getConfigManager().getSetting( Settings.FUZZY_MODE ) );
this.setPlaceMode( (YesNo) this.getUpgradeable().getConfigManager().getSetting( Settings.PLACE_BLOCK ) );
}
this.standardDetectAndSendChanges();
@ -114,8 +111,18 @@ public class ContainerFormationPlane extends ContainerUpgradeable
@Override
public boolean isSlotEnabled( final int idx )
{
final int upgrades = this.upgradeable.getInstalledUpgrades( Upgrades.CAPACITY );
final int upgrades = this.getUpgradeable().getInstalledUpgrades( Upgrades.CAPACITY );
return upgrades > idx;
}
public YesNo getPlaceMode()
{
return this.placeMode;
}
private void setPlaceMode( final YesNo placeMode )
{
this.placeMode = placeMode;
}
}

View File

@ -31,16 +31,13 @@ import appeng.tile.grindstone.TileGrinder;
public class ContainerGrinder extends AEBaseContainer
{
final TileGrinder grinder;
public ContainerGrinder( final InventoryPlayer ip, final TileGrinder grinder )
{
super( ip, grinder, null );
this.grinder = grinder;
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 0, 12, 17, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 1, 12 + 18, 17, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 2, 12 + 36, 17, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 0, 12, 17, this.getInventoryPlayer() ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 1, 12 + 18, 17, this.getInventoryPlayer() ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, grinder, 2, 12 + 36, 17, this.getInventoryPlayer() ) );
this.addSlotToContainer( new SlotInaccessible( grinder, 6, 80, 40 ) );

View File

@ -37,8 +37,6 @@ import appeng.util.Platform;
public class ContainerIOPort extends ContainerUpgradeable
{
final TileIOPort ioPort;
@GuiSync( 2 )
public FullnessMode fMode = FullnessMode.EMPTY;
@GuiSync( 3 )
@ -47,7 +45,6 @@ public class ContainerIOPort extends ContainerUpgradeable
public ContainerIOPort( final InventoryPlayer ip, final TileIOPort te )
{
super( ip, te );
this.ioPort = te;
}
@Override
@ -62,13 +59,13 @@ public class ContainerIOPort extends ContainerUpgradeable
int offX = 19;
int offY = 17;
final IInventory cells = this.upgradeable.getInventoryByName( "cells" );
final IInventory cells = this.getUpgradeable().getInventoryByName( "cells" );
for( int y = 0; y < 3; y++ )
{
for( int x = 0; x < 2; x++ )
{
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this.getInventoryPlayer() ) );
}
}
@ -82,10 +79,10 @@ public class ContainerIOPort extends ContainerUpgradeable
}
}
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
final IInventory upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer() ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getInventoryPlayer() ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getInventoryPlayer() ) ).setNotDraggable() );
}
@Override
@ -107,11 +104,31 @@ public class ContainerIOPort extends ContainerUpgradeable
if( Platform.isServer() )
{
this.opMode = (OperationMode) this.upgradeable.getConfigManager().getSetting( Settings.OPERATION_MODE );
this.fMode = (FullnessMode) this.upgradeable.getConfigManager().getSetting( Settings.FULLNESS_MODE );
this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED );
this.setOperationMode( (OperationMode) this.getUpgradeable().getConfigManager().getSetting( Settings.OPERATION_MODE ) );
this.setFullMode( (FullnessMode) this.getUpgradeable().getConfigManager().getSetting( Settings.FULLNESS_MODE ) );
this.setRedStoneMode( (RedstoneMode) this.getUpgradeable().getConfigManager().getSetting( Settings.REDSTONE_CONTROLLED ) );
}
this.standardDetectAndSendChanges();
}
public FullnessMode getFullMode()
{
return this.fMode;
}
private void setFullMode( final FullnessMode fMode )
{
this.fMode = fMode;
}
public OperationMode getOperationMode()
{
return this.opMode;
}
private void setOperationMode( final OperationMode opMode )
{
this.opMode = opMode;
}
}

View File

@ -43,11 +43,11 @@ import appeng.util.Platform;
public class ContainerInscriber extends ContainerUpgradeable implements IProgressProvider
{
final TileInscriber ti;
private final TileInscriber ti;
final Slot top;
final Slot middle;
final Slot bottom;
private final Slot top;
private final Slot middle;
private final Slot bottom;
@GuiSync( 2 )
public int maxProcessingTime = -1;
@ -60,9 +60,9 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
super( ip, te );
this.ti = te;
this.addSlotToContainer( this.top = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, this.ti, 0, 45, 16, this.invPlayer ) );
this.addSlotToContainer( this.bottom = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, this.ti, 1, 45, 62, this.invPlayer ) );
this.addSlotToContainer( this.middle = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, this.ti, 2, 63, 39, this.invPlayer ) );
this.addSlotToContainer( this.top = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, this.ti, 0, 45, 16, this.getInventoryPlayer() ) );
this.addSlotToContainer( this.bottom = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, this.ti, 1, 45, 62, this.getInventoryPlayer() ) );
this.addSlotToContainer( this.middle = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, this.ti, 2, 63, 39, this.getInventoryPlayer() ) );
this.addSlotToContainer( new SlotOutput( this.ti, 3, 113, 40, -1 ) );
}
@ -100,8 +100,8 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
if( Platform.isServer() )
{
this.maxProcessingTime = this.ti.maxProcessingTime;
this.processingTime = this.ti.processingTime;
this.maxProcessingTime = this.ti.getMaxProcessingTime();
this.processingTime = this.ti.getProcessingTime();
}
}

View File

@ -36,7 +36,7 @@ import appeng.helpers.IInterfaceHost;
public class ContainerInterface extends ContainerUpgradeable
{
final DualityInterface myDuality;
private final DualityInterface myDuality;
@GuiSync( 3 )
public YesNo bMode = YesNo.NO;
@ -52,7 +52,7 @@ public class ContainerInterface extends ContainerUpgradeable
for( int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++ )
{
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, this.invPlayer ) );
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality.getPatterns(), x, 8 + 18 * x, 90 + 7, this.getInventoryPlayer() ) );
}
for( int x = 0; x < DualityInterface.NUMBER_OF_CONFIG_SLOTS; x++ )
@ -94,7 +94,27 @@ public class ContainerInterface extends ContainerUpgradeable
@Override
protected void loadSettingsFromHost( final IConfigManager cm )
{
this.bMode = (YesNo) cm.getSetting( Settings.BLOCK );
this.iTermMode = (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL );
this.setBlockingMode( (YesNo) cm.getSetting( Settings.BLOCK ) );
this.setInterfaceTerminalMode( (YesNo) cm.getSetting( Settings.INTERFACE_TERMINAL ) );
}
public YesNo getBlockingMode()
{
return this.bMode;
}
private void setBlockingMode( final YesNo bMode )
{
this.bMode = bMode;
}
public YesNo getInterfaceTerminalMode()
{
return this.iTermMode;
}
private void setInterfaceTerminalMode( final YesNo iTermMode )
{
this.iTermMode = iTermMode;
}
}

View File

@ -62,10 +62,10 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
*/
private static long autoBase = Long.MIN_VALUE;
final Map<IInterfaceHost, InvTracker> diList = new HashMap<IInterfaceHost, InvTracker>();
final Map<Long, InvTracker> byId = new HashMap<Long, InvTracker>();
IGrid grid;
NBTTagCompound data = new NBTTagCompound();
private final Map<IInterfaceHost, InvTracker> diList = new HashMap<IInterfaceHost, InvTracker>();
private final Map<Long, InvTracker> byId = new HashMap<Long, InvTracker>();
private IGrid grid;
private NBTTagCompound data = new NBTTagCompound();
public ContainerInterfaceTerminal( final InventoryPlayer ip, final PartInterfaceTerminal anchor )
{
@ -401,14 +401,14 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
data.setTag( name, tag );
}
static class InvTracker
private static class InvTracker
{
public final long sortBy;
final long which = autoBase++;
final String unlocalizedName;
final IInventory client;
final IInventory server;
private final long sortBy;
private final long which = autoBase++;
private final String unlocalizedName;
private final IInventory client;
private final IInventory server;
public InvTracker( final DualityInterface dual, final IInventory patterns, final String unlocalizedName )
{
@ -419,7 +419,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
}
}
static class PatternInvSlot extends WrapperInvSlot
private static class PatternInvSlot extends WrapperInvSlot
{
public PatternInvSlot( final IInventory inv )

View File

@ -43,10 +43,10 @@ import appeng.util.Platform;
public class ContainerLevelEmitter extends ContainerUpgradeable
{
final PartLevelEmitter lvlEmitter;
private final PartLevelEmitter lvlEmitter;
@SideOnly( Side.CLIENT )
public GuiTextField textField;
private GuiTextField textField;
@GuiSync( 2 )
public LevelType lvType;
@GuiSync( 3 )
@ -76,28 +76,28 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
@Override
protected void setupConfig()
{
final IInventory upgrades = this.upgradeable.getInventoryByName( "upgrades" );
final IInventory upgrades = this.getUpgradeable().getInventoryByName( "upgrades" );
if( this.availableUpgrades() > 0 )
{
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getInventoryPlayer() ) ).setNotDraggable() );
}
if( this.availableUpgrades() > 1 )
{
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getInventoryPlayer() ) ).setNotDraggable() );
}
if( this.availableUpgrades() > 2 )
{
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getInventoryPlayer() ) ).setNotDraggable() );
}
if( this.availableUpgrades() > 3 )
{
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.invPlayer ) ).setNotDraggable() );
this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getInventoryPlayer() ) ).setNotDraggable() );
}
final IInventory inv = this.upgradeable.getInventoryByName( "config" );
final IInventory inv = this.getUpgradeable().getInventoryByName( "config" );
final int y = 40;
final int x = 80 + 44;
this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) );
}
@ -122,10 +122,10 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
if( Platform.isServer() )
{
this.EmitterValue = this.lvlEmitter.getReportingValue();
this.cmType = (YesNo) this.upgradeable.getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE );
this.lvType = (LevelType) this.upgradeable.getConfigManager().getSetting( Settings.LEVEL_TYPE );
this.fzMode = (FuzzyMode) this.upgradeable.getConfigManager().getSetting( Settings.FUZZY_MODE );
this.rsMode = (RedstoneMode) this.upgradeable.getConfigManager().getSetting( Settings.REDSTONE_EMITTER );
this.setCraftingMode( (YesNo) this.getUpgradeable().getConfigManager().getSetting( Settings.CRAFT_VIA_REDSTONE ) );
this.setLevelMode( (LevelType) this.getUpgradeable().getConfigManager().getSetting( Settings.LEVEL_TYPE ) );
this.setFuzzyMode( (FuzzyMode) this.getUpgradeable().getConfigManager().getSetting( Settings.FUZZY_MODE ) );
this.setRedStoneMode( (RedstoneMode) this.getUpgradeable().getConfigManager().getSetting( Settings.REDSTONE_EMITTER ) );
}
this.standardDetectAndSendChanges();
@ -142,4 +142,26 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
}
}
}
@Override
public YesNo getCraftingMode()
{
return this.cmType;
}
@Override
public void setCraftingMode( final YesNo cmType )
{
this.cmType = cmType;
}
public LevelType getLevelMode()
{
return this.lvType;
}
private void setLevelMode( final LevelType lvType )
{
this.lvType = lvType;
}
}

Some files were not shown because too many files have changed in this diff Show More