Swapped out Gui Sync with something a little more fancy.

This commit is contained in:
AlgorithmX2
2014-05-07 00:22:42 -05:00
parent 24d497e583
commit 1db9283eed
25 changed files with 750 additions and 973 deletions
@@ -1,22 +1,23 @@
package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import appeng.container.AEBaseContainer;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ContainerInscriber extends AEBaseContainer
{
TileInscriber myte;
@GuiSync(0)
public int maxProessingTime = -1;
@GuiSync(1)
public int processingTime = -1;
public ContainerInscriber(InventoryPlayer ip, TileInscriber te) {
@@ -39,37 +40,8 @@ public class ContainerInscriber extends AEBaseContainer
if ( Platform.isServer() )
{
int localMax = myte.maxProessingTime;
int localTime = myte.processingTime;
for (int i = 0; i < this.crafters.size(); ++i)
{
ICrafting icrafting = (ICrafting) this.crafters.get( i );
if ( this.maxProessingTime != localMax )
{
icrafting.sendProgressBarUpdate( this, 0, localMax );
}
if ( this.processingTime != localTime )
{
icrafting.sendProgressBarUpdate( this, 1, localTime );
}
}
this.maxProessingTime = localMax;
this.processingTime = localTime;
this.maxProessingTime = myte.maxProessingTime;
this.processingTime = myte.processingTime;
}
}
@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int idx, int value)
{
if ( idx == 0 )
this.maxProessingTime = value;
if ( idx == 1 )
this.processingTime = value;
}
}