Auto Format code

This commit is contained in:
modmuss50 2016-10-08 20:46:16 +01:00
parent 112b1657cf
commit 796df6c055
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
503 changed files with 12260 additions and 16291 deletions

View file

@ -4,14 +4,12 @@ import net.minecraft.util.EnumFacing;
import reborncore.client.multiblock.Multiblock;
import techreborn.init.ModBlocks;
public class ClientMultiBlocks
{
public class ClientMultiBlocks {
public static Multiblock reactor;
public static Multiblock frezzer;
public static void init()
{
public static void init() {
reactor = new Multiblock();
checkCoils();
@ -19,40 +17,32 @@ public class ClientMultiBlocks
checkMachine();
}
public static void checkCoils()
{
public static void checkCoils() {
if ((isCoil(3, 0, 1)) && (isCoil(3, 0, 0)) && (isCoil(3, 0, 0 - 1)) && (isCoil(0 - 3, 0, 1))
&& (isCoil(0 - 3, 0, 0)) && (isCoil(0 - 3, 0, 0 - 1)) && (isCoil(2, 0, 2)) && (isCoil(2, 0, 1))
&& (isCoil(2, 0, 0 - 1)) && (isCoil(2, 0, 0 - 2)) && (isCoil(0 - 2, 0, 2)) && (isCoil(0 - 2, 0, 1))
&& (isCoil(0 - 2, 0, 0 - 1)) && (isCoil(0 - 2, 0, 0 - 2)) && (isCoil(1, 0, 3)) && (isCoil(1, 0, 2))
&& (isCoil(1, 0, 0 - 2)) && (isCoil(1, 0, 0 - 3)) && (isCoil(0 - 1, 0, 3)) && (isCoil(0 - 1, 0, 2))
&& (isCoil(0 - 1, 0, 0 - 2)) && (isCoil(0 - 1, 0, 0 - 3)) && (isCoil(0, 0, 3)) && (isCoil(0, 0, 0 - 3)))
{
&& (isCoil(0 - 3, 0, 0)) && (isCoil(0 - 3, 0, 0 - 1)) && (isCoil(2, 0, 2)) && (isCoil(2, 0, 1))
&& (isCoil(2, 0, 0 - 1)) && (isCoil(2, 0, 0 - 2)) && (isCoil(0 - 2, 0, 2)) && (isCoil(0 - 2, 0, 1))
&& (isCoil(0 - 2, 0, 0 - 1)) && (isCoil(0 - 2, 0, 0 - 2)) && (isCoil(1, 0, 3)) && (isCoil(1, 0, 2))
&& (isCoil(1, 0, 0 - 2)) && (isCoil(1, 0, 0 - 3)) && (isCoil(0 - 1, 0, 3)) && (isCoil(0 - 1, 0, 2))
&& (isCoil(0 - 1, 0, 0 - 2)) && (isCoil(0 - 1, 0, 0 - 3)) && (isCoil(0, 0, 3)) && (isCoil(0, 0, 0 - 3))) {
}
}
private static boolean isCoil(int x, int y, int z)
{
private static boolean isCoil(int x, int y, int z) {
reactor.addComponent(x, y, z, ModBlocks.FusionCoil, 0);
return true;
}
public static void checkMachine()
{
public static void checkMachine() {
int xDir = EnumFacing.UP.getFrontOffsetX() * 2;
int yDir = EnumFacing.UP.getFrontOffsetY() * 2;
int zDir = EnumFacing.UP.getFrontOffsetZ() * 2;
for (int i = -1; i < 2; i++)
{
for (int j = -1; j < 2; j++)
{
for (int k = -1; k < 2; k++)
{
if ((i != 0) || (j != 0) || (k != 0))
{
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
for (int k = -1; k < 2; k++) {
if ((i != 0) || (j != 0) || (k != 0)) {
frezzer.addComponent(xDir + i, yDir + j, zDir + k, ModBlocks.MachineCasing,
(((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0))
|| ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1));
(((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0))
|| ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1));
}
}
}

View file

@ -15,14 +15,12 @@ import techreborn.tiles.generator.*;
import techreborn.tiles.idsu.TileIDSU;
import techreborn.tiles.lesu.TileLesu;
import techreborn.tiles.multiblock.*;
import techreborn.tiles.multiblock.TileImplosionCompressor;
import techreborn.tiles.storage.TileBatBox;
import techreborn.tiles.storage.TileMFE;
import techreborn.tiles.storage.TileMFSU;
import techreborn.tiles.teir1.*;
public class GuiHandler implements IGuiHandler
{
public class GuiHandler implements IGuiHandler {
public static final int thermalGeneratorID = 0;
public static final int quantumTankID = 1;
@ -63,139 +61,102 @@ public class GuiHandler implements IGuiHandler
public static final int batboxID = 39;
public static final int mfsuID = 40;
public static final int mfeID = 41;
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
RebornContainer container = null;
if (ID == thermalGeneratorID)
{
if (ID == thermalGeneratorID) {
return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == semifluidGeneratorID)
{
player);
} else if (ID == semifluidGeneratorID) {
return new ContainerSemifluidGenerator((TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == gasTurbineID)
{
player);
} else if (ID == gasTurbineID) {
return new ContainerGasTurbine((TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == quantumTankID)
{
} else if (ID == quantumTankID) {
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == digitalChestID)
{
} else if (ID == digitalChestID) {
return new ContainerDigitalChest((TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == quantumChestID)
{
} else if (ID == quantumChestID) {
return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == centrifugeID)
{
} else if (ID == centrifugeID) {
container = new ContainerCentrifuge();
} else if (ID == rollingMachineID)
{
} else if (ID == rollingMachineID) {
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == blastFurnaceID)
{
} else if (ID == blastFurnaceID) {
return new ContainerBlastFurnace((TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == alloySmelterID)
{
} else if (ID == alloySmelterID) {
container = new ContainerAlloySmelter();
} else if (ID == industrialGrinderID)
{
} else if (ID == industrialGrinderID) {
return new ContainerIndustrialGrinder((TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == implosionCompresserID)
{
player);
} else if (ID == implosionCompresserID) {
return new ContainerImplosionCompressor(
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == matterfabID)
{
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == matterfabID) {
return new ContainerMatterFabricator((TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == chunkloaderID)
{
player);
} else if (ID == chunkloaderID) {
return new ContainerChunkloader((TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == assemblingmachineID)
{
} else if (ID == assemblingmachineID) {
container = new ContainerAssemblingMachine();
} else if (ID == dieselGeneratorID)
{
} else if (ID == dieselGeneratorID) {
return new ContainerDieselGenerator((TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == industrialElectrolyzerID)
{
player);
} else if (ID == industrialElectrolyzerID) {
return new ContainerIndustrialElectrolyzer(
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == aesuID)
{
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == aesuID) {
return new ContainerAESU((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == alloyFurnaceID)
{
} else if (ID == alloyFurnaceID) {
return new ContainerAlloyFurnace((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == sawMillID)
{
} else if (ID == sawMillID) {
return new ContainerIndustrialSawmill((TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == chemicalReactorID)
{
player);
} else if (ID == chemicalReactorID) {
return new ContainerChemicalReactor((TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == manuelID)
{
player);
} else if (ID == manuelID) {
return null;
} else if (ID == destructoPackID)
{
} else if (ID == destructoPackID) {
return new ContainerDestructoPack(player);
} else if (ID == lesuID)
{
} else if (ID == lesuID) {
return new ContainerLESU((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == idsuID)
{
} else if (ID == idsuID) {
return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == chargeBench)
{
} else if (ID == chargeBench) {
return new ContainerChargeBench((TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == fusionID)
{
} else if (ID == fusionID) {
return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == vacuumFreezerID)
{
player);
} else if (ID == vacuumFreezerID) {
return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == grinderID)
{
} else if (ID == grinderID) {
container = new ContainerGrinder();
} else if (ID == generatorID)
{
} else if (ID == generatorID) {
return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == extractorID)
{
} else if (ID == extractorID) {
container = new ContainerExtractor();
} else if (ID == compressorID)
{
} else if (ID == compressorID) {
return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == electricFurnaceID)
{
} else if (ID == electricFurnaceID) {
return new ContainerElectricFurnace((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)),
player);
} else if (ID == ironFurnace)
{
player);
} else if (ID == ironFurnace) {
return new ContainerIronFurnace((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == recyclerID)
{
} else if (ID == recyclerID) {
return new ContainerRecycler((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == scrapboxinatorID)
{
} else if (ID == scrapboxinatorID) {
return new ContainerScrapboxinator((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == batboxID)
{
} else if (ID == batboxID) {
return new ContainerBatbox((TileBatBox) world.getTileEntity(new BlockPos(x, y, z)), player);
}else if (ID == mfsuID){
} else if (ID == mfsuID) {
return new ContainerMFSU((TileMFSU) world.getTileEntity(new BlockPos(x, y, z)), player);
}else if (ID == mfeID){
} else if (ID == mfeID) {
return new ContainerMFE((TileMFE) world.getTileEntity(new BlockPos(x, y, z)), player);
}
if(container != null){
if(container instanceof IContainerLayout){
if (container != null) {
if (container instanceof IContainerLayout) {
IContainerLayout layout = (IContainerLayout) container;
layout.setTile(world.getTileEntity(new BlockPos(x, y, z)));
layout.setPlayer(player);
@ -208,130 +169,88 @@ public class GuiHandler implements IGuiHandler
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
if (ID == thermalGeneratorID)
{
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID == thermalGeneratorID) {
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == semifluidGeneratorID)
{
} else if (ID == semifluidGeneratorID) {
return new GuiSemifluidGenerator(player,
(TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == gasTurbineID)
{
(TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == gasTurbineID) {
return new GuiGasTurbine(player, (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == quantumTankID)
{
} else if (ID == quantumTankID) {
return new GuiQuantumTank(player, (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == digitalChestID)
{
} else if (ID == digitalChestID) {
return new GuiDigitalChest(player, (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == quantumChestID)
{
} else if (ID == quantumChestID) {
return new GuiQuantumChest(player, (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == centrifugeID)
{
} else if (ID == centrifugeID) {
return new GuiCentrifuge(player, (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == rollingMachineID)
{
} else if (ID == rollingMachineID) {
return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == blastFurnaceID)
{
} else if (ID == blastFurnaceID) {
return new GuiBlastFurnace(player, (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == alloySmelterID)
{
} else if (ID == alloySmelterID) {
return new GuiAlloySmelter(player, (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == industrialGrinderID)
{
} else if (ID == industrialGrinderID) {
return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == implosionCompresserID)
{
} else if (ID == implosionCompresserID) {
return new GuiImplosionCompressor(player,
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == matterfabID)
{
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == matterfabID) {
return new GuiMatterFabricator(player, (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == chunkloaderID)
{
} else if (ID == chunkloaderID) {
return new GuiChunkLoader(player, (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == assemblingmachineID)
{
} else if (ID == assemblingmachineID) {
return new GuiAssemblingMachine(player, (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == dieselGeneratorID)
{
} else if (ID == dieselGeneratorID) {
return new GuiDieselGenerator(player, (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == industrialElectrolyzerID)
{
} else if (ID == industrialElectrolyzerID) {
return new GuiIndustrialElectrolyzer(player,
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == aesuID)
{
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == aesuID) {
return new GuiAESU(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == alloyFurnaceID)
{
} else if (ID == alloyFurnaceID) {
return new GuiAlloyFurnace(player, (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == sawMillID)
{
} else if (ID == sawMillID) {
return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == chemicalReactorID)
{
} else if (ID == chemicalReactorID) {
return new GuiChemicalReactor(player, (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == manuelID)
{
} else if (ID == manuelID) {
return new GuiManual();
} else if (ID == destructoPackID)
{
} else if (ID == destructoPackID) {
return new GuiDestructoPack(new ContainerDestructoPack(player));
} else if (ID == lesuID)
{
} else if (ID == lesuID) {
return new GuiLESU(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == idsuID)
{
} else if (ID == idsuID) {
return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == chargeBench)
{
} else if (ID == chargeBench) {
return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == fusionID)
{
} else if (ID == fusionID) {
return new GuiFusionReactor(player,
(TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == vacuumFreezerID)
{
(TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == vacuumFreezerID) {
return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == grinderID)
{
} else if (ID == grinderID) {
return new GuiGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == generatorID)
{
} else if (ID == generatorID) {
return new GuiGenerator(player, (TileGenerator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == extractorID)
{
} else if (ID == extractorID) {
return new GuiExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == compressorID)
{
} else if (ID == compressorID) {
return new GuiCompressor(player, (TileCompressor) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == electricFurnaceID)
{
} else if (ID == electricFurnaceID) {
return new GuiElectricFurnace(player, (TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == ironFurnace)
{
} else if (ID == ironFurnace) {
return new GuiIronFurnace(player, (TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == recyclerID)
{
} else if (ID == recyclerID) {
return new GuiRecycler(player, (TileRecycler) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == scrapboxinatorID)
{
} else if (ID == scrapboxinatorID) {
return new GuiScrapboxinator(player, (TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == batboxID)
{
} else if (ID == batboxID) {
return new GuiBatbox(player, (TileBatBox) world.getTileEntity(new BlockPos(x, y, z)));
}
else if (ID == mfsuID)
{
} else if (ID == mfsuID) {
return new GuiMFSU(player, (TileMFSU) world.getTileEntity(new BlockPos(x, y, z)));
}
else if (ID == mfeID)
{
} else if (ID == mfeID) {
return new GuiMFE(player, (TileMFE) world.getTileEntity(new BlockPos(x, y, z)));
}
return null;

View file

@ -1,8 +1,7 @@
package techreborn.client;
//TODO recode for 1.8
public class IconSupplier
{
public class IconSupplier {
// public static IIcon insulatedCopperCable;
// public static IIcon copperCable;
// public static IIcon goldCable;

View file

@ -7,16 +7,13 @@ import net.minecraftforge.client.model.ModelLoader;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
public class RegisterItemJsons
{
public static void registerModels()
{
public class RegisterItemJsons {
public static void registerModels() {
registerItems();
registerBlocks();
}
private static void registerItems()
{
private static void registerItems() {
register(ModItems.reBattery, "reBattery");
register(ModItems.lithiumBattery, "lithiumBattery");
register(ModItems.energyCrystal, "energyCrystal");
@ -24,29 +21,24 @@ public class RegisterItemJsons
register(ModItems.nanosaber, "nanosaber");
}
private static void registerBlocks()
{
private static void registerBlocks() {
register(ModBlocks.ironFence, "ironFence");
}
private static void register(Item item, int meta, String name)
{
private static void register(Item item, int meta, String name) {
ModelLoader.setCustomModelResourceLocation(item, meta,
new ModelResourceLocation("techreborn:" + name, "inventory"));
new ModelResourceLocation("techreborn:" + name, "inventory"));
}
private static void register(Item item, String name)
{
private static void register(Item item, String name) {
register(item, 0, name);
}
private static void register(Block block, int meta, String name)
{
private static void register(Block block, int meta, String name) {
register(Item.getItemFromBlock(block), meta, name);
}
private static void register(Block block, String name)
{
private static void register(Block block, String name) {
register(Item.getItemFromBlock(block), 0, name);
}
}

View file

@ -15,71 +15,57 @@ import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.Color;
import techreborn.Core;
public class StackToolTipEvent
{
public class StackToolTipEvent {
@SubscribeEvent
public void handleItemTooltipEvent(ItemTooltipEvent event)
{
if (event.getItemStack().getItem() instanceof IListInfoProvider)
{
public void handleItemTooltipEvent(ItemTooltipEvent event) {
if (event.getItemStack().getItem() instanceof IListInfoProvider) {
((IListInfoProvider) event.getItemStack().getItem()).addInfo(event.getToolTip(), false);
} else if (event.getItemStack().getItem() instanceof IEnergyInterfaceItem)
{
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))
{
} else if (event.getItemStack().getItem() instanceof IEnergyInterfaceItem) {
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
int percentage = percentage(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()),
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()));
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()),
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()));
TextFormatting color;
if (percentage <= 10)
{
if (percentage <= 10) {
color = TextFormatting.RED;
} else if (percentage >= 75)
{
} else if (percentage >= 75) {
color = TextFormatting.GREEN;
} else
{
} else {
color = TextFormatting.YELLOW;
}
event.getToolTip().add(color + ""
+ PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()))
+ TextFormatting.LIGHT_PURPLE + " stored");
+ PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getEnergy(event.getItemStack()))
+ TextFormatting.LIGHT_PURPLE + " stored");
event.getToolTip().add(Color.GREEN + ""
+ PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()))
+ TextFormatting.LIGHT_PURPLE + " max");
+ PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxPower(event.getItemStack()))
+ TextFormatting.LIGHT_PURPLE + " max");
event.getToolTip()
.add(TextFormatting.GREEN + "" + percentage + "%" + TextFormatting.LIGHT_PURPLE + " charged");
.add(TextFormatting.GREEN + "" + percentage + "%" + TextFormatting.LIGHT_PURPLE + " charged");
event.getToolTip().add(Color.GREEN + "" + PowerSystem.getLocaliszedPower(
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxTransfer(event.getItemStack()))
+ TextFormatting.LIGHT_PURPLE + " /tick in/out");
(int) ((IEnergyInterfaceItem) event.getItemStack().getItem()).getMaxTransfer(event.getItemStack()))
+ TextFormatting.LIGHT_PURPLE + " /tick in/out");
}
} else
{
try
{
} else {
try {
Block block = Block.getBlockFromItem(event.getItemStack().getItem());
if (block != null && (block instanceof BlockContainer || block instanceof ITileEntityProvider)
&& block.getRegistryName().getResourceDomain().contains("techreborn"))
{
&& block.getRegistryName().getResourceDomain().contains("techreborn")) {
TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld,
block.getDefaultState());
if (tile instanceof IListInfoProvider)
{
block.getDefaultState());
if (tile instanceof IListInfoProvider) {
((IListInfoProvider) tile).addInfo(event.getToolTip(), false);
}
}
} catch (NullPointerException e)
{
} catch (NullPointerException e) {
Core.logHelper.debug("Failed to load info for " + event.getItemStack().getDisplayName());
}
}
}
public int percentage(int MaxValue, int CurrentValue)
{
public int percentage(int MaxValue, int CurrentValue) {
if (CurrentValue == 0)
return 0;
return (int) ((CurrentValue * 100.0f) / MaxValue);

View file

@ -4,19 +4,16 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import techreborn.init.ModBlocks;
public class TechRebornCreativeTab extends CreativeTabs
{
public class TechRebornCreativeTab extends CreativeTabs {
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
public TechRebornCreativeTab()
{
public TechRebornCreativeTab() {
super("techreborn");
}
@Override
public Item getTabIconItem()
{
public Item getTabIconItem() {
return Item.getItemFromBlock(ModBlocks.thermalGenerator);
}
}

View file

@ -2,26 +2,18 @@ package techreborn.client;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import techreborn.init.ModItems;
import techreborn.items.DynamicCell;
import java.util.Random;
public class TechRebornCreativeTabMisc extends CreativeTabs
{
public class TechRebornCreativeTabMisc extends CreativeTabs {
public static TechRebornCreativeTabMisc instance = new TechRebornCreativeTabMisc();
public TechRebornCreativeTabMisc()
{
public TechRebornCreativeTabMisc() {
super("techreborn");
}
@Override
public Item getTabIconItem()
{
public Item getTabIconItem() {
return ModItems.dynamicCell;
}

View file

@ -10,41 +10,31 @@ import techreborn.Core;
import java.awt.*;
import java.util.ArrayList;
public class VersionCheckerClient
{
public class VersionCheckerClient {
ResourceLocation texture;
public VersionCheckerClient()
{
public VersionCheckerClient() {
texture = new ResourceLocation("textures/gui/demo_background.png");
}
@SubscribeEvent
public void drawGui(GuiScreenEvent.DrawScreenEvent event)
{
if (event.getGui() instanceof GuiModList)
{
public void drawGui(GuiScreenEvent.DrawScreenEvent event) {
if (event.getGui() instanceof GuiModList) {
ArrayList<String> changeLog = Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion();
String s = "";
if (Core.INSTANCE.versionChecker.isChecking)
{
if (Core.INSTANCE.versionChecker.isChecking) {
s = "Checking for update...";
} else if (Core.INSTANCE.versionChecker.isLatestVersion())
{
} else if (Core.INSTANCE.versionChecker.isLatestVersion()) {
s = "You have the latest version of TechReborn";
} else
{
} else {
s = "There is an update for TechReborn with " + changeLog.size() + " changes.";
}
event.getGui().drawString(event.getGui().mc.fontRendererObj, s, 10, 5, Color.white.getRGB());
if (!Core.INSTANCE.versionChecker.isLatestVersion())
{
if (event.getMouseY() < 20)
{
if (!Core.INSTANCE.versionChecker.isLatestVersion()) {
if (event.getMouseY() < 20) {
GuiUtil.drawTooltipBox(5, 15, 330, changeLog.size() * 10 + 5);
int y = 20;
for (String change : changeLog)
{
for (String change : changeLog) {
event.getGui().drawString(event.getGui().mc.fontRendererObj, change, 10, y, Color.white.getRGB());
y += 10;
}

View file

@ -2,9 +2,9 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAesu;

View file

@ -2,14 +2,13 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraft.inventory.SlotFurnaceFuel;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAlloyFurnace;
public class ContainerAlloyFurnace extends RebornContainer
{
public class ContainerAlloyFurnace extends RebornContainer {
public int tickTime;
EntityPlayer player;
@ -17,8 +16,8 @@ public class ContainerAlloyFurnace extends RebornContainer
int currentItemBurnTime;
int burnTime;
int cookTime;
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player)
{
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player) {
tile = tileAlloyfurnace;
this.player = player;
@ -32,29 +31,24 @@ public class ContainerAlloyFurnace extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
@ -62,21 +56,16 @@ public class ContainerAlloyFurnace extends RebornContainer
}
@Override
public void detectAndSendChanges()
{
for (int i = 0; i < this.listeners.size(); i++)
{
public void detectAndSendChanges() {
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener crafting = this.listeners.get(i);
if (this.currentItemBurnTime != tile.currentItemBurnTime)
{
if (this.currentItemBurnTime != tile.currentItemBurnTime) {
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
}
if (this.burnTime != tile.burnTime)
{
if (this.burnTime != tile.burnTime) {
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
}
if (this.cookTime != tile.cookTime)
{
if (this.cookTime != tile.cookTime) {
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
}
}
@ -84,17 +73,13 @@ public class ContainerAlloyFurnace extends RebornContainer
}
@Override
public void updateProgressBar(int id, int value)
{
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if (id == 0)
{
if (id == 0) {
this.currentItemBurnTime = value;
} else if (id == 1)
{
} else if (id == 1) {
this.burnTime = value;
} else if (id == 2)
{
} else if (id == 2) {
this.cookTime = value;
}
this.tile.currentItemBurnTime = this.currentItemBurnTime;

View file

@ -13,16 +13,14 @@ import techreborn.tiles.TileAlloySmelter;
import javax.annotation.Nullable;
import java.util.List;
public class ContainerAlloySmelter extends ContainerCrafting implements IContainerLayout<TileAlloySmelter>
{
public class ContainerAlloySmelter extends ContainerCrafting implements IContainerLayout<TileAlloySmelter> {
public int tickTime;
EntityPlayer player;
TileAlloySmelter tile;
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@ -47,16 +45,13 @@ public class ContainerAlloySmelter extends ContainerCrafting implements IContain
public void addPlayerSlots() {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -7,21 +7,18 @@ import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.TileAssemblingMachine;
import techreborn.tiles.teir1.TileGrinder;
import javax.annotation.Nullable;
import java.util.List;
public class ContainerAssemblingMachine extends ContainerCrafting implements IContainerLayout<TileAssemblingMachine>
{
public class ContainerAssemblingMachine extends ContainerCrafting implements IContainerLayout<TileAssemblingMachine> {
public int tickTime;
EntityPlayer player;
TileAssemblingMachine tile;
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@ -45,16 +42,13 @@ public class ContainerAssemblingMachine extends ContainerCrafting implements ICo
public void addPlayerSlots() {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -2,15 +2,14 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotCharge;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.storage.TileBatBox;
public class ContainerBatbox extends RebornContainer
{
public class ContainerBatbox extends RebornContainer {
public int burnTime = 0;
public int totalBurnTime = 0;
@ -19,24 +18,20 @@ public class ContainerBatbox extends RebornContainer
EntityPlayer player;
TileBatBox tile;
public ContainerBatbox(TileBatBox tile, EntityPlayer player)
{
public ContainerBatbox(TileBatBox tile, EntityPlayer player) {
super();
this.tile = tile;
this.player = player;
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
@ -45,51 +40,41 @@ public class ContainerBatbox extends RebornContainer
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.energy != (int) tile.getEnergy())
{
if (this.energy != (int) tile.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.burnTime = value;
} else if (id == 1)
{
} else if (id == 1) {
this.totalBurnTime = value;
} else if (id == 2)
{
} else if (id == 2) {
this.energy = value;
}
this.tile.setEnergy(energy);
}
public int getScaledBurnTime(int i)
{
public int getScaledBurnTime(int i) {
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
}

View file

@ -6,79 +6,67 @@ import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.multiblock.TileBlastFurnace;
public class ContainerBlastFurnace extends ContainerCrafting
{
public class ContainerBlastFurnace extends ContainerCrafting {
public int heat;
public int tickTime;
EntityPlayer player;
TileBlastFurnace tile;
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player)
{
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player) {
super(tileblastfurnace.crafter);
tile = tileblastfurnace;
this.player = player;
// input
this.addSlotToContainer(new BaseSlot(tileblastfurnace.inventory, 0, 40, 25));// Input
// 1
// 1
this.addSlotToContainer(new BaseSlot(tileblastfurnace.inventory, 1, 40, 43));// Input
// 2
// 2
// outputs
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));// Output
// 1
// 1
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));// Output
// 2
// 2
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.heat != tile.getHeat())
{
if (this.heat != tile.getHeat()) {
IContainerListener.sendProgressBarUpdate(this, 10, tile.getHeat());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 10, tile.getHeat());
}
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.heat = value;
}
super.updateProgressBar(id, value);

View file

@ -11,16 +11,14 @@ import techreborn.tiles.TileCentrifuge;
import javax.annotation.Nullable;
import java.util.List;
public class ContainerCentrifuge extends ContainerCrafting implements IContainerLayout<TileCentrifuge>
{
public class ContainerCentrifuge extends ContainerCrafting implements IContainerLayout<TileCentrifuge> {
public int tickTime;
EntityPlayer player;
TileCentrifuge tile;
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@ -47,16 +45,13 @@ public class ContainerCentrifuge extends ContainerCrafting implements IContainer
public void addPlayerSlots() {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -1,20 +1,19 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
//import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileChargeBench;
public class ContainerChargeBench extends RebornContainer
{
//import reborncore.client.gui.BaseSlot;
public class ContainerChargeBench extends RebornContainer {
public int tickTime;
EntityPlayer player;
TileChargeBench tile;
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player)
{
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player) {
tile = tileChargeBench;
this.player = player;
@ -27,23 +26,19 @@ public class ContainerChargeBench extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}

View file

@ -6,15 +6,13 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.TileChemicalReactor;
public class ContainerChemicalReactor extends ContainerCrafting
{
public class ContainerChemicalReactor extends ContainerCrafting {
public int tickTime;
EntityPlayer player;
TileChemicalReactor tile;
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player)
{
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player) {
super(tilechemicalReactor.crafter);
tile = tilechemicalReactor;
this.player = player;
@ -34,23 +32,19 @@ public class ContainerChemicalReactor extends ContainerCrafting
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}

View file

@ -5,35 +5,29 @@ import reborncore.client.gui.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileChunkLoader;
public class ContainerChunkloader extends RebornContainer
{
public class ContainerChunkloader extends RebornContainer {
EntityPlayer player;
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player)
{
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player) {
this.player = player;
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}

View file

@ -6,15 +6,13 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileCompressor;
public class ContainerCompressor extends ContainerCrafting
{
public class ContainerCompressor extends ContainerCrafting {
public int connectionStatus;
EntityPlayer player;
TileCompressor tile;
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player)
{
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) {
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
@ -31,23 +29,19 @@ public class ContainerCompressor extends ContainerCrafting
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
}

View file

@ -3,12 +3,10 @@ package techreborn.client.container;
import net.minecraft.inventory.IContainerListener;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.tile.IContainerLayout;
import reborncore.common.container.RebornContainer;
import reborncore.common.recipes.RecipeCrafter;
public abstract class ContainerCrafting extends RebornContainer
{
public abstract class ContainerCrafting extends RebornContainer {
RecipeCrafter crafter;
@ -16,8 +14,7 @@ public abstract class ContainerCrafting extends RebornContainer
int currentNeededTicks = 0;
int energy;
public ContainerCrafting(RecipeCrafter crafter)
{
public ContainerCrafting(RecipeCrafter crafter) {
this();
this.crafter = crafter;
}
@ -30,30 +27,24 @@ public abstract class ContainerCrafting extends RebornContainer
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1)
{
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) {
IContainerListener.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
}
if (this.currentNeededTicks != crafter.currentNeededTicks)
{
if (this.currentNeededTicks != crafter.currentNeededTicks) {
IContainerListener.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
}
if (this.energy != (int) crafter.energy.getEnergy())
{
if (this.energy != (int) crafter.energy.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
@ -62,20 +53,15 @@ public abstract class ContainerCrafting extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.currentTickTime = value;
if (this.currentTickTime == -1)
{
if (this.currentTickTime == -1) {
this.currentTickTime = 0;
}
} else if (id == 1)
{
} else if (id == 1) {
this.currentNeededTicks = value;
} else if (id == 2)
{
} else if (id == 2) {
this.energy = value;
}
this.crafter.currentTickTime = currentTickTime;

View file

@ -1,48 +1,41 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.client.gui.BaseSlot;
import net.minecraft.item.ItemStack;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotFilteredVoid;
import reborncore.common.container.RebornContainer;
import reborncore.common.util.Inventory;
import techreborn.init.ModItems;
public class ContainerDestructoPack extends RebornContainer
{
public class ContainerDestructoPack extends RebornContainer {
private EntityPlayer player;
private Inventory inv;
public ContainerDestructoPack(EntityPlayer player)
{
public ContainerDestructoPack(EntityPlayer player) {
this.player = player;
inv = new Inventory(1, "destructopack", 64, null);
buildContainer();
}
@Override
public boolean canInteractWith(EntityPlayer arg0)
{
public boolean canInteractWith(EntityPlayer arg0) {
return true;
}
private void buildContainer()
{
private void buildContainer() {
this.addSlotToContainer(
new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { new ItemStack(ModItems.parts, 1, 37) }));
new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { new ItemStack(ModItems.parts, 1, 37) }));
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -2,23 +2,21 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileDieselGenerator;
public class ContainerDieselGenerator extends RebornContainer
{
public class ContainerDieselGenerator extends RebornContainer {
public TileDieselGenerator tiledieselGenerator;
public EntityPlayer player;
public int energy;
public int fluid;
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player)
{
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player) {
super();
this.tiledieselGenerator = tiledieselGenerator;
this.player = player;
@ -29,47 +27,38 @@ public class ContainerDieselGenerator extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.energy != (int) tiledieselGenerator.getEnergy())
{
if (this.energy != (int) tiledieselGenerator.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
}
if (this.fluid != tiledieselGenerator.tank.getFluidAmount())
{
if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) {
IContainerListener.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
@ -77,13 +66,10 @@ public class ContainerDieselGenerator extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.energy = value;
} else if (id == 1)
{
} else if (id == 1) {
this.fluid = value;
}
}

View file

@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileDigitalChest;
public class ContainerDigitalChest extends RebornContainer
{
public class ContainerDigitalChest extends RebornContainer {
public TileDigitalChest tileDigitalChest;
public EntityPlayer player;
public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player)
{
public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player) {
super();
this.tileDigitalChest = tileDigitalChest;
this.player = player;
@ -24,23 +22,19 @@ public class ContainerDigitalChest extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}

View file

@ -1,23 +1,21 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileElectricFurnace;
public class ContainerElectricFurnace extends RebornContainer
{
public class ContainerElectricFurnace extends RebornContainer {
public int connectionStatus;
EntityPlayer player;
TileElectricFurnace tile;
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player)
{
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) {
super();
tile = tileGrinder;
this.player = player;
@ -34,32 +32,26 @@ public class ContainerElectricFurnace extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}

View file

@ -1,9 +1,5 @@
package techreborn.client.container;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import reborncore.api.tile.IContainerLayout;
@ -13,17 +9,17 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileExtractor;
public class ContainerExtractor extends ContainerCrafting implements IContainerLayout<TileExtractor>
{
import javax.annotation.Nullable;
import java.util.List;
public class ContainerExtractor extends ContainerCrafting implements IContainerLayout<TileExtractor> {
public int connectionStatus;
EntityPlayer player;
TileExtractor tileExtractor;
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@ -38,23 +34,20 @@ public class ContainerExtractor extends ContainerCrafting implements IContainerL
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));
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 5, 152, 62));
}
@Override
public void addPlayerSlots() {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@ -73,7 +66,7 @@ public class ContainerExtractor extends ContainerCrafting implements IContainerL
@Override
public void setPlayer(EntityPlayer player) {
this.player = player;
}
@Override

View file

@ -2,15 +2,14 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
public class ContainerFusionReactor extends RebornContainer
{
public class ContainerFusionReactor extends RebornContainer {
public int coilStatus;
public int energy;
@ -20,8 +19,7 @@ public class ContainerFusionReactor extends RebornContainer
TileEntityFusionController fusionController;
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player)
{
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player) {
super();
this.fusionController = tileEntityFusionController;
@ -31,60 +29,48 @@ public class ContainerFusionReactor extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.coilStatus != fusionController.coilStatus)
{
if (this.coilStatus != fusionController.coilStatus) {
IContainerListener.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
}
if (this.energy != (int) fusionController.getEnergy())
{
if (this.energy != (int) fusionController.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
}
if (this.tickTime != fusionController.crafingTickTime)
{
if (this.tickTime != fusionController.crafingTickTime) {
IContainerListener.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
}
if (this.finalTickTime != fusionController.finalTickTime)
{
if (this.finalTickTime != fusionController.finalTickTime) {
IContainerListener.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
}
if (this.neededEU != fusionController.neededPower)
{
if (this.neededEU != fusionController.neededPower) {
IContainerListener.sendProgressBarUpdate(this, 4, fusionController.neededPower);
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
@ -95,41 +81,31 @@ public class ContainerFusionReactor extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.coilStatus = value;
} else if (id == 1)
{
} else if (id == 1) {
this.energy = value;
} else if (id == 2)
{
} else if (id == 2) {
this.tickTime = value;
} else if (id == 3)
{
} else if (id == 3) {
this.finalTickTime = value;
} else if (id == 4)
{
} else if (id == 4) {
this.neededEU = value;
}
if (tickTime == -1)
{
if (tickTime == -1) {
tickTime = 0;
}
if (finalTickTime == -1)
{
if (finalTickTime == -1) {
finalTickTime = 0;
}
if (neededEU == -1)
{
if (neededEU == -1) {
neededEU = 0;
}
}
public int getProgressScaled()
{
public int getProgressScaled() {
return Math.max(0, Math.min(24,
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
}
}

View file

@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileGasTurbine;
public class ContainerGasTurbine extends RebornContainer
{
public class ContainerGasTurbine extends RebornContainer {
public TileGasTurbine tileGasTurbine;
public EntityPlayer player;
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player)
{
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player) {
super();
this.tileGasTurbine = tileGasTurbine;
this.player = player;
@ -24,23 +22,19 @@ public class ContainerGasTurbine extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -2,16 +2,15 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraft.inventory.SlotFurnaceFuel;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotCharge;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileGenerator;
public class ContainerGenerator extends RebornContainer
{
public class ContainerGenerator extends RebornContainer {
public int burnTime = 0;
public int totalBurnTime = 0;
@ -20,8 +19,7 @@ public class ContainerGenerator extends RebornContainer
EntityPlayer player;
TileGenerator tile;
public ContainerGenerator(TileGenerator tile, EntityPlayer player)
{
public ContainerGenerator(TileGenerator tile, EntityPlayer player) {
super();
this.tile = tile;
this.player = player;
@ -33,51 +31,41 @@ public class ContainerGenerator extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.burnTime != tile.burnTime)
{
if (this.burnTime != tile.burnTime) {
IContainerListener.sendProgressBarUpdate(this, 0, tile.burnTime);
}
if (this.totalBurnTime != tile.totalBurnTime)
{
if (this.totalBurnTime != tile.totalBurnTime) {
IContainerListener.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
}
if (this.energy != (int) tile.getEnergy())
{
if (this.energy != (int) tile.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
@ -86,23 +74,18 @@ public class ContainerGenerator extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.burnTime = value;
} else if (id == 1)
{
} else if (id == 1) {
this.totalBurnTime = value;
} else if (id == 2)
{
} else if (id == 2) {
this.energy = value;
}
this.tile.setEnergy(energy);
}
public int getScaledBurnTime(int i)
{
public int getScaledBurnTime(int i) {
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}

View file

@ -1,33 +1,28 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import reborncore.api.tile.IContainerLayout;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotInput;
import reborncore.client.gui.SlotOutput;
import reborncore.common.recipes.RecipeCrafter;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileGrinder;
import javax.annotation.Nullable;
import java.util.List;
public class ContainerGrinder extends ContainerCrafting implements IContainerLayout<TileGrinder>
{
public class ContainerGrinder extends ContainerCrafting implements IContainerLayout<TileGrinder> {
public int connectionStatus;
EntityPlayer player;
TileGrinder tile;
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void addInventorySlots() {
// input
@ -45,16 +40,13 @@ public class ContainerGrinder extends ContainerCrafting implements IContainerLay
public void addPlayerSlots() {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -2,9 +2,9 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.idsu.TileIDSU;

View file

@ -2,22 +2,20 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.multiblock.TileImplosionCompressor;
public class ContainerImplosionCompressor extends ContainerCrafting
{
public class ContainerImplosionCompressor extends ContainerCrafting {
public int tickTime;
public int multIBlockState = 0;
EntityPlayer player;
TileImplosionCompressor tile;
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player)
{
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player) {
super(tilecompressor.crafter);
tile = tilecompressor;
this.player = player;
@ -31,59 +29,48 @@ public class ContainerImplosionCompressor extends ContainerCrafting
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.multIBlockState != getMultIBlockStateint())
{
if (this.multIBlockState != getMultIBlockStateint()) {
IContainerListener.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 3)
{
public void updateProgressBar(int id, int value) {
if (id == 3) {
this.multIBlockState = value;
}
}
public int getMultIBlockStateint()
{
public int getMultIBlockStateint() {
return tile.getMutliBlock() ? 1 : 0;
}

View file

@ -5,15 +5,13 @@ import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class ContainerIndustrialElectrolyzer extends ContainerCrafting
{
public class ContainerIndustrialElectrolyzer extends ContainerCrafting {
public int tickTime;
EntityPlayer player;
TileIndustrialElectrolyzer tile;
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player)
{
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player) {
super(electrolyzer.crafter);
tile = electrolyzer;
this.player = player;
@ -31,23 +29,19 @@ public class ContainerIndustrialElectrolyzer extends ContainerCrafting
this.addSlotToContainer(new BaseSlot(electrolyzer.inventory, 6, 18, 51));
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}

View file

@ -1,49 +1,45 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.multiblock.TileIndustrialGrinder;
public class ContainerIndustrialGrinder extends ContainerCrafting {
EntityPlayer player;
TileIndustrialGrinder tile;
EntityPlayer player;
TileIndustrialGrinder tile;
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player) {
super(tileGrinder.getRecipeCrafter());
tile = tileGrinder;
this.player = player;
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player) {
super(tileGrinder.getRecipeCrafter());
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 32, 26));
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 1, 32, 44));
// input
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 32, 26));
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 1, 32, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 35));
// outputs
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 35));
for (int 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 (int 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 (int i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
for (int 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 boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -8,39 +8,36 @@ import techreborn.tiles.multiblock.TileIndustrialSawmill;
public class ContainerIndustrialSawmill extends RebornContainer {
public int tickTime;
EntityPlayer player;
TileIndustrialSawmill tile;
public int tickTime;
EntityPlayer player;
TileIndustrialSawmill tile;
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player) {
tile = tileIndustrialSawmill;
this.player = player;
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player) {
tile = tileIndustrialSawmill;
this.player = player;
// input
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 0, 32, 26));
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 1, 32, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 35));
// input
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 0, 32, 26));
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 1, 32, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 35));
for (int 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 (int 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 (int i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
for (int 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 boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -1,23 +1,21 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.client.gui.BaseSlot;
import net.minecraft.inventory.SlotFurnaceFuel;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileIronFurnace;
public class ContainerIronFurnace extends RebornContainer
{
public class ContainerIronFurnace extends RebornContainer {
public int connectionStatus;
EntityPlayer player;
TileIronFurnace tile;
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player)
{
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) {
super();
tile = tileGrinder;
this.player = player;
@ -30,32 +28,26 @@ public class ContainerIronFurnace extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}

View file

@ -2,9 +2,9 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;

View file

@ -7,17 +7,15 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotCharge;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.storage.TileMFE;
public class ContainerMFE extends RebornContainer
{
public class ContainerMFE extends RebornContainer {
public int burnTime = 0;
public int totalBurnTime = 0;
@ -25,37 +23,32 @@ public class ContainerMFE extends RebornContainer
public int tickTime;
EntityPlayer player;
TileMFE tile;
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
public ContainerMFE(TileMFE tile, EntityPlayer player)
{
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET };
public ContainerMFE(TileMFE tile, EntityPlayer player) {
super();
this.tile = tile;
this.player = player;
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
for (int k = 0; k < 4; k++)
{
for (int k = 0; k < 4; k++) {
final EntityEquipmentSlot slot = equipmentSlots[k];
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19)
{
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19) {
@Override
public int getSlotStackLimit() { return 1; }
@Override
public boolean isItemValid(ItemStack stack)
{
public boolean isItemValid(ItemStack stack) {
return stack != null && stack.getItem().isValidArmor(stack, slot, player);
}
});
@ -65,51 +58,41 @@ public class ContainerMFE extends RebornContainer
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.energy != (int) tile.getEnergy())
{
if (this.energy != (int) tile.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.burnTime = value;
} else if (id == 1)
{
} else if (id == 1) {
this.totalBurnTime = value;
} else if (id == 2)
{
} else if (id == 2) {
this.energy = value;
}
this.tile.setEnergy(energy);
}
public int getScaledBurnTime(int i)
{
public int getScaledBurnTime(int i) {
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
}

View file

@ -3,16 +3,15 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotCharge;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.storage.TileMFSU;
public class ContainerMFSU extends RebornContainer
{
public class ContainerMFSU extends RebornContainer {
public int burnTime = 0;
public int totalBurnTime = 0;
@ -20,37 +19,32 @@ public class ContainerMFSU extends RebornContainer
public int tickTime;
EntityPlayer player;
TileMFSU tile;
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
public ContainerMFSU(TileMFSU tile, EntityPlayer player)
{
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET };
public ContainerMFSU(TileMFSU tile, EntityPlayer player) {
super();
this.tile = tile;
this.player = player;
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
for (int k = 0; k < 4; k++)
{
for (int k = 0; k < 4; k++) {
final EntityEquipmentSlot slot = equipmentSlots[k];
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19)
{
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19) {
@Override
public int getSlotStackLimit() { return 1; }
@Override
public boolean isItemValid(ItemStack stack)
{
public boolean isItemValid(ItemStack stack) {
return stack != null && stack.getItem().isValidArmor(stack, slot, player);
}
});
@ -60,51 +54,41 @@ public class ContainerMFSU extends RebornContainer
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.energy != (int) tile.getEnergy())
{
if (this.energy != (int) tile.getEnergy()) {
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.burnTime = value;
} else if (id == 1)
{
} else if (id == 1) {
this.totalBurnTime = value;
} else if (id == 2)
{
} else if (id == 2) {
this.energy = value;
}
this.tile.setEnergy(energy);
}
public int getScaledBurnTime(int i)
{
public int getScaledBurnTime(int i) {
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
}

View file

@ -2,22 +2,20 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileMatterFabricator;
public class ContainerMatterFabricator extends RebornContainer
{
public class ContainerMatterFabricator extends RebornContainer {
public int progressTime;
EntityPlayer player;
TileMatterFabricator tile;
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player)
{
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player) {
tile = tileMatterfab;
this.player = player;
@ -34,61 +32,49 @@ public class ContainerMatterFabricator extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++)
{
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.progressTime != tile.progresstime)
{
if (this.progressTime != tile.progresstime) {
IContainerListener.sendProgressBarUpdate(this, 0, tile.progresstime);
}
}
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.progresstime);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.progressTime = value;
}
}
public int getProgressScaled(int scale)
{
if (progressTime != 0)
{
public int getProgressScaled(int scale) {
if (progressTime != 0) {
return progressTime * scale / tile.maxProgresstime();
}
return 0;

View file

@ -3,19 +3,16 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.common.container.RebornContainer;
public class ContainerPda extends RebornContainer
{
public class ContainerPda extends RebornContainer {
EntityPlayer player;
public ContainerPda(EntityPlayer player)
{
public ContainerPda(EntityPlayer player) {
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}

View file

@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileQuantumChest;
public class ContainerQuantumChest extends RebornContainer
{
public class ContainerQuantumChest extends RebornContainer {
public TileQuantumChest tileQuantumChest;
public EntityPlayer player;
public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player)
{
public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player) {
super();
this.tileQuantumChest = tileQuantumChest;
this.player = player;
@ -24,23 +22,19 @@ public class ContainerQuantumChest extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}

View file

@ -8,13 +8,11 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileQuantumTank;
public class ContainerQuantumTank extends RebornContainer
{
public class ContainerQuantumTank extends RebornContainer {
public TileQuantumTank tileQuantumTank;
public EntityPlayer player;
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player)
{
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player) {
super();
this.tileQuantumTank = tileQuantumTank;
this.player = player;
@ -25,23 +23,19 @@ public class ContainerQuantumTank extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -1,23 +1,21 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.teir1.TileRecycler;
public class ContainerRecycler extends RebornContainer
{
public class ContainerRecycler extends RebornContainer {
public int connectionStatus;
EntityPlayer player;
TileRecycler tile;
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player)
{
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) {
super();
tile = tileGrinder;
this.player = player;
@ -34,32 +32,26 @@ public class ContainerRecycler extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}

View file

@ -3,15 +3,14 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.IInventory;
import reborncore.client.gui.BaseSlot;
import net.minecraft.item.ItemStack;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.api.RollingMachineRecipe;
import techreborn.tiles.TileRollingMachine;
public class ContainerRollingMachine extends RebornContainer
{
public class ContainerRollingMachine extends RebornContainer {
EntityPlayer player;
TileRollingMachine tile;
@ -19,17 +18,14 @@ public class ContainerRollingMachine extends RebornContainer
int burnTime;
int energy;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player)
{
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) {
tile = tileRollingmachine;
this.player = player;
for (int l = 0; l < 3; l++)
{
for (int k1 = 0; k1 < 3; k1++)
{
for (int l = 0; l < 3; l++) {
for (int k1 = 0; k1 < 3; k1++) {
this.addSlotToContainer(
new BaseSlot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18));
new BaseSlot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18));
}
}
@ -40,36 +36,30 @@ public class ContainerRollingMachine extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public final void onCraftMatrixChanged(IInventory inv)
{
public final void onCraftMatrixChanged(IInventory inv) {
ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe(tile.craftMatrix, tile.getWorld());
tile.inventory.setInventorySlotContents(1, output);
}
@Override
public void addListener(IContainerListener crafting)
{
public void addListener(IContainerListener crafting) {
super.addListener(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
@ -77,21 +67,16 @@ public class ContainerRollingMachine extends RebornContainer
}
@Override
public void detectAndSendChanges()
{
for (int i = 0; i < this.listeners.size(); i++)
{
public void detectAndSendChanges() {
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener crafting = this.listeners.get(i);
if (this.currentItemBurnTime != tile.runTime)
{
if (this.currentItemBurnTime != tile.runTime) {
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
}
if (this.burnTime != tile.tickTime || tile.tickTime == -1)
{
if (this.burnTime != tile.tickTime || tile.tickTime == -1) {
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
}
if (this.energy != (int) tile.getEnergy())
{
if (this.energy != (int) tile.getEnergy()) {
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
@ -99,32 +84,25 @@ public class ContainerRollingMachine extends RebornContainer
}
@Override
public void updateProgressBar(int id, int value)
{
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if (id == 0)
{
if (id == 0) {
this.currentItemBurnTime = value;
} else if (id == 1)
{
} else if (id == 1) {
this.burnTime = value;
} else if (id == 2)
{
} else if (id == 2) {
this.energy = value;
}
this.tile.runTime = this.currentItemBurnTime;
if (this.burnTime == -1)
{
if (this.burnTime == -1) {
this.burnTime = 0;
}
this.tile.tickTime = this.burnTime;
this.tile.setEnergy(this.energy);
}
public int getBurnTimeRemainingScaled(int scale)
{
if (burnTime == 0 || this.currentItemBurnTime == 0)
{
public int getBurnTimeRemainingScaled(int scale) {
if (burnTime == 0 || this.currentItemBurnTime == 0) {
return 0;
}
return this.burnTime * scale / this.currentItemBurnTime;

View file

@ -1,23 +1,21 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.BaseSlot;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.api.gui.SlotUpgrade;
import techreborn.tiles.TileScrapboxinator;
public class ContainerScrapboxinator extends RebornContainer
{
public class ContainerScrapboxinator extends RebornContainer {
public int connectionStatus;
EntityPlayer player;
TileScrapboxinator tile;
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player)
{
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player) {
super();
tile = tileScrapboxinator;
this.player = player;
@ -34,32 +32,26 @@ public class ContainerScrapboxinator extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
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_)
{
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}

View file

@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileSemifluidGenerator;
public class ContainerSemifluidGenerator extends RebornContainer
{
public class ContainerSemifluidGenerator extends RebornContainer {
public TileSemifluidGenerator tileSemifluidGenerator;
public EntityPlayer player;
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player)
{
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player) {
super();
this.tileSemifluidGenerator = tileSemifluidGenerator;
this.player = player;
@ -24,23 +22,19 @@ public class ContainerSemifluidGenerator extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -8,13 +8,11 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileThermalGenerator;
public class ContainerThermalGenerator extends RebornContainer
{
public class ContainerThermalGenerator extends RebornContainer {
public TileThermalGenerator tileThermalGenerator;
public EntityPlayer player;
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player)
{
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player) {
super();
this.tileThermalGenerator = tileThermalGenerator;
this.player = player;
@ -25,23 +23,19 @@ public class ContainerThermalGenerator extends RebornContainer
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
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)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -1,43 +1,40 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import reborncore.client.gui.BaseSlot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.multiblock.TileVacuumFreezer;
public class ContainerVacuumFreezer extends ContainerCrafting {
EntityPlayer player;
TileVacuumFreezer tile;
EntityPlayer player;
TileVacuumFreezer tile;
public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter, EntityPlayer player) {
super(tileAlloysmelter.crafter);
tile = tileAlloysmelter;
this.player = player;
public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter, EntityPlayer player) {
super(tileAlloysmelter.crafter);
tile = tileAlloysmelter;
this.player = player;
// input
this.addSlotToContainer(new BaseSlot(tileAlloysmelter.inventory, 0, 56, 34));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35));
// input
this.addSlotToContainer(new BaseSlot(tileAlloysmelter.inventory, 0, 56, 34));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35));
for (int 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 (int 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 (int i = 0; i < 9; ++i) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
for (int 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 boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -1,25 +1,21 @@
package techreborn.client.container;
import net.minecraft.inventory.IInventory;
import reborncore.client.gui.BaseSlot;
import net.minecraft.item.ItemStack;
import reborncore.client.gui.BaseSlot;
import techreborn.init.ModItems;
public class SlotScrapbox extends BaseSlot
{
public class SlotScrapbox extends BaseSlot {
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4)
{
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4);
}
public boolean isItemValid(ItemStack par1ItemStack)
{
public boolean isItemValid(ItemStack par1ItemStack) {
return par1ItemStack.getItem() == ModItems.scrapBox;
}
public int getSlotStackLimit()
{
public int getSlotStackLimit() {
return 64;
}
}

View file

@ -15,8 +15,7 @@ import techreborn.tiles.TileAesu;
import java.awt.*;
import java.io.IOException;
public class GuiAESU extends GuiContainer
{
public class GuiAESU extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
@ -24,8 +23,7 @@ public class GuiAESU extends GuiContainer
ContainerAESU containerAesu;
public GuiAESU(EntityPlayer player, TileAesu tileaesu)
{
public GuiAESU(EntityPlayer player, TileAesu tileaesu) {
super(new ContainerAESU(tileaesu, player));
this.xSize = 176;
this.ySize = 197;
@ -34,8 +32,7 @@ public class GuiAESU extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
super.initGui();
this.buttonList.clear();
int k = (this.width - this.xSize) / 2;
@ -47,8 +44,7 @@ public class GuiAESU extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -56,21 +52,19 @@ public class GuiAESU extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.aesu.name"), 40, 10,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
}
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
protected void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu));
}

View file

@ -8,18 +8,16 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerAlloyFurnace;
import techreborn.tiles.TileAlloyFurnace;
public class GuiAlloyFurnace extends GuiContainer
{
public class GuiAlloyFurnace extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/alloy_furnace.png");
"textures/gui/alloy_furnace.png");
TileAlloyFurnace alloyfurnace;
ContainerAlloyFurnace containerAlloyFurnace;
public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace)
{
public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace) {
super(new ContainerAlloyFurnace(tileAlloyFurnace, player));
this.xSize = 176;
this.ySize = 167;
@ -28,24 +26,21 @@ public class GuiAlloyFurnace extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (this.alloyfurnace.isBurning())
{
if (this.alloyfurnace.isBurning()) {
int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
i1 = this.alloyfurnace.getCookProgressScaled(24);
@ -53,13 +48,12 @@ public class GuiAlloyFurnace extends GuiContainer
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -9,16 +9,14 @@ import reborncore.common.container.RebornContainer;
import techreborn.client.container.ContainerAlloySmelter;
import techreborn.tiles.TileAlloySmelter;
public class GuiAlloySmelter extends GuiContainer
{
public class GuiAlloySmelter extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/electric_alloy_furnace.png");
"textures/gui/electric_alloy_furnace.png");
TileAlloySmelter alloysmelter;
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter)
{
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter) {
super(RebornContainer.createContainer(ContainerAlloySmelter.class, tilealloysmelter, player));
this.xSize = 176;
this.ySize = 167;
@ -26,16 +24,14 @@ public class GuiAlloySmelter extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -45,24 +41,21 @@ public class GuiAlloySmelter extends GuiContainer
int j = 0;
j = alloysmelter.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
}
j = alloysmelter.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -7,20 +7,17 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.container.RebornContainer;
import techreborn.client.container.ContainerAssemblingMachine;
import techreborn.client.container.ContainerGrinder;
import techreborn.tiles.TileAssemblingMachine;
public class GuiAssemblingMachine extends GuiContainer
{
public class GuiAssemblingMachine extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/assembling_machine.png");
"textures/gui/assembling_machine.png");
TileAssemblingMachine assemblingmachine;
ContainerAssemblingMachine containerAssemblingMachine;
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine)
{
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) {
super(RebornContainer.createContainer(ContainerAssemblingMachine.class, tileassemblinmachine, player));
containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots;
this.xSize = 176;
@ -29,16 +26,14 @@ public class GuiAssemblingMachine extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -48,24 +43,21 @@ public class GuiAssemblingMachine extends GuiContainer
int j = 0;
j = assemblingmachine.getProgressScaled(20);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
}
j = assemblingmachine.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -8,8 +8,7 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerBatbox;
import techreborn.tiles.storage.TileBatBox;
public class GuiBatbox extends GuiContainer
{
public class GuiBatbox extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/batbox.png");
@ -17,8 +16,7 @@ public class GuiBatbox extends GuiContainer
ContainerBatbox containerGenerator;
public GuiBatbox(EntityPlayer player, TileBatBox generator)
{
public GuiBatbox(EntityPlayer player, TileBatBox generator) {
super(new ContainerBatbox(generator, player));
this.xSize = 176;
this.ySize = 167;
@ -27,16 +25,14 @@ public class GuiBatbox extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
@ -45,8 +41,7 @@ public class GuiBatbox extends GuiContainer
int j = 0;
j = generator.getEnergyScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
}
//
@ -58,17 +53,16 @@ public class GuiBatbox extends GuiContainer
// }
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.batbox.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize - 140,
4210752);
4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
4210752);
4210752);
}
}

View file

@ -19,18 +19,17 @@ import techreborn.tiles.multiblock.TileBlastFurnace;
import java.io.IOException;
public class GuiBlastFurnace extends GuiContainer
{
public class GuiBlastFurnace extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_blast_furnace.png");
"textures/gui/industrial_blast_furnace.png");
TileBlastFurnace blastfurnace;
ContainerBlastFurnace containerBlastFurnace;
boolean hasMultiBlock;
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace)
{
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) {
super(new ContainerBlastFurnace(tileblastfurnace, player));
this.xSize = 176;
this.ySize = 167;
@ -39,8 +38,7 @@ public class GuiBlastFurnace extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
hasMultiBlock = containerBlastFurnace.heat != 0;
int k = (this.width - this.xSize) / 2;
@ -49,73 +47,62 @@ public class GuiBlastFurnace extends GuiContainer
buttonList.add(button);
super.initGui();
CoordTriplet coordinates = new CoordTriplet(
blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0)
{
blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0) {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B";
} else
{
} else {
button.displayString = "A";
}
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (hasMultiBlock)
{
if (hasMultiBlock) {
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
l + 52 + 12 - 0, -1);
l + 52 + 12 - 0, -1);
}
int j = 0;
this.mc.getTextureManager().bindTexture(texture);
j = blastfurnace.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16);
}
j = blastfurnace.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_);
String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
if (containerBlastFurnace.heat != 0)
{
4210752);
if (containerBlastFurnace.heat != 0) {
this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752);
}
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
@Override
public void actionPerformed(GuiButton button) throws IOException
{
public void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
if (button.id == 212)
{
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null)
{
if (button.id == 212) {
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
{// This code here makes a basic multiblock and then sets to the
// selected one.
Multiblock multiblock = new Multiblock();
@ -160,16 +147,15 @@ public class GuiBlastFurnace extends GuiContainer
MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.partent = new Location(blastfurnace.getPos().getX(),
blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld());
blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld());
ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(
blastfurnace.getPos().getX()
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
blastfurnace.getPos().getX()
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
}
button.displayString = "A";
} else
{
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B";
}

View file

@ -7,19 +7,16 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.container.RebornContainer;
import techreborn.client.container.ContainerCentrifuge;
import techreborn.client.container.ContainerGrinder;
import techreborn.tiles.TileCentrifuge;
public class GuiCentrifuge extends GuiContainer
{
public class GuiCentrifuge extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_centrifuge.png");
"textures/gui/industrial_centrifuge.png");
TileCentrifuge centrifuge;
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge)
{
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge) {
super(RebornContainer.createContainer(ContainerCentrifuge.class, tileCentrifuge, player));
this.xSize = 176;
this.ySize = 167;
@ -27,16 +24,14 @@ public class GuiCentrifuge extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -46,8 +41,7 @@ public class GuiCentrifuge extends GuiContainer
int j = 0;
j = centrifuge.getProgressScaled(11);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j);
this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10);
this.drawTexturedModalRect(k + 83, l + 53, 177, 39, 10, j);
@ -56,20 +50,18 @@ public class GuiCentrifuge extends GuiContainer
j = centrifuge.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -8,15 +8,13 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerChargeBench;
import techreborn.tiles.TileChargeBench;
public class GuiChargeBench extends GuiContainer
{
public class GuiChargeBench extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chargebench.png");
TileChargeBench chargebench;
public GuiChargeBench(EntityPlayer player, TileChargeBench tile)
{
public GuiChargeBench(EntityPlayer player, TileChargeBench tile) {
super(new ContainerChargeBench(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -24,16 +22,14 @@ public class GuiChargeBench extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -43,18 +39,16 @@ public class GuiChargeBench extends GuiContainer
int j = 0;
j = chargebench.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 10, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.chargebench.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -8,17 +8,15 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerChemicalReactor;
import techreborn.tiles.TileChemicalReactor;
public class GuiChemicalReactor extends GuiContainer
{
public class GuiChemicalReactor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/chemical_reactor.png");
"textures/gui/chemical_reactor.png");
TileChemicalReactor chemicalReactor;
ContainerChemicalReactor containerChemicalReactor;
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor)
{
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) {
super(new ContainerChemicalReactor(tilechemicalReactor, player));
containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots;
this.xSize = 176;
@ -27,16 +25,14 @@ public class GuiChemicalReactor extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -46,25 +42,22 @@ public class GuiChemicalReactor extends GuiContainer
int j = 0;
j = chemicalReactor.getProgressScaled(11);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
}
j = chemicalReactor.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -9,19 +9,17 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerChunkloader;
import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer
{
public class GuiChunkLoader extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_chunkloader.png");
"textures/gui/industrial_chunkloader.png");
TileChunkLoader chunkloader;
private GuiButton plusOneButton;
private GuiButton plusTenButton;
private GuiButton minusOneButton;
private GuiButton minusTenButton;
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader)
{
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader) {
super(new ContainerChunkloader(tilechunkloader, player));
this.xSize = 176;
this.ySize = 167;
@ -29,8 +27,7 @@ public class GuiChunkLoader extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
super.initGui();
this.guiLeft = this.width / 2 - this.xSize / 2;
this.guiTop = this.height / 2 - this.ySize / 2;
@ -47,8 +44,7 @@ public class GuiChunkLoader extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -56,13 +52,12 @@ public class GuiChunkLoader extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerCompressor;
import techreborn.tiles.teir1.TileCompressor;
public class GuiCompressor extends GuiContainer
{
public class GuiCompressor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
TileCompressor compressor;
ContainerCompressor containerGrinder;
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder)
{
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) {
super(new ContainerCompressor(tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
@ -26,8 +24,7 @@ public class GuiCompressor extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -37,24 +34,21 @@ public class GuiCompressor extends GuiContainer
int j = 0;
j = compressor.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = compressor.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.compressor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -7,34 +7,30 @@ import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
public class GuiDestructoPack extends GuiContainer
{
public class GuiDestructoPack extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/destructopack.png");
"textures/gui/destructopack.png");
public GuiDestructoPack(Container container)
{
public GuiDestructoPack(Container container) {
super(container);
this.xSize = 176;
this.ySize = 166;
}
@Override
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2)
{
protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166);
}
@Override
protected void drawGuiContainerForegroundLayer(int arg0, int arg1)
{
protected void drawGuiContainerForegroundLayer(int arg0, int arg1) {
String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name");
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 5, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2,
4210752);
4210752);
super.drawGuiContainerForegroundLayer(arg0, arg1);
}
}

View file

@ -9,18 +9,16 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerDieselGenerator;
import techreborn.tiles.generator.TileDieselGenerator;
public class GuiDieselGenerator extends GuiContainer
{
public class GuiDieselGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/diesel_generator.png");
"textures/gui/diesel_generator.png");
TileDieselGenerator tile;
ContainerDieselGenerator containerDieselGenerator;
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile)
{
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile) {
super(new ContainerDieselGenerator(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -29,8 +27,7 @@ public class GuiDieselGenerator extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -38,18 +35,17 @@ public class GuiDieselGenerator extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(containerDieselGenerator.fluid + "", 10, 30, 16448255);
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerDieselGenerator.energy) + "", 10, 50,
16448255);
16448255);
}
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerDigitalChest;
import techreborn.tiles.TileDigitalChest;
public class GuiDigitalChest extends GuiContainer
{
public class GuiDigitalChest extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileDigitalChest tile;
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile)
{
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile) {
super(new ContainerDigitalChest(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -25,8 +23,7 @@ public class GuiDigitalChest extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -34,17 +31,16 @@ public class GuiDigitalChest extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.digitalChest.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10, 30,
16448255);
16448255);
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerElectricFurnace;
import techreborn.tiles.teir1.TileElectricFurnace;
public class GuiElectricFurnace extends GuiContainer
{
public class GuiElectricFurnace extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
TileElectricFurnace furnace;
ContainerElectricFurnace containerGrinder;
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder)
{
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) {
super(new ContainerElectricFurnace(tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
@ -26,8 +24,7 @@ public class GuiElectricFurnace extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -37,25 +34,22 @@ public class GuiElectricFurnace extends GuiContainer
int j = 0;
j = furnace.gaugeProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16);
}
j = furnace.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -9,16 +9,14 @@ import reborncore.common.container.RebornContainer;
import techreborn.client.container.ContainerExtractor;
import techreborn.tiles.teir1.TileExtractor;
public class GuiExtractor extends GuiContainer
{
public class GuiExtractor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
TileExtractor extractor;
ContainerExtractor containerExtractor;
public GuiExtractor(EntityPlayer player, TileExtractor tileExtractor)
{
public GuiExtractor(EntityPlayer player, TileExtractor tileExtractor) {
super(RebornContainer.createContainer(ContainerExtractor.class, tileExtractor, player));
this.xSize = 176;
this.ySize = 167;
@ -27,8 +25,7 @@ public class GuiExtractor extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -38,24 +35,21 @@ public class GuiExtractor extends GuiContainer
int j = 0;
j = extractor.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = extractor.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.extractor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -1,7 +1,5 @@
package techreborn.client.gui;
import java.io.IOException;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
@ -12,42 +10,40 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerFusionReactor;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
public class GuiFusionReactor extends GuiContainer
{
import java.io.IOException;
public class GuiFusionReactor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/fusion_reactor.png");
"textures/gui/fusion_reactor.png");
ContainerFusionReactor containerFusionReactor;
TileEntityFusionController fusionController;
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu)
{
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu) {
super(new ContainerFusionReactor(tileaesu, player));
containerFusionReactor = (ContainerFusionReactor) this.inventorySlots;
this.fusionController = tileaesu;
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
this.fontRendererObj.drawString(name, 87, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255);
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16,
16448255);
16448255);
if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
this.fontRendererObj.drawString(
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
24, 16448255);
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
24, 16448255);
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
// GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20,
@ -70,8 +66,7 @@ public class GuiFusionReactor extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -85,16 +80,14 @@ public class GuiFusionReactor extends GuiContainer
}
public int percentage(int MaxValue, int CurrentValue)
{
public int percentage(int MaxValue, int CurrentValue) {
if (CurrentValue == 0)
return 0;
return (int) ((CurrentValue * 100.0f) / MaxValue);
}
@Override
public void actionPerformed(GuiButton button) throws IOException
{
public void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
// if(button.id == 212){
// if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){

View file

@ -8,17 +8,15 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerGasTurbine;
import techreborn.tiles.generator.TileGasTurbine;
public class GuiGasTurbine extends GuiContainer
{
public class GuiGasTurbine extends GuiContainer {
// TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileGasTurbine tile;
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile)
{
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile) {
super(new ContainerGasTurbine(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -26,8 +24,7 @@ public class GuiGasTurbine extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -35,13 +32,12 @@ public class GuiGasTurbine extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = "Gas Turbine";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
}

View file

@ -8,8 +8,7 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerGenerator;
import techreborn.tiles.generator.TileGenerator;
public class GuiGenerator extends GuiContainer
{
public class GuiGenerator extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/generator.png");
@ -17,8 +16,7 @@ public class GuiGenerator extends GuiContainer
ContainerGenerator containerGenerator;
public GuiGenerator(EntityPlayer player, TileGenerator generator)
{
public GuiGenerator(EntityPlayer player, TileGenerator generator) {
super(new ContainerGenerator(generator, player));
this.xSize = 176;
this.ySize = 167;
@ -27,16 +25,14 @@ public class GuiGenerator extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
@ -45,27 +41,24 @@ public class GuiGenerator extends GuiContainer
int j = 0;
j = generator.getEnergyScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
}
if (containerGenerator.burnTime != 0)
{
if (containerGenerator.burnTime != 0) {
j = containerGenerator.getScaledBurnTime(13);
this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.generator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
4210752);
4210752);
}
}

View file

@ -9,16 +9,14 @@ import reborncore.common.container.RebornContainer;
import techreborn.client.container.ContainerGrinder;
import techreborn.tiles.teir1.TileGrinder;
public class GuiGrinder extends GuiContainer
{
public class GuiGrinder extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/grinder.png");
TileGrinder grinder;
ContainerGrinder containerGrinder;
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder)
{
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) {
super(RebornContainer.createContainer(ContainerGrinder.class, tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
@ -27,8 +25,7 @@ public class GuiGrinder extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -38,25 +35,22 @@ public class GuiGrinder extends GuiContainer
int j = 0;
j = grinder.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 80, l + 36, 176, 14, j + 1, 16);
}
j = grinder.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.grinder.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -15,8 +15,7 @@ import techreborn.tiles.idsu.TileIDSU;
import java.awt.*;
import java.io.IOException;
public class GuiIDSU extends GuiContainer
{
public class GuiIDSU extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
@ -24,8 +23,7 @@ public class GuiIDSU extends GuiContainer
ContainerIDSU containerIDSU;
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU)
{
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU) {
super(new ContainerIDSU(tileIDSU, player));
this.xSize = 176;
this.ySize = 197;
@ -33,19 +31,15 @@ public class GuiIDSU extends GuiContainer
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
}
public static boolean isInteger(String s)
{
public static boolean isInteger(String s) {
return isInteger(s, 10);
}
public static boolean isInteger(String s, int radix)
{
public static boolean isInteger(String s, int radix) {
if (s.isEmpty())
return false;
for (int i = 0; i < s.length(); i++)
{
if (i == 0 && s.charAt(i) == '-')
{
for (int i = 0; i < s.length(); i++) {
if (i == 0 && s.charAt(i) == '-') {
if (s.length() == 1)
return false;
else
@ -58,8 +52,7 @@ public class GuiIDSU extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
super.initGui();
this.buttonList.clear();
int k = (this.width - this.xSize) / 2;
@ -72,8 +65,7 @@ public class GuiIDSU extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -81,21 +73,19 @@ public class GuiIDSU extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 75, 10,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 22,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 32,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 42,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
}
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
protected void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu));

View file

@ -10,57 +10,56 @@ import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/implosion_compressor.png");
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/implosion_compressor.png");
TileImplosionCompressor compresser;
ContainerImplosionCompressor containerImplosionCompressor;
TileImplosionCompressor compresser;
ContainerImplosionCompressor containerImplosionCompressor;
public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser) {
super(new ContainerImplosionCompressor(tilecompresser, player));
containerImplosionCompressor = (ContainerImplosionCompressor) this.inventorySlots;
this.xSize = 176;
this.ySize = 167;
compresser = tilecompresser;
}
public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser) {
super(new ContainerImplosionCompressor(tilecompresser, player));
containerImplosionCompressor = (ContainerImplosionCompressor) this.inventorySlots;
this.xSize = 176;
this.ySize = 167;
compresser = tilecompresser;
}
@Override
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (containerImplosionCompressor.multIBlockState == 0) {
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
if (containerImplosionCompressor.multIBlockState == 0) {
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
this.mc.getTextureManager().bindTexture(texture);
int j = compresser.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 61, l + 37, 176, 14, j + 1, 16);
}
this.mc.getTextureManager().bindTexture(texture);
int j = compresser.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 61, l + 37, 176, 14, j + 1, 16);
}
j = compresser.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -8,18 +8,16 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerIndustrialElectrolyzer;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class GuiIndustrialElectrolyzer extends GuiContainer
{
public class GuiIndustrialElectrolyzer extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_electrolyzer.png");
"textures/gui/industrial_electrolyzer.png");
TileIndustrialElectrolyzer eletrolyzer;
ContainerIndustrialElectrolyzer containerIndustrialElectrolyzer;
public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer)
{
public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer) {
super(new ContainerIndustrialElectrolyzer(tileeletrolyzer, player));
this.xSize = 176;
this.ySize = 167;
@ -28,16 +26,14 @@ public class GuiIndustrialElectrolyzer extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -47,24 +43,21 @@ public class GuiIndustrialElectrolyzer extends GuiContainer
int j = 0;
j = eletrolyzer.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 72, l + 38, 176, 14, j + 1, 16);
}
j = eletrolyzer.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 134, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2), 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -13,85 +13,85 @@ import techreborn.tiles.multiblock.TileIndustrialGrinder;
public class GuiIndustrialGrinder extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_grinder.png");
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_grinder.png");
TileIndustrialGrinder grinder;
ContainerIndustrialGrinder containerGrinder;
TileIndustrialGrinder grinder;
ContainerIndustrialGrinder containerGrinder;
public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder) {
super(new ContainerIndustrialGrinder(tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
grinder = tilegrinder;
containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots;
}
public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder) {
super(new ContainerIndustrialGrinder(tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
grinder = tilegrinder;
containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots;
}
@Override
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int progress = grinder.getProgressScaled(24);
if (progress > 0) {
this.drawTexturedModalRect(k + 50, l + 35, 176, 14, progress + 1, 16);
}
int progress = grinder.getProgressScaled(24);
if (progress > 0) {
this.drawTexturedModalRect(k + 50, l + 35, 176, 14, progress + 1, 16);
}
int energy = (int) (grinder.getEnergy() * 12f / grinder.getMaxPower());
if (energy > 0) {
this.drawTexturedModalRect(k + 132, l + 63 + 12 - energy, 176, 12 - energy, 14, energy + 2);
}
int energy = (int) (grinder.getEnergy() * 12f / grinder.getMaxPower());
if (energy > 0) {
this.drawTexturedModalRect(k + 132, l + 63 + 12 - energy, 176, 12 - energy, 14, energy + 2);
}
if(!grinder.tank.isEmpty()) {
drawFluid(grinder.tank.getFluid(), k + 11, l + 66, 12, 47, grinder.tank.getCapacity());
if (!grinder.tank.isEmpty()) {
drawFluid(grinder.tank.getFluid(), k + 11, l + 66, 12, 47, grinder.tank.getCapacity());
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(k + 14, l + 24, 179, 88, 9, 37);
}
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(k + 14, l + 24, 179, 88, 9, 37);
}
if (!grinder.getMutliBlock()) {
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
if (!grinder.getMutliBlock()) {
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
}
}
public void drawFluid(FluidStack fluid, int x, int y, int width, int height, int maxCapacity) {
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
ResourceLocation still = fluid.getFluid().getStill(fluid);
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite(still.toString());
public void drawFluid(FluidStack fluid, int x, int y, int width, int height, int maxCapacity) {
mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
ResourceLocation still = fluid.getFluid().getStill(fluid);
TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite(still.toString());
int drawHeight = (int) ((fluid.amount / (maxCapacity * 1F)) * height);
int iconHeight = sprite.getIconHeight();
int offsetHeight = drawHeight;
int drawHeight = (int) ((fluid.amount / (maxCapacity * 1F)) * height);
int iconHeight = sprite.getIconHeight();
int offsetHeight = drawHeight;
int iteration = 0;
while(offsetHeight != 0) {
int curHeight = offsetHeight < iconHeight ? offsetHeight : iconHeight;
drawTexturedModalRect(x, y - offsetHeight, sprite, width, curHeight);
offsetHeight -= curHeight;
iteration++;
if(iteration > 50) break;
}
int iteration = 0;
while (offsetHeight != 0) {
int curHeight = offsetHeight < iconHeight ? offsetHeight : iconHeight;
drawTexturedModalRect(x, y - offsetHeight, sprite, width, curHeight);
offsetHeight -= curHeight;
iteration++;
if (iteration > 50)
break;
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -11,33 +11,29 @@ import net.minecraftforge.fluids.FluidStack;
import techreborn.client.container.ContainerIndustrialSawmill;
import techreborn.tiles.multiblock.TileIndustrialSawmill;
public class GuiIndustrialSawmill extends GuiContainer
{
public class GuiIndustrialSawmill extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png");
"textures/gui/industrial_sawmill.png");
TileIndustrialSawmill sawmill;
public GuiIndustrialSawmill(EntityPlayer player, TileIndustrialSawmill tilesawmill)
{
public GuiIndustrialSawmill(EntityPlayer player, TileIndustrialSawmill tilesawmill) {
super(new ContainerIndustrialSawmill(tilesawmill, player));
this.xSize = 176;
this.ySize = 167;
this.sawmill = tilesawmill;
this.sawmill = tilesawmill;
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -51,7 +47,7 @@ public class GuiIndustrialSawmill extends GuiContainer
int energy = 13 - (int) (sawmill.getEnergy() / sawmill.getMaxPower() * 13F);
drawTexturedModalRect(k + 36, l + 66 + energy, 179, 1 + energy, 7, 13 - energy);
if(!sawmill.tank.isEmpty()) {
if (!sawmill.tank.isEmpty()) {
drawFluid(sawmill.tank.getFluid(), k + 11, l + 66, 12, 47, sawmill.tank.getCapacity());
int j = sawmill.getEnergyScaled(12);
@ -62,7 +58,7 @@ public class GuiIndustrialSawmill extends GuiContainer
if (!sawmill.getMutliBlock()) {
//GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
l + 52 + 12, -1);
l + 52 + 12, -1);
}
}
}
@ -77,12 +73,13 @@ public class GuiIndustrialSawmill extends GuiContainer
int offsetHeight = drawHeight;
int iteration = 0;
while(offsetHeight != 0) {
while (offsetHeight != 0) {
int curHeight = offsetHeight < iconHeight ? offsetHeight : iconHeight;
drawTexturedModalRect(x, y - offsetHeight, sprite, width, curHeight);
offsetHeight -= curHeight;
iteration++;
if(iteration > 50) break;
if (iteration > 50)
break;
}
}

View file

@ -8,17 +8,15 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerIronFurnace;
import techreborn.tiles.TileIronFurnace;
public class GuiIronFurnace extends GuiContainer
{
public class GuiIronFurnace extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("minecraft",
"textures/gui/container/furnace.png");
"textures/gui/container/furnace.png");
TileIronFurnace furnace;
ContainerIronFurnace containerGrinder;
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder)
{
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder) {
super(new ContainerIronFurnace(tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
@ -27,8 +25,7 @@ public class GuiIronFurnace extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -38,25 +35,22 @@ public class GuiIronFurnace extends GuiContainer
int j = 0;
j = furnace.gaugeProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = furnace.gaugeFuelScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -1,7 +1,5 @@
package techreborn.client.gui;
import java.awt.*;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
@ -11,8 +9,9 @@ import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerLESU;
import techreborn.tiles.lesu.TileLesu;
public class GuiLESU extends GuiContainer
{
import java.awt.*;
public class GuiLESU extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
@ -20,8 +19,7 @@ public class GuiLESU extends GuiContainer
ContainerLESU containerLesu;
public GuiLESU(EntityPlayer player, TileLesu tileaesu)
{
public GuiLESU(EntityPlayer player, TileLesu tileaesu) {
super(new ContainerLESU(tileaesu, player));
this.xSize = 176;
this.ySize = 197;
@ -30,8 +28,7 @@ public class GuiLESU extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -39,19 +36,18 @@ public class GuiLESU extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.lesu.name"), 40, 10,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB());
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euStorage) + " max", 10, 60,
Color.WHITE.getRGB());
Color.WHITE.getRGB());
}
}

View file

@ -11,8 +11,7 @@ import techreborn.tiles.storage.TileMFE;
/**
* Created by Rushmead
*/
public class GuiMFE extends GuiContainer
{
public class GuiMFE extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/mfe.png");
@ -20,8 +19,7 @@ public class GuiMFE extends GuiContainer
ContainerMFE containerGenerator;
public GuiMFE(EntityPlayer player, TileMFE generator)
{
public GuiMFE(EntityPlayer player, TileMFE generator) {
super(new ContainerMFE(generator, player));
this.xSize = 176;
this.ySize = 167;
@ -30,16 +28,14 @@ public class GuiMFE extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
@ -48,8 +44,7 @@ public class GuiMFE extends GuiContainer
int j = 0;
j = generator.getEnergyScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
}
//
@ -61,17 +56,16 @@ public class GuiMFE extends GuiContainer
// }
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.mfe.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), this.xSize - 60,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 110, this.ySize - 150,
4210752);
4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 110, this.ySize - 160,
4210752);
4210752);
}
}

View file

@ -11,8 +11,7 @@ import techreborn.tiles.storage.TileMFSU;
/**
* Created by Rushmead
*/
public class GuiMFSU extends GuiContainer
{
public class GuiMFSU extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/mfsu.png");
@ -20,8 +19,7 @@ public class GuiMFSU extends GuiContainer
ContainerMFSU containerGenerator;
public GuiMFSU(EntityPlayer player, TileMFSU generator)
{
public GuiMFSU(EntityPlayer player, TileMFSU generator) {
super(new ContainerMFSU(generator, player));
this.xSize = 176;
this.ySize = 167;
@ -30,16 +28,14 @@ public class GuiMFSU extends GuiContainer
}
@Override
public void initGui()
{
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
@ -48,8 +44,7 @@ public class GuiMFSU extends GuiContainer
int j = 0;
j = generator.getEnergyScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
}
//
@ -61,17 +56,16 @@ public class GuiMFSU extends GuiContainer
// }
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.mfsu.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), this.xSize - 60,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 110, this.ySize - 150,
4210752);
4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 110, this.ySize - 160,
4210752);
4210752);
}
}

View file

@ -8,18 +8,16 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerMatterFabricator;
import techreborn.tiles.TileMatterFabricator;
public class GuiMatterFabricator extends GuiContainer
{
public class GuiMatterFabricator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/matterfabricator.png");
"textures/gui/matterfabricator.png");
TileMatterFabricator matterfab;
ContainerMatterFabricator containerMatterFabricator;
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab)
{
public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab) {
super(new ContainerMatterFabricator(tilematterfab, player));
this.xSize = 176;
this.ySize = 167;
@ -28,8 +26,7 @@ public class GuiMatterFabricator extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -37,21 +34,19 @@ public class GuiMatterFabricator extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int j = containerMatterFabricator.getProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
String name = I18n.translateToLocal("tile.techreborn.matterfabricator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752);
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerQuantumChest;
import techreborn.tiles.TileQuantumChest;
public class GuiQuantumChest extends GuiContainer
{
public class GuiQuantumChest extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileQuantumChest tile;
public GuiQuantumChest(EntityPlayer player, TileQuantumChest tile)
{
public GuiQuantumChest(EntityPlayer player, TileQuantumChest tile) {
super(new ContainerQuantumChest(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -25,8 +23,7 @@ public class GuiQuantumChest extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -34,17 +31,16 @@ public class GuiQuantumChest extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.quantumChest.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10, 30,
16448255);
16448255);
if (tile.storedItem == null && tile.getStackInSlot(1) != null)
this.fontRendererObj.drawString(tile.getStackInSlot(1).stackSize + "", 10, 30, 16448255);
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerQuantumTank;
import techreborn.tiles.TileQuantumTank;
public class GuiQuantumTank extends GuiContainer
{
public class GuiQuantumTank extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileQuantumTank tile;
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile)
{
public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile) {
super(new ContainerQuantumTank(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -25,8 +23,7 @@ public class GuiQuantumTank extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -34,13 +31,12 @@ public class GuiQuantumTank extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerRecycler;
import techreborn.tiles.teir1.TileRecycler;
public class GuiRecycler extends GuiContainer
{
public class GuiRecycler extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
TileRecycler compressor;
ContainerRecycler containerGrinder;
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder)
{
public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder) {
super(new ContainerRecycler(tilegrinder, player));
this.xSize = 176;
this.ySize = 167;
@ -26,8 +24,7 @@ public class GuiRecycler extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -37,24 +34,21 @@ public class GuiRecycler extends GuiContainer
int j = 0;
j = compressor.gaugeProgressScaled(24);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = compressor.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.recycler.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -9,16 +9,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.tiles.TileRollingMachine;
public class GuiRollingMachine extends GuiContainer
{
public class GuiRollingMachine extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/rolling_machine.png");
"textures/gui/rolling_machine.png");
TileRollingMachine rollingMachine;
ContainerRollingMachine containerRollingMachine;
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
{
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) {
super(new ContainerRollingMachine(tileRollingmachine, player));
this.xSize = 176;
this.ySize = 167;
@ -27,8 +25,7 @@ public class GuiRollingMachine extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -39,24 +36,21 @@ public class GuiRollingMachine extends GuiContainer
this.drawTexturedModalRect(k + 91, l + 34, 176, 14, j + 1, 19);
j = this.rollingMachine.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 7, l + 33 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
@Override
public void initGui()
{
public void initGui() {
this.buttonList.clear();
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;

View file

@ -8,17 +8,15 @@ import net.minecraft.util.ResourceLocation;
import techreborn.client.container.ContainerScrapboxinator;
import techreborn.tiles.TileScrapboxinator;
public class GuiScrapboxinator extends GuiContainer
{
public class GuiScrapboxinator extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/scrapboxinator.png");
"textures/gui/scrapboxinator.png");
TileScrapboxinator tile;
ContainerScrapboxinator containerScrapboxinator;
public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator)
{
public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator) {
super(new ContainerScrapboxinator(tileScrapboxinator, player));
this.xSize = 176;
this.ySize = 167;
@ -27,8 +25,7 @@ public class GuiScrapboxinator extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -39,24 +36,21 @@ public class GuiScrapboxinator extends GuiContainer
j = tile.gaugeProgressScaled(24);
// System.out.println(compressor.gaugeProgressScaled(10));
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
}
j = tile.getEnergyScaled(12);
if (j > 0)
{
if (j > 0) {
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
4210752);
4210752);
}
}

View file

@ -8,17 +8,15 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerSemifluidGenerator;
import techreborn.tiles.generator.TileSemifluidGenerator;
public class GuiSemifluidGenerator extends GuiContainer
{
public class GuiSemifluidGenerator extends GuiContainer {
// TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/semifluid_generator.png");
"textures/gui/semifluid_generator.png");
TileSemifluidGenerator tile;
public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile)
{
public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile) {
super(new ContainerSemifluidGenerator(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -26,8 +24,7 @@ public class GuiSemifluidGenerator extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -35,13 +32,12 @@ public class GuiSemifluidGenerator extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = "Semifluid Generator";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
}

View file

@ -8,16 +8,14 @@ import net.minecraft.util.text.translation.I18n;
import techreborn.client.container.ContainerThermalGenerator;
import techreborn.tiles.generator.TileThermalGenerator;
public class GuiThermalGenerator extends GuiContainer
{
public class GuiThermalGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileThermalGenerator tile;
public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile)
{
public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile) {
super(new ContainerThermalGenerator(tile, player));
this.xSize = 176;
this.ySize = 167;
@ -25,8 +23,7 @@ public class GuiThermalGenerator extends GuiContainer
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
@ -34,13 +31,12 @@ public class GuiThermalGenerator extends GuiContainer
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(tile.getEnergy() + "", 10, 40, 16448255);

View file

@ -10,51 +10,49 @@ import techreborn.tiles.multiblock.TileVacuumFreezer;
public class GuiVacuumFreezer extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png");
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png");
TileVacuumFreezer crafter;
TileVacuumFreezer crafter;
public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer freezer) {
super(new ContainerVacuumFreezer(freezer, player));
this.xSize = 176;
this.ySize = 167;
crafter = freezer;
}
public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer freezer) {
super(new ContainerVacuumFreezer(freezer, player));
this.xSize = 176;
this.ySize = 167;
crafter = freezer;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int j = crafter.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 80, l + 37, 176, 14, j + 1, 16);
}
int j = crafter.getProgressScaled(24);
if (j > 0) {
this.drawTexturedModalRect(k + 80, l + 37, 176, 14, j + 1, 16);
}
j = (int) (crafter.getEnergy() * 12f / crafter.getMaxPower());
if (j > 0) {
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
j = (int) (crafter.getEnergy() * 12f / crafter.getMaxPower());
if (j > 0) {
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
if (!crafter.getMultiBlock()) {
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
if (!crafter.getMultiBlock()) {
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
}
j = crafter.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
j = crafter.getEnergyScaled(12);
if (j > 0) {
this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
}
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -5,7 +5,6 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.util.text.translation.LanguageMap;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
@ -13,64 +12,63 @@ import java.util.ArrayList;
public abstract class GuiWidget<T extends Container> extends GuiContainer {
public static final LanguageMap translate = ObfuscationReflectionHelper.getPrivateValue(LanguageMap.class, null, 2);
public static final LanguageMap translate = ObfuscationReflectionHelper.getPrivateValue(LanguageMap.class, null, 2);
private final ArrayList<Widget> widgets = new ArrayList<>();
private final ResourceLocation background;
private final ArrayList<Widget> widgets = new ArrayList<>();
private final ResourceLocation background;
public GuiWidget(T inventorySlotsIn, ResourceLocation background, int xSize, int ySize) {
super(inventorySlotsIn);
this.xSize = xSize;
this.ySize = ySize;
this.background = background;
}
public GuiWidget(T inventorySlotsIn, ResourceLocation background, int xSize, int ySize) {
super(inventorySlotsIn);
this.xSize = xSize;
this.ySize = ySize;
this.background = background;
}
public T getContainer() {
return (T) inventorySlots;
}
public T getContainer() {
return (T) inventorySlots;
}
@Override
public void initGui() {
super.initGui();
widgets.clear();
initWidgets();
}
@Override
public void initGui() {
super.initGui();
widgets.clear();
initWidgets();
}
public void addWidget(Widget widget) {
widgets.add(widget);
}
public void addWidget(Widget widget) {
widgets.add(widget);
}
public void removeWidget(Widget widget) {
widgets.remove(widget);
}
public void removeWidget(Widget widget) {
widgets.remove(widget);
}
public abstract void initWidgets();
public abstract void initWidgets();
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(background);
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(background);
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
String name = translate.translateKey("tile.techreborn.industrialgrinder.name");
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
String name = translate.translateKey("tile.techreborn.industrialgrinder.name");
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
fontRendererObj.drawString(translate.translateKey("container.inventory"), 8, ySize - 94, 4210752);
fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
fontRendererObj.drawString(translate.translateKey("container.inventory"), 8, ySize - 94, 4210752);
for (Widget widget : widgets)
widget.drawWidget(this, x, y, mouseX, mouseY);
}
for(Widget widget : widgets)
widget.drawWidget(this, x, y, mouseX, mouseY);
}
public FontRenderer getFontRenderer() {
return fontRendererObj;
}
public FontRenderer getFontRenderer() {
return fontRendererObj;
}
}

View file

@ -5,45 +5,46 @@ import techreborn.client.gui.widget.tooltip.ToolTip;
public abstract class Widget {
private final int x, y;
protected final int width, height;
private final int x, y;
protected final int width, height;
private ToolTip toolTip;
private ToolTip toolTip;
public Widget(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public Widget(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public int getWidth() {
return width;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public int getHeight() {
return height;
}
public ToolTip getToolTip() {
return toolTip;
}
public ToolTip getToolTip() {
return toolTip;
}
public void setToolTip(ToolTip toolTip) {
this.toolTip = toolTip;
}
public void setToolTip(ToolTip toolTip) {
this.toolTip = toolTip;
}
public final void drawWidget(GuiWidget gui, int cornerX, int cornerY, int mouseX, int mouseY) {
int drawX = cornerX + x;
int drawY = cornerY + y;
if(toolTip != null && drawX > mouseX && drawY > mouseY &&
drawX + width < mouseX && drawY + height < mouseY) {
toolTip.draw(gui.getFontRenderer(), mouseX, mouseY);
}
draw(gui, drawX, drawY);
}
public final void drawWidget(GuiWidget gui, int cornerX, int cornerY, int mouseX, int mouseY) {
int drawX = cornerX + x;
int drawY = cornerY + y;
if (toolTip != null && drawX > mouseX && drawY > mouseY &&
drawX + width < mouseX && drawY + height < mouseY) {
toolTip.draw(gui.getFontRenderer(), mouseX, mouseY);
}
draw(gui, drawX, drawY);
}
protected abstract void draw(GuiScreen guiScreen, int x, int y);
protected abstract void mouseClick(GuiWidget guiWidget, int mouseX, int mouseY);
protected abstract void draw(GuiScreen guiScreen, int x, int y);
protected abstract void mouseClick(GuiWidget guiWidget, int mouseX, int mouseY);
}

View file

@ -1,6 +1,5 @@
package techreborn.client.gui.widget.tooltip;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import reborncore.client.gui.GuiUtil;
@ -9,53 +8,53 @@ import java.util.Collections;
public class ToolTip {
protected ArrayList<ToolTipLine> lines = new ArrayList<>();
protected ArrayList<ToolTipLine> lines = new ArrayList<>();
public ToolTip(String... textLines) {
for(String text : textLines)
lines.add(new ToolTipLine(text));
}
public ToolTip(String... textLines) {
for (String text : textLines)
lines.add(new ToolTipLine(text));
}
public ToolTip(ToolTipLine... toolTipLines) {
Collections.addAll(lines, toolTipLines);
}
public ToolTip(ToolTipLine... toolTipLines) {
Collections.addAll(lines, toolTipLines);
}
public ToolTip(int linesSize) {
for(int i = 0; i < linesSize; i++)
lines.add(new ToolTipLine());
}
public ToolTip(int linesSize) {
for (int i = 0; i < linesSize; i++)
lines.add(new ToolTipLine());
}
public void addLine(ToolTipLine toolTipLine) {
lines.add(toolTipLine);
}
public void addLine(ToolTipLine toolTipLine) {
lines.add(toolTipLine);
}
public void removeLine(int index) {
lines.remove(index);
}
public void removeLine(int index) {
lines.remove(index);
}
public ToolTipLine getLine(int index) {
return lines.get(index);
}
public ToolTipLine getLine(int index) {
return lines.get(index);
}
public ArrayList<ToolTipLine> getLines() {
return lines;
}
public ArrayList<ToolTipLine> getLines() {
return lines;
}
protected void refresh() {}
protected void refresh() {}
public void draw(FontRenderer font, int mouseX, int mouseY) {
refresh();
int maxLineLength = 0;
int textX = mouseX + 3;
int textY = mouseY + 3;
for(ToolTipLine toolTipLine : lines) {
toolTipLine.draw(font, textX, textY);
textY += (font.FONT_HEIGHT + 3);
int lineWidth = toolTipLine.getWidth(font);
if(lineWidth > maxLineLength)
maxLineLength = lineWidth;
}
GuiUtil.drawTooltipBox(mouseX, mouseY, maxLineLength, textY + 3);
}
public void draw(FontRenderer font, int mouseX, int mouseY) {
refresh();
int maxLineLength = 0;
int textX = mouseX + 3;
int textY = mouseY + 3;
for (ToolTipLine toolTipLine : lines) {
toolTipLine.draw(font, textX, textY);
textY += (font.FONT_HEIGHT + 3);
int lineWidth = toolTipLine.getWidth(font);
if (lineWidth > maxLineLength)
maxLineLength = lineWidth;
}
GuiUtil.drawTooltipBox(mouseX, mouseY, maxLineLength, textY + 3);
}
}

View file

@ -4,81 +4,83 @@ import net.minecraft.client.gui.FontRenderer;
public class ToolTipLine {
private String line;
private int color;
private boolean shadowed;
private String line;
private int color;
private boolean shadowed;
public ToolTipLine(String line, int color, boolean shadowed) {
this.line = line;
this.color = color;
this.shadowed = shadowed;
}
public ToolTipLine(String line, int color, boolean shadowed) {
this.line = line;
this.color = color;
this.shadowed = shadowed;
}
public ToolTipLine(String line, int color) {
this(line, color, false);
}
public ToolTipLine(String line, int color) {
this(line, color, false);
}
public ToolTipLine(String line, boolean shadowed) {
this(line, 0xFFFFFF, shadowed);
}
public ToolTipLine(String line, boolean shadowed) {
this(line, 0xFFFFFF, shadowed);
}
public ToolTipLine(String line) {
this(line, 0xFFFFFF, false);
}
public ToolTipLine(String line) {
this(line, 0xFFFFFF, false);
}
public ToolTipLine() {
this("");
}
public ToolTipLine() {
this("");
}
public String getLine() {
return line;
}
public String getLine() {
return line;
}
public void setLine(String line) {
this.line = line;
}
public void setLine(String line) {
this.line = line;
}
public int getColor() {
return color;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public void setColor(int color) {
this.color = color;
}
public boolean isShadowed() {
return shadowed;
}
public boolean isShadowed() {
return shadowed;
}
public void setShadowed(boolean shadowed) {
this.shadowed = shadowed;
}
public void setShadowed(boolean shadowed) {
this.shadowed = shadowed;
}
public int getWidth(FontRenderer fontRenderer) {
return fontRenderer.getStringWidth(getLine());
}
public int getWidth(FontRenderer fontRenderer) {
return fontRenderer.getStringWidth(getLine());
}
public void draw(FontRenderer fontRenderer, int x, int y) {
fontRenderer.drawString(getLine(), x, y, color, isShadowed());
}
public void draw(FontRenderer fontRenderer, int x, int y) {
fontRenderer.drawString(getLine(), x, y, color, isShadowed());
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ToolTipLine that = (ToolTipLine) o;
return color == that.color &&
shadowed == that.shadowed &&
line.equals(that.line);
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ToolTipLine that = (ToolTipLine) o;
return color == that.color &&
shadowed == that.shadowed &&
line.equals(that.line);
}
}
@Override
public int hashCode() {
int result = line.hashCode();
result = 31 * result + color;
result = 31 * result + (shadowed ? 1 : 0);
return result;
}
@Override
public int hashCode() {
int result = line.hashCode();
result = 31 * result + color;
result = 31 * result + (shadowed ? 1 : 0);
return result;
}
}

View file

@ -13,17 +13,14 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import reborncore.api.power.IEnergyInterfaceItem;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.Color;
import techreborn.client.keybindings.KeyBindings;
import techreborn.config.ConfigTechReborn;
public class ChargeHud
{
public class ChargeHud {
public static final ChargeHud instance = new ChargeHud();
public static KeyBindings key;
public static boolean showHud = true;
@ -31,25 +28,21 @@ public class ChargeHud
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
if (key.config.isPressed())
{
public void onRenderExperienceBar(RenderGameOverlayEvent event) {
if (key.config.isPressed()) {
showHud = !showHud;
}
if (event.isCancelable() || event.getType() != ElementType.ALL)
return;
if (mc.inGameHasFocus || (mc.currentScreen != null && mc.gameSettings.showDebugInfo))
{
if (mc.inGameHasFocus || (mc.currentScreen != null && mc.gameSettings.showDebugInfo)) {
if (ConfigTechReborn.ShowChargeHud)
drawChargeHud(event.getResolution());
}
}
public void drawChargeHud(ScaledResolution res)
{
public void drawChargeHud(ScaledResolution res) {
EntityPlayer player = mc.thePlayer;
ItemStack armorstack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
ItemStack offHandstack = player.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
@ -58,8 +51,7 @@ public class ChargeHud
int y = 5;
if (armorstack != null && ConfigTechReborn.ShowChargeHud
&& armorstack.getItem() instanceof IEnergyInterfaceItem)
{
&& armorstack.getItem() instanceof IEnergyInterfaceItem) {
double MaxCharge = ((IEnergyInterfaceItem) armorstack.getItem()).getMaxPower(armorstack);
double CurrentCharge = ((IEnergyInterfaceItem) armorstack.getItem()).getEnergy(armorstack);
Color color = Color.GREEN;
@ -72,26 +64,22 @@ public class ChargeHud
// Render the stack
renderItemStack(armorstack, 0, y - 5);
// Get the color depending on current charge
if (CurrentCharge <= half)
{
if (CurrentCharge <= half) {
color = Color.YELLOW;
}
if (CurrentCharge <= quarter)
{
if (CurrentCharge <= quarter) {
color = Color.DARK_RED;
}
mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/"
+ PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
+ PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
y += 20;
}
if (showHud)
{
if (offHandstack != null && offHandstack.getItem() instanceof IEnergyInterfaceItem)
{
if (showHud) {
if (offHandstack != null && offHandstack.getItem() instanceof IEnergyInterfaceItem) {
double MaxCharge = ((IEnergyInterfaceItem) offHandstack.getItem()).getMaxPower(offHandstack);
double CurrentCharge = ((IEnergyInterfaceItem) offHandstack.getItem()).getEnergy(offHandstack);
if(MaxCharge != 0){
if (MaxCharge != 0) {
Color color = Color.GREEN;
double quarter = MaxCharge / 4;
double half = MaxCharge / 2;
@ -100,21 +88,18 @@ public class ChargeHud
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
renderItemStack(offHandstack, 0, y - 5);
if (CurrentCharge <= half)
{
if (CurrentCharge <= half) {
color = Color.YELLOW;
}
if (CurrentCharge <= quarter)
{
if (CurrentCharge <= quarter) {
color = Color.DARK_RED;
}
mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/"
+ PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
+ PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
y += 20;
}
}
if (stack != null && stack.getItem() instanceof IEnergyInterfaceItem)
{
if (stack != null && stack.getItem() instanceof IEnergyInterfaceItem) {
double MaxCharge = ((IEnergyInterfaceItem) stack.getItem()).getMaxPower(stack);
double CurrentCharge = ((IEnergyInterfaceItem) stack.getItem()).getEnergy(stack);
Color color = Color.GREEN;
@ -125,12 +110,10 @@ public class ChargeHud
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
renderItemStack(stack, 0, y - 5);
if (CurrentCharge <= half)
{
if (CurrentCharge <= half) {
color = Color.YELLOW;
}
if (CurrentCharge <= quarter)
{
if (CurrentCharge <= quarter) {
color = Color.DARK_RED;
}
mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0);
@ -139,10 +122,8 @@ public class ChargeHud
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
public void renderItemStack(ItemStack stack, int x, int y)
{
if (stack != null)
{
public void renderItemStack(ItemStack stack, int x, int y) {
if (stack != null) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();

View file

@ -1,13 +1,10 @@
package techreborn.client.keybindings;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import techreborn.lib.ModInfo;
public class KeyBindings
{
public class KeyBindings {
public static KeyBinding config = new KeyBinding(ModInfo.Keys.CONFIG, Keyboard.KEY_P, ModInfo.Keys.CATEGORY);

View file

@ -5,12 +5,9 @@ import net.minecraftforge.fml.common.gameevent.InputEvent;
import techreborn.Core;
import techreborn.lib.Key;
public class KeyInputEventHandler
{
private static Key getPressedKeybinding()
{
if (KeyBindings.config.isPressed())
{
public class KeyInputEventHandler {
private static Key getPressedKeybinding() {
if (KeyBindings.config.isPressed()) {
return Key.CONFIG;
}
@ -18,8 +15,7 @@ public class KeyInputEventHandler
}
@SubscribeEvent
public void handleKeyInputEvent(InputEvent.KeyInputEvent event)
{
public void handleKeyInputEvent(InputEvent.KeyInputEvent event) {
Core.logHelper.info(getPressedKeybinding());
}

View file

@ -35,179 +35,180 @@ import java.util.List;
@SideOnly(Side.CLIENT)
public class ModelDynamicCell implements IModel {
public static final ModelDynamicCell MODEL = new ModelDynamicCell(
new ResourceLocation("techreborn:items/cell_cover"),
new ResourceLocation("techreborn:items/cell_empty")
);
public static final ModelDynamicCell MODEL = new ModelDynamicCell(
new ResourceLocation("techreborn:items/cell_cover"),
new ResourceLocation("techreborn:items/cell_empty")
);
public static final ModelResourceLocation MODEL_LOCATION = new ModelResourceLocation(new ResourceLocation("techreborn", "dynamic_cell"), "default");
public static final ModelResourceLocation MODEL_LOCATION = new ModelResourceLocation(new ResourceLocation("techreborn", "dynamic_cell"), "default");
private static final float NORTH_Z_FLUID = 7.6f / 16f;
private static final float SOUTH_Z_FLUID = 8.4f / 16f;
private static final float NORTH_Z_FLUID = 7.6f / 16f;
private static final float SOUTH_Z_FLUID = 8.4f / 16f;
public static void init() {
ModelLoader.setCustomMeshDefinition(ModItems.dynamicCell, stack -> MODEL_LOCATION);
ModelBakery.registerItemVariants(ModItems.dynamicCell, MODEL_LOCATION);
ModelLoaderRegistry.registerLoader(new DynamicCellLoader());
}
public static void init() {
ModelLoader.setCustomMeshDefinition(ModItems.dynamicCell, stack -> MODEL_LOCATION);
ModelBakery.registerItemVariants(ModItems.dynamicCell, MODEL_LOCATION);
ModelLoaderRegistry.registerLoader(new DynamicCellLoader());
}
private final ResourceLocation baseTexture;
private final ResourceLocation emptyTexture;
private final Fluid fluid;
public ModelDynamicCell(ResourceLocation baseTexture, ResourceLocation emptyTexture) {
this(baseTexture, emptyTexture, null);
}
private final ResourceLocation baseTexture;
private final ResourceLocation emptyTexture;
private final Fluid fluid;
public ModelDynamicCell(ResourceLocation baseTexture, ResourceLocation emptyTexture, Fluid fluid) {
this.baseTexture = baseTexture;
this.emptyTexture = emptyTexture;
this.fluid = fluid;
}
public ModelDynamicCell(ResourceLocation baseTexture, ResourceLocation emptyTexture) {
this(baseTexture, emptyTexture, null);
}
@Override
public Collection<ResourceLocation> getDependencies() {
return ImmutableList.of();
}
public ModelDynamicCell(ResourceLocation baseTexture, ResourceLocation emptyTexture, Fluid fluid) {
this.baseTexture = baseTexture;
this.emptyTexture = emptyTexture;
this.fluid = fluid;
}
@Override
public Collection<ResourceLocation> getTextures() {
return ImmutableList.of(baseTexture, emptyTexture);
}
@Override
public Collection<ResourceLocation> getDependencies() {
return ImmutableList.of();
}
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
@Override
public Collection<ResourceLocation> getTextures() {
return ImmutableList.of(baseTexture, emptyTexture);
}
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
TRSRTransformation transform = state.apply(Optional.<IModelPart>absent()).or(TRSRTransformation.identity());
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
builder.addAll(new ItemLayerModel(ImmutableList.of(baseTexture)).bake(transform, format, bakedTextureGetter).getQuads(null, null, 0L));
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
TRSRTransformation transform = state.apply(Optional.<IModelPart>absent()).or(TRSRTransformation.identity());
ResourceLocation sprite = fluid != null ? fluid.getStill() : emptyTexture;
int color = fluid != null ? fluid.getColor() : Color.WHITE.getRGB();
TextureAtlasSprite fluidSprite = bakedTextureGetter.apply(sprite);
if (fluid != null) {
if (fluidSprite != null) {
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, NORTH_Z_FLUID, fluidSprite, EnumFacing.NORTH, color));
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, SOUTH_Z_FLUID, fluidSprite, EnumFacing.SOUTH, color));
}
}
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
builder.addAll(new ItemLayerModel(ImmutableList.of(baseTexture)).bake(transform, format, bakedTextureGetter).getQuads(null, null, 0L));
return new BakedDynamicCell(builder.build(), this, bakedTextureGetter.apply(baseTexture), format, transformMap);
}
ResourceLocation sprite = fluid != null ? fluid.getStill() : emptyTexture;
int color = fluid != null ? fluid.getColor() : Color.WHITE.getRGB();
TextureAtlasSprite fluidSprite = bakedTextureGetter.apply(sprite);
if(fluid != null){
if (fluidSprite != null) {
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, NORTH_Z_FLUID, fluidSprite, EnumFacing.NORTH, color));
builder.add(ItemTextureQuadConverter.genQuad(format, transform, 5, 2, 11, 14, SOUTH_Z_FLUID, fluidSprite, EnumFacing.SOUTH, color));
}
}
@Override
public IModelState getDefaultState() {
return TRSRTransformation.identity();
}
return new BakedDynamicCell(builder.build(), this, bakedTextureGetter.apply(baseTexture), format, transformMap);
}
public static class DynamicCellLoader implements ICustomModelLoader {
@Override
public IModelState getDefaultState() {
return TRSRTransformation.identity();
}
@Override
public boolean accepts(ResourceLocation modelLocation) {
return modelLocation.getResourceDomain().equals("techreborn") && modelLocation.getResourcePath().contains("dynamic_cell");
}
@Override
public IModel loadModel(ResourceLocation modelLocation) throws Exception {
return MODEL;
}
public static class DynamicCellLoader implements ICustomModelLoader {
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation) {
return modelLocation.getResourceDomain().equals("techreborn") && modelLocation.getResourcePath().contains("dynamic_cell");
}
}
@Override
public IModel loadModel(ResourceLocation modelLocation) throws Exception {
return MODEL;
}
public static class BakedDynamicCell implements IBakedModel {
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {}
private final List<BakedQuad> quads;
private final ModelDynamicCell parent;
private final TextureAtlasSprite particle;
private final VertexFormat format;
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap;
}
public BakedDynamicCell(List<BakedQuad> quads,
ModelDynamicCell parent,
TextureAtlasSprite particle,
VertexFormat format,
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap) {
this.transformMap = transformMap;
this.quads = quads;
this.parent = parent;
this.particle = particle;
this.format = format;
}
public static class BakedDynamicCell implements IBakedModel{
@Override
public List<BakedQuad> getQuads(
@Nullable
IBlockState state,
@Nullable
EnumFacing side, long rand) {
return quads;
}
private final List<BakedQuad> quads;
private final ModelDynamicCell parent;
private final TextureAtlasSprite particle;
private final VertexFormat format;
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap;
@Override
public boolean isAmbientOcclusion() {
return true;
}
public BakedDynamicCell(List<BakedQuad> quads, ModelDynamicCell parent, TextureAtlasSprite particle, VertexFormat format, ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap) {
this.transformMap = transformMap;
this.quads = quads;
this.parent = parent;
this.particle = particle;
this.format = format;
}
@Override
public boolean isGui3d() {
return false;
}
@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
return quads;
}
@Override
public boolean isBuiltInRenderer() {
return false;
}
@Override
public boolean isAmbientOcclusion() {
return true;
}
@Override
public TextureAtlasSprite getParticleTexture() {
return particle;
}
@Override
public boolean isGui3d() {
return false;
}
@Override
public ItemCameraTransforms getItemCameraTransforms() {
return ModelHelper.DEFAULT_ITEM_TRANSFORMS;
}
@Override
public boolean isBuiltInRenderer() {
return false;
}
@Override
public ItemOverrideList getOverrides() {
return OVERRIDES;
}
@Override
public TextureAtlasSprite getParticleTexture() {
return particle;
}
}
@Override
public ItemCameraTransforms getItemCameraTransforms() {
return ModelHelper.DEFAULT_ITEM_TRANSFORMS;
}
public static final OverrideHandler OVERRIDES = new OverrideHandler();
@Override
public ItemOverrideList getOverrides() {
return OVERRIDES;
}
public static class OverrideHandler extends ItemOverrideList {
private final HashMap<String, IBakedModel> modelCache = new HashMap<>();
}
private final Function<ResourceLocation, TextureAtlasSprite> textureGetter = location ->
Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
private OverrideHandler() {
super(ImmutableList.of());
}
public static final OverrideHandler OVERRIDES = new OverrideHandler();
public static class OverrideHandler extends ItemOverrideList {
private final HashMap<String, IBakedModel> modelCache = new HashMap<>();
private final Function<ResourceLocation, TextureAtlasSprite> textureGetter = location ->
Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
private OverrideHandler() {
super(ImmutableList.of());
}
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) {
FluidStack fluidStack = DynamicCell.getFluidHandler(stack).getFluid();
if(fluidStack == null) {
//return default bucket
return originalModel;
}
String name = fluidStack.getFluid().getName();
if(!modelCache.containsKey(name)) {
BakedDynamicCell bakedCell = (BakedDynamicCell) originalModel;
ModelDynamicCell model = new ModelDynamicCell(bakedCell.parent.baseTexture, bakedCell.parent.emptyTexture, fluidStack.getFluid());
modelCache.put(name, model.bake(new SimpleModelState(bakedCell.transformMap), bakedCell.format, textureGetter));
}
return modelCache.get(name);
}
}
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) {
FluidStack fluidStack = DynamicCell.getFluidHandler(stack).getFluid();
if (fluidStack == null) {
//return default bucket
return originalModel;
}
String name = fluidStack.getFluid().getName();
if (!modelCache.containsKey(name)) {
BakedDynamicCell bakedCell = (BakedDynamicCell) originalModel;
ModelDynamicCell model = new ModelDynamicCell(bakedCell.parent.baseTexture, bakedCell.parent.emptyTexture, fluidStack.getFluid());
modelCache.put(name, model.bake(new SimpleModelState(bakedCell.transformMap), bakedCell.format, textureGetter));
}
return modelCache.get(name);
}
}
}

View file

@ -21,26 +21,24 @@ import java.io.Reader;
@SideOnly(Side.CLIENT)
public class ModelHelper {
public static final ItemCameraTransforms DEFAULT_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/generated"));
public static final ItemCameraTransforms HANDHELD_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/handheld"));
public static final ItemCameraTransforms DEFAULT_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/generated"));
public static final ItemCameraTransforms HANDHELD_ITEM_TRANSFORMS = loadTransformFromJson(new ResourceLocation("minecraft:models/item/handheld"));
public static ItemCameraTransforms loadTransformFromJson(ResourceLocation location) {
try {
public static ItemCameraTransforms loadTransformFromJson(ResourceLocation location) {
try {
return ModelBlock.deserialize(getReaderForResource(location)).getAllTransforms();
} catch (IOException exception) {
Core.logHelper.warn("Can't load resource " + location);
exception.printStackTrace();
return null;
}
}
public static Reader getReaderForResource(ResourceLocation location) throws IOException {
ResourceLocation file = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + ".json");
IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(file);
return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8));
}
return ModelBlock.deserialize(getReaderForResource(location)).getAllTransforms();
} catch (IOException exception) {
Core.logHelper.warn("Can't load resource " + location);
exception.printStackTrace();
return null;
}
}
public static Reader getReaderForResource(ResourceLocation location) throws IOException {
ResourceLocation file = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + ".json");
IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(file);
return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8));
}
}

View file

@ -15,23 +15,19 @@ import techreborn.init.ModBlocks;
/**
* Created by Mark on 13/03/2016.
*/
public class RenderNukePrimed extends Render<EntityNukePrimed>
{
public class RenderNukePrimed extends Render<EntityNukePrimed> {
public RenderNukePrimed(RenderManager renderManager)
{
public RenderNukePrimed(RenderManager renderManager) {
super(renderManager);
this.shadowSize = 0.5F;
}
@Override
public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks)
{
public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) {
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y + 0.5F, (float) z);
if ((float) entity.fuse - partialTicks + 1.0F < 10.0F)
{
if ((float) entity.fuse - partialTicks + 1.0F < 10.0F) {
float f = 1.0F - ((float) entity.fuse - partialTicks + 1.0F) / 10.0F;
f = MathHelper.clamp_float(f, 0.0F, 1.0F);
f = f * f;
@ -43,10 +39,9 @@ public class RenderNukePrimed extends Render<EntityNukePrimed>
this.bindEntityTexture(entity);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(ModBlocks.nuke.getDefaultState(),
entity.getBrightness(partialTicks));
entity.getBrightness(partialTicks));
GlStateManager.translate(0.0F, 0.0F, 1.0F);
if (entity.fuse / 5 % 2 == 0)
{
if (entity.fuse / 5 % 2 == 0) {
GlStateManager.disableLighting();
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 772);
@ -54,7 +49,7 @@ public class RenderNukePrimed extends Render<EntityNukePrimed>
GlStateManager.doPolygonOffset(-3.0F, -3.0F);
GlStateManager.enablePolygonOffset();
blockrendererdispatcher.renderBlockBrightness(
ModBlocks.nuke.getDefaultState().withProperty(BlockNuke.OVERLAY, true), 1.0F);
ModBlocks.nuke.getDefaultState().withProperty(BlockNuke.OVERLAY, true), 1.0F);
GlStateManager.doPolygonOffset(0.0F, 0.0F);
GlStateManager.disablePolygonOffset();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
@ -66,8 +61,7 @@ public class RenderNukePrimed extends Render<EntityNukePrimed>
}
@Override
protected ResourceLocation getEntityTexture(EntityNukePrimed entity)
{
protected ResourceLocation getEntityTexture(EntityNukePrimed entity) {
return TextureMap.LOCATION_BLOCKS_TEXTURE;
}
}

View file

@ -10,30 +10,25 @@ import techreborn.compat.ICompatModule;
/**
* Created by modmuss50 on 05/03/2016.
*/
public class ClientPartLoader implements ICompatModule
{
public class ClientPartLoader implements ICompatModule {
@Override
public void preInit(FMLPreInitializationEvent event)
{
public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new ClientPartModelBakery());
}
@Override
public void init(FMLInitializationEvent event)
{
public void init(FMLInitializationEvent event) {
}
@Override
public void postInit(FMLPostInitializationEvent event)
{
public void postInit(FMLPostInitializationEvent event) {
}
@Override
public void serverStarting(FMLServerStartingEvent event)
{
public void serverStarting(FMLServerStartingEvent event) {
}
}

View file

@ -14,35 +14,30 @@ import techreborn.parts.powerCables.EnumCableType;
/**
* Created by modmuss50 on 04/03/2016.
*/
public class ClientPartModelBakery
{
public class ClientPartModelBakery {
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onModelBake(ModelBakeEvent event)
{
for (EnumCableType type : EnumCableType.values())
{
public void onModelBake(ModelBakeEvent event) {
for (EnumCableType type : EnumCableType.values()) {
event.getModelRegistry().putObject(
new ModelResourceLocation("techreborn:cable", "type=" + type.getName().toLowerCase()),
new RenderCablePart(type));
new ModelResourceLocation("techreborn:cable", "type=" + type.getName().toLowerCase()),
new RenderCablePart(type));
}
for(EnumFluidPipeTypes type : EnumFluidPipeTypes.values()){
for (EnumFluidPipeTypes type : EnumFluidPipeTypes.values()) {
event.getModelRegistry().putObject(
new ModelResourceLocation("techreborn:fluidpipe#type=" + type.getName().toLowerCase()),
new RenderFluidPipePart(type));
new ModelResourceLocation("techreborn:fluidpipe#type=" + type.getName().toLowerCase()),
new RenderFluidPipePart(type));
}
}
@SubscribeEvent
public void textureStichEvent(TextureStitchEvent event)
{
for (EnumCableType type : EnumCableType.values())
{
public void textureStichEvent(TextureStitchEvent event) {
for (EnumCableType type : EnumCableType.values()) {
event.getMap().registerSprite(new ResourceLocation(type.textureName));
}
for(EnumFluidPipeTypes type : EnumFluidPipeTypes.values()){
for (EnumFluidPipeTypes type : EnumFluidPipeTypes.values()) {
event.getMap().registerSprite(new ResourceLocation(type.textureName));
}
}

View file

@ -6,7 +6,6 @@ import net.minecraft.client.renderer.block.model.*;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.property.IExtendedBlockState;
import org.lwjgl.util.vector.Vector3f;
import reborncore.client.models.BakedModelUtils;
import reborncore.common.misc.vecmath.Vecs3dCube;
import techreborn.parts.powerCables.CableMultipart;
@ -16,22 +15,19 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class RenderCablePart implements IBakedModel
{
public class RenderCablePart implements IBakedModel {
EnumCableType type;
private FaceBakery faceBakery = new FaceBakery();
private TextureAtlasSprite texture;
public RenderCablePart(EnumCableType type)
{
public RenderCablePart(EnumCableType type) {
texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName);
this.type = type;
}
@Override
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand)
{
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand) {
type = blockState.getValue(CableMultipart.TYPE);
texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName);
ArrayList<BakedQuad> list = new ArrayList<>();
@ -40,81 +36,67 @@ public class RenderCablePart implements IBakedModel
double thickness = type.cableThickness;
double lastThickness = 16 - thickness;
IExtendedBlockState state = (IExtendedBlockState) blockState;
if (side != null)
{
if (side != null) {
return Collections.emptyList();
}
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness),
list, face, ModelRotation.X0_Y0, texture, null, faceBakery);
if (state != null)
{
if (state.getValue(CableMultipart.UP))
{
list, face, ModelRotation.X0_Y0, texture, null, faceBakery);
if (state != null) {
if (state.getValue(CableMultipart.UP)) {
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness),
list, face, ModelRotation.X0_Y0, texture, EnumFacing.UP, faceBakery);
list, face, ModelRotation.X0_Y0, texture, EnumFacing.UP, faceBakery);
}
if (state.getValue(CableMultipart.DOWN))
{
if (state.getValue(CableMultipart.DOWN)) {
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list,
face, ModelRotation.X0_Y0, texture, EnumFacing.DOWN, faceBakery);
face, ModelRotation.X0_Y0, texture, EnumFacing.DOWN, faceBakery);
}
if (state.getValue(CableMultipart.NORTH))
{
if (state.getValue(CableMultipart.NORTH)) {
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list,
face, ModelRotation.X0_Y90, texture, EnumFacing.NORTH, faceBakery);
face, ModelRotation.X0_Y90, texture, EnumFacing.NORTH, faceBakery);
}
if (state.getValue(CableMultipart.SOUTH))
{
if (state.getValue(CableMultipart.SOUTH)) {
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness),
list, face, ModelRotation.X0_Y270, texture, EnumFacing.SOUTH, faceBakery);
list, face, ModelRotation.X0_Y270, texture, EnumFacing.SOUTH, faceBakery);
}
if (state.getValue(CableMultipart.EAST))
{
if (state.getValue(CableMultipart.EAST)) {
BakedModelUtils.addCubeToList(new Vecs3dCube(lastThickness, thickness, thickness, 16.0, lastThickness, lastThickness),
list, face, ModelRotation.X0_Y0, texture, EnumFacing.EAST, faceBakery);
list, face, ModelRotation.X0_Y0, texture, EnumFacing.EAST, faceBakery);
}
if (state.getValue(CableMultipart.WEST))
{
if (state.getValue(CableMultipart.WEST)) {
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list,
face, ModelRotation.X0_Y0, texture, EnumFacing.WEST, faceBakery);
face, ModelRotation.X0_Y0, texture, EnumFacing.WEST, faceBakery);
}
}
return list;
}
@Override
public boolean isAmbientOcclusion()
{
public boolean isAmbientOcclusion() {
return true;
}
@Override
public boolean isGui3d()
{
public boolean isGui3d() {
return true;
}
@Override
public boolean isBuiltInRenderer()
{
public boolean isBuiltInRenderer() {
return false;
}
@Override
public TextureAtlasSprite getParticleTexture()
{
public TextureAtlasSprite getParticleTexture() {
return texture;
}
@Override
public ItemCameraTransforms getItemCameraTransforms()
{
public ItemCameraTransforms getItemCameraTransforms() {
return ItemCameraTransforms.DEFAULT;
}
@Override
public ItemOverrideList getOverrides()
{
public ItemOverrideList getOverrides() {
return null;
}
}

Some files were not shown because too many files have changed in this diff Show more