Auto Format code
This commit is contained in:
parent
112b1657cf
commit
796df6c055
503 changed files with 12260 additions and 16291 deletions
|
@ -15,8 +15,7 @@ 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");
|
||||
|
||||
|
@ -24,8 +23,7 @@ public class GuiAESU extends GuiContainer
|
|||
|
||||
ContainerAESU containerAesu;
|
||||
|
||||
public GuiAESU(EntityPlayer player, TileAesu tileaesu)
|
||||
{
|
||||
public GuiAESU(EntityPlayer player, TileAesu tileaesu) {
|
||||
super(new ContainerAESU(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 197;
|
||||
|
@ -34,8 +32,7 @@ public class GuiAESU extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -47,8 +44,7 @@ public class GuiAESU extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -56,21 +52,19 @@ public class GuiAESU extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
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());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu));
|
||||
}
|
||||
|
|
|
@ -8,18 +8,16 @@ 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");
|
||||
"textures/gui/alloy_furnace.png");
|
||||
|
||||
TileAlloyFurnace alloyfurnace;
|
||||
|
||||
ContainerAlloyFurnace containerAlloyFurnace;
|
||||
|
||||
public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace)
|
||||
{
|
||||
public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace) {
|
||||
super(new ContainerAlloyFurnace(tileAlloyFurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -28,24 +26,21 @@ public class GuiAlloyFurnace extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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())
|
||||
{
|
||||
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);
|
||||
|
@ -53,13 +48,12 @@ public class GuiAlloyFurnace extends GuiContainer
|
|||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,16 +9,14 @@ import reborncore.common.container.RebornContainer;
|
|||
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");
|
||||
"textures/gui/electric_alloy_furnace.png");
|
||||
|
||||
TileAlloySmelter alloysmelter;
|
||||
|
||||
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter)
|
||||
{
|
||||
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter) {
|
||||
super(RebornContainer.createContainer(ContainerAlloySmelter.class, tilealloysmelter, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -26,16 +24,14 @@ public class GuiAlloySmelter extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -45,24 +41,21 @@ public class GuiAlloySmelter extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = alloysmelter.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = alloysmelter.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,20 +7,17 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.client.container.ContainerAssemblingMachine;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
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");
|
||||
"textures/gui/assembling_machine.png");
|
||||
|
||||
TileAssemblingMachine assemblingmachine;
|
||||
ContainerAssemblingMachine containerAssemblingMachine;
|
||||
|
||||
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine)
|
||||
{
|
||||
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) {
|
||||
super(RebornContainer.createContainer(ContainerAssemblingMachine.class, tileassemblinmachine, player));
|
||||
containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
|
@ -29,16 +26,14 @@ public class GuiAssemblingMachine extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -48,24 +43,21 @@ public class GuiAssemblingMachine extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = assemblingmachine.getProgressScaled(20);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = assemblingmachine.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerBatbox;
|
||||
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");
|
||||
|
||||
|
@ -17,8 +16,7 @@ public class GuiBatbox extends GuiContainer
|
|||
|
||||
ContainerBatbox containerGenerator;
|
||||
|
||||
public GuiBatbox(EntityPlayer player, TileBatBox generator)
|
||||
{
|
||||
public GuiBatbox(EntityPlayer player, TileBatBox generator) {
|
||||
super(new ContainerBatbox(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,16 +25,14 @@ public class GuiBatbox extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -45,8 +41,7 @@ public class GuiBatbox extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
//
|
||||
|
@ -58,17 +53,16 @@ public class GuiBatbox extends GuiContainer
|
|||
// }
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.batbox.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize - 140,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
|
||||
4210752);
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,18 +19,17 @@ import techreborn.tiles.multiblock.TileBlastFurnace;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GuiBlastFurnace extends GuiContainer
|
||||
{
|
||||
public class GuiBlastFurnace extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_blast_furnace.png");
|
||||
"textures/gui/industrial_blast_furnace.png");
|
||||
|
||||
TileBlastFurnace blastfurnace;
|
||||
|
||||
ContainerBlastFurnace containerBlastFurnace;
|
||||
boolean hasMultiBlock;
|
||||
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace)
|
||||
{
|
||||
|
||||
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) {
|
||||
super(new ContainerBlastFurnace(tileblastfurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -39,8 +38,7 @@ public class GuiBlastFurnace extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
|
||||
hasMultiBlock = containerBlastFurnace.heat != 0;
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -49,73 +47,62 @@ public class GuiBlastFurnace extends GuiContainer
|
|||
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)
|
||||
{
|
||||
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
|
||||
{
|
||||
} else {
|
||||
button.displayString = "A";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
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 (hasMultiBlock)
|
||||
{
|
||||
if (hasMultiBlock) {
|
||||
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);
|
||||
l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
j = blastfurnace.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = blastfurnace.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
public void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
if (button.id == 212)
|
||||
{
|
||||
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null)
|
||||
{
|
||||
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();
|
||||
|
@ -160,16 +147,15 @@ public class GuiBlastFurnace extends GuiContainer
|
|||
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());
|
||||
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));
|
||||
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";
|
||||
}
|
||||
|
|
|
@ -7,19 +7,16 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
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");
|
||||
"textures/gui/industrial_centrifuge.png");
|
||||
|
||||
TileCentrifuge centrifuge;
|
||||
|
||||
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge)
|
||||
{
|
||||
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge) {
|
||||
super(RebornContainer.createContainer(ContainerCentrifuge.class, tileCentrifuge, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,16 +24,14 @@ public class GuiCentrifuge extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -46,8 +41,7 @@ public class GuiCentrifuge extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = centrifuge.getProgressScaled(11);
|
||||
if (j > 0)
|
||||
{
|
||||
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);
|
||||
|
@ -56,20 +50,18 @@ public class GuiCentrifuge extends GuiContainer
|
|||
|
||||
j = centrifuge.getEnergyScaled(12);
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,15 +8,13 @@ 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");
|
||||
|
||||
TileChargeBench chargebench;
|
||||
|
||||
public GuiChargeBench(EntityPlayer player, TileChargeBench tile)
|
||||
{
|
||||
public GuiChargeBench(EntityPlayer player, TileChargeBench tile) {
|
||||
super(new ContainerChargeBench(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -24,16 +22,14 @@ public class GuiChargeBench extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -43,18 +39,16 @@ public class GuiChargeBench extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = chargebench.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,17 +8,15 @@ 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");
|
||||
"textures/gui/chemical_reactor.png");
|
||||
|
||||
TileChemicalReactor chemicalReactor;
|
||||
ContainerChemicalReactor containerChemicalReactor;
|
||||
|
||||
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor)
|
||||
{
|
||||
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) {
|
||||
super(new ContainerChemicalReactor(tilechemicalReactor, player));
|
||||
containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots;
|
||||
this.xSize = 176;
|
||||
|
@ -27,16 +25,14 @@ public class GuiChemicalReactor extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -46,25 +42,22 @@ public class GuiChemicalReactor extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = chemicalReactor.getProgressScaled(11);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
|
||||
}
|
||||
|
||||
j = chemicalReactor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,19 +9,17 @@ 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 static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_chunkloader.png");
|
||||
"textures/gui/industrial_chunkloader.png");
|
||||
TileChunkLoader chunkloader;
|
||||
private GuiButton plusOneButton;
|
||||
private GuiButton plusTenButton;
|
||||
private GuiButton minusOneButton;
|
||||
private GuiButton minusTenButton;
|
||||
|
||||
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader)
|
||||
{
|
||||
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader) {
|
||||
super(new ContainerChunkloader(tilechunkloader, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -29,8 +27,7 @@ public class GuiChunkLoader extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.guiLeft = this.width / 2 - this.xSize / 2;
|
||||
this.guiTop = this.height / 2 - this.ySize / 2;
|
||||
|
@ -47,8 +44,7 @@ public class GuiChunkLoader extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -56,13 +52,12 @@ public class GuiChunkLoader extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
|
||||
TileCompressor compressor;
|
||||
ContainerCompressor containerGrinder;
|
||||
|
||||
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder)
|
||||
{
|
||||
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) {
|
||||
super(new ContainerCompressor(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -26,8 +24,7 @@ public class GuiCompressor extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -37,24 +34,21 @@ public class GuiCompressor extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = compressor.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = compressor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,34 +7,30 @@ 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");
|
||||
"textures/gui/destructopack.png");
|
||||
|
||||
public GuiDestructoPack(Container container)
|
||||
{
|
||||
public GuiDestructoPack(Container container) {
|
||||
super(container);
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
super.drawGuiContainerForegroundLayer(arg0, arg1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,18 +9,16 @@ 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/diesel_generator.png");
|
||||
"textures/gui/diesel_generator.png");
|
||||
|
||||
TileDieselGenerator tile;
|
||||
|
||||
ContainerDieselGenerator containerDieselGenerator;
|
||||
|
||||
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile)
|
||||
{
|
||||
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile) {
|
||||
super(new ContainerDieselGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -29,8 +27,7 @@ public class GuiDieselGenerator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -38,18 +35,17 @@ public class GuiDieselGenerator extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
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);
|
||||
16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileDigitalChest tile;
|
||||
|
||||
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile)
|
||||
{
|
||||
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile) {
|
||||
super(new ContainerDigitalChest(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -25,8 +23,7 @@ public class GuiDigitalChest extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -34,17 +31,16 @@ public class GuiDigitalChest extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.digitalChest.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
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);
|
||||
16448255);
|
||||
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
|
||||
TileElectricFurnace furnace;
|
||||
ContainerElectricFurnace containerGrinder;
|
||||
|
||||
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder)
|
||||
{
|
||||
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) {
|
||||
super(new ContainerElectricFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -26,8 +24,7 @@ public class GuiElectricFurnace extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -37,25 +34,22 @@ public class GuiElectricFurnace extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = furnace.gaugeProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,16 +9,14 @@ import reborncore.common.container.RebornContainer;
|
|||
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");
|
||||
|
||||
TileExtractor extractor;
|
||||
ContainerExtractor containerExtractor;
|
||||
|
||||
public GuiExtractor(EntityPlayer player, TileExtractor tileExtractor)
|
||||
{
|
||||
public GuiExtractor(EntityPlayer player, TileExtractor tileExtractor) {
|
||||
super(RebornContainer.createContainer(ContainerExtractor.class, tileExtractor, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,8 +25,7 @@ public class GuiExtractor extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -38,24 +35,21 @@ public class GuiExtractor extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = extractor.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = extractor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
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;
|
||||
|
@ -12,42 +10,40 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerFusionReactor;
|
||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||
|
||||
public class GuiFusionReactor extends GuiContainer
|
||||
{
|
||||
import java.io.IOException;
|
||||
|
||||
public class GuiFusionReactor extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/fusion_reactor.png");
|
||||
"textures/gui/fusion_reactor.png");
|
||||
|
||||
ContainerFusionReactor containerFusionReactor;
|
||||
TileEntityFusionController fusionController;
|
||||
|
||||
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu)
|
||||
{
|
||||
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu) {
|
||||
super(new ContainerFusionReactor(tileaesu, player));
|
||||
containerFusionReactor = (ContainerFusionReactor) this.inventorySlots;
|
||||
this.fusionController = tileaesu;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.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.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);
|
||||
16448255);
|
||||
if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
|
||||
this.fontRendererObj.drawString(
|
||||
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
|
||||
24, 16448255);
|
||||
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
|
||||
24, 16448255);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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,
|
||||
|
@ -70,8 +66,7 @@ public class GuiFusionReactor extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -85,16 +80,14 @@ public class GuiFusionReactor extends GuiContainer
|
|||
|
||||
}
|
||||
|
||||
public int percentage(int MaxValue, int CurrentValue)
|
||||
{
|
||||
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
|
||||
{
|
||||
public void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
// if(button.id == 212){
|
||||
// if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
|
||||
|
|
|
@ -8,17 +8,15 @@ 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/thermal_generator.png");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileGasTurbine tile;
|
||||
|
||||
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile)
|
||||
{
|
||||
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile) {
|
||||
super(new ContainerGasTurbine(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -26,8 +24,7 @@ public class GuiGasTurbine extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -35,13 +32,12 @@ public class GuiGasTurbine extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ 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");
|
||||
|
||||
|
@ -17,8 +16,7 @@ public class GuiGenerator extends GuiContainer
|
|||
|
||||
ContainerGenerator containerGenerator;
|
||||
|
||||
public GuiGenerator(EntityPlayer player, TileGenerator generator)
|
||||
{
|
||||
public GuiGenerator(EntityPlayer player, TileGenerator generator) {
|
||||
super(new ContainerGenerator(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,16 +25,14 @@ public class GuiGenerator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -45,27 +41,24 @@ public class GuiGenerator extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
|
||||
if (containerGenerator.burnTime != 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
|
||||
4210752);
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,16 +9,14 @@ import reborncore.common.container.RebornContainer;
|
|||
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");
|
||||
|
||||
TileGrinder grinder;
|
||||
ContainerGrinder containerGrinder;
|
||||
|
||||
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder)
|
||||
{
|
||||
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) {
|
||||
super(RebornContainer.createContainer(ContainerGrinder.class, tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,8 +25,7 @@ public class GuiGrinder extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -38,25 +35,22 @@ public class GuiGrinder extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = grinder.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 80, l + 36, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = grinder.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,8 +15,7 @@ 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");
|
||||
|
||||
|
@ -24,8 +23,7 @@ public class GuiIDSU extends GuiContainer
|
|||
|
||||
ContainerIDSU containerIDSU;
|
||||
|
||||
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU)
|
||||
{
|
||||
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU) {
|
||||
super(new ContainerIDSU(tileIDSU, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 197;
|
||||
|
@ -33,19 +31,15 @@ public class GuiIDSU extends GuiContainer
|
|||
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
|
||||
}
|
||||
|
||||
public static boolean isInteger(String s)
|
||||
{
|
||||
public static boolean isInteger(String s) {
|
||||
return isInteger(s, 10);
|
||||
}
|
||||
|
||||
public static boolean isInteger(String s, int radix)
|
||||
{
|
||||
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) == '-')
|
||||
{
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
if (i == 0 && s.charAt(i) == '-') {
|
||||
if (s.length() == 1)
|
||||
return false;
|
||||
else
|
||||
|
@ -58,8 +52,7 @@ public class GuiIDSU extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -72,8 +65,7 @@ public class GuiIDSU extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -81,21 +73,19 @@ public class GuiIDSU extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 75, 10,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 22,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 32,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 42,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException
|
||||
{
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu));
|
||||
|
||||
|
|
|
@ -10,57 +10,56 @@ import techreborn.tiles.multiblock.TileImplosionCompressor;
|
|||
|
||||
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, -1);
|
||||
}
|
||||
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, -1);
|
||||
}
|
||||
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int j = compresser.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 61, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int j = compresser.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 61, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = compresser.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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);
|
||||
}
|
||||
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,18 +8,16 @@ 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");
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
TileIndustrialElectrolyzer eletrolyzer;
|
||||
|
||||
ContainerIndustrialElectrolyzer containerIndustrialElectrolyzer;
|
||||
|
||||
public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer)
|
||||
{
|
||||
public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer) {
|
||||
super(new ContainerIndustrialElectrolyzer(tileeletrolyzer, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -28,16 +26,14 @@ public class GuiIndustrialElectrolyzer extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -47,24 +43,21 @@ public class GuiIndustrialElectrolyzer extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = eletrolyzer.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 72, l + 38, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = eletrolyzer.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,85 +13,85 @@ import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
|||
|
||||
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
|
||||
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 progress = grinder.getProgressScaled(24);
|
||||
if (progress > 0) {
|
||||
this.drawTexturedModalRect(k + 50, l + 35, 176, 14, progress + 1, 16);
|
||||
}
|
||||
int progress = grinder.getProgressScaled(24);
|
||||
if (progress > 0) {
|
||||
this.drawTexturedModalRect(k + 50, l + 35, 176, 14, progress + 1, 16);
|
||||
}
|
||||
|
||||
int energy = (int) (grinder.getEnergy() * 12f / grinder.getMaxPower());
|
||||
if (energy > 0) {
|
||||
this.drawTexturedModalRect(k + 132, l + 63 + 12 - energy, 176, 12 - energy, 14, energy + 2);
|
||||
}
|
||||
int energy = (int) (grinder.getEnergy() * 12f / grinder.getMaxPower());
|
||||
if (energy > 0) {
|
||||
this.drawTexturedModalRect(k + 132, l + 63 + 12 - energy, 176, 12 - energy, 14, energy + 2);
|
||||
}
|
||||
|
||||
if(!grinder.tank.isEmpty()) {
|
||||
drawFluid(grinder.tank.getFluid(), k + 11, l + 66, 12, 47, grinder.tank.getCapacity());
|
||||
if (!grinder.tank.isEmpty()) {
|
||||
drawFluid(grinder.tank.getFluid(), k + 11, l + 66, 12, 47, grinder.tank.getCapacity());
|
||||
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
drawTexturedModalRect(k + 14, l + 24, 179, 88, 9, 37);
|
||||
}
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
drawTexturedModalRect(k + 14, l + 24, 179, 88, 9, 37);
|
||||
}
|
||||
|
||||
if (!grinder.getMutliBlock()) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
|
||||
}
|
||||
if (!grinder.getMutliBlock()) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void drawFluid(FluidStack fluid, int x, int y, int width, int height, int maxCapacity) {
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
ResourceLocation still = fluid.getFluid().getStill(fluid);
|
||||
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite(still.toString());
|
||||
public void drawFluid(FluidStack fluid, int x, int y, int width, int height, int maxCapacity) {
|
||||
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
ResourceLocation still = fluid.getFluid().getStill(fluid);
|
||||
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite(still.toString());
|
||||
|
||||
int drawHeight = (int) ((fluid.amount / (maxCapacity * 1F)) * height);
|
||||
int iconHeight = sprite.getIconHeight();
|
||||
int offsetHeight = drawHeight;
|
||||
int drawHeight = (int) ((fluid.amount / (maxCapacity * 1F)) * height);
|
||||
int iconHeight = sprite.getIconHeight();
|
||||
int offsetHeight = drawHeight;
|
||||
|
||||
int iteration = 0;
|
||||
while(offsetHeight != 0) {
|
||||
int curHeight = offsetHeight < iconHeight ? offsetHeight : iconHeight;
|
||||
drawTexturedModalRect(x, y - offsetHeight, sprite, width, curHeight);
|
||||
offsetHeight -= curHeight;
|
||||
iteration++;
|
||||
if(iteration > 50) break;
|
||||
}
|
||||
int iteration = 0;
|
||||
while (offsetHeight != 0) {
|
||||
int curHeight = offsetHeight < iconHeight ? offsetHeight : iconHeight;
|
||||
drawTexturedModalRect(x, y - offsetHeight, sprite, width, curHeight);
|
||||
offsetHeight -= curHeight;
|
||||
iteration++;
|
||||
if (iteration > 50)
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,33 +11,29 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import techreborn.client.container.ContainerIndustrialSawmill;
|
||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
||||
|
||||
public class GuiIndustrialSawmill extends GuiContainer
|
||||
{
|
||||
public class GuiIndustrialSawmill extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
|
||||
TileIndustrialSawmill sawmill;
|
||||
|
||||
public GuiIndustrialSawmill(EntityPlayer player, TileIndustrialSawmill tilesawmill)
|
||||
{
|
||||
public GuiIndustrialSawmill(EntityPlayer player, TileIndustrialSawmill tilesawmill) {
|
||||
super(new ContainerIndustrialSawmill(tilesawmill, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.sawmill = tilesawmill;
|
||||
this.sawmill = tilesawmill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -51,7 +47,7 @@ public class GuiIndustrialSawmill extends GuiContainer
|
|||
int energy = 13 - (int) (sawmill.getEnergy() / sawmill.getMaxPower() * 13F);
|
||||
drawTexturedModalRect(k + 36, l + 66 + energy, 179, 1 + energy, 7, 13 - energy);
|
||||
|
||||
if(!sawmill.tank.isEmpty()) {
|
||||
if (!sawmill.tank.isEmpty()) {
|
||||
drawFluid(sawmill.tank.getFluid(), k + 11, l + 66, 12, 47, sawmill.tank.getCapacity());
|
||||
|
||||
int j = sawmill.getEnergyScaled(12);
|
||||
|
@ -62,7 +58,7 @@ public class GuiIndustrialSawmill extends GuiContainer
|
|||
if (!sawmill.getMutliBlock()) {
|
||||
//GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12, -1);
|
||||
l + 52 + 12, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,12 +73,13 @@ public class GuiIndustrialSawmill extends GuiContainer
|
|||
int offsetHeight = drawHeight;
|
||||
|
||||
int iteration = 0;
|
||||
while(offsetHeight != 0) {
|
||||
while (offsetHeight != 0) {
|
||||
int curHeight = offsetHeight < iconHeight ? offsetHeight : iconHeight;
|
||||
drawTexturedModalRect(x, y - offsetHeight, sprite, width, curHeight);
|
||||
offsetHeight -= curHeight;
|
||||
iteration++;
|
||||
if(iteration > 50) break;
|
||||
if (iteration > 50)
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,17 +8,15 @@ 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");
|
||||
"textures/gui/container/furnace.png");
|
||||
|
||||
TileIronFurnace furnace;
|
||||
ContainerIronFurnace containerGrinder;
|
||||
|
||||
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder)
|
||||
{
|
||||
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder) {
|
||||
super(new ContainerIronFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,8 +25,7 @@ public class GuiIronFurnace extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -38,25 +35,22 @@ public class GuiIronFurnace extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = furnace.gaugeProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.gaugeFuelScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
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;
|
||||
|
@ -11,8 +9,9 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import techreborn.client.container.ContainerLESU;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
||||
public class GuiLESU extends GuiContainer
|
||||
{
|
||||
import java.awt.*;
|
||||
|
||||
public class GuiLESU extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
|
||||
|
||||
|
@ -20,8 +19,7 @@ public class GuiLESU extends GuiContainer
|
|||
|
||||
ContainerLESU containerLesu;
|
||||
|
||||
public GuiLESU(EntityPlayer player, TileLesu tileaesu)
|
||||
{
|
||||
public GuiLESU(EntityPlayer player, TileLesu tileaesu) {
|
||||
super(new ContainerLESU(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 197;
|
||||
|
@ -30,8 +28,7 @@ public class GuiLESU extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -39,19 +36,18 @@ public class GuiLESU extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
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());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30,
|
||||
Color.WHITE.getRGB());
|
||||
Color.WHITE.getRGB());
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40,
|
||||
Color.WHITE.getRGB());
|
||||
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());
|
||||
Color.WHITE.getRGB());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ import techreborn.tiles.storage.TileMFE;
|
|||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
public class GuiMFE extends GuiContainer
|
||||
{
|
||||
public class GuiMFE extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/mfe.png");
|
||||
|
||||
|
@ -20,8 +19,7 @@ public class GuiMFE extends GuiContainer
|
|||
|
||||
ContainerMFE containerGenerator;
|
||||
|
||||
public GuiMFE(EntityPlayer player, TileMFE generator)
|
||||
{
|
||||
public GuiMFE(EntityPlayer player, TileMFE generator) {
|
||||
super(new ContainerMFE(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -30,16 +28,14 @@ public class GuiMFE extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -48,8 +44,7 @@ public class GuiMFE extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
//
|
||||
|
@ -61,17 +56,16 @@ public class GuiMFE extends GuiContainer
|
|||
// }
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.mfe.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), this.xSize - 60,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 110, this.ySize - 150,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 110, this.ySize - 160,
|
||||
4210752);
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ import techreborn.tiles.storage.TileMFSU;
|
|||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
public class GuiMFSU extends GuiContainer
|
||||
{
|
||||
public class GuiMFSU extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/mfsu.png");
|
||||
|
||||
|
@ -20,8 +19,7 @@ public class GuiMFSU extends GuiContainer
|
|||
|
||||
ContainerMFSU containerGenerator;
|
||||
|
||||
public GuiMFSU(EntityPlayer player, TileMFSU generator)
|
||||
{
|
||||
public GuiMFSU(EntityPlayer player, TileMFSU generator) {
|
||||
super(new ContainerMFSU(generator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -30,16 +28,14 @@ public class GuiMFSU extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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;
|
||||
|
@ -48,8 +44,7 @@ public class GuiMFSU extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = generator.getEnergyScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
//
|
||||
|
@ -61,17 +56,16 @@ public class GuiMFSU extends GuiContainer
|
|||
// }
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.mfsu.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), this.xSize - 60,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 110, this.ySize - 150,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 110, this.ySize - 160,
|
||||
4210752);
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,18 +8,16 @@ 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");
|
||||
"textures/gui/matterfabricator.png");
|
||||
|
||||
TileMatterFabricator matterfab;
|
||||
|
||||
ContainerMatterFabricator containerMatterFabricator;
|
||||
|
||||
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab)
|
||||
{
|
||||
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab) {
|
||||
super(new ContainerMatterFabricator(tilematterfab, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -28,8 +26,7 @@ public class GuiMatterFabricator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -37,21 +34,19 @@ public class GuiMatterFabricator extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = containerMatterFabricator.getProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileQuantumChest tile;
|
||||
|
||||
public GuiQuantumChest(EntityPlayer player, TileQuantumChest tile)
|
||||
{
|
||||
public GuiQuantumChest(EntityPlayer player, TileQuantumChest tile) {
|
||||
super(new ContainerQuantumChest(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -25,8 +23,7 @@ public class GuiQuantumChest extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -34,17 +31,16 @@ public class GuiQuantumChest extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumChest.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
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);
|
||||
16448255);
|
||||
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
|
||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileQuantumTank tile;
|
||||
|
||||
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile)
|
||||
{
|
||||
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile) {
|
||||
super(new ContainerQuantumTank(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -25,8 +23,7 @@ public class GuiQuantumTank extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -34,13 +31,12 @@ public class GuiQuantumTank extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
|
||||
TileRecycler compressor;
|
||||
ContainerRecycler containerGrinder;
|
||||
|
||||
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder)
|
||||
{
|
||||
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder) {
|
||||
super(new ContainerRecycler(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -26,8 +24,7 @@ public class GuiRecycler extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -37,24 +34,21 @@ public class GuiRecycler extends GuiContainer
|
|||
int j = 0;
|
||||
|
||||
j = compressor.gaugeProgressScaled(24);
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = compressor.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,16 +9,14 @@ 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");
|
||||
"textures/gui/rolling_machine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
ContainerRollingMachine containerRollingMachine;
|
||||
|
||||
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
|
||||
{
|
||||
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) {
|
||||
super(new ContainerRollingMachine(tileRollingmachine, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,8 +25,7 @@ public class GuiRollingMachine extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -39,24 +36,21 @@ public class GuiRollingMachine extends GuiContainer
|
|||
this.drawTexturedModalRect(k + 91, l + 34, 176, 14, j + 1, 19);
|
||||
|
||||
j = this.rollingMachine.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
|
|
|
@ -8,17 +8,15 @@ 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");
|
||||
"textures/gui/scrapboxinator.png");
|
||||
|
||||
TileScrapboxinator tile;
|
||||
ContainerScrapboxinator containerScrapboxinator;
|
||||
|
||||
public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator)
|
||||
{
|
||||
public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator) {
|
||||
super(new ContainerScrapboxinator(tileScrapboxinator, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -27,8 +25,7 @@ public class GuiScrapboxinator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -39,24 +36,21 @@ public class GuiScrapboxinator extends GuiContainer
|
|||
|
||||
j = tile.gaugeProgressScaled(24);
|
||||
// System.out.println(compressor.gaugeProgressScaled(10));
|
||||
if (j > 0)
|
||||
{
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = tile.getEnergyScaled(12);
|
||||
if (j > 0)
|
||||
{
|
||||
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_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
|
||||
4210752);
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,17 +8,15 @@ 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/semifluid_generator.png");
|
||||
"textures/gui/semifluid_generator.png");
|
||||
|
||||
TileSemifluidGenerator tile;
|
||||
|
||||
public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile)
|
||||
{
|
||||
public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile) {
|
||||
super(new ContainerSemifluidGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -26,8 +24,7 @@ public class GuiSemifluidGenerator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -35,13 +32,12 @@ public class GuiSemifluidGenerator extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
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);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -8,16 +8,14 @@ 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");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileThermalGenerator tile;
|
||||
|
||||
public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile)
|
||||
{
|
||||
public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile) {
|
||||
super(new ContainerThermalGenerator(tile, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
@ -25,8 +23,7 @@ public class GuiThermalGenerator extends GuiContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
|
@ -34,13 +31,12 @@ public class GuiThermalGenerator extends GuiContainer
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||
4210752);
|
||||
4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
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);
|
||||
|
|
|
@ -10,51 +10,49 @@ import techreborn.tiles.multiblock.TileVacuumFreezer;
|
|||
|
||||
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;
|
||||
TileVacuumFreezer crafter;
|
||||
|
||||
public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer freezer) {
|
||||
super(new ContainerVacuumFreezer(freezer, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
crafter = freezer;
|
||||
}
|
||||
public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer freezer) {
|
||||
super(new ContainerVacuumFreezer(freezer, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
crafter = freezer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
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 partialTicks, int mouseX, int mouseY) {
|
||||
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 = crafter.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 80, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
int j = crafter.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 80, l + 37, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = (int) (crafter.getEnergy() * 12f / crafter.getMaxPower());
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
j = (int) (crafter.getEnergy() * 12f / crafter.getMaxPower());
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
if (!crafter.getMultiBlock()) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
|
||||
}
|
||||
if (!crafter.getMultiBlock()) {
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
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"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
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"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
|||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.util.text.translation.LanguageMap;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
|
@ -13,64 +12,63 @@ import java.util.ArrayList;
|
|||
|
||||
public abstract class GuiWidget<T extends Container> extends GuiContainer {
|
||||
|
||||
public static final LanguageMap translate = ObfuscationReflectionHelper.getPrivateValue(LanguageMap.class, null, 2);
|
||||
public static final LanguageMap translate = ObfuscationReflectionHelper.getPrivateValue(LanguageMap.class, null, 2);
|
||||
|
||||
private final ArrayList<Widget> widgets = new ArrayList<>();
|
||||
private final ResourceLocation background;
|
||||
private final ArrayList<Widget> widgets = new ArrayList<>();
|
||||
private final ResourceLocation background;
|
||||
|
||||
public GuiWidget(T inventorySlotsIn, ResourceLocation background, int xSize, int ySize) {
|
||||
super(inventorySlotsIn);
|
||||
this.xSize = xSize;
|
||||
this.ySize = ySize;
|
||||
this.background = background;
|
||||
}
|
||||
public GuiWidget(T inventorySlotsIn, ResourceLocation background, int xSize, int ySize) {
|
||||
super(inventorySlotsIn);
|
||||
this.xSize = xSize;
|
||||
this.ySize = ySize;
|
||||
this.background = background;
|
||||
}
|
||||
|
||||
public T getContainer() {
|
||||
return (T) inventorySlots;
|
||||
}
|
||||
public T getContainer() {
|
||||
return (T) inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
widgets.clear();
|
||||
initWidgets();
|
||||
}
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
widgets.clear();
|
||||
initWidgets();
|
||||
}
|
||||
|
||||
public void addWidget(Widget widget) {
|
||||
widgets.add(widget);
|
||||
}
|
||||
public void addWidget(Widget widget) {
|
||||
widgets.add(widget);
|
||||
}
|
||||
|
||||
public void removeWidget(Widget widget) {
|
||||
widgets.remove(widget);
|
||||
}
|
||||
public void removeWidget(Widget widget) {
|
||||
widgets.remove(widget);
|
||||
}
|
||||
|
||||
public abstract void initWidgets();
|
||||
|
||||
public abstract void initWidgets();
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(background);
|
||||
int x = (this.width - this.xSize) / 2;
|
||||
int y = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(background);
|
||||
int x = (this.width - this.xSize) / 2;
|
||||
int y = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
int x = (this.width - this.xSize) / 2;
|
||||
int y = (this.height - this.ySize) / 2;
|
||||
String name = translate.translateKey("tile.techreborn.industrialgrinder.name");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
int x = (this.width - this.xSize) / 2;
|
||||
int y = (this.height - this.ySize) / 2;
|
||||
String name = translate.translateKey("tile.techreborn.industrialgrinder.name");
|
||||
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
fontRendererObj.drawString(translate.translateKey("container.inventory"), 8, ySize - 94, 4210752);
|
||||
|
||||
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
fontRendererObj.drawString(translate.translateKey("container.inventory"), 8, ySize - 94, 4210752);
|
||||
for (Widget widget : widgets)
|
||||
widget.drawWidget(this, x, y, mouseX, mouseY);
|
||||
}
|
||||
|
||||
for(Widget widget : widgets)
|
||||
widget.drawWidget(this, x, y, mouseX, mouseY);
|
||||
}
|
||||
|
||||
public FontRenderer getFontRenderer() {
|
||||
return fontRendererObj;
|
||||
}
|
||||
public FontRenderer getFontRenderer() {
|
||||
return fontRendererObj;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,45 +5,46 @@ import techreborn.client.gui.widget.tooltip.ToolTip;
|
|||
|
||||
public abstract class Widget {
|
||||
|
||||
private final int x, y;
|
||||
protected final int width, height;
|
||||
private final int x, y;
|
||||
protected final int width, height;
|
||||
|
||||
private ToolTip toolTip;
|
||||
private ToolTip toolTip;
|
||||
|
||||
public Widget(int x, int y, int width, int height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
public Widget(int x, int y, int width, int height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public ToolTip getToolTip() {
|
||||
return toolTip;
|
||||
}
|
||||
public ToolTip getToolTip() {
|
||||
return toolTip;
|
||||
}
|
||||
|
||||
public void setToolTip(ToolTip toolTip) {
|
||||
this.toolTip = toolTip;
|
||||
}
|
||||
public void setToolTip(ToolTip toolTip) {
|
||||
this.toolTip = toolTip;
|
||||
}
|
||||
|
||||
public final void drawWidget(GuiWidget gui, int cornerX, int cornerY, int mouseX, int mouseY) {
|
||||
int drawX = cornerX + x;
|
||||
int drawY = cornerY + y;
|
||||
if(toolTip != null && drawX > mouseX && drawY > mouseY &&
|
||||
drawX + width < mouseX && drawY + height < mouseY) {
|
||||
toolTip.draw(gui.getFontRenderer(), mouseX, mouseY);
|
||||
}
|
||||
draw(gui, drawX, drawY);
|
||||
}
|
||||
public final void drawWidget(GuiWidget gui, int cornerX, int cornerY, int mouseX, int mouseY) {
|
||||
int drawX = cornerX + x;
|
||||
int drawY = cornerY + y;
|
||||
if (toolTip != null && drawX > mouseX && drawY > mouseY &&
|
||||
drawX + width < mouseX && drawY + height < mouseY) {
|
||||
toolTip.draw(gui.getFontRenderer(), mouseX, mouseY);
|
||||
}
|
||||
draw(gui, drawX, drawY);
|
||||
}
|
||||
|
||||
protected abstract void draw(GuiScreen guiScreen, int x, int y);
|
||||
protected abstract void mouseClick(GuiWidget guiWidget, int mouseX, int mouseY);
|
||||
protected abstract void draw(GuiScreen guiScreen, int x, int y);
|
||||
|
||||
protected abstract void mouseClick(GuiWidget guiWidget, int mouseX, int mouseY);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package techreborn.client.gui.widget.tooltip;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import reborncore.client.gui.GuiUtil;
|
||||
|
||||
|
@ -9,53 +8,53 @@ import java.util.Collections;
|
|||
|
||||
public class ToolTip {
|
||||
|
||||
protected ArrayList<ToolTipLine> lines = new ArrayList<>();
|
||||
protected ArrayList<ToolTipLine> lines = new ArrayList<>();
|
||||
|
||||
public ToolTip(String... textLines) {
|
||||
for(String text : textLines)
|
||||
lines.add(new ToolTipLine(text));
|
||||
}
|
||||
public ToolTip(String... textLines) {
|
||||
for (String text : textLines)
|
||||
lines.add(new ToolTipLine(text));
|
||||
}
|
||||
|
||||
public ToolTip(ToolTipLine... toolTipLines) {
|
||||
Collections.addAll(lines, toolTipLines);
|
||||
}
|
||||
public ToolTip(ToolTipLine... toolTipLines) {
|
||||
Collections.addAll(lines, toolTipLines);
|
||||
}
|
||||
|
||||
public ToolTip(int linesSize) {
|
||||
for(int i = 0; i < linesSize; i++)
|
||||
lines.add(new ToolTipLine());
|
||||
}
|
||||
public ToolTip(int linesSize) {
|
||||
for (int i = 0; i < linesSize; i++)
|
||||
lines.add(new ToolTipLine());
|
||||
}
|
||||
|
||||
public void addLine(ToolTipLine toolTipLine) {
|
||||
lines.add(toolTipLine);
|
||||
}
|
||||
public void addLine(ToolTipLine toolTipLine) {
|
||||
lines.add(toolTipLine);
|
||||
}
|
||||
|
||||
public void removeLine(int index) {
|
||||
lines.remove(index);
|
||||
}
|
||||
public void removeLine(int index) {
|
||||
lines.remove(index);
|
||||
}
|
||||
|
||||
public ToolTipLine getLine(int index) {
|
||||
return lines.get(index);
|
||||
}
|
||||
public ToolTipLine getLine(int index) {
|
||||
return lines.get(index);
|
||||
}
|
||||
|
||||
public ArrayList<ToolTipLine> getLines() {
|
||||
return lines;
|
||||
}
|
||||
public ArrayList<ToolTipLine> getLines() {
|
||||
return lines;
|
||||
}
|
||||
|
||||
protected void refresh() {}
|
||||
protected void refresh() {}
|
||||
|
||||
public void draw(FontRenderer font, int mouseX, int mouseY) {
|
||||
refresh();
|
||||
int maxLineLength = 0;
|
||||
int textX = mouseX + 3;
|
||||
int textY = mouseY + 3;
|
||||
for(ToolTipLine toolTipLine : lines) {
|
||||
toolTipLine.draw(font, textX, textY);
|
||||
textY += (font.FONT_HEIGHT + 3);
|
||||
int lineWidth = toolTipLine.getWidth(font);
|
||||
if(lineWidth > maxLineLength)
|
||||
maxLineLength = lineWidth;
|
||||
}
|
||||
GuiUtil.drawTooltipBox(mouseX, mouseY, maxLineLength, textY + 3);
|
||||
}
|
||||
public void draw(FontRenderer font, int mouseX, int mouseY) {
|
||||
refresh();
|
||||
int maxLineLength = 0;
|
||||
int textX = mouseX + 3;
|
||||
int textY = mouseY + 3;
|
||||
for (ToolTipLine toolTipLine : lines) {
|
||||
toolTipLine.draw(font, textX, textY);
|
||||
textY += (font.FONT_HEIGHT + 3);
|
||||
int lineWidth = toolTipLine.getWidth(font);
|
||||
if (lineWidth > maxLineLength)
|
||||
maxLineLength = lineWidth;
|
||||
}
|
||||
GuiUtil.drawTooltipBox(mouseX, mouseY, maxLineLength, textY + 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,81 +4,83 @@ import net.minecraft.client.gui.FontRenderer;
|
|||
|
||||
public class ToolTipLine {
|
||||
|
||||
private String line;
|
||||
private int color;
|
||||
private boolean shadowed;
|
||||
private String line;
|
||||
private int color;
|
||||
private boolean shadowed;
|
||||
|
||||
public ToolTipLine(String line, int color, boolean shadowed) {
|
||||
this.line = line;
|
||||
this.color = color;
|
||||
this.shadowed = shadowed;
|
||||
}
|
||||
public ToolTipLine(String line, int color, boolean shadowed) {
|
||||
this.line = line;
|
||||
this.color = color;
|
||||
this.shadowed = shadowed;
|
||||
}
|
||||
|
||||
public ToolTipLine(String line, int color) {
|
||||
this(line, color, false);
|
||||
}
|
||||
public ToolTipLine(String line, int color) {
|
||||
this(line, color, false);
|
||||
}
|
||||
|
||||
public ToolTipLine(String line, boolean shadowed) {
|
||||
this(line, 0xFFFFFF, shadowed);
|
||||
}
|
||||
public ToolTipLine(String line, boolean shadowed) {
|
||||
this(line, 0xFFFFFF, shadowed);
|
||||
}
|
||||
|
||||
public ToolTipLine(String line) {
|
||||
this(line, 0xFFFFFF, false);
|
||||
}
|
||||
public ToolTipLine(String line) {
|
||||
this(line, 0xFFFFFF, false);
|
||||
}
|
||||
|
||||
public ToolTipLine() {
|
||||
this("");
|
||||
}
|
||||
public ToolTipLine() {
|
||||
this("");
|
||||
}
|
||||
|
||||
public String getLine() {
|
||||
return line;
|
||||
}
|
||||
public String getLine() {
|
||||
return line;
|
||||
}
|
||||
|
||||
public void setLine(String line) {
|
||||
this.line = line;
|
||||
}
|
||||
public void setLine(String line) {
|
||||
this.line = line;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
public void setColor(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public boolean isShadowed() {
|
||||
return shadowed;
|
||||
}
|
||||
public boolean isShadowed() {
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
public void setShadowed(boolean shadowed) {
|
||||
this.shadowed = shadowed;
|
||||
}
|
||||
public void setShadowed(boolean shadowed) {
|
||||
this.shadowed = shadowed;
|
||||
}
|
||||
|
||||
public int getWidth(FontRenderer fontRenderer) {
|
||||
return fontRenderer.getStringWidth(getLine());
|
||||
}
|
||||
public int getWidth(FontRenderer fontRenderer) {
|
||||
return fontRenderer.getStringWidth(getLine());
|
||||
}
|
||||
|
||||
public void draw(FontRenderer fontRenderer, int x, int y) {
|
||||
fontRenderer.drawString(getLine(), x, y, color, isShadowed());
|
||||
}
|
||||
public void draw(FontRenderer fontRenderer, int x, int y) {
|
||||
fontRenderer.drawString(getLine(), x, y, color, isShadowed());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ToolTipLine that = (ToolTipLine) o;
|
||||
return color == that.color &&
|
||||
shadowed == that.shadowed &&
|
||||
line.equals(that.line);
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
ToolTipLine that = (ToolTipLine) o;
|
||||
return color == that.color &&
|
||||
shadowed == that.shadowed &&
|
||||
line.equals(that.line);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = line.hashCode();
|
||||
result = 31 * result + color;
|
||||
result = 31 * result + (shadowed ? 1 : 0);
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = line.hashCode();
|
||||
result = 31 * result + color;
|
||||
result = 31 * result + (shadowed ? 1 : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue