Code formatter take 2
This commit is contained in:
parent
33985f1a31
commit
5eed5b161d
450 changed files with 32768 additions and 26684 deletions
|
@ -1,5 +1,8 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -12,54 +15,63 @@ import techreborn.client.container.ContainerAesu;
|
|||
import techreborn.packets.PacketAesu;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
public class GuiAesu extends GuiContainer
|
||||
{
|
||||
|
||||
public class GuiAesu extends GuiContainer {
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
|
||||
TileAesu aesu;
|
||||
ContainerAesu containerAesu;
|
||||
TileAesu aesu;
|
||||
|
||||
public GuiAesu(EntityPlayer player, TileAesu tileaesu) {
|
||||
super(new ContainerAesu(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 197;
|
||||
aesu = tileaesu;
|
||||
this.containerAesu = (ContainerAesu) this.inventorySlots;
|
||||
}
|
||||
ContainerAesu containerAesu;
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 117, l + 20, 15, 15, "++"));
|
||||
this.buttonList.add(new GuiButton(1, k + 117, l + 20 + 20, 15, 15, "+"));
|
||||
this.buttonList.add(new GuiButton(2, k + 117, l + 20 + (20 * 2), 15, 15, "-"));
|
||||
this.buttonList.add(new GuiButton(3, k + 117, l + 20 + (20 * 3), 15, 15, "--"));
|
||||
}
|
||||
public GuiAesu(EntityPlayer player, TileAesu tileaesu)
|
||||
{
|
||||
super(new ContainerAesu(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 197;
|
||||
aesu = tileaesu;
|
||||
this.containerAesu = (ContainerAesu) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 128, l + 5, 15, 15, "++"));
|
||||
this.buttonList.add(new GuiButton(1, k + 128, l + 5 + 20, 15, 15, "+"));
|
||||
this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-"));
|
||||
this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--"));
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.aesu.name"), 40, 10, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu));
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.aesu.name"), 40, 10,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40,
|
||||
Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,56 +8,58 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerAlloyFurnace;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
|
||||
public class GuiAlloyFurnace extends GuiContainer {
|
||||
public class GuiAlloyFurnace extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/alloy_furnace.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/alloy_furnace.png");
|
||||
|
||||
TileAlloyFurnace alloyfurnace;
|
||||
TileAlloyFurnace alloyfurnace;
|
||||
|
||||
ContainerAlloyFurnace containerAlloyFurnace;
|
||||
ContainerAlloyFurnace containerAlloyFurnace;
|
||||
|
||||
public GuiAlloyFurnace(EntityPlayer player,
|
||||
TileAlloyFurnace tileAlloyFurnace) {
|
||||
super(new ContainerAlloyFurnace(tileAlloyFurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.alloyfurnace = tileAlloyFurnace;
|
||||
this.containerAlloyFurnace = (ContainerAlloyFurnace) this.inventorySlots;
|
||||
}
|
||||
public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace)
|
||||
{
|
||||
super(new ContainerAlloyFurnace(tileAlloyFurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.alloyfurnace = tileAlloyFurnace;
|
||||
this.containerAlloyFurnace = (ContainerAlloyFurnace) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (this.alloyfurnace.isBurning()) {
|
||||
int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13);
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
|
||||
i1 = this.alloyfurnace.getCookProgressScaled(24);
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
|
||||
}
|
||||
}
|
||||
if (this.alloyfurnace.isBurning())
|
||||
{
|
||||
int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13);
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
|
||||
i1 = this.alloyfurnace.getCookProgressScaled(24);
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,50 +8,60 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
|
||||
public class GuiAlloySmelter extends GuiContainer {
|
||||
public class GuiAlloySmelter extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/electric_alloy_furnace.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/electric_alloy_furnace.png");
|
||||
|
||||
TileAlloySmelter alloysmelter;
|
||||
TileAlloySmelter alloysmelter;
|
||||
|
||||
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter) {
|
||||
super(new ContainerAlloySmelter(tilealloysmelter, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
alloysmelter = tilealloysmelter;
|
||||
}
|
||||
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter)
|
||||
{
|
||||
super(new ContainerAlloySmelter(tilealloysmelter, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
alloysmelter = tilealloysmelter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = alloysmelter.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = alloysmelter.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = alloysmelter.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = alloysmelter.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,52 +8,62 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerAssemblingMachine;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
|
||||
public class GuiAssemblingMachine extends GuiContainer {
|
||||
public class GuiAssemblingMachine extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/assembling_machine.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/assembling_machine.png");
|
||||
|
||||
TileAssemblingMachine assemblingmachine;
|
||||
ContainerAssemblingMachine containerAssemblingMachine;
|
||||
TileAssemblingMachine assemblingmachine;
|
||||
ContainerAssemblingMachine containerAssemblingMachine;
|
||||
|
||||
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) {
|
||||
super(new ContainerAssemblingMachine(tileassemblinmachine, player));
|
||||
containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
assemblingmachine = tileassemblinmachine;
|
||||
}
|
||||
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine)
|
||||
{
|
||||
super(new ContainerAssemblingMachine(tileassemblinmachine, player));
|
||||
containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
assemblingmachine = tileassemblinmachine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = assemblingmachine.getProgressScaled(20);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = assemblingmachine.getProgressScaled(20);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = assemblingmachine.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = assemblingmachine.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,60 +6,69 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerBatbox;
|
||||
import techreborn.client.container.ContainerGenerator;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
|
||||
public class GuiBatbox extends GuiContainer {
|
||||
public class GuiBatbox extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/batbox.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/batbox.png");
|
||||
|
||||
TileBatBox generator;
|
||||
TileBatBox generator;
|
||||
|
||||
ContainerBatbox containerGenerator;
|
||||
ContainerBatbox containerGenerator;
|
||||
|
||||
public GuiBatbox(EntityPlayer player, TileBatBox generator) {
|
||||
super(new ContainerBatbox(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
this.containerGenerator = (ContainerBatbox) this.inventorySlots;
|
||||
}
|
||||
public GuiBatbox(EntityPlayer player, TileBatBox generator)
|
||||
{
|
||||
super(new ContainerBatbox(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
this.containerGenerator = (ContainerBatbox) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
//
|
||||
// if (containerGenerator.burnTime != 0)
|
||||
// {
|
||||
// j = containerGenerator.getScaledBurnTime(13);
|
||||
// this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1);
|
||||
// }
|
||||
}
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
//
|
||||
// if (containerGenerator.burnTime != 0)
|
||||
// {
|
||||
// j = containerGenerator.getScaledBurnTime(13);
|
||||
// this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14,
|
||||
// j + 1);
|
||||
// }
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.batbox.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.batbox.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize- 140, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize- 150, 4210752);
|
||||
}
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize - 140,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -17,84 +19,103 @@ import techreborn.init.ModBlocks;
|
|||
import techreborn.proxies.ClientProxy;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
import java.io.IOException;
|
||||
public class GuiBlastFurnace extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_blast_furnace.png");
|
||||
|
||||
public class GuiBlastFurnace extends GuiContainer {
|
||||
TileBlastFurnace blastfurnace;
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_blast_furnace.png");
|
||||
ContainerBlastFurnace containerBlastFurnace;
|
||||
|
||||
TileBlastFurnace blastfurnace;
|
||||
|
||||
ContainerBlastFurnace containerBlastFurnace;
|
||||
|
||||
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) {
|
||||
super(new ContainerBlastFurnace(tileblastfurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
blastfurnace = tileblastfurnace;
|
||||
this.containerBlastFurnace = (ContainerBlastFurnace) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
|
||||
buttonList.add(button);
|
||||
super.initGui();
|
||||
CoordTriplet coordinates = new CoordTriplet(blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
|
||||
if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0){
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
} else {
|
||||
button.displayString = "A";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (containerBlastFurnace.heat == 0) {
|
||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
j = blastfurnace.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = blastfurnace.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_);
|
||||
String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
if (containerBlastFurnace.heat != 0) {
|
||||
this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752);
|
||||
}
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace)
|
||||
{
|
||||
super(new ContainerBlastFurnace(tileblastfurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
blastfurnace = tileblastfurnace;
|
||||
this.containerBlastFurnace = (ContainerBlastFurnace) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException {
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
|
||||
buttonList.add(button);
|
||||
super.initGui();
|
||||
CoordTriplet coordinates = new CoordTriplet(
|
||||
blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
|
||||
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
|
||||
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
|
||||
if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0)
|
||||
{
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
} else
|
||||
{
|
||||
button.displayString = "A";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (containerBlastFurnace.heat == 0)
|
||||
{
|
||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
j = blastfurnace.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = blastfurnace.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_);
|
||||
String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
if (containerBlastFurnace.heat != 0)
|
||||
{
|
||||
this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752);
|
||||
}
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
super.actionPerformed(button);
|
||||
if(button.id == 212){
|
||||
if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
|
||||
{//This code here makes a basic multiblock and then sets to the selected one.
|
||||
if (button.id == 212)
|
||||
{
|
||||
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null)
|
||||
{
|
||||
{// This code here makes a basic multiblock and then sets to the
|
||||
// selected one.
|
||||
Multiblock multiblock = new Multiblock();
|
||||
multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0);
|
||||
|
@ -105,7 +126,7 @@ public class GuiBlastFurnace extends GuiContainer {
|
|||
multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0);
|
||||
|
||||
|
||||
multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0);
|
||||
|
@ -114,7 +135,7 @@ public class GuiBlastFurnace extends GuiContainer {
|
|||
multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0);
|
||||
|
||||
|
||||
multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0);
|
||||
|
@ -133,14 +154,20 @@ public class GuiBlastFurnace extends GuiContainer {
|
|||
multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0);
|
||||
multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0);
|
||||
|
||||
|
||||
MultiblockSet set = new MultiblockSet(multiblock);
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
ClientProxy.multiblockRenderEvent.partent = new Location(blastfurnace.getPos().getX(), blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld());
|
||||
ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
|
||||
ClientProxy.multiblockRenderEvent.partent = new Location(blastfurnace.getPos().getX(),
|
||||
blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld());
|
||||
ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(
|
||||
blastfurnace.getPos().getX()
|
||||
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
|
||||
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
|
||||
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
|
||||
}
|
||||
button.displayString = "A";
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
}
|
||||
|
|
|
@ -8,57 +8,66 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
|
||||
public class GuiCentrifuge extends GuiContainer {
|
||||
public class GuiCentrifuge extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_centrifuge.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_centrifuge.png");
|
||||
|
||||
TileCentrifuge centrifuge;
|
||||
TileCentrifuge centrifuge;
|
||||
|
||||
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge) {
|
||||
super(new ContainerCentrifuge(tileCentrifuge, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
centrifuge = tileCentrifuge;
|
||||
}
|
||||
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge)
|
||||
{
|
||||
super(new ContainerCentrifuge(tileCentrifuge, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
centrifuge = tileCentrifuge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = centrifuge.getProgressScaled(11);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j);
|
||||
this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10);
|
||||
this.drawTexturedModalRect(k + 83, l + 53, 177, 39, 10, j);
|
||||
this.drawTexturedModalRect(k + 68 + 10 - j, l + 38, 177 + 10 - j, 27, j, 10);
|
||||
}
|
||||
j = centrifuge.getProgressScaled(11);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j);
|
||||
this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10);
|
||||
this.drawTexturedModalRect(k + 83, l + 53, 177, 39, 10, j);
|
||||
this.drawTexturedModalRect(k + 68 + 10 - j, l + 38, 177 + 10 - j, 27, j, 10);
|
||||
}
|
||||
|
||||
j = centrifuge.getEnergyScaled(12);
|
||||
j = centrifuge.getEnergyScaled(12);
|
||||
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
|
||||
String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
|
||||
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
|
||||
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
|
||||
String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
|
||||
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
|
||||
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerChargeBench;
|
||||
import techreborn.tiles.TileChargeBench;
|
||||
|
||||
public class GuiChargeBench extends GuiContainer {
|
||||
public class GuiChargeBench extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chargebench.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chargebench.png");
|
||||
|
||||
TileChargeBench chargebench;
|
||||
TileChargeBench chargebench;
|
||||
|
||||
public GuiChargeBench(EntityPlayer player, TileChargeBench tile) {
|
||||
super(new ContainerChargeBench(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chargebench = tile;
|
||||
}
|
||||
public GuiChargeBench(EntityPlayer player, TileChargeBench tile)
|
||||
{
|
||||
super(new ContainerChargeBench(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chargebench = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = chargebench.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 10, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = chargebench.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 10, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.chargebench.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.chargebench.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,53 +8,63 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerChemicalReactor;
|
||||
import techreborn.tiles.TileChemicalReactor;
|
||||
|
||||
public class GuiChemicalReactor extends GuiContainer {
|
||||
public class GuiChemicalReactor extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chemical_reactor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/chemical_reactor.png");
|
||||
|
||||
TileChemicalReactor chemicalReactor;
|
||||
ContainerChemicalReactor containerChemicalReactor;
|
||||
TileChemicalReactor chemicalReactor;
|
||||
ContainerChemicalReactor containerChemicalReactor;
|
||||
|
||||
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) {
|
||||
super(new ContainerChemicalReactor(tilechemicalReactor, player));
|
||||
containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chemicalReactor = tilechemicalReactor;
|
||||
}
|
||||
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor)
|
||||
{
|
||||
super(new ContainerChemicalReactor(tilechemicalReactor, player));
|
||||
containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chemicalReactor = tilechemicalReactor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = chemicalReactor.getProgressScaled(11);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
|
||||
}
|
||||
j = chemicalReactor.getProgressScaled(11);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
|
||||
}
|
||||
|
||||
j = chemicalReactor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
j = chemicalReactor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,59 +9,60 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerChunkloader;
|
||||
import techreborn.tiles.TileChunkLoader;
|
||||
|
||||
public class GuiChunkLoader extends GuiContainer {
|
||||
public class GuiChunkLoader extends GuiContainer
|
||||
{
|
||||
|
||||
private GuiButton plusOneButton;
|
||||
private GuiButton plusTenButton;
|
||||
private GuiButton minusOneButton;
|
||||
private GuiButton minusTenButton;
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_chunkloader.png");
|
||||
TileChunkLoader chunkloader;
|
||||
private GuiButton plusOneButton;
|
||||
private GuiButton plusTenButton;
|
||||
private GuiButton minusOneButton;
|
||||
private GuiButton minusTenButton;
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/industrial_chunkloader.png");
|
||||
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader)
|
||||
{
|
||||
super(new ContainerChunkloader(tilechunkloader, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chunkloader = tilechunkloader;
|
||||
}
|
||||
|
||||
TileChunkLoader chunkloader;
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.guiLeft = this.width / 2 - this.xSize / 2;
|
||||
this.guiTop = this.height / 2 - this.ySize / 2;
|
||||
plusOneButton = new GuiButton(0, guiLeft + 5, guiTop + 37, 40, 20, "+1");
|
||||
plusTenButton = new GuiButton(0, guiLeft + 45, guiTop + 37, 40, 20, "+10");
|
||||
|
||||
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader) {
|
||||
super(new ContainerChunkloader(tilechunkloader, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chunkloader = tilechunkloader;
|
||||
}
|
||||
minusOneButton = new GuiButton(0, guiLeft + 90, guiTop + 37, 40, 20, "-1");
|
||||
minusTenButton = new GuiButton(0, guiLeft + 130, guiTop + 37, 40, 20, "-10");
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.guiLeft = this.width / 2 - this.xSize / 2;
|
||||
this.guiTop = this.height / 2 - this.ySize / 2;
|
||||
plusOneButton = new GuiButton(0, guiLeft + 5, guiTop + 37, 40, 20, "+1");
|
||||
plusTenButton = new GuiButton(0, guiLeft + 45, guiTop + 37, 40, 20, "+10");
|
||||
buttonList.add(plusOneButton);
|
||||
buttonList.add(plusTenButton);
|
||||
buttonList.add(minusOneButton);
|
||||
buttonList.add(minusTenButton);
|
||||
}
|
||||
|
||||
minusOneButton = new GuiButton(0, guiLeft + 90, guiTop + 37, 40, 20, "-1");
|
||||
minusTenButton = new GuiButton(0, guiLeft + 130, guiTop + 37, 40, 20, "-10");
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
buttonList.add(plusOneButton);
|
||||
buttonList.add(plusTenButton);
|
||||
buttonList.add(minusOneButton);
|
||||
buttonList.add(minusTenButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerCompressor;
|
||||
import techreborn.tiles.teir1.TileCompressor;
|
||||
|
||||
public class GuiCompressor extends GuiContainer {
|
||||
public class GuiCompressor extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
|
||||
TileCompressor compressor;
|
||||
ContainerCompressor containerGrinder;
|
||||
TileCompressor compressor;
|
||||
ContainerCompressor containerGrinder;
|
||||
|
||||
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) {
|
||||
super(new ContainerCompressor(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compressor = tilegrinder;
|
||||
containerGrinder = (ContainerCompressor) this.inventorySlots;
|
||||
}
|
||||
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder)
|
||||
{
|
||||
super(new ContainerCompressor(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compressor = tilegrinder;
|
||||
containerGrinder = (ContainerCompressor) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = compressor.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = compressor.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = compressor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = compressor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.compressor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.compressor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,30 +7,34 @@ import net.minecraft.inventory.Container;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
public class GuiDestructoPack extends GuiContainer {
|
||||
public class GuiDestructoPack extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/destructopack.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/destructopack.png");
|
||||
|
||||
public GuiDestructoPack(Container container) {
|
||||
super(container);
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
public GuiDestructoPack(Container container)
|
||||
{
|
||||
super(container);
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int arg0, int arg1) {
|
||||
String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name");
|
||||
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 5, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
super.drawGuiContainerForegroundLayer(arg0, arg1);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int arg0, int arg1)
|
||||
{
|
||||
String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name");
|
||||
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 5, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2,
|
||||
4210752);
|
||||
super.drawGuiContainerForegroundLayer(arg0, arg1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,46 +9,47 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerDieselGenerator;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
public class GuiDieselGenerator extends GuiContainer {
|
||||
public class GuiDieselGenerator extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/thermal_generator.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/ThermalGenerator.png");
|
||||
|
||||
TileDieselGenerator tile;
|
||||
TileDieselGenerator tile;
|
||||
|
||||
ContainerDieselGenerator containerDieselGenerator;
|
||||
ContainerDieselGenerator containerDieselGenerator;
|
||||
|
||||
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile) {
|
||||
super(new ContainerDieselGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
containerDieselGenerator = (ContainerDieselGenerator) this.inventorySlots;
|
||||
}
|
||||
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile)
|
||||
{
|
||||
super(new ContainerDieselGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
containerDieselGenerator = (ContainerDieselGenerator) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(containerDieselGenerator.fluid + "", 10,
|
||||
30, 16448255);
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(containerDieselGenerator.fluid + "", 10, 30, 16448255);
|
||||
|
||||
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerDieselGenerator.energy) + "", 10,
|
||||
50, 16448255);
|
||||
}
|
||||
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerDieselGenerator.energy) + "", 10, 50,
|
||||
16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,40 +8,44 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerDigitalChest;
|
||||
import techreborn.tiles.TileDigitalChest;
|
||||
|
||||
public class GuiDigitalChest extends GuiContainer {
|
||||
public class GuiDigitalChest extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/thermal_generator.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/ThermalGenerator.png");
|
||||
|
||||
TileDigitalChest tile;
|
||||
TileDigitalChest tile;
|
||||
|
||||
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile) {
|
||||
super(new ContainerDigitalChest(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile)
|
||||
{
|
||||
super(new ContainerDigitalChest(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.digitalChest.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
|
||||
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.digitalChest.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
|
||||
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10, 30,
|
||||
16448255);
|
||||
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,46 +8,54 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerElectricFurnace;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
|
||||
public class GuiElectricFurnace extends GuiContainer {
|
||||
public class GuiElectricFurnace extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
|
||||
TileElectricFurnace furnace;
|
||||
ContainerElectricFurnace containerGrinder;
|
||||
TileElectricFurnace furnace;
|
||||
ContainerElectricFurnace containerGrinder;
|
||||
|
||||
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) {
|
||||
super(new ContainerElectricFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerElectricFurnace) this.inventorySlots;
|
||||
}
|
||||
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder)
|
||||
{
|
||||
super(new ContainerElectricFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerElectricFurnace) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = furnace.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = furnace.gaugeProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = furnace.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerExtractor;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
public class GuiExtractor extends GuiContainer {
|
||||
public class GuiExtractor extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
|
||||
TileExtractor extractor;
|
||||
ContainerExtractor containerGrinder;
|
||||
TileExtractor extractor;
|
||||
ContainerExtractor containerGrinder;
|
||||
|
||||
public GuiExtractor(EntityPlayer player, TileExtractor tilegrinder) {
|
||||
super(new ContainerExtractor(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
extractor = tilegrinder;
|
||||
containerGrinder = (ContainerExtractor) this.inventorySlots;
|
||||
}
|
||||
public GuiExtractor(EntityPlayer player, TileExtractor tilegrinder)
|
||||
{
|
||||
super(new ContainerExtractor(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
extractor = tilegrinder;
|
||||
containerGrinder = (ContainerExtractor) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = extractor.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = extractor.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = extractor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = extractor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.extractor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.extractor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -10,88 +12,110 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerFusionReactor;
|
||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||
|
||||
import java.io.IOException;
|
||||
public class GuiFusionReactor extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/fusion_reactor.png");
|
||||
|
||||
public class GuiFusionReactor extends GuiContainer {
|
||||
ContainerFusionReactor containerFusionReactor;
|
||||
TileEntityFusionController fusionController;
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/fusion_reactor.png");
|
||||
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu)
|
||||
{
|
||||
super(new ContainerFusionReactor(tileaesu, player));
|
||||
containerFusionReactor = (ContainerFusionReactor) this.inventorySlots;
|
||||
this.fusionController = tileaesu;
|
||||
}
|
||||
|
||||
ContainerFusionReactor containerFusionReactor;
|
||||
TileEntityFusionController fusionController;
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
||||
this.fontRendererObj.drawString(name, 87, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
||||
public GuiFusionReactor(EntityPlayer player,
|
||||
TileEntityFusionController tileaesu) {
|
||||
super(new ContainerFusionReactor(tileaesu, player));
|
||||
containerFusionReactor = (ContainerFusionReactor) this.inventorySlots;
|
||||
this.fusionController = tileaesu;
|
||||
}
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255);
|
||||
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16,
|
||||
16448255);
|
||||
if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
|
||||
this.fontRendererObj.drawString(
|
||||
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
|
||||
24, 16448255);
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
||||
this.fontRendererObj.drawString(name, 87, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255);
|
||||
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16, 16448255);
|
||||
if(containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
|
||||
this.fontRendererObj.drawString("Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11, 24, 16448255);
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
// GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20,
|
||||
// 20, "");
|
||||
// buttonList.add(button);
|
||||
super.initGui();
|
||||
// CoordTriplet coordinates = new
|
||||
// CoordTriplet(fusionController.getPos().getX() -
|
||||
// (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX()
|
||||
// * 2), fusionController.getPos().getY() - 1,
|
||||
// fusionController.getPos().getZ() -
|
||||
// (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ()
|
||||
// * 2));
|
||||
// if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){
|
||||
// ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
// button.displayString = "B";
|
||||
// } else {
|
||||
// button.displayString = "A";
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
//GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, "");
|
||||
//buttonList.add(button);
|
||||
super.initGui();
|
||||
// CoordTriplet coordinates = new CoordTriplet(fusionController.getPos().getX() - (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX() * 2), fusionController.getPos().getY() - 1, fusionController.getPos().getZ() - (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ() * 2));
|
||||
// if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){
|
||||
// ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
// button.displayString = "B";
|
||||
// } else {
|
||||
// button.displayString = "A";
|
||||
// }
|
||||
}
|
||||
drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14);
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
// progressBar
|
||||
drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16);
|
||||
|
||||
drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14);
|
||||
}
|
||||
|
||||
//progressBar
|
||||
drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16);
|
||||
public int percentage(int MaxValue, int CurrentValue)
|
||||
{
|
||||
if (CurrentValue == 0)
|
||||
return 0;
|
||||
return (int) ((CurrentValue * 100.0f) / MaxValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int percentage(int MaxValue, int CurrentValue) {
|
||||
if (CurrentValue == 0)
|
||||
return 0;
|
||||
return (int) ((CurrentValue * 100.0f) / MaxValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
// if(button.id == 212){
|
||||
// if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
|
||||
// {//This code here makes a basic multiblock and then sets to the selected one.
|
||||
// MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
|
||||
// ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
// ClientProxy.multiblockRenderEvent.partent = new Location(fusionController.getPos().getX(), fusionController.getPos().getY(), fusionController.getPos().getZ(), fusionController.getWorld());
|
||||
// ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(fusionController.getPos().getX() , fusionController.getPos().getY() -1 , fusionController.getPos().getZ());
|
||||
// }
|
||||
// button.displayString = "A";
|
||||
// } else {
|
||||
// ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
// button.displayString = "B";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
super.actionPerformed(button);
|
||||
// if(button.id == 212){
|
||||
// if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
|
||||
// {//This code here makes a basic multiblock and then sets to the
|
||||
// selected one.
|
||||
// MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
|
||||
// ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
// ClientProxy.multiblockRenderEvent.partent = new
|
||||
// Location(fusionController.getPos().getX(),
|
||||
// fusionController.getPos().getY(), fusionController.getPos().getZ(),
|
||||
// fusionController.getWorld());
|
||||
// ClientProxy.multiblockRenderEvent.anchor = new
|
||||
// CoordTriplet(fusionController.getPos().getX() ,
|
||||
// fusionController.getPos().getY() -1 ,
|
||||
// fusionController.getPos().getZ());
|
||||
// }
|
||||
// button.displayString = "A";
|
||||
// } else {
|
||||
// ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
// button.displayString = "B";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,41 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerGasTurbine;
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
public class GuiGasTurbine extends GuiContainer {
|
||||
public class GuiGasTurbine extends GuiContainer
|
||||
{
|
||||
|
||||
//TODO: use semifluid generator texture
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/ThermalGenerator.png");
|
||||
// TODO: use semifluid generator texture
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/ThermalGenerator.png");
|
||||
|
||||
TileGasTurbine tile;
|
||||
TileGasTurbine tile;
|
||||
|
||||
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile) {
|
||||
super(new ContainerGasTurbine(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile)
|
||||
{
|
||||
super(new ContainerGasTurbine(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = "Gas Turbine";
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10,
|
||||
30, 16448255);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = "Gas Turbine";
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,55 +8,64 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerGenerator;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
public class GuiGenerator extends GuiContainer {
|
||||
public class GuiGenerator extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/generator.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/generator.png");
|
||||
|
||||
TileGenerator generator;
|
||||
TileGenerator generator;
|
||||
|
||||
ContainerGenerator containerGenerator;
|
||||
ContainerGenerator containerGenerator;
|
||||
|
||||
public GuiGenerator(EntityPlayer player, TileGenerator generator) {
|
||||
super(new ContainerGenerator(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
this.containerGenerator = (ContainerGenerator) this.inventorySlots;
|
||||
}
|
||||
public GuiGenerator(EntityPlayer player, TileGenerator generator)
|
||||
{
|
||||
super(new ContainerGenerator(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
this.containerGenerator = (ContainerGenerator) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
|
||||
if (containerGenerator.burnTime != 0)
|
||||
{
|
||||
j = containerGenerator.getScaledBurnTime(13);
|
||||
this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1);
|
||||
}
|
||||
}
|
||||
if (containerGenerator.burnTime != 0)
|
||||
{
|
||||
j = containerGenerator.getScaledBurnTime(13);
|
||||
this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.generator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.generator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize- 150, 4210752);
|
||||
}
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,46 +8,54 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerGrinder;
|
||||
import techreborn.tiles.teir1.TileGrinder;
|
||||
|
||||
public class GuiGrinder extends GuiContainer {
|
||||
public class GuiGrinder extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/grinder.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/grinder.png");
|
||||
|
||||
TileGrinder grinder;
|
||||
ContainerGrinder containerGrinder;
|
||||
TileGrinder grinder;
|
||||
ContainerGrinder containerGrinder;
|
||||
|
||||
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) {
|
||||
super(new ContainerGrinder(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
grinder = tilegrinder;
|
||||
containerGrinder = (ContainerGrinder) this.inventorySlots;
|
||||
}
|
||||
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder)
|
||||
{
|
||||
super(new ContainerGrinder(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
grinder = tilegrinder;
|
||||
containerGrinder = (ContainerGrinder) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = grinder.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = grinder.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = grinder.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = grinder.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.grinder.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.grinder.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -12,80 +15,90 @@ import techreborn.client.container.ContainerIDSU;
|
|||
import techreborn.packets.PacketIdsu;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
public class GuiIDSU extends GuiContainer
|
||||
{
|
||||
|
||||
public class GuiIDSU extends GuiContainer {
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/aesu.png");
|
||||
TileIDSU idsu;
|
||||
|
||||
ContainerIDSU containerIDSU;
|
||||
|
||||
TileIDSU idsu;
|
||||
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU)
|
||||
{
|
||||
super(new ContainerIDSU(tileIDSU, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 165;
|
||||
idsu = tileIDSU;
|
||||
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
|
||||
}
|
||||
|
||||
ContainerIDSU containerIDSU;
|
||||
public static boolean isInteger(String s)
|
||||
{
|
||||
return isInteger(s, 10);
|
||||
}
|
||||
|
||||
public static boolean isInteger(String s, int radix)
|
||||
{
|
||||
if (s.isEmpty())
|
||||
return false;
|
||||
for (int i = 0; i < s.length(); i++)
|
||||
{
|
||||
if (i == 0 && s.charAt(i) == '-')
|
||||
{
|
||||
if (s.length() == 1)
|
||||
return false;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
if (Character.digit(s.charAt(i), radix) < 0)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU) {
|
||||
super(new ContainerIDSU(tileIDSU, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 165;
|
||||
idsu = tileIDSU;
|
||||
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 128, l + 5, 15, 15, "++"));
|
||||
this.buttonList.add(new GuiButton(1, k + 128, l + 5 + 20, 15, 15, "+"));
|
||||
this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-"));
|
||||
this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--"));
|
||||
this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 128, l + 5, 15, 15, "++"));
|
||||
this.buttonList.add(new GuiButton(1, k + 128, l + 5 + 20, 15, 15, "+"));
|
||||
this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-"));
|
||||
this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--"));
|
||||
this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+"));
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 40, 10,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 20,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 30,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 40,
|
||||
Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 40, 10, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
}
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu));
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu));
|
||||
|
||||
}
|
||||
|
||||
public static boolean isInteger(String s) {
|
||||
return isInteger(s, 10);
|
||||
}
|
||||
|
||||
public static boolean isInteger(String s, int radix) {
|
||||
if (s.isEmpty()) return false;
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
if (i == 0 && s.charAt(i) == '-') {
|
||||
if (s.length() == 1) return false;
|
||||
else continue;
|
||||
}
|
||||
if (Character.digit(s.charAt(i), radix) < 0) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -8,58 +8,70 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerImplosionCompressor;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
|
||||
public class GuiImplosionCompressor extends GuiContainer {
|
||||
public class GuiImplosionCompressor extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/implosion_compressor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/implosion_compressor.png");
|
||||
|
||||
TileImplosionCompressor compresser;
|
||||
ContainerImplosionCompressor containerImplosionCompressor;
|
||||
TileImplosionCompressor compresser;
|
||||
ContainerImplosionCompressor containerImplosionCompressor;
|
||||
|
||||
public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser) {
|
||||
super(new ContainerImplosionCompressor(tilecompresser, player));
|
||||
containerImplosionCompressor = (ContainerImplosionCompressor) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compresser = tilecompresser;
|
||||
}
|
||||
public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser)
|
||||
{
|
||||
super(new ContainerImplosionCompressor(tilecompresser, player));
|
||||
containerImplosionCompressor = (ContainerImplosionCompressor) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compresser = tilecompresser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (containerImplosionCompressor.multIBlockState == 0) {
|
||||
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
j = compresser.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 60, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
if (containerImplosionCompressor.multIBlockState == 0)
|
||||
{
|
||||
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
||||
j = compresser.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
int j = 0;
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
j = compresser.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 60, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
j = compresser.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,54 +8,63 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerIndustrialElectrolyzer;
|
||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||
|
||||
public class GuiIndustrialElectrolyzer extends GuiContainer {
|
||||
public class GuiIndustrialElectrolyzer extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_electrolyzer.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
TileIndustrialElectrolyzer eletrolyzer;
|
||||
TileIndustrialElectrolyzer eletrolyzer;
|
||||
|
||||
ContainerIndustrialElectrolyzer containerIndustrialElectrolyzer;
|
||||
ContainerIndustrialElectrolyzer containerIndustrialElectrolyzer;
|
||||
|
||||
public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer) {
|
||||
super(new ContainerIndustrialElectrolyzer(tileeletrolyzer, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
eletrolyzer = tileeletrolyzer;
|
||||
containerIndustrialElectrolyzer = (ContainerIndustrialElectrolyzer) this.inventorySlots;
|
||||
}
|
||||
public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer)
|
||||
{
|
||||
super(new ContainerIndustrialElectrolyzer(tileeletrolyzer, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
eletrolyzer = tileeletrolyzer;
|
||||
containerIndustrialElectrolyzer = (ContainerIndustrialElectrolyzer) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = eletrolyzer.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 72, l + 38, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = eletrolyzer.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 72, l + 38, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = eletrolyzer.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 134, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = eletrolyzer.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 134, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
|
||||
this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2), 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
|
||||
this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2), 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,71 +8,82 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerIndustrialGrinder;
|
||||
import techreborn.tiles.TileIndustrialGrinder;
|
||||
|
||||
public class GuiIndustrialGrinder extends GuiContainer {
|
||||
public class GuiIndustrialGrinder extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_grinder.png");
|
||||
|
||||
TileIndustrialGrinder grinder;
|
||||
ContainerIndustrialGrinder containerGrinder;
|
||||
TileIndustrialGrinder grinder;
|
||||
ContainerIndustrialGrinder containerGrinder;
|
||||
|
||||
public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder) {
|
||||
super(new ContainerIndustrialGrinder(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
grinder = tilegrinder;
|
||||
containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots;
|
||||
}
|
||||
public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder)
|
||||
{
|
||||
super(new ContainerIndustrialGrinder(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
grinder = tilegrinder;
|
||||
containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = grinder.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = grinder.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = grinder.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
j = grinder.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
if (containerGrinder.connectionStatus != 1) {
|
||||
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1);
|
||||
}
|
||||
if (containerGrinder.connectionStatus != 1)
|
||||
{
|
||||
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12 - j, -1);
|
||||
}
|
||||
|
||||
//TODO 1.8 nope
|
||||
// if (grinder.tank.getFluidAmount() != 0) {
|
||||
// IIcon fluidIcon = grinder.tank.getFluid().getFluid().getIcon();
|
||||
// if (fluidIcon != null) {
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
// drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55);
|
||||
//
|
||||
// this.mc.renderEngine
|
||||
// .bindTexture(TextureMap.locationBlocksTexture);
|
||||
// int liquidHeight = grinder.tank.getFluidAmount() * 47
|
||||
// / grinder.tank.getCapacity();
|
||||
// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47
|
||||
// - liquidHeight, 12.0D, liquidHeight, this.zLevel);
|
||||
//
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
//
|
||||
// drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// TODO 1.8 nope
|
||||
// if (grinder.tank.getFluidAmount() != 0) {
|
||||
// IIcon fluidIcon = grinder.tank.getFluid().getFluid().getIcon();
|
||||
// if (fluidIcon != null) {
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
// drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55);
|
||||
//
|
||||
// this.mc.renderEngine
|
||||
// .bindTexture(TextureMap.locationBlocksTexture);
|
||||
// int liquidHeight = grinder.tank.getFluidAmount() * 47
|
||||
// / grinder.tank.getCapacity();
|
||||
// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47
|
||||
// - liquidHeight, 12.0D, liquidHeight, this.zLevel);
|
||||
//
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
//
|
||||
// drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,80 +9,86 @@ import reborncore.client.gui.GuiUtil;
|
|||
import techreborn.client.container.ContainerIndustrialSawmill;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
|
||||
public class GuiIndustrialSawmill extends GuiContainer {
|
||||
public class GuiIndustrialSawmill extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/industrial_sawmill.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
|
||||
TileIndustrialSawmill sawmill;
|
||||
TileIndustrialSawmill sawmill;
|
||||
|
||||
public GuiIndustrialSawmill(EntityPlayer player,
|
||||
TileIndustrialSawmill tilesawmill) {
|
||||
super(new ContainerIndustrialSawmill(tilesawmill, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
sawmill = tilesawmill;
|
||||
}
|
||||
public GuiIndustrialSawmill(EntityPlayer player, TileIndustrialSawmill tilesawmill)
|
||||
{
|
||||
super(new ContainerIndustrialSawmill(tilesawmill, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
sawmill = tilesawmill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = sawmill.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 38, 176, 14, j - 1, 11);
|
||||
}
|
||||
j = sawmill.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 56, l + 38, 176, 14, j - 1, 11);
|
||||
}
|
||||
|
||||
j = sawmill.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 33, l + 65 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
// TODO 1.8
|
||||
// if (sawmill.tank.getFluidAmount() != 0) {
|
||||
// IIcon fluidIcon = sawmill.tank.getFluid().getFluid().getIcon();
|
||||
// if (fluidIcon != null) {
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
//
|
||||
//
|
||||
// this.mc.renderEngine
|
||||
// .bindTexture(TextureMap.locationBlocksTexture);
|
||||
// int liquidHeight = sawmill.tank.getFluidAmount() * 47
|
||||
// / sawmill.tank.getCapacity();
|
||||
// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47
|
||||
// - liquidHeight, 12.0D, liquidHeight, this.zLevel);
|
||||
//
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
// // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55);
|
||||
// }
|
||||
// }
|
||||
drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47);
|
||||
if (sawmill.getMutliBlock() != true)
|
||||
{
|
||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
||||
j = sawmill.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 33, l + 65 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
//TODO 1.8
|
||||
// if (sawmill.tank.getFluidAmount() != 0) {
|
||||
// IIcon fluidIcon = sawmill.tank.getFluid().getFluid().getIcon();
|
||||
// if (fluidIcon != null) {
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
//
|
||||
//
|
||||
// this.mc.renderEngine
|
||||
// .bindTexture(TextureMap.locationBlocksTexture);
|
||||
// int liquidHeight = sawmill.tank.getFluidAmount() * 47
|
||||
// / sawmill.tank.getCapacity();
|
||||
// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47
|
||||
// - liquidHeight, 12.0D, liquidHeight, this.zLevel);
|
||||
//
|
||||
// this.mc.renderEngine.bindTexture(texture);
|
||||
// // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55);
|
||||
// }
|
||||
// }
|
||||
drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47);
|
||||
if (sawmill.getMutliBlock() != true) {
|
||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.industrialsawmill.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 58,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.industrialsawmill.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 58,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,46 +8,55 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerIronFurnace;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
|
||||
public class GuiIronFurnace extends GuiContainer {
|
||||
public class GuiIronFurnace extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("minecraft", "textures/gui/container/furnace.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("minecraft",
|
||||
"textures/gui/container/furnace.png");
|
||||
|
||||
TileIronFurnace furnace;
|
||||
ContainerIronFurnace containerGrinder;
|
||||
TileIronFurnace furnace;
|
||||
ContainerIronFurnace containerGrinder;
|
||||
|
||||
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder) {
|
||||
super(new ContainerIronFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerIronFurnace) this.inventorySlots;
|
||||
}
|
||||
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder)
|
||||
{
|
||||
super(new ContainerIronFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerIronFurnace) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
int j = 0;
|
||||
|
||||
j = furnace.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = furnace.gaugeProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.gaugeFuelScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = furnace.gaugeFuelScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -9,37 +11,47 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerLesu;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
||||
import java.awt.*;
|
||||
public class GuiLesu extends GuiContainer
|
||||
{
|
||||
|
||||
public class GuiLesu extends GuiContainer {
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
|
||||
TileLesu aesu;
|
||||
ContainerLesu containerLesu;
|
||||
TileLesu aesu;
|
||||
|
||||
public GuiLesu(EntityPlayer player, TileLesu tileaesu) {
|
||||
super(new ContainerLesu(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 197;
|
||||
aesu = tileaesu;
|
||||
this.containerLesu = (ContainerLesu) this.inventorySlots;
|
||||
}
|
||||
ContainerLesu containerLesu;
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
public GuiLesu(EntityPlayer player, TileLesu tileaesu)
|
||||
{
|
||||
super(new ContainerLesu(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 165;
|
||||
aesu = tileaesu;
|
||||
this.containerLesu = (ContainerLesu) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.lesu.name"), 40, 10,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40,
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euStorage) + " max", 10, 60,
|
||||
Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.lesu.name"), 40, 10, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euStorage) + " max", 10, 60, Color.WHITE.getRGB());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,48 +8,51 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerMatterFabricator;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
|
||||
public class GuiMatterFabricator extends GuiContainer {
|
||||
public class GuiMatterFabricator extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/matterfabricator.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/matterfabricator.png");
|
||||
|
||||
TileMatterFabricator matterfab;
|
||||
TileMatterFabricator matterfab;
|
||||
|
||||
ContainerMatterFabricator containerMatterFabricator;
|
||||
ContainerMatterFabricator containerMatterFabricator;
|
||||
|
||||
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab) {
|
||||
super(new ContainerMatterFabricator(tilematterfab, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
matterfab = tilematterfab;
|
||||
containerMatterFabricator = (ContainerMatterFabricator) this.inventorySlots;
|
||||
}
|
||||
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab)
|
||||
{
|
||||
super(new ContainerMatterFabricator(tilematterfab, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
matterfab = tilematterfab;
|
||||
containerMatterFabricator = (ContainerMatterFabricator) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = containerMatterFabricator.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
}
|
||||
int j = containerMatterFabricator.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
String name = I18n.translateToLocal("tile.techreborn.matterfabricator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
String name = I18n.translateToLocal("tile.techreborn.matterfabricator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,41 +8,44 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerQuantumChest;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
|
||||
public class GuiQuantumChest extends GuiContainer {
|
||||
public class GuiQuantumChest extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/thermal_generator.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/ThermalGenerator.png");
|
||||
|
||||
TileQuantumChest tile;
|
||||
TileQuantumChest tile;
|
||||
|
||||
public GuiQuantumChest(EntityPlayer player, TileQuantumChest tile) {
|
||||
super(new ContainerQuantumChest(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
public GuiQuantumChest(EntityPlayer player, TileQuantumChest tile)
|
||||
{
|
||||
super(new ContainerQuantumChest(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumChest.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
|
||||
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumChest.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
|
||||
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10, 30,
|
||||
16448255);
|
||||
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,40 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerQuantumTank;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
|
||||
public class GuiQuantumTank extends GuiContainer {
|
||||
public class GuiQuantumTank extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/thermal_generator.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileQuantumTank tile;
|
||||
TileQuantumTank tile;
|
||||
|
||||
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile) {
|
||||
super(new ContainerQuantumTank(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile)
|
||||
{
|
||||
super(new ContainerQuantumTank(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10,
|
||||
30, 16448255);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerRecycler;
|
||||
import techreborn.tiles.teir1.TileRecycler;
|
||||
|
||||
public class GuiRecycler extends GuiContainer {
|
||||
public class GuiRecycler extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
|
||||
TileRecycler compressor;
|
||||
ContainerRecycler containerGrinder;
|
||||
TileRecycler compressor;
|
||||
ContainerRecycler containerGrinder;
|
||||
|
||||
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder) {
|
||||
super(new ContainerRecycler(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compressor = tilegrinder;
|
||||
containerGrinder = (ContainerRecycler) this.inventorySlots;
|
||||
}
|
||||
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder)
|
||||
{
|
||||
super(new ContainerRecycler(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compressor = tilegrinder;
|
||||
containerGrinder = (ContainerRecycler) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
|
||||
j = compressor.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
int j = 0;
|
||||
|
||||
j = compressor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = compressor.gaugeProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.recycler.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
j = compressor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.recycler.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,54 +9,59 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
|
||||
public class GuiRollingMachine extends GuiContainer {
|
||||
public class GuiRollingMachine extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/rolling_machine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
ContainerRollingMachine containerRollingMachine;
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/rolling_machine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
ContainerRollingMachine containerRollingMachine;
|
||||
|
||||
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) {
|
||||
super(new ContainerRollingMachine(tileRollingmachine, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
rollingMachine = tileRollingmachine;
|
||||
containerRollingMachine = (ContainerRollingMachine) this.inventorySlots;
|
||||
}
|
||||
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
|
||||
{
|
||||
super(new ContainerRollingMachine(tileRollingmachine, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
rollingMachine = tileRollingmachine;
|
||||
containerRollingMachine = (ContainerRollingMachine) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = this.containerRollingMachine.getBurnTimeRemainingScaled(24);
|
||||
this.drawTexturedModalRect(k + 91, l + 34, 176, 14, j + 1, 19);
|
||||
int j = this.containerRollingMachine.getBurnTimeRemainingScaled(24);
|
||||
this.drawTexturedModalRect(k + 91, l + 34, 176, 14, j + 1, 19);
|
||||
|
||||
j = this.rollingMachine.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 7, l + 33 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = this.rollingMachine.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 7, l + 33 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 4, l + 4, 20, 20, "R"));
|
||||
super.initGui();
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 4, l + 4, 20, 20, "R"));
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,46 +8,55 @@ import net.minecraft.util.ResourceLocation;
|
|||
import techreborn.client.container.ContainerScrapboxinator;
|
||||
import techreborn.tiles.TileScrapboxinator;
|
||||
|
||||
public class GuiScrapboxinator extends GuiContainer {
|
||||
public class GuiScrapboxinator extends GuiContainer
|
||||
{
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/scrapboxinator.png");
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/scrapboxinator.png");
|
||||
|
||||
TileScrapboxinator tile;
|
||||
ContainerScrapboxinator containerScrapboxinator;
|
||||
TileScrapboxinator tile;
|
||||
ContainerScrapboxinator containerScrapboxinator;
|
||||
|
||||
public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator) {
|
||||
super(new ContainerScrapboxinator(tileScrapboxinator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
tile = tileScrapboxinator;
|
||||
containerScrapboxinator = (ContainerScrapboxinator) this.inventorySlots;
|
||||
}
|
||||
public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator)
|
||||
{
|
||||
super(new ContainerScrapboxinator(tileScrapboxinator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
tile = tileScrapboxinator;
|
||||
containerScrapboxinator = (ContainerScrapboxinator) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
|
||||
j = tile.gaugeProgressScaled(24);
|
||||
// System.out.println(compressor.gaugeProgressScaled(10));
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
int j = 0;
|
||||
|
||||
j = tile.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
j = tile.gaugeProgressScaled(24);
|
||||
// System.out.println(compressor.gaugeProgressScaled(10));
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
j = tile.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,39 +8,41 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerSemifluidGenerator;
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
public class GuiSemifluidGenerator extends GuiContainer {
|
||||
public class GuiSemifluidGenerator extends GuiContainer
|
||||
{
|
||||
|
||||
//TODO: use semifluid generator texture
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/ThermalGenerator.png");
|
||||
// TODO: use semifluid generator texture
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/ThermalGenerator.png");
|
||||
|
||||
TileSemifluidGenerator tile;
|
||||
TileSemifluidGenerator tile;
|
||||
|
||||
public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile) {
|
||||
super(new ContainerSemifluidGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile)
|
||||
{
|
||||
super(new ContainerSemifluidGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = "Semifluid Generator";
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10,
|
||||
30, 16448255);
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = "Semifluid Generator";
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
|
@ -8,40 +8,42 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import techreborn.client.container.ContainerThermalGenerator;
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
public class GuiThermalGenerator extends GuiContainer {
|
||||
public class GuiThermalGenerator extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/thermal_generator.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileThermalGenerator tile;
|
||||
TileThermalGenerator tile;
|
||||
|
||||
public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile) {
|
||||
super(new ContainerThermalGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile)
|
||||
{
|
||||
super(new ContainerThermalGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
|
||||
int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
|
||||
int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
this.fontRendererObj.drawString(tile.getEnergy() + "", 10, 40, 16448255);
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
this.fontRendererObj.drawString(tile.getEnergy() + "", 10, 40, 16448255);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -15,87 +17,107 @@ import techreborn.client.container.ContainerVacuumFreezer;
|
|||
import techreborn.proxies.ClientProxy;
|
||||
import techreborn.tiles.TileVacuumFreezer;
|
||||
|
||||
import java.io.IOException;
|
||||
public class GuiVacuumFreezer extends GuiContainer
|
||||
{
|
||||
|
||||
public class GuiVacuumFreezer extends GuiContainer {
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/vacuum_freezer.png");
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png");
|
||||
TileVacuumFreezer crafter;
|
||||
ContainerVacuumFreezer containerVacuumFreezer;
|
||||
|
||||
TileVacuumFreezer crafter;
|
||||
ContainerVacuumFreezer containerVacuumFreezer;
|
||||
public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer tilealloysmelter)
|
||||
{
|
||||
super(new ContainerVacuumFreezer(tilealloysmelter, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
crafter = tilealloysmelter;
|
||||
this.containerVacuumFreezer = (ContainerVacuumFreezer) this.inventorySlots;
|
||||
}
|
||||
|
||||
public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer tilealloysmelter) {
|
||||
super(new ContainerVacuumFreezer(tilealloysmelter, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
crafter = tilealloysmelter;
|
||||
this.containerVacuumFreezer = (ContainerVacuumFreezer) this.inventorySlots;
|
||||
}
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, "");
|
||||
buttonList.add(button);
|
||||
super.initGui();
|
||||
CoordTriplet coordinates = new CoordTriplet(crafter.getPos().getX(), crafter.getPos().getY() - 5,
|
||||
crafter.getPos().getZ());
|
||||
if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor))
|
||||
{
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
} else
|
||||
{
|
||||
button.displayString = "A";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, "");
|
||||
buttonList.add(button);
|
||||
super.initGui();
|
||||
CoordTriplet coordinates = new CoordTriplet(crafter.getPos().getX(), crafter.getPos().getY() - 5, crafter.getPos().getZ());
|
||||
if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
} else {
|
||||
button.displayString = "A";
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
int j = 0;
|
||||
|
||||
int j = 0;
|
||||
j = crafter.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = crafter.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
j = crafter.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
j = crafter.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
if (containerVacuumFreezer.machineStatus == 0)
|
||||
{
|
||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12 - 0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
if (containerVacuumFreezer.machineStatus == 0) {
|
||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
|
||||
}
|
||||
}
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
if(button.id == 212){
|
||||
if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
|
||||
{//This code here makes a basic multiblock and then sets to the selected one.
|
||||
MultiblockSet set = new MultiblockSet(ClientMultiBlocks.frezzer);
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
ClientProxy.multiblockRenderEvent.partent = new Location(crafter.getPos().getX(), crafter.getPos().getY(), crafter.getPos().getZ(), crafter.getWorld());
|
||||
ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(crafter.getPos().getX() , crafter.getPos().getY() -5 , crafter.getPos().getZ());
|
||||
}
|
||||
button.displayString = "A";
|
||||
} else {
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
super.actionPerformed(button);
|
||||
if (button.id == 212)
|
||||
{
|
||||
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null)
|
||||
{
|
||||
{// This code here makes a basic multiblock and then sets to the
|
||||
// selected one.
|
||||
MultiblockSet set = new MultiblockSet(ClientMultiBlocks.frezzer);
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
ClientProxy.multiblockRenderEvent.partent = new Location(crafter.getPos().getX(),
|
||||
crafter.getPos().getY(), crafter.getPos().getZ(), crafter.getWorld());
|
||||
ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(crafter.getPos().getX(),
|
||||
crafter.getPos().getY() - 5, crafter.getPos().getZ());
|
||||
}
|
||||
button.displayString = "A";
|
||||
} else
|
||||
{
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue