Merge branch 'feature/containers-builder' of https://github.com/TechReborn/TechReborn into feature/containers-builder
# Conflicts: # src/main/java/techreborn/client/gui/GuiBatbox.java # src/main/java/techreborn/client/gui/GuiQuantumChest.java
This commit is contained in:
commit
0cccb0a91b
47 changed files with 915 additions and 1452 deletions
|
@ -67,30 +67,34 @@ public class GuiHandler implements IGuiHandler {
|
|||
public static final int mfeID = 41;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x, final int y, final int z) {
|
||||
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z) {
|
||||
RebornContainer container = null;
|
||||
if (ID == GuiHandler.thermalGeneratorID) {
|
||||
return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
} else if (ID == GuiHandler.semifluidGeneratorID) {
|
||||
return new ContainerSemifluidGenerator((TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
} else if (ID == GuiHandler.gasTurbineID) {
|
||||
return new ContainerGasTurbine((TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
if (ID == GuiHandler.gasTurbineID || ID == GuiHandler.semifluidGeneratorID
|
||||
|| ID == GuiHandler.thermalGeneratorID || ID == GuiHandler.dieselGeneratorID) {
|
||||
return new ContainerBuilder("fluidgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 80, 17)
|
||||
.outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue().addInventory().create();
|
||||
} else if (ID == GuiHandler.quantumTankID) {
|
||||
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == GuiHandler.digitalChestID || ID == GuiHandler.quantumChestID) {
|
||||
return new ContainerBuilder().player(player.inventory).inventory().hotbar().addInventory()
|
||||
return new ContainerBuilder("digitalchest").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 80, 17).outputSlot(1, 80, 53)
|
||||
.fakeSlot(2, 59, 42).addInventory().create();
|
||||
} else if (ID == GuiHandler.centrifugeID) {
|
||||
container = new ContainerCentrifuge(player, (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
return new ContainerBuilder("centrifuge").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 80, 35)
|
||||
.slot(1, 50, 5).outputSlot(2, 80, 5).outputSlot(3, 110, 35).outputSlot(4, 80, 65)
|
||||
.outputSlot(5, 50, 35).energySlot(6, 8, 51).upgradeSlot(7, 152, 8).upgradeSlot(8, 152, 26)
|
||||
.upgradeSlot(9, 152, 44).upgradeSlot(10, 152, 62).syncEnergyValue().syncCrafterValue()
|
||||
.addInventory().create();
|
||||
} else if (ID == GuiHandler.rollingMachineID) {
|
||||
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == GuiHandler.blastFurnaceID) {
|
||||
return new ContainerBlastFurnace((TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == GuiHandler.alloySmelterID) {
|
||||
container = new ContainerAlloySmelter(player, (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
container = new ContainerAlloySmelter(player,
|
||||
(TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
} else if (ID == GuiHandler.industrialGrinderID) {
|
||||
return new ContainerIndustrialGrinder((TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
|
@ -101,13 +105,14 @@ public class GuiHandler implements IGuiHandler {
|
|||
return new ContainerMatterFabricator((TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
} else if (ID == GuiHandler.assemblingmachineID) {
|
||||
container = new ContainerAssemblingMachine(player, (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
return new ContainerBuilder("assemblingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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();
|
||||
} else if (ID == GuiHandler.chunkloaderID) {
|
||||
return new ContainerBuilder().player(player.inventory).inventory().hotbar().addInventory()
|
||||
return new ContainerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.create();
|
||||
} else if (ID == GuiHandler.dieselGeneratorID) {
|
||||
return new ContainerDieselGenerator((TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
} else if (ID == GuiHandler.industrialElectrolyzerID) {
|
||||
return new ContainerIndustrialElectrolyzer(
|
||||
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
|
@ -119,8 +124,11 @@ public class GuiHandler implements IGuiHandler {
|
|||
return new ContainerIndustrialSawmill((TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
} else if (ID == GuiHandler.chemicalReactorID) {
|
||||
return new ContainerChemicalReactor((TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
return new ContainerBuilder("chemicalreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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();
|
||||
} else if (ID == GuiHandler.manuelID) {
|
||||
return null;
|
||||
} else if (ID == GuiHandler.destructoPackID) {
|
||||
|
@ -133,35 +141,74 @@ public class GuiHandler implements IGuiHandler {
|
|||
return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
} else if (ID == GuiHandler.chargeBench) {
|
||||
return new ContainerBuilder().player(player.inventory).inventory().hotbar(8, 142).addInventory()
|
||||
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 62, 21)
|
||||
return new ContainerBuilder("chargebench").player(player.inventory).inventory().hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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();
|
||||
} else if (ID == GuiHandler.vacuumFreezerID) {
|
||||
return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == GuiHandler.grinderID) {
|
||||
container = new ContainerGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
} else if (ID == GuiHandler.generatorID) {
|
||||
return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == GuiHandler.extractorID) {
|
||||
container = new ContainerExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
return new ContainerBuilder("generator").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).fuelSlot(0, 80, 53)
|
||||
.energySlot(1, 80, 17).syncEnergyValue()
|
||||
.syncIntegerValue(((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
||||
((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
||||
.syncIntegerValue(((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::getTotalBurnTime,
|
||||
((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)))::setTotalBurnTime)
|
||||
.addInventory().create();
|
||||
} else if (ID == GuiHandler.compressorID) {
|
||||
return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
return new ContainerBuilder("compressor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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();
|
||||
} else if (ID == GuiHandler.extractorID) {
|
||||
return new ContainerBuilder("extractor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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();
|
||||
} else if (ID == GuiHandler.grinderID) {
|
||||
return new ContainerBuilder("grinder").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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();
|
||||
} else if (ID == GuiHandler.electricFurnaceID) {
|
||||
return new ContainerElectricFurnace((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)),
|
||||
player);
|
||||
return new ContainerBuilder("electricfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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(((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
||||
((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
||||
.addInventory().create();
|
||||
} else if (ID == GuiHandler.ironFurnace) {
|
||||
return new ContainerIronFurnace((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).slot(0, 56, 17)
|
||||
.outputSlot(1, 116, 34).fuelSlot(2, 56, 53)
|
||||
.syncIntegerValue(((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getBurnTime,
|
||||
((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setBurnTime)
|
||||
.syncIntegerValue(((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::getTotalBurnTime,
|
||||
((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)))::setTotalBurnTime)
|
||||
.addInventory().create();
|
||||
} else if (ID == GuiHandler.recyclerID) {
|
||||
return new ContainerRecycler((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
return new ContainerBuilder("recycler").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).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(((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)))::getProgress,
|
||||
((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)))::setProgress)
|
||||
.addInventory().create();
|
||||
} else if (ID == GuiHandler.scrapboxinatorID) {
|
||||
return new ContainerScrapboxinator((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
} else if (ID == GuiHandler.batboxID) {
|
||||
return new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
return new ContainerBuilder("batbox").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 80, 17)
|
||||
.energySlot(1, 80, 53).syncEnergyValue().addInventory().create();
|
||||
} else if (ID == GuiHandler.mfeID) {
|
||||
return new ContainerBuilder("mfe").player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
||||
.complete(44, 6).addArmor().addInventory()
|
||||
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 80, 17)
|
||||
.energySlot(1, 80, 53).syncEnergyValue().addInventory().create();
|
||||
} else if (ID == GuiHandler.mfeID || ID == GuiHandler.mfsuID) {
|
||||
return new ContainerBuilder().player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
||||
} else if (ID == GuiHandler.mfsuID) {
|
||||
return new ContainerBuilder("mfsu").player(player.inventory).inventory(8, 84).hotbar(8, 142).armor()
|
||||
.complete(44, 6).addArmor().addInventory()
|
||||
.tile((IInventory) world.getTileEntity(new BlockPos(x, y, z))).energySlot(0, 80, 17)
|
||||
.energySlot(1, 80, 53).syncEnergyValue().addInventory().create();
|
||||
|
@ -180,7 +227,8 @@ public class GuiHandler implements IGuiHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x, final int y, final int z) {
|
||||
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z) {
|
||||
if (ID == GuiHandler.thermalGeneratorID) {
|
||||
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
} else if (ID == GuiHandler.semifluidGeneratorID) {
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.tile.IContainerLayout;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerAssemblingMachine extends ContainerCrafting{
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileAssemblingMachine tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ContainerAssemblingMachine(EntityPlayer player, TileAssemblingMachine tile) {
|
||||
super(tile.crafter);
|
||||
this.player = player;
|
||||
this.tile = tile;
|
||||
addPlayerSlots();
|
||||
addInventorySlots();
|
||||
}
|
||||
|
||||
|
||||
public void addInventorySlots() {
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 0, 47, 17));
|
||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 1, 65, 17));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 116, 35));
|
||||
// power
|
||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 3, 56, 53));
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 4, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 5, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 6, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 7, 152, 62));
|
||||
}
|
||||
|
||||
|
||||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.tile.IContainerLayout;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerCentrifuge extends ContainerCrafting {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileCentrifuge tile;
|
||||
|
||||
public ContainerCentrifuge(EntityPlayer player, TileCentrifuge tile) {
|
||||
super(tile.crafter);
|
||||
this.player = player;
|
||||
this.tile = tile;
|
||||
addInventorySlots();
|
||||
addPlayerSlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void addInventorySlots() {
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 0, 80, 35));
|
||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 1, 50, 5));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 80, 5));
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 3, 110, 35));
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 4, 80, 65));
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 5, 50, 35));
|
||||
// battery
|
||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 6, 8, 51));
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 7, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 8, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 9, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 10, 152, 62));
|
||||
}
|
||||
|
||||
|
||||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.TileChemicalReactor;
|
||||
|
||||
public class ContainerChemicalReactor extends ContainerCrafting {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileChemicalReactor tile;
|
||||
|
||||
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player) {
|
||||
super(tilechemicalReactor.crafter);
|
||||
tile = tilechemicalReactor;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tilechemicalReactor.inventory, 0, 70, 21));
|
||||
this.addSlotToContainer(new BaseSlot(tilechemicalReactor.inventory, 1, 90, 21));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tilechemicalReactor.inventory, 2, 80, 51));
|
||||
// battery
|
||||
this.addSlotToContainer(new BaseSlot(tilechemicalReactor.inventory, 3, 8, 51));
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileCompressor;
|
||||
|
||||
public class ContainerCompressor extends ContainerCrafting {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileCompressor tile;
|
||||
|
||||
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) {
|
||||
super(tileGrinder.crafter);
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
||||
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
public class ContainerDieselGenerator extends RebornContainer {
|
||||
public TileDieselGenerator tiledieselGenerator;
|
||||
public EntityPlayer player;
|
||||
public int energy;
|
||||
public int fluid;
|
||||
|
||||
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player) {
|
||||
super();
|
||||
this.tiledieselGenerator = tiledieselGenerator;
|
||||
this.player = player;
|
||||
|
||||
this.addSlotToContainer(new BaseSlot(tiledieselGenerator.inventory, 0, 80, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tiledieselGenerator.inventory, 1, 80, 53));
|
||||
this.addSlotToContainer(new SlotFake(tiledieselGenerator.inventory, 2, 59, 42, false, false, 1));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.energy != (int) tiledieselGenerator.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
|
||||
}
|
||||
if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
|
||||
crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.energy = value;
|
||||
} else if (id == 1) {
|
||||
this.fluid = value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
|
||||
public class ContainerElectricFurnace extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileElectricFurnace tile;
|
||||
|
||||
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
||||
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotInput;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
public class ContainerExtractor extends ContainerCrafting {
|
||||
|
||||
EntityPlayer player;
|
||||
TileExtractor tileExtractor;
|
||||
|
||||
public ContainerExtractor(EntityPlayer player, TileExtractor tileExtractor) {
|
||||
super(tileExtractor.crafter);
|
||||
this.player = player;
|
||||
this.tileExtractor = tileExtractor;
|
||||
// input
|
||||
this.addSlotToContainer(new SlotInput(tileExtractor.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tileExtractor.inventory, 1, 116, 34));
|
||||
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 5, 152, 62));
|
||||
|
||||
addPlayerSlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
public class ContainerGasTurbine extends RebornContainer {
|
||||
public TileGasTurbine tileGasTurbine;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player) {
|
||||
super();
|
||||
this.tileGasTurbine = tileGasTurbine;
|
||||
this.player = player;
|
||||
|
||||
this.addSlotToContainer(new BaseSlot(tileGasTurbine.inventory, 0, 80, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tileGasTurbine.inventory, 1, 80, 53));
|
||||
this.addSlotToContainer(new SlotFake(tileGasTurbine.inventory, 2, 59, 42, false, false, 1));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotCharge;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
public class ContainerGenerator extends RebornContainer {
|
||||
|
||||
public int burnTime = 0;
|
||||
public int totalBurnTime = 0;
|
||||
public int energy;
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileGenerator tile;
|
||||
|
||||
public ContainerGenerator(TileGenerator tile, EntityPlayer player) {
|
||||
super();
|
||||
this.tile = tile;
|
||||
this.player = player;
|
||||
|
||||
// fuel
|
||||
this.addSlotToContainer(new SlotFurnaceFuel(tile.inventory, 0, 80, 53));
|
||||
// charge
|
||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 1, 80, 17));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.burnTime != tile.burnTime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, tile.burnTime);
|
||||
}
|
||||
if (this.totalBurnTime != tile.totalBurnTime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
|
||||
}
|
||||
if (this.energy != (int) tile.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
|
||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 1) {
|
||||
this.totalBurnTime = value;
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.tile.setEnergy(energy);
|
||||
}
|
||||
|
||||
public int getScaledBurnTime(int i) {
|
||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotInput;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileGrinder;
|
||||
|
||||
public class ContainerGrinder extends ContainerCrafting {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileGrinder tile;
|
||||
|
||||
public ContainerGrinder(EntityPlayer player, TileGrinder tile) {
|
||||
super(tile.crafter);
|
||||
this.player = player;
|
||||
this.tile = tile;
|
||||
addInventorySlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void addInventorySlots() {
|
||||
// input
|
||||
this.addSlotToContainer(new SlotInput(tile.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 1, 116, 34));
|
||||
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 5, 152, 62));
|
||||
|
||||
addPlayerSlots();
|
||||
}
|
||||
|
||||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
|
||||
public class ContainerIronFurnace extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileIronFurnace tile;
|
||||
|
||||
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
||||
// Fuel
|
||||
this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileRecycler;
|
||||
|
||||
public class ContainerRecycler extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileRecycler tile;
|
||||
|
||||
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
||||
|
||||
// upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
public class ContainerSemifluidGenerator extends RebornContainer {
|
||||
public TileSemifluidGenerator tileSemifluidGenerator;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player) {
|
||||
super();
|
||||
this.tileSemifluidGenerator = tileSemifluidGenerator;
|
||||
this.player = player;
|
||||
|
||||
this.addSlotToContainer(new BaseSlot(tileSemifluidGenerator.inventory, 0, 80, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tileSemifluidGenerator.inventory, 1, 80, 53));
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotFluid;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
public class ContainerThermalGenerator extends RebornContainer {
|
||||
public TileThermalGenerator tileThermalGenerator;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player) {
|
||||
super();
|
||||
this.tileThermalGenerator = tileThermalGenerator;
|
||||
this.player = player;
|
||||
|
||||
this.addSlotToContainer(new SlotFluid(tileThermalGenerator.inventory, 0, 80, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tileThermalGenerator.inventory, 1, 80, 53));
|
||||
this.addSlotToContainer(new SlotFake(tileThermalGenerator.inventory, 2, 59, 42, false, false, 1));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -20,7 +20,9 @@ import java.util.function.IntConsumer;
|
|||
import java.util.function.IntSupplier;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
final class BuiltContainer extends Container {
|
||||
public class BuiltContainer extends Container {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final Predicate<EntityPlayer> canInteract;
|
||||
private final List<Range<Integer>> playerSlotRanges;
|
||||
|
@ -30,8 +32,11 @@ final class BuiltContainer extends Container {
|
|||
private final ArrayList<MutableTriple<IntSupplier, IntConsumer, Integer>> integerValues;
|
||||
private Integer[] integerParts;
|
||||
|
||||
public BuiltContainer(final Predicate<EntityPlayer> canInteract, final List<Range<Integer>> playerSlotRange,
|
||||
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
|
||||
final List<Range<Integer>> playerSlotRange,
|
||||
final List<Range<Integer>> tileSlotRange) {
|
||||
this.name = name;
|
||||
|
||||
this.canInteract = canInteract;
|
||||
|
||||
this.playerSlotRanges = playerSlotRange;
|
||||
|
@ -242,4 +247,8 @@ final class BuiltContainer extends Container {
|
|||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
|
@ -15,6 +15,8 @@ import java.util.function.IntSupplier;
|
|||
import java.util.function.Predicate;
|
||||
|
||||
public class ContainerBuilder {
|
||||
|
||||
private final String name;
|
||||
private Predicate<EntityPlayer> canInteract = player -> true;
|
||||
|
||||
final List<Slot> slots;
|
||||
|
@ -23,7 +25,10 @@ public class ContainerBuilder {
|
|||
final List<Pair<IntSupplier, IntConsumer>> shortValues;
|
||||
final List<Pair<IntSupplier, IntConsumer>> integerValues;
|
||||
|
||||
public ContainerBuilder() {
|
||||
public ContainerBuilder(final String name) {
|
||||
|
||||
this.name = name;
|
||||
|
||||
this.slots = new ArrayList<>();
|
||||
this.playerInventoryRanges = new ArrayList<>();
|
||||
this.tileInventoryRanges = new ArrayList<>();
|
||||
|
@ -54,7 +59,7 @@ public class ContainerBuilder {
|
|||
}
|
||||
|
||||
public BuiltContainer create() {
|
||||
final BuiltContainer built = new BuiltContainer(this.canInteract, this.playerInventoryRanges,
|
||||
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract, this.playerInventoryRanges,
|
||||
this.tileInventoryRanges);
|
||||
if (!this.shortValues.isEmpty())
|
||||
built.addShortSync(this.shortValues);
|
||||
|
|
|
@ -4,10 +4,13 @@ import org.apache.commons.lang3.Range;
|
|||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
import reborncore.api.power.IEnergyInterfaceItem;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
|
@ -15,6 +18,7 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||
import techreborn.utils.upgrade.IMachineUpgrade;
|
||||
|
||||
import java.util.function.IntConsumer;
|
||||
import java.util.function.IntSupplier;
|
||||
|
@ -54,6 +58,25 @@ public class ContainerTileInventoryBuilder {
|
|||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("null")
|
||||
public ContainerTileInventoryBuilder fluidSlot(final int index, final int x, final int y) {
|
||||
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(
|
||||
stack -> stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, EnumFacing.UP)));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y)
|
||||
{
|
||||
this.parent.slots.add(new SlotFurnaceFuel(this.tile, index, x, y));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ContainerTileInventoryBuilder upgradeSlot(final int index, final int x, final int y) {
|
||||
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
|
||||
.setFilter(stack -> stack.getItem() instanceof IMachineUpgrade));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param supplier
|
||||
|
@ -88,6 +111,20 @@ public class ContainerTileInventoryBuilder {
|
|||
return this;
|
||||
}
|
||||
|
||||
public ContainerTileInventoryBuilder syncCrafterValue() {
|
||||
if (this.tile instanceof IRecipeCrafterProvider)
|
||||
return this
|
||||
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime,
|
||||
(currentTickTime) -> ((IRecipeCrafterProvider) this.tile)
|
||||
.getRecipeCrafter().currentTickTime = currentTickTime)
|
||||
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks,
|
||||
(currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile)
|
||||
.getRecipeCrafter().currentNeededTicks = currentNeededTicks);
|
||||
Core.logHelper
|
||||
.error(this.tile + " is not an instance of IRecipeCrafterProvider! Craft progress cannot be synced.");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ContainerBuilder addInventory() {
|
||||
this.parent.tileInventoryRanges.add(Range.between(this.rangeStart, this.parent.slots.size() - 1));
|
||||
return this.parent;
|
||||
|
|
|
@ -5,59 +5,61 @@ 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.ContainerAssemblingMachine;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
|
||||
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) {
|
||||
super(RebornContainer.createContainer(ContainerAssemblingMachine.class, tileassemblinmachine, player));
|
||||
containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots;
|
||||
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());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
assemblingmachine = tileassemblinmachine;
|
||||
this.assemblingmachine = assemblingMachine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final 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(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(GuiAssemblingMachine.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 = assemblingmachine.getProgressScaled(20);
|
||||
j = this.assemblingmachine.getProgressScaled(20);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = assemblingmachine.getEnergyScaled(12);
|
||||
j = this.assemblingmachine.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,17 +12,10 @@ public class GuiBatbox extends GuiBase {
|
|||
TileBatBox tile;
|
||||
|
||||
public GuiBatbox(final EntityPlayer player, final TileBatBox tile) {
|
||||
super(player, tile, new ContainerBuilder().player(player.inventory).inventory().hotbar().addInventory().tile(tile).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create());
|
||||
super(player, tile, new ContainerBuilder("batbox").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory().tile(tile).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue().addInventory().create());
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
|
@ -33,6 +26,7 @@ public class GuiBatbox extends GuiBase {
|
|||
this.buttonList.add(new GuiButtonPowerBar(0, guiLeft + 82, guiTop + 29));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
builder.drawMultiEnergyBar(this, 81, 28, (int) tile.getEnergy(), (int) tile.getMaxPower(), mouseX - guiLeft, mouseY - guiTop);
|
||||
|
|
|
@ -5,42 +5,46 @@ 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.ContainerCentrifuge;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
|
||||
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) {
|
||||
super(RebornContainer.createContainer(ContainerCentrifuge.class, tileCentrifuge, player));
|
||||
public GuiCentrifuge(final EntityPlayer player, final TileCentrifuge tileCentrifuge) {
|
||||
super(new ContainerBuilder("centrifuge").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory()
|
||||
.tile(tileCentrifuge).slot(0, 80, 35).slot(1, 50, 5).outputSlot(2, 80, 5).outputSlot(3, 110, 35)
|
||||
.outputSlot(4, 80, 65).outputSlot(5, 50, 35).energySlot(6, 8, 51).upgradeSlot(7, 152, 8)
|
||||
.upgradeSlot(8, 152, 26).upgradeSlot(9, 152, 44).upgradeSlot(10, 152, 62).syncEnergyValue()
|
||||
.syncCrafterValue().addInventory().create());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
centrifuge = tileCentrifuge;
|
||||
this.centrifuge = tileCentrifuge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final 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(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(GuiCentrifuge.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 = centrifuge.getProgressScaled(11);
|
||||
j = this.centrifuge.getProgressScaled(11);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j);
|
||||
this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10);
|
||||
|
@ -48,20 +52,21 @@ public class GuiCentrifuge extends GuiContainer {
|
|||
this.drawTexturedModalRect(k + 68 + 10 - j, l + 38, 177 + 10 - j, 27, j, 10);
|
||||
}
|
||||
|
||||
j = centrifuge.getEnergyScaled(12);
|
||||
j = this.centrifuge.getEnergyScaled(12);
|
||||
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
|
||||
String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
|
||||
final String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
|
||||
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
|
||||
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(this.centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -5,59 +5,62 @@ 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.ContainerChemicalReactor;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.TileChemicalReactor;
|
||||
|
||||
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) {
|
||||
super(new ContainerChemicalReactor(tilechemicalReactor, player));
|
||||
containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots;
|
||||
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());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
chemicalReactor = tilechemicalReactor;
|
||||
this.chemicalReactor = tilechemicalReactor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final 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(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(GuiChemicalReactor.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 = chemicalReactor.getProgressScaled(11);
|
||||
j = this.chemicalReactor.getProgressScaled(11);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
|
||||
}
|
||||
|
||||
j = chemicalReactor.getEnergyScaled(12);
|
||||
j = this.chemicalReactor.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,47 +5,49 @@ 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.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerDieselGenerator;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
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) {
|
||||
super(new ContainerDieselGenerator(tile, player));
|
||||
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());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.tile = tile;
|
||||
containerDieselGenerator = (ContainerDieselGenerator) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
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(GuiDieselGenerator.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.dieselgenerator.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
|
||||
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerDieselGenerator.energy) + "", 10, 50,
|
||||
16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.tile.getEnergy()) + "", 10, 50,
|
||||
16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,25 +10,26 @@ 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.ContainerElectricFurnace;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
|
||||
public class GuiElectricFurnace extends GuiContainer {
|
||||
|
@ -13,43 +14,44 @@ 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) {
|
||||
super(new ContainerElectricFurnace(tilegrinder, player));
|
||||
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());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerElectricFurnace) this.inventorySlots;
|
||||
this.furnace = furnace;
|
||||
}
|
||||
|
||||
@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(GuiElectricFurnace.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 = furnace.gaugeProgressScaled(24);
|
||||
j = this.furnace.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.getEnergyScaled(12);
|
||||
j = this.furnace.getEnergyScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,40 +5,45 @@ 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.ContainerGasTurbine;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
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) {
|
||||
super(new ContainerGasTurbine(tile, player));
|
||||
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());
|
||||
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(GuiGasTurbine.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 = "Gas Turbine";
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,10 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerGenerator;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
public class GuiGenerator extends GuiContainer {
|
||||
|
@ -14,51 +16,52 @@ public class GuiGenerator extends GuiContainer {
|
|||
|
||||
TileGenerator generator;
|
||||
|
||||
ContainerGenerator containerGenerator;
|
||||
|
||||
public GuiGenerator(EntityPlayer player, TileGenerator generator) {
|
||||
super(new ContainerGenerator(generator, player));
|
||||
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());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
this.generator = generator;
|
||||
this.containerGenerator = (ContainerGenerator) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
final int l = (this.height - this.ySize) / 2;
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||
this.mc.getTextureManager().bindTexture(GuiGenerator.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 = generator.getEnergyScaled(24);
|
||||
j = this.generator.getEnergyScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
||||
}
|
||||
|
||||
if (containerGenerator.burnTime != 0) {
|
||||
j = containerGenerator.getScaledBurnTime(13);
|
||||
if (this.generator.burnTime != 0) {
|
||||
j = this.generator.getScaledBurnTime(13);
|
||||
this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.generator.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.generator.getEnergy()), 25,
|
||||
this.ySize - 150, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,52 +5,56 @@ 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.ContainerIronFurnace;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
|
||||
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) {
|
||||
super(new ContainerIronFurnace(tilegrinder, player));
|
||||
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());
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerIronFurnace) this.inventorySlots;
|
||||
this.furnace = furnace;
|
||||
}
|
||||
|
||||
@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(GuiIronFurnace.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 = furnace.gaugeProgressScaled(24);
|
||||
j = this.furnace.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.gaugeFuelScaled(12);
|
||||
j = this.furnace.gaugeFuelScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -10,7 +10,7 @@ public class GuiQuantumChest extends GuiBase {
|
|||
TileQuantumChest tile;
|
||||
|
||||
public GuiQuantumChest(final EntityPlayer player, final TileQuantumChest 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("quantumchest").player(player.inventory).inventory().hotbar().addInventory().tile(tile).slot(0, 80, 24).outputSlot(1, 80, 64).addInventory().create());
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,42 +5,47 @@ 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.client.RenderUtil;
|
||||
import techreborn.client.container.ContainerSemifluidGenerator;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
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) {
|
||||
super(new ContainerSemifluidGenerator(tile, player));
|
||||
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());
|
||||
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(GuiSemifluidGenerator.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);
|
||||
RenderUtil.renderGuiTank(tile.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
|
||||
RenderUtil.renderGuiTank(this.tile.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = "Semifluid Generator";
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
|
@ -5,43 +5,48 @@ 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.client.RenderUtil;
|
||||
import techreborn.client.container.ContainerThermalGenerator;
|
||||
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
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) {
|
||||
super(new ContainerThermalGenerator(tile, player));
|
||||
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());
|
||||
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(GuiThermalGenerator.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);
|
||||
RenderUtil.renderGuiTank(tile.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
|
||||
RenderUtil.renderGuiTank(this.tile.tank.getFluid(), 16, 16, k + 59, l + 42, this.zLevel, 16, 16);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final 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);
|
||||
this.fontRendererObj.drawString(this.tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
this.fontRendererObj.drawString(this.tile.getEnergy() + "", 10, 40, 16448255);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue