Convert recycler + Fix slot indexes
This commit is contained in:
parent
d77ed99e8a
commit
b9444b5ce5
6 changed files with 95 additions and 133 deletions
|
@ -19,8 +19,8 @@ public class GuiAssemblingMachine extends GuiContainer {
|
|||
public GuiAssemblingMachine(final EntityPlayer player, final TileAssemblingMachine assemblingMachine) {
|
||||
super(new ContainerBuilder("assemblingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(assemblingMachine).slot(0, 47, 17).slot(1, 65, 17).outputSlot(2, 116, 35)
|
||||
.energySlot(6, 56, 53).upgradeSlot(7, 152, 8).upgradeSlot(8, 152, 26).upgradeSlot(9, 152, 44)
|
||||
.upgradeSlot(10, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
|
||||
.energySlot(3, 56, 53).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44)
|
||||
.upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.assemblingmachine = assemblingMachine;
|
||||
|
|
|
@ -19,8 +19,8 @@ public class GuiChemicalReactor extends GuiContainer {
|
|||
public GuiChemicalReactor(final EntityPlayer player, final TileChemicalReactor tilechemicalReactor) {
|
||||
super(new ContainerBuilder("chemicalreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(tilechemicalReactor).slot(0, 70, 21).slot(1, 90, 21).outputSlot(2, 80, 51)
|
||||
.energySlot(6, 8, 51).upgradeSlot(7, 152, 8).upgradeSlot(8, 152, 26).upgradeSlot(9, 152, 44)
|
||||
.upgradeSlot(10, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
|
||||
.energySlot(3, 8, 51).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44)
|
||||
.upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.chemicalReactor = tilechemicalReactor;
|
||||
|
|
|
@ -5,50 +5,54 @@ 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.ContainerRecycler;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.teir1.TileRecycler;
|
||||
|
||||
public class GuiRecycler extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
||||
|
||||
TileRecycler compressor;
|
||||
ContainerRecycler containerGrinder;
|
||||
TileRecycler recycler;
|
||||
|
||||
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder) {
|
||||
super(new ContainerRecycler(tilegrinder, player));
|
||||
public GuiRecycler(final EntityPlayer player, final TileRecycler recycler) {
|
||||
super(new ContainerBuilder("recycler").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(recycler).slot(0, 56, 34).slot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26)
|
||||
.upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62).syncEnergyValue()
|
||||
.syncIntegerValue(recycler::getProgress, recycler::setProgress).addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
compressor = tilegrinder;
|
||||
containerGrinder = (ContainerRecycler) this.inventorySlots;
|
||||
this.recycler = recycler;
|
||||
}
|
||||
|
||||
@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(GuiRecycler.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.gaugeProgressScaled(24);
|
||||
j = this.recycler.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = compressor.getEnergyScaled(12);
|
||||
j = this.recycler.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.recycler.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue