Fixed some issues with the AESU, Added gui text to it
This commit is contained in:
parent
81a5f3fc76
commit
944ac7492e
3 changed files with 47 additions and 6 deletions
|
@ -1,6 +1,9 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
|
@ -16,7 +19,8 @@ public class ContainerAesu extends TechRebornContainer {
|
|||
return true;
|
||||
}
|
||||
|
||||
public int tickTime;
|
||||
public int euOut;
|
||||
public int storedEu;
|
||||
|
||||
public ContainerAesu(TileAesu tileaesu,
|
||||
EntityPlayer player)
|
||||
|
@ -46,4 +50,35 @@ public class ContainerAesu extends TechRebornContainer {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); i++) {
|
||||
ICrafting icrafting = (ICrafting)this.crafters.get(i);
|
||||
if(this.euOut != tile.output){
|
||||
icrafting.sendProgressBarUpdate(this, 0, tile.output);
|
||||
}
|
||||
if(this.storedEu != tile.energy){
|
||||
icrafting.sendProgressBarUpdate(this, 1, (int) tile.energy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.output);
|
||||
crafting.sendProgressBarUpdate(this, 1, (int) tile.energy);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if(id == 0){
|
||||
this.euOut = value;
|
||||
} else if(id == 1){
|
||||
this.storedEu = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ import techreborn.packets.PacketAesu;
|
|||
import techreborn.packets.PacketHandler;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class GuiAesu extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
|
@ -18,6 +20,8 @@ public class GuiAesu extends GuiContainer {
|
|||
|
||||
TileAesu aesu;
|
||||
|
||||
ContainerAesu containerAesu;
|
||||
|
||||
public GuiAesu(EntityPlayer player,
|
||||
TileAesu tileaesu)
|
||||
{
|
||||
|
@ -25,6 +29,7 @@ public class GuiAesu extends GuiContainer {
|
|||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
aesu = tileaesu;
|
||||
this.containerAesu = (ContainerAesu) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +57,9 @@ public class GuiAesu extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.aesu.name"), 40, 6, 4210752);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.aesu.name"), 40, 6, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerAesu.euOut + " eu/tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerAesu.storedEu + " eu", 10, 30, Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import codechicken.microblock.FaceEdgeGrid;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import ic2.core.block.wiring.TileEntityElectricBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -16,7 +15,7 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
|
|||
public static final int MAX_OUTPUT = 8192;
|
||||
public static final int MAX_STORAGE = 1000000000; //One billion!
|
||||
public Inventory inventory = new Inventory(2, "TileAesu", 64);
|
||||
public int OUTPUT = 64; //The current output
|
||||
private int OUTPUT = 64; //The current output
|
||||
|
||||
public TileAesu()
|
||||
{
|
||||
|
@ -39,7 +38,7 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
|
|||
@Override
|
||||
public short getFacing()
|
||||
{
|
||||
return (short) getBlockMetadata();
|
||||
return super.getFacing();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -98,7 +97,7 @@ public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
|
|||
if(OUTPUT > MAX_OUTPUT){
|
||||
OUTPUT = MAX_OUTPUT;
|
||||
}
|
||||
if(OUTPUT < 0){
|
||||
if(OUTPUT <= -1){
|
||||
OUTPUT = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue