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,14 +1,12 @@
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.SlotRestrictedInput;
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ContainerVibrationChamber extends AEBaseContainer
{
@@ -25,52 +23,23 @@ public class ContainerVibrationChamber extends AEBaseContainer
}
public int aePerTick = 5;
public int burnSpeed = 100;
@GuiSync(0)
public int burnProgress = 0;
@GuiSync(1)
public int burnSpeed = 100;
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
if ( Platform.isServer() )
{
int burnProgress = (int) (this.myte.maxBurnTime <= 0 ? 0 : 12 * this.myte.burnTime / this.myte.maxBurnTime);
for (int i = 0; i < this.crafters.size(); ++i)
{
ICrafting icrafting = (ICrafting) this.crafters.get( i );
if ( this.burnProgress != burnProgress )
{
icrafting.sendProgressBarUpdate( this, 0, (int) burnProgress );
}
if ( this.burnSpeed != this.myte.burnSpeed )
{
icrafting.sendProgressBarUpdate( this, 1, this.myte.burnSpeed );
}
}
this.burnProgress = burnProgress;
this.burnProgress = (int) (this.myte.maxBurnTime <= 0 ? 0 : 12 * this.myte.burnTime / this.myte.maxBurnTime);
this.burnSpeed = this.myte.burnSpeed;
}
}
@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int idx, int value)
{
if ( idx == 0 )
{
this.burnProgress = value;
}
if ( idx == 1 )
{
this.burnSpeed = value;
}
super.detectAndSendChanges();
}
}