Add JEI transfer support for ContainerBuilder + Convert Compressor, Extractor and Grinder
This commit is contained in:
parent
1df2c84e16
commit
94a0616d8e
28 changed files with 401 additions and 433 deletions
|
@ -17,7 +17,7 @@ public class GuiBatbox extends GuiContainer {
|
|||
TileBatBox generator;
|
||||
|
||||
public GuiBatbox(final EntityPlayer player, final TileBatBox generator) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
super(new ContainerBuilder("batbox").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(generator).energySlot(0, 80, 17).energySlot(1, 80, 53).syncEnergyValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
|
|
@ -16,9 +16,9 @@ public class GuiChargeBench extends GuiContainer {
|
|||
TileChargeBench chargebench;
|
||||
|
||||
public GuiChargeBench(final EntityPlayer player, final TileChargeBench tile) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory().tile(tile)
|
||||
.energySlot(0, 62, 21).energySlot(1, 80, 21).energySlot(2, 98, 21).energySlot(3, 62, 39).energySlot(4, 80, 39)
|
||||
.energySlot(5, 98, 39).syncEnergyValue().addInventory().create());
|
||||
super(new ContainerBuilder("charbench").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(tile).energySlot(0, 62, 21).energySlot(1, 80, 21).energySlot(2, 98, 21).energySlot(3, 62, 39)
|
||||
.energySlot(4, 80, 39).energySlot(5, 98, 39).syncEnergyValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.chargebench = tile;
|
||||
|
|
|
@ -13,7 +13,7 @@ import techreborn.tiles.TileChunkLoader;
|
|||
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;
|
||||
|
@ -21,10 +21,11 @@ public class GuiChunkLoader extends GuiContainer {
|
|||
private GuiButton minusTenButton;
|
||||
|
||||
public GuiChunkLoader(final EntityPlayer player, final TileChunkLoader tilechunkloader) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory().hotbar().addInventory().create());
|
||||
super(new ContainerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chunkloader = tilechunkloader;
|
||||
this.chunkloader = tilechunkloader;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,33 +33,34 @@ public class GuiChunkLoader extends GuiContainer {
|
|||
super.initGui();
|
||||
this.guiLeft = this.width / 2 - this.xSize / 2;
|
||||
this.guiTop = this.height / 2 - this.ySize / 2;
|
||||
plusOneButton = new GuiButton(0, guiLeft + 5, guiTop + 37, 40, 20, "+1");
|
||||
plusTenButton = new GuiButton(0, guiLeft + 45, guiTop + 37, 40, 20, "+10");
|
||||
this.plusOneButton = new GuiButton(0, this.guiLeft + 5, this.guiTop + 37, 40, 20, "+1");
|
||||
this.plusTenButton = new GuiButton(0, this.guiLeft + 45, this.guiTop + 37, 40, 20, "+10");
|
||||
|
||||
minusOneButton = new GuiButton(0, guiLeft + 90, guiTop + 37, 40, 20, "-1");
|
||||
minusTenButton = new GuiButton(0, guiLeft + 130, guiTop + 37, 40, 20, "-10");
|
||||
this.minusOneButton = new GuiButton(0, this.guiLeft + 90, this.guiTop + 37, 40, 20, "-1");
|
||||
this.minusTenButton = new GuiButton(0, this.guiLeft + 130, this.guiTop + 37, 40, 20, "-10");
|
||||
|
||||
buttonList.add(plusOneButton);
|
||||
buttonList.add(plusTenButton);
|
||||
buttonList.add(minusOneButton);
|
||||
buttonList.add(minusTenButton);
|
||||
this.buttonList.add(this.plusOneButton);
|
||||
this.buttonList.add(this.plusTenButton);
|
||||
this.buttonList.add(this.minusOneButton);
|
||||
this.buttonList.add(this.minusTenButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final 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.mc.getTextureManager().bindTexture(GuiChunkLoader.texture);
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.client.container.ContainerCompressor;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.teir1.TileCompressor;
|
||||
|
||||
public class GuiCompressor extends GuiContainer {
|
||||
|
@ -13,42 +14,45 @@ 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) {
|
||||
super(new ContainerCompressor(tilegrinder, player));
|
||||
public GuiCompressor(final EntityPlayer player, final TileCompressor compressor) {
|
||||
super(new ContainerBuilder("compressor").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(compressor).slot(0, 56, 34).outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26)
|
||||
.upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62).syncEnergyValue().syncCrafterValue().addInventory()
|
||||
.create());
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compressor = tilegrinder;
|
||||
containerGrinder = (ContainerCompressor) this.inventorySlots;
|
||||
this.compressor = compressor;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final 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.mc.getTextureManager().bindTexture(GuiCompressor.texture);
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
|
||||
j = compressor.getProgressScaled(24);
|
||||
j = this.compressor.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = compressor.getEnergyScaled(12);
|
||||
j = this.compressor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.compressor.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,9 @@ public class GuiDieselGenerator extends GuiContainer {
|
|||
TileDieselGenerator tile;
|
||||
|
||||
public GuiDieselGenerator(final EntityPlayer player, final TileDieselGenerator tile) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory().tile(tile)
|
||||
.slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory().create());
|
||||
super(new ContainerBuilder("fluidgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(tile).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue()
|
||||
.addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
|
|
|
@ -2,6 +2,7 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.TileDigitalChest;
|
||||
|
||||
|
@ -10,25 +11,27 @@ public class GuiDigitalChest extends GuiBase {
|
|||
TileDigitalChest tile;
|
||||
|
||||
public GuiDigitalChest(final EntityPlayer player, final TileDigitalChest tile) {
|
||||
super(player, tile, new ContainerBuilder().player(player.inventory).inventory().hotbar().addInventory().tile(tile).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create());
|
||||
super(player, tile, new ContainerBuilder("digitalchest").player(player.inventory).inventory().hotbar()
|
||||
.addInventory().tile(tile).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create());
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
|
||||
drawSlotBackground(80, 24);
|
||||
drawSlotBackground(80, 64);
|
||||
this.drawSlotBackground(80, 24);
|
||||
this.drawSlotBackground(80, 64);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
if (tile.storedItem != ItemStack.EMPTY && tile.getStackInSlot(1) != null) {
|
||||
builder.drawBigBlueBar(this, 31, 43, tile.storedItem.getCount() + tile.getStackInSlot(1).getCount(), tile.maxCapacity, mouseX - guiLeft, mouseY - guiTop, "Stored");
|
||||
if (this.tile.storedItem != ItemStack.EMPTY && this.tile.getStackInSlot(1) != null) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.tile.storedItem.getCount() + this.tile.getStackInSlot(1).getCount(), this.tile.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored");
|
||||
}
|
||||
if (tile.storedItem == ItemStack.EMPTY && tile.getStackInSlot(1) != null) {
|
||||
builder.drawBigBlueBar(this, 31, 43, tile.getStackInSlot(1).getCount(), tile.maxCapacity, mouseX - guiLeft, mouseY - guiTop, "Stored");
|
||||
if (this.tile.storedItem == ItemStack.EMPTY && this.tile.getStackInSlot(1) != null) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43, this.tile.getStackInSlot(1).getCount(), this.tile.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@ public class GuiElectricFurnace extends GuiContainer {
|
|||
TileElectricFurnace furnace;
|
||||
|
||||
public GuiElectricFurnace(final EntityPlayer player, final TileElectricFurnace furnace) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(furnace).slot(0, 56, 34).outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26)
|
||||
.upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62).syncEnergyValue()
|
||||
super(new ContainerBuilder("electricfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(furnace).slot(0, 56, 34).outputSlot(1, 116, 34).upgradeSlot(2, 152, 8)
|
||||
.upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62).syncEnergyValue()
|
||||
.syncIntegerValue(furnace::getBurnTime, furnace::setBurnTime).addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.client.container.ContainerExtractor;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
public class GuiExtractor extends GuiContainer {
|
||||
|
@ -14,42 +14,44 @@ 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) {
|
||||
super(RebornContainer.createContainer(ContainerExtractor.class, tileExtractor, player));
|
||||
public GuiExtractor(final EntityPlayer player, final TileExtractor extractor) {
|
||||
super(new ContainerBuilder("extractor").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(extractor).slot(0, 56, 34).outputSlot(1, 116, 34).upgradeSlot(2, 152, 8)
|
||||
.upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62).syncEnergyValue()
|
||||
.syncCrafterValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.extractor = tileExtractor;
|
||||
containerExtractor = (ContainerExtractor) this.inventorySlots;
|
||||
this.extractor = extractor;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final 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.mc.getTextureManager().bindTexture(GuiExtractor.texture);
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
|
||||
j = extractor.getProgressScaled(24);
|
||||
j = this.extractor.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = extractor.getEnergyScaled(12);
|
||||
j = this.extractor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.extractor.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,10 @@ public class GuiGasTurbine extends GuiContainer {
|
|||
TileGasTurbine tile;
|
||||
|
||||
public GuiGasTurbine(final EntityPlayer player, final TileGasTurbine tile) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory().tile(tile)
|
||||
.slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory().create());
|
||||
super(new ContainerBuilder("fluidgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory()
|
||||
.tile(tile).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory()
|
||||
.create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
|
|
|
@ -17,7 +17,7 @@ public class GuiGenerator extends GuiContainer {
|
|||
TileGenerator generator;
|
||||
|
||||
public GuiGenerator(final EntityPlayer player, final TileGenerator generator) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
super(new ContainerBuilder("generator").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(generator).fuelSlot(0, 80, 53).energySlot(1, 80, 17).syncEnergyValue()
|
||||
.syncIntegerValue(generator::getBurnTime, generator::setBurnTime)
|
||||
.syncIntegerValue(generator::getTotalBurnTime, generator::setTotalBurnTime).addInventory().create());
|
||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.client.container.ContainerGrinder;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.teir1.TileGrinder;
|
||||
|
||||
public class GuiGrinder extends GuiContainer {
|
||||
|
@ -14,43 +14,44 @@ 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) {
|
||||
super(RebornContainer.createContainer(ContainerGrinder.class, tilegrinder, player));
|
||||
public GuiGrinder(final EntityPlayer player, final TileGrinder grinder) {
|
||||
super(new ContainerBuilder("grinder").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(grinder).slot(0, 56, 34).outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26)
|
||||
.upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62).syncEnergyValue().syncCrafterValue().addInventory()
|
||||
.create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.grinder = tilegrinder;
|
||||
containerGrinder = (ContainerGrinder) this.inventorySlots;
|
||||
this.grinder = grinder;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final 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.mc.getTextureManager().bindTexture(GuiGrinder.texture);
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int j = 0;
|
||||
|
||||
j = grinder.getProgressScaled(24);
|
||||
j = this.grinder.getProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 80, l + 36, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = grinder.getEnergyScaled(12);
|
||||
j = this.grinder.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.grinder.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ public class GuiIronFurnace extends GuiContainer {
|
|||
TileIronFurnace furnace;
|
||||
|
||||
public GuiIronFurnace(final EntityPlayer player, final TileIronFurnace furnace) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(furnace).slot(0, 56, 17).outputSlot(1, 116, 34).fuelSlot(2, 56, 53)
|
||||
super(new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(furnace).slot(0, 56, 17).outputSlot(1, 116, 34).fuelSlot(2, 56, 53)
|
||||
.syncIntegerValue(furnace::getBurnTime, furnace::setBurnTime)
|
||||
.syncIntegerValue(furnace::getTotalBurnTime, furnace::setTotalBurnTime).addInventory()
|
||||
.create());
|
||||
|
|
|
@ -21,9 +21,9 @@ public class GuiMFE extends GuiContainer {
|
|||
|
||||
|
||||
public GuiMFE(final EntityPlayer player, final TileMFE generator) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).armor().complete(44, 6)
|
||||
.addArmor().addInventory().tile(generator).energySlot(0, 80, 17).energySlot(1, 80, 53).syncEnergyValue()
|
||||
.addInventory().create());
|
||||
super(new ContainerBuilder("mfe").player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
||||
.complete(44, 6).addArmor().addInventory().tile(generator).energySlot(0, 80, 17).energySlot(1, 80, 53)
|
||||
.syncEnergyValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
|
|
|
@ -20,9 +20,9 @@ public class GuiMFSU extends GuiContainer {
|
|||
TileMFSU generator;
|
||||
|
||||
public GuiMFSU(final EntityPlayer player, final TileMFSU generator) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).armor().complete(44, 6)
|
||||
.addArmor().addInventory().tile(generator).energySlot(0, 80, 17).energySlot(1, 80, 53).syncEnergyValue()
|
||||
.addInventory().create());
|
||||
super(new ContainerBuilder("mfsu").player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
||||
.complete(44, 6).addArmor().addInventory().tile(generator).energySlot(0, 80, 17).energySlot(1, 80, 53)
|
||||
.syncEnergyValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import reborncore.common.util.ItemUtils;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
|
@ -14,42 +15,44 @@ import techreborn.tiles.TileQuantumChest;
|
|||
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(final EntityPlayer player, final TileQuantumChest tile) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 64).hotbar(8, 152).addInventory().tile(tile)
|
||||
.slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).addInventory().create());
|
||||
super(new ContainerBuilder("quantumchest").player(player.inventory).inventory(8, 64).hotbar(8, 152)
|
||||
.addInventory().tile(tile).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).addInventory()
|
||||
.create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final 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.mc.getTextureManager().bindTexture(GuiQuantumChest.texture);
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.quantumChest.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
|
||||
int count = 0;
|
||||
if (tile.storedItem != ItemStack.EMPTY || !tile.getStackInSlot(1).isEmpty()) {
|
||||
if (this.tile.storedItem != ItemStack.EMPTY || !this.tile.getStackInSlot(1).isEmpty()) {
|
||||
|
||||
count = tile.storedItem.getCount();
|
||||
if (tile.getStackInSlot(1) != ItemStack.EMPTY && (tile.storedItem.isEmpty()
|
||||
|| ItemUtils.isItemEqual(tile.getStackInSlot(1), tile.getStackInSlot(2), true, true)))
|
||||
count += tile.getStackInSlot(1).getCount();
|
||||
count = this.tile.storedItem.getCount();
|
||||
if (this.tile.getStackInSlot(1) != ItemStack.EMPTY && (this.tile.storedItem.isEmpty()
|
||||
|| ItemUtils.isItemEqual(this.tile.getStackInSlot(1), this.tile.getStackInSlot(2), true, true)))
|
||||
count += this.tile.getStackInSlot(1).getCount();
|
||||
}
|
||||
this.fontRendererObj.drawString(count + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -20,8 +20,9 @@ public class GuiSemifluidGenerator extends GuiContainer {
|
|||
TileSemifluidGenerator tile;
|
||||
|
||||
public GuiSemifluidGenerator(final EntityPlayer player, final TileSemifluidGenerator tile) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory().tile(tile)
|
||||
.slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory().create());
|
||||
super(new ContainerBuilder("fluidgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(tile).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue()
|
||||
.addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
|
|
|
@ -19,8 +19,9 @@ public class GuiThermalGenerator extends GuiContainer {
|
|||
TileThermalGenerator tile;
|
||||
|
||||
public GuiThermalGenerator(final EntityPlayer player, final TileThermalGenerator tile) {
|
||||
super(new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory().tile(tile)
|
||||
.slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory().create());
|
||||
super(new ContainerBuilder("fluidgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(tile).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue()
|
||||
.addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue