Change all containers init to IContainerProvider + Add Enum for gui ids handling

This commit is contained in:
Ourten 2017-01-08 20:34:46 +01:00
parent b93fe6c5ad
commit eb220643fc
114 changed files with 2155 additions and 2025 deletions

View file

@ -6,11 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileAlloyFurnace;
public class GuiAlloyFurnace extends GuiContainer {
@ -20,25 +15,11 @@ public class GuiAlloyFurnace extends GuiContainer {
TileAlloyFurnace alloyfurnace;
public GuiAlloyFurnace(final EntityPlayer player, final TileAlloyFurnace tileAlloyFurnace) {
super(new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tileAlloyFurnace)
.filterSlot(0, 47, 17,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isItemEqual(recipe.getInputs().get(0), stack, true, true, true)))
.filterSlot(1, 65, 17,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isItemEqual(recipe.getInputs().get(1), stack, true, true, true)))
.outputSlot(2, 116, 35).fuelSlot(3, 56, 53)
.syncIntegerValue(tileAlloyFurnace::getBurnTime, tileAlloyFurnace::setBurnTime)
.syncIntegerValue(tileAlloyFurnace::getCookTime, tileAlloyFurnace::setCookTime)
.syncIntegerValue(tileAlloyFurnace::getCurrentItemBurnTime, tileAlloyFurnace::setCurrentItemBurnTime)
.addInventory().create());
public GuiAlloyFurnace(final EntityPlayer player, final TileAlloyFurnace alloyFurnace) {
super(alloyFurnace.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.alloyfurnace = tileAlloyFurnace;
this.alloyfurnace = alloyFurnace;
}
@Override

View file

@ -6,11 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileAlloySmelter;
public class GuiAlloySmelter extends GuiContainer {
@ -20,23 +15,11 @@ public class GuiAlloySmelter extends GuiContainer {
TileAlloySmelter alloysmelter;
public GuiAlloySmelter(final EntityPlayer player, final TileAlloySmelter tilealloysmelter) {
super(new ContainerBuilder("alloysmelter").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tilealloysmelter)
.filterSlot(0, 47, 17,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isItemEqual(recipe.getInputs().get(0), stack, true, true, true)))
.filterSlot(1, 65, 17,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isItemEqual(recipe.getInputs().get(1), stack, true, true, true)))
.outputSlot(2, 116, 35).energySlot(3, 56, 53).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26)
.upgradeSlot(6, 152, 44).upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory()
.create());
public GuiAlloySmelter(final EntityPlayer player, final TileAlloySmelter alloySmelter) {
super(alloySmelter.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.alloysmelter = tilealloysmelter;
this.alloysmelter = alloySmelter;
}
@Override

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileAssemblingMachine;
public class GuiAssemblingMachine extends GuiContainer {
@ -17,10 +16,7 @@ public class GuiAssemblingMachine extends GuiContainer {
TileAssemblingMachine assemblingmachine;
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(3, 56, 53).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44)
.upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
super(assemblingMachine.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.assemblingmachine = assemblingMachine;

View file

@ -2,8 +2,9 @@ package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.storage.TileBatBox;
public class GuiBatbox extends GuiBase {
@ -11,27 +12,27 @@ public class GuiBatbox extends GuiBase {
TileBatBox tile;
public GuiBatbox(final EntityPlayer player, final TileBatBox tile) {
super(player, tile, new ContainerBuilder("batbox").player(player.inventory).inventory().hotbar().addInventory().tile(tile).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create());
super(player, tile, tile.createContainer(player));
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);
Layer layer = Layer.BACKGROUND;
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
drawSlot(98, 45, layer);
this.drawSlot(62, 45, layer);
this.drawSlot(98, 45, layer);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
final Layer layer = Layer.FOREGROUND;
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
this.builder.drawMultiEnergyBar(this, 81, 28, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
GlStateManager.scale(0.6, 0.6, 5);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) (tile.getEnergy())) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) (tile.getMaxPower())) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
this.drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.tile.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.tile.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
GlStateManager.scale(1, 1, 1);
}
}

View file

@ -17,7 +17,6 @@ import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location;
import reborncore.common.multiblock.CoordTriplet;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModBlocks;
import techreborn.proxies.ClientProxy;
import techreborn.tiles.multiblock.TileBlastFurnace;
@ -33,14 +32,11 @@ public class GuiBlastFurnace extends GuiContainer {
boolean hasMultiBlock;
public GuiBlastFurnace(final EntityPlayer player, final TileBlastFurnace tileblastfurnace) {
super(new ContainerBuilder("blastfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tileblastfurnace).slot(0, 40, 25).slot(1, 40, 43).outputSlot(2, 100, 35)
.outputSlot(3, 118, 35).syncEnergyValue().syncCrafterValue()
.syncIntegerValue(tileblastfurnace::getHeat, tileblastfurnace::setHeat).addInventory().create());
public GuiBlastFurnace(final EntityPlayer player, final TileBlastFurnace blastFurnace) {
super(blastFurnace.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.blastfurnace = tileblastfurnace;
this.blastfurnace = blastFurnace;
}
@Override

View file

@ -1,19 +1,16 @@
package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileCentrifuge;
public class GuiCentrifuge extends GuiBase {
TileCentrifuge tile;
TileCentrifuge centrifuge;
public GuiCentrifuge(final EntityPlayer player, final TileCentrifuge tile) {
super(player, tile, new ContainerBuilder("centrifuge").player(player.inventory).inventory().hotbar().addInventory()
.tile(tile).slot(0, 40, 34).slot(1, 40, 54).outputSlot(2, 82, 44).outputSlot(3, 101, 25)
.outputSlot(4, 120, 44).outputSlot(5, 101, 63).energySlot(6, 8, 72).syncEnergyValue()
.syncCrafterValue().addInventory().create());
this.tile = tile;
public GuiCentrifuge(final EntityPlayer player, final TileCentrifuge centrifuge) {
super(player, centrifuge, centrifuge.createContainer(player));
this.centrifuge = centrifuge;
}
@Override
@ -24,29 +21,29 @@ public class GuiCentrifuge extends GuiBase {
}
@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);
Layer layer = Layer.BACKGROUND;
final Layer layer = Layer.BACKGROUND;
drawSlot(8, 72, layer);
this.drawSlot(8, 72, layer);
drawSlot(40, 34, layer);
drawSlot(40, 54, layer);
this.drawSlot(40, 34, layer);
this.drawSlot(40, 54, layer);
drawSlot(82, 44, layer);
drawSlot(101, 25, layer);
drawSlot(120, 44, layer);
drawSlot(101, 63, layer);
this.drawSlot(82, 44, layer);
this.drawSlot(101, 25, layer);
this.drawSlot(120, 44, layer);
this.drawSlot(101, 63, layer);
builder.drawJEIButton(this, 150, 4, mouseX, mouseY, layer);
this.builder.drawJEIButton(this, 150, 4, mouseX, mouseY, layer);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
final Layer layer = Layer.FOREGROUND;
builder.drawProgressBar(this, tile.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
builder.drawMultiEnergyBar(this, 9, 18, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
this.builder.drawProgressBar(this, this.centrifuge.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.centrifuge.getEnergy(), (int) this.centrifuge.getMaxPower(), mouseX, mouseY, 0, layer);
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileChargeBench;
public class GuiChargeBench extends GuiContainer {
@ -15,13 +14,11 @@ public class GuiChargeBench extends GuiContainer {
TileChargeBench chargebench;
public GuiChargeBench(final EntityPlayer player, final TileChargeBench tile) {
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());
public GuiChargeBench(final EntityPlayer player, final TileChargeBench chargeBench) {
super(chargeBench.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.chargebench = tile;
this.chargebench = chargeBench;
}
@Override

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileChemicalReactor;
public class GuiChemicalReactor extends GuiContainer {
@ -16,14 +15,11 @@ public class GuiChemicalReactor extends GuiContainer {
TileChemicalReactor chemicalReactor;
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(3, 8, 51).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44)
.upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
public GuiChemicalReactor(final EntityPlayer player, final TileChemicalReactor chemicalReactor) {
super(chemicalReactor.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.chemicalReactor = tilechemicalReactor;
this.chemicalReactor = chemicalReactor;
}
@Override

View file

@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer {
@ -20,12 +19,11 @@ public class GuiChunkLoader extends GuiContainer {
private GuiButton minusOneButton;
private GuiButton minusTenButton;
public GuiChunkLoader(final EntityPlayer player, final TileChunkLoader tilechunkloader) {
super(new ContainerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory()
.create());
public GuiChunkLoader(final EntityPlayer player, final TileChunkLoader chunkLoader) {
super(chunkLoader.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.chunkloader = tilechunkloader;
this.chunkloader = chunkLoader;
}
@Override

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.teir1.TileCompressor;
public class GuiCompressor extends GuiContainer {
@ -16,10 +15,7 @@ public class GuiCompressor extends GuiContainer {
TileCompressor compressor;
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());
super(compressor.createContainer(player));
this.xSize = 176;
this.ySize = 167;

View file

@ -8,7 +8,6 @@ import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.generator.TileDieselGenerator;
public class GuiDieselGenerator extends GuiContainer {
@ -16,15 +15,13 @@ public class GuiDieselGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/diesel_generator.png");
TileDieselGenerator tile;
TileDieselGenerator dieselGenerator;
public GuiDieselGenerator(final EntityPlayer player, final TileDieselGenerator tile) {
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());
public GuiDieselGenerator(final EntityPlayer player, final TileDieselGenerator dieselGenerator) {
super(dieselGenerator.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.tile = tile;
this.dieselGenerator = dieselGenerator;
}
@Override
@ -44,10 +41,10 @@ public class GuiDieselGenerator extends GuiContainer {
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.dieselGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.tile.getEnergy()) + "", 10, 50,
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.dieselGenerator.getEnergy()) + "", 10, 50,
16448255);
}
}

View file

@ -2,22 +2,22 @@ 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;
public class GuiDigitalChest extends GuiBase {
TileDigitalChest tile;
TileDigitalChest digitalChest;
public GuiDigitalChest(final EntityPlayer player, final TileDigitalChest tile) {
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;
public GuiDigitalChest(final EntityPlayer player, final TileDigitalChest digitalChest) {
super(player, digitalChest, digitalChest.createContainer(player));
this.digitalChest = digitalChest;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
Layer layer = Layer.BACKGROUND;
final Layer layer = Layer.BACKGROUND;
this.drawSlot(80, 24, layer);
this.drawSlot(80, 64, layer);
@ -26,13 +26,16 @@ public class GuiDigitalChest extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
final Layer layer = Layer.FOREGROUND;
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", layer);
if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43,
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
}
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", layer);
if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
}
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.teir1.TileElectricFurnace;
public class GuiElectricFurnace extends GuiContainer {
@ -16,10 +15,7 @@ public class GuiElectricFurnace extends GuiContainer {
TileElectricFurnace furnace;
public GuiElectricFurnace(final EntityPlayer player, final TileElectricFurnace furnace) {
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());
super(furnace.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.furnace = furnace;

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.teir1.TileExtractor;
public class GuiExtractor extends GuiContainer {
@ -16,10 +15,7 @@ public class GuiExtractor extends GuiContainer {
TileExtractor extractor;
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());
super(extractor.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.extractor = extractor;

View file

@ -15,7 +15,6 @@ import reborncore.common.misc.Location;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.ClientMultiBlocks;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.proxies.ClientProxy;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
@ -29,12 +28,7 @@ public class GuiFusionReactor extends GuiContainer {
TileEntityFusionController fusionController;
public GuiFusionReactor(final EntityPlayer player, final TileEntityFusionController fusion) {
super(new ContainerBuilder("fusionreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(fusion).slot(0, 88, 17).slot(1, 88, 53).outputSlot(2, 148, 35).syncEnergyValue()
.syncIntegerValue(fusion::getCoilStatus, fusion::setCoilStatus)
.syncIntegerValue(fusion::getCrafingTickTime, fusion::setCrafingTickTime)
.syncIntegerValue(fusion::getFinalTickTime, fusion::setFinalTickTime)
.syncIntegerValue(fusion::getNeededPower, fusion::setNeededPower).addInventory().create());
super(fusion.createContainer(player));
this.fusionController = fusion;
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.generator.TileGasTurbine;
public class GuiGasTurbine extends GuiContainer {
@ -15,16 +14,13 @@ public class GuiGasTurbine extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
TileGasTurbine tile;
TileGasTurbine gasTurbine;
public GuiGasTurbine(final EntityPlayer player, final TileGasTurbine tile) {
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());
public GuiGasTurbine(final EntityPlayer player, final TileGasTurbine gasTurbine) {
super(gasTurbine.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.tile = tile;
this.gasTurbine = gasTurbine;
}
@Override
@ -44,6 +40,6 @@ public class GuiGasTurbine extends GuiContainer {
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.gasTurbine.tank.getFluidAmount() + "", 10, 30, 16448255);
}
}

View file

@ -7,7 +7,6 @@ import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.generator.TileGenerator;
public class GuiGenerator extends GuiContainer {
@ -17,10 +16,7 @@ public class GuiGenerator extends GuiContainer {
TileGenerator generator;
public GuiGenerator(final EntityPlayer player, final TileGenerator generator) {
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());
super(generator.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.generator = generator;

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.teir1.TileGrinder;
public class GuiGrinder extends GuiContainer {
@ -16,10 +15,7 @@ public class GuiGrinder extends GuiContainer {
TileGrinder grinder;
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());
super(grinder.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.grinder = grinder;

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer {
@ -14,15 +13,13 @@ public class GuiImplosionCompressor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/implosion_compressor.png");
TileImplosionCompressor compresser;
TileImplosionCompressor compressor;
public GuiImplosionCompressor(final EntityPlayer player, final TileImplosionCompressor tilecompressor) {
super(new ContainerBuilder("implosioncompressor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tilecompressor).slot(0, 37, 26).slot(1, 37, 44).outputSlot(2, 93, 35)
.outputSlot(3, 111, 35).syncEnergyValue().syncCrafterValue().addInventory().create());
public GuiImplosionCompressor(final EntityPlayer player, final TileImplosionCompressor compressor) {
super(compressor.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.compresser = tilecompressor;
this.compressor = compressor;
}
@Override
@ -40,18 +37,18 @@ public class GuiImplosionCompressor extends GuiContainer {
final int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (!this.compresser.getMutliBlock()) {
if (!this.compressor.getMutliBlock()) {
// 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(GuiImplosionCompressor.texture);
int j = this.compresser.getProgressScaled(24);
int j = this.compressor.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 61, l + 37, 176, 14, j + 1, 16);
}
j = this.compresser.getEnergyScaled(12);
j = this.compressor.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class GuiIndustrialElectrolyzer extends GuiContainer {
@ -18,10 +17,7 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tileeletrolyzer) {
super(new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tileeletrolyzer).slot(0, 80, 51).slot(1, 50, 51).outputSlot(2, 50, 19)
.outputSlot(3, 70, 19).outputSlot(4, 90, 19).outputSlot(5, 110, 19).energySlot(6, 18, 51)
.syncEnergyValue().syncCrafterValue().addInventory().create());
super(tileeletrolyzer.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.eletrolyzer = tileeletrolyzer;

View file

@ -9,7 +9,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fluids.FluidStack;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.multiblock.TileIndustrialGrinder;
public class GuiIndustrialGrinder extends GuiContainer {
@ -19,14 +18,11 @@ public class GuiIndustrialGrinder extends GuiContainer {
TileIndustrialGrinder grinder;
public GuiIndustrialGrinder(final EntityPlayer player, final TileIndustrialGrinder tilegrinder) {
super(new ContainerBuilder("industrialgrinder").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tilegrinder).slot(0, 32, 26).slot(1, 32, 44).outputSlot(2, 77, 35)
.outputSlot(3, 95, 35).outputSlot(4, 113, 35).outputSlot(5, 131, 35).syncEnergyValue()
.syncCrafterValue().addInventory().create());
public GuiIndustrialGrinder(final EntityPlayer player, final TileIndustrialGrinder grinder) {
super(grinder.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.grinder = tilegrinder;
this.grinder = grinder;
}
@Override

View file

@ -9,7 +9,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fluids.FluidStack;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.multiblock.TileIndustrialSawmill;
public class GuiIndustrialSawmill extends GuiContainer {
@ -19,14 +18,11 @@ public class GuiIndustrialSawmill extends GuiContainer {
TileIndustrialSawmill sawmill;
public GuiIndustrialSawmill(final EntityPlayer player, final TileIndustrialSawmill tilesawmill) {
super(new ContainerBuilder("chemicalreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tilesawmill).slot(0, 70, 21).slot(1, 90, 21).outputSlot(2, 80, 51)
.energySlot(3, 8, 51).upgradeSlot(4, 152, 8).upgradeSlot(5, 152, 26).upgradeSlot(6, 152, 44)
.upgradeSlot(7, 152, 62).syncEnergyValue().syncCrafterValue().addInventory().create());
public GuiIndustrialSawmill(final EntityPlayer player, final TileIndustrialSawmill sawmill) {
super(sawmill.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.sawmill = tilesawmill;
this.sawmill = sawmill;
}
@Override

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileIronFurnace;
public class GuiIronFurnace extends GuiContainer {
@ -17,11 +16,7 @@ public class GuiIronFurnace extends GuiContainer {
TileIronFurnace furnace;
public GuiIronFurnace(final EntityPlayer player, final TileIronFurnace furnace) {
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());
super(furnace.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.furnace = furnace;

View file

@ -2,37 +2,38 @@ package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.storage.TileMFE;
public class GuiMFE extends GuiBase {
TileMFE tile;
TileMFE mfe;
public GuiMFE(final EntityPlayer player, final TileMFE tile) {
super(player, tile, new ContainerBuilder("mfe").player(player.inventory).inventory().hotbar().armor().complete(8, 18).addArmor().addInventory().tile(tile).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create());
this.tile = tile;
public GuiMFE(final EntityPlayer player, final TileMFE mfe) {
super(player, mfe, mfe.createContainer(player));
this.mfe = mfe;
}
@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);
Layer layer = Layer.BACKGROUND;
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
drawSlot(98, 45, layer);
drawArmourSlots(8, 18, layer);
this.drawSlot(62, 45, layer);
this.drawSlot(98, 45, layer);
this.drawArmourSlots(8, 18, layer);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
final Layer layer = Layer.FOREGROUND;
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
this.builder.drawMultiEnergyBar(this, 81, 28, (int) this.mfe.getEnergy(), (int) this.mfe.getMaxPower(), mouseX, mouseY, 0, layer);
GlStateManager.scale(0.6, 0.6, 5);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) (tile.getEnergy())) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) (tile.getMaxPower())) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
this.drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.mfe.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.mfe.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
GlStateManager.scale(1, 1, 1);
}
}

View file

@ -2,37 +2,38 @@ package techreborn.client.gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.storage.TileMFSU;
public class GuiMFSU extends GuiBase {
TileMFSU tile;
TileMFSU mfsu;
public GuiMFSU(final EntityPlayer player, final TileMFSU tile) {
super(player, tile, new ContainerBuilder("mfsu").player(player.inventory).inventory().hotbar().armor().complete(8, 18).addArmor().addInventory().tile(tile).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create());
this.tile = tile;
public GuiMFSU(final EntityPlayer player, final TileMFSU mfsu) {
super(player, mfsu, mfsu.createContainer(player));
this.mfsu = mfsu;
}
@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);
Layer layer = Layer.BACKGROUND;
final Layer layer = Layer.BACKGROUND;
drawSlot(62, 45, layer);
drawSlot(98, 45, layer);
drawArmourSlots(8, 18, layer);
this.drawSlot(62, 45, layer);
this.drawSlot(98, 45, layer);
this.drawArmourSlots(8, 18, layer);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
final Layer layer = Layer.FOREGROUND;
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX, mouseY, 0, layer);
this.builder.drawMultiEnergyBar(this, 81, 28, (int) this.mfsu.getEnergy(), (int) this.mfsu.getMaxPower(), mouseX, mouseY, 0, layer);
GlStateManager.scale(0.6, 0.6, 5);
drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) (tile.getEnergy())) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) (tile.getMaxPower())) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
this.drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.mfsu.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.mfsu.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
GlStateManager.scale(1, 1, 1);
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileMatterFabricator;
public class GuiMatterFabricator extends GuiContainer {
@ -17,10 +16,7 @@ public class GuiMatterFabricator extends GuiContainer {
TileMatterFabricator matterfab;
public GuiMatterFabricator(final EntityPlayer player, final TileMatterFabricator tilematterfab) {
super(new ContainerBuilder("matterfabricator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tilematterfab).slot(0, 33, 17).slot(1, 33, 35).slot(2, 33, 53).slot(3, 51, 17)
.slot(4, 51, 35).slot(5, 51, 53).outputSlot(6, 116, 35).syncEnergyValue()
.syncIntegerValue(tilematterfab::getProgress, tilematterfab::setProgress).addInventory().create());
super(tilematterfab.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.matterfab = tilematterfab;

View file

@ -2,22 +2,22 @@ package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileQuantumChest;
public class GuiQuantumChest extends GuiBase {
TileQuantumChest tile;
TileQuantumChest quantumChest;
public GuiQuantumChest(final EntityPlayer player, final TileQuantumChest tile) {
super(player, tile, new ContainerBuilder("quantumchest").player(player.inventory).inventory().hotbar().addInventory().tile(tile).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create());
this.tile = tile;
public GuiQuantumChest(final EntityPlayer player, final TileQuantumChest quantumChest) {
super(player, quantumChest, quantumChest.createContainer(player));
this.quantumChest = quantumChest;
}
@Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
Layer layer = Layer.BACKGROUND;
final Layer layer = Layer.BACKGROUND;
this.drawSlot(80, 24, layer);
this.drawSlot(80, 64, layer);
@ -26,13 +26,13 @@ public class GuiQuantumChest extends GuiBase {
@Override
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
Layer layer = Layer.FOREGROUND;
final Layer layer = Layer.FOREGROUND;
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", layer);
if (this.quantumChest.storedItem != ItemStack.EMPTY && this.quantumChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getCount() + this.quantumChest.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
}
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", layer);
if (this.quantumChest.storedItem == ItemStack.EMPTY && this.quantumChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
}
}
}

View file

@ -5,39 +5,40 @@ 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.ContainerQuantumTank;
import techreborn.tiles.TileQuantumTank;
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;
TileQuantumTank quantumTank;
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile) {
super(new ContainerQuantumTank(tile, player));
public GuiQuantumTank(final EntityPlayer player, final TileQuantumTank quantumTank) {
super(quantumTank.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.tile = tile;
this.quantumTank = quantumTank;
}
@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(GuiQuantumTank.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.quantumTank.name");
@Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final 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);
this.fontRendererObj.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255);
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.teir1.TileRecycler;
public class GuiRecycler extends GuiContainer {
@ -16,10 +15,7 @@ public class GuiRecycler extends GuiContainer {
TileRecycler recycler;
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());
super(recycler.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.recycler = recycler;

View file

@ -7,8 +7,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.api.RollingMachineRecipe;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.TileRollingMachine;
public class GuiRollingMachine extends GuiContainer {
@ -18,14 +16,7 @@ public class GuiRollingMachine extends GuiContainer {
TileRollingMachine rollingMachine;
public GuiRollingMachine(final EntityPlayer player, final TileRollingMachine tileRollingmachine) {
super(new ContainerBuilder("rollingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(tileRollingmachine.craftMatrix).slot(0, 30, 17).slot(1, 48, 17).slot(2, 66, 17)
.slot(3, 30, 35).slot(4, 48, 35).slot(5, 66, 35).slot(6, 30, 53).slot(7, 48, 53).slot(8, 66, 53)
.onCraft(inv -> tileRollingmachine.inventory.setInventorySlotContents(1,
RollingMachineRecipe.instance.findMatchingRecipe(inv, tileRollingmachine.getWorld())))
.addInventory().tile(tileRollingmachine).outputSlot(0, 124, 35).energySlot(2, 8, 51).syncEnergyValue()
.syncIntegerValue(tileRollingmachine::getBurnTime, tileRollingmachine::setBurnTime).addInventory()
.create());
super(tileRollingmachine.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.rollingMachine = tileRollingmachine;

View file

@ -6,57 +6,50 @@ import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.init.ModItems;
import techreborn.tiles.TileScrapboxinator;
public class GuiScrapboxinator extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/scrapboxinator.png");
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/scrapboxinator.png");
TileScrapboxinator tile;
TileScrapboxinator scrapboxinator;
public GuiScrapboxinator(final EntityPlayer player, final TileScrapboxinator scrapboxinator) {
super(new ContainerBuilder("scrapboxinator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(scrapboxinator)
.filterSlot(0, 56, 34, stack -> stack.getItem() == ModItems.SCRAP_BOX).outputSlot(1, 116, 34)
.upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44).upgradeSlot(5, 152, 62)
.syncEnergyValue().syncIntegerValue(scrapboxinator::getProgress, scrapboxinator::setProgress)
.addInventory().create());
this.xSize = 176;
this.ySize = 167;
this.tile = scrapboxinator;
}
public GuiScrapboxinator(final EntityPlayer player, final TileScrapboxinator scrapboxinator) {
super(scrapboxinator.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.scrapboxinator = scrapboxinator;
}
@Override
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(GuiScrapboxinator.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);
@Override
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(GuiScrapboxinator.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;
int j = 0;
j = this.tile.gaugeProgressScaled(24);
// System.out.println(compressor.gaugeProgressScaled(10));
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = this.scrapboxinator.gaugeProgressScaled(24);
// System.out.println(compressor.gaugeProgressScaled(10));
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = this.tile.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
j = this.scrapboxinator.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
@Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
4210752);
}
@Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
4210752);
}
}

View file

@ -8,7 +8,6 @@ import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.generator.TileSemifluidGenerator;
public class GuiSemifluidGenerator extends GuiContainer {
@ -17,15 +16,13 @@ public class GuiSemifluidGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/semifluid_generator.png");
TileSemifluidGenerator tile;
TileSemifluidGenerator semifluidGenerator;
public GuiSemifluidGenerator(final EntityPlayer player, final TileSemifluidGenerator tile) {
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());
public GuiSemifluidGenerator(final EntityPlayer player, final TileSemifluidGenerator semifluidGenerator) {
super(semifluidGenerator.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.tile = tile;
this.semifluidGenerator = semifluidGenerator;
}
@Override
@ -35,7 +32,7 @@ public class GuiSemifluidGenerator extends GuiContainer {
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);
RenderUtil.renderGuiTank(this.tile.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
RenderUtil.renderGuiTank(this.semifluidGenerator.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
}
@Override
@ -46,6 +43,6 @@ public class GuiSemifluidGenerator extends GuiContainer {
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.semifluidGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
}
}

View file

@ -8,7 +8,6 @@ import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.generator.TileThermalGenerator;
public class GuiThermalGenerator extends GuiContainer {
@ -16,15 +15,13 @@ public class GuiThermalGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
TileThermalGenerator tile;
TileThermalGenerator thermalGenerator;
public GuiThermalGenerator(final EntityPlayer player, final TileThermalGenerator tile) {
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());
public GuiThermalGenerator(final EntityPlayer player, final TileThermalGenerator thermalGenerator) {
super(thermalGenerator.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.tile = tile;
this.thermalGenerator = thermalGenerator;
}
@Override
@ -34,7 +31,7 @@ public class GuiThermalGenerator extends GuiContainer {
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);
RenderUtil.renderGuiTank(this.tile.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
RenderUtil.renderGuiTank(this.thermalGenerator.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
}
@Override
@ -45,8 +42,8 @@ public class GuiThermalGenerator extends GuiContainer {
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.tile.getEnergy() + "", 10, 40, 16448255);
this.fontRendererObj.drawString(this.thermalGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.thermalGenerator.getEnergy() + "", 10, 40, 16448255);
}
}

View file

@ -6,22 +6,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.builder.ContainerBuilder;
import techreborn.tiles.multiblock.TileVacuumFreezer;
public class GuiVacuumFreezer extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png");
TileVacuumFreezer crafter;
TileVacuumFreezer freezer;
public GuiVacuumFreezer(final EntityPlayer player, final TileVacuumFreezer freezer) {
super(new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory(8, 84).hotbar(8, 142)
.addInventory().tile(freezer).slot(0, 56, 34).outputSlot(1, 116, 35).syncEnergyValue()
.syncCrafterValue().addInventory().create());
super(freezer.createContainer(player));
this.xSize = 176;
this.ySize = 167;
this.crafter = freezer;
this.freezer = freezer;
}
@Override
@ -32,21 +29,21 @@ public class GuiVacuumFreezer extends GuiContainer {
final int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int j = this.crafter.getProgressScaled(24);
int j = this.freezer.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 80, l + 37, 176, 14, j + 1, 16);
}
j = (int) (this.crafter.getEnergy() * 12f / this.crafter.getMaxPower());
j = (int) (this.freezer.getEnergy() * 12f / this.freezer.getMaxPower());
if (j > 0) {
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
if (!this.crafter.getMultiBlock()) {
if (!this.freezer.getMultiBlock()) {
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
j = this.crafter.getEnergyScaled(12);
j = this.freezer.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}