Merged branch 1.9 into 1.9

This commit is contained in:
Stuart Pomeroy 2016-03-28 11:47:56 +01:00
commit 6247a2093d

View file

@ -1,77 +1,77 @@
package techreborn.client.gui; package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerMFE; import techreborn.client.container.ContainerMFE;
import techreborn.tiles.storage.TileMFE; import techreborn.tiles.storage.TileMFE;
/** /**
* Created by Rushmead * Created by Rushmead
*/ */
public class GuiMFE extends GuiContainer public class GuiMFE extends GuiContainer
{ {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/mfe.png"); public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/mfe.png");
TileMFE generator; TileMFE generator;
ContainerMFE containerGenerator; ContainerMFE containerGenerator;
public GuiMFE(EntityPlayer player, TileMFE generator) public GuiMFE(EntityPlayer player, TileMFE generator)
{ {
super(new ContainerMFE(generator, player)); super(new ContainerMFE(generator, player));
this.xSize = 176; this.xSize = 176;
this.ySize = 167; this.ySize = 167;
this.generator = generator; this.generator = generator;
this.containerGenerator = (ContainerMFE) this.inventorySlots; this.containerGenerator = (ContainerMFE) this.inventorySlots;
} }
@Override @Override
public void initGui() public void initGui()
{ {
int k = (this.width - this.xSize) / 2; int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2; int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@Override @Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{ {
this.mc.getTextureManager().bindTexture(texture); this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2; int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2; int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int j = 0; int j = 0;
j = generator.getEnergyScaled(24); j = generator.getEnergyScaled(24);
if (j > 0) if (j > 0)
{ {
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16); this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
} }
// //
// if (containerGenerator.burnTime != 0) // if (containerGenerator.burnTime != 0)
// { // {
// j = containerGenerator.getScaledBurnTime(13); // j = containerGenerator.getScaledBurnTime(13);
// this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, // this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14,
// j + 1); // j + 1);
// } // }
} }
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{ {
String name = I18n.translateToLocal("tile.techreborn.mfe.name"); String name = I18n.translateToLocal("tile.techreborn.mfe.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), this.xSize - 60, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), this.xSize - 60,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 110, this.ySize - 150, this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 110, this.ySize - 150,
4210752); 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 110, this.ySize - 160, this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 110, this.ySize - 160,
4210752); 4210752);
} }
} }