Auto format code

This commit is contained in:
modmuss50 2017-06-12 14:23:32 +01:00
parent fc4d8686b8
commit b25742dde0
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
175 changed files with 527 additions and 737 deletions

View file

@ -68,8 +68,7 @@ public enum EGui {
private final boolean containerBuilder;
private EGui(final boolean containerBuilder)
{
private EGui(final boolean containerBuilder) {
this.containerBuilder = containerBuilder;
}

View file

@ -29,7 +29,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import techreborn.client.container.*;
import techreborn.client.gui.*;
import techreborn.manual.GuiManual;
@ -48,7 +47,7 @@ public class GuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
final int y, final int z) {
final int y, final int z) {
final EGui gui = EGui.values()[ID];
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
@ -73,7 +72,7 @@ public class GuiHandler implements IGuiHandler {
@Override
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
final int y, final int z) {
final int y, final int z) {
final EGui gui = EGui.values()[ID];
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));

View file

@ -179,7 +179,7 @@ public class RegisterItemJsons {
}
for (EnumCableType cableType : EnumCableType.values()) {
registerBlockstate(ModBlocks.CABLE, cableType.ordinal(), "inv_" +cableType.getName().toLowerCase());
registerBlockstate(ModBlocks.CABLE, cableType.ordinal(), "inv_" + cableType.getName().toLowerCase());
}
}

View file

@ -30,7 +30,6 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.slots.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;
public class ContainerLESU extends RebornContainer {

View file

@ -25,7 +25,6 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import techreborn.client.container.builder.BuiltContainer;
public interface IContainerProvider {

View file

@ -24,16 +24,14 @@
package techreborn.client.container.builder;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.MutableTriple;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.MutableTriple;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.common.util.ItemUtils;
import techreborn.client.container.IRightClickHandler;
@ -58,8 +56,8 @@ public class BuiltContainer extends Container {
private Integer[] integerParts;
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
final List<Range<Integer>> playerSlotRange,
final List<Range<Integer>> tileSlotRange) {
final List<Range<Integer>> playerSlotRange,
final List<Range<Integer>> tileSlotRange) {
this.name = name;
this.canInteract = canInteract;
@ -107,10 +105,10 @@ public class BuiltContainer extends Container {
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
if(dragType == 1 && slotId > 0 && slotId < 1000){
if (dragType == 1 && slotId > 0 && slotId < 1000) {
Slot slot = this.inventorySlots.get(slotId);
if(slot instanceof IRightClickHandler){
if(((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)){
if (slot instanceof IRightClickHandler) {
if (((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)) {
return ItemStack.EMPTY;
}
}
@ -180,20 +178,16 @@ public class BuiltContainer extends Container {
@Override
public void updateProgressBar(final int id, final int value) {
if(id < this.shortValues.size())
{
if (id < this.shortValues.size()) {
this.shortValues.get(id).getMiddle().accept((short) value);
this.shortValues.get(id).setRight((short) value);
}
else if (id - this.shortValues.size() < this.integerValues.size() * 2)
{
} else if (id - this.shortValues.size() < this.integerValues.size() * 2) {
if ((id - this.shortValues.size()) % 2 == 0)
this.integerParts[(id - this.shortValues.size()) / 2] = value;
else
{
else {
this.integerValues.get((id - this.shortValues.size()) / 2).getMiddle().accept(
(this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF);
(this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF);
}
}
}
@ -247,7 +241,7 @@ public class BuiltContainer extends Container {
final Slot slot = this.inventorySlots.get(slotIndex);
final ItemStack stackInSlot = slot.getStack();
if (stackInSlot != ItemStack.EMPTY && ItemUtils.isItemEqual(stackInSlot, stackToShift, true, true)
&& slot.isItemValid(stackToShift)) {
&& slot.isItemValid(stackToShift)) {
final int resultingStackSize = stackInSlot.getCount() + stackToShift.getCount();
final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
if (resultingStackSize <= max) {
@ -299,4 +293,4 @@ public class BuiltContainer extends Container {
public String getName() {
return this.name;
}
}
}

View file

@ -24,14 +24,13 @@
package techreborn.client.container.builder;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import java.util.List;
@ -91,8 +90,8 @@ public class ContainerBuilder {
public BuiltContainer create() {
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
this.playerInventoryRanges,
this.tileInventoryRanges);
this.playerInventoryRanges,
this.tileInventoryRanges);
if (!this.shortValues.isEmpty())
built.addShortSync(this.shortValues);
if (!this.integerValues.isEmpty())

View file

@ -24,9 +24,6 @@
package techreborn.client.container.builder;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotFurnaceFuel;
@ -34,7 +31,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.api.power.IEnergyInterfaceItem;
import reborncore.api.recipe.IRecipeCrafterProvider;
import reborncore.api.tile.IUpgrade;
@ -43,7 +41,6 @@ import reborncore.client.gui.slots.BaseSlot;
import reborncore.client.gui.slots.SlotFake;
import reborncore.client.gui.slots.SlotOutput;
import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.Core;
import techreborn.client.container.builder.slot.FilteredSlot;
import techreborn.client.container.builder.slot.UpgradeSlot;
@ -63,7 +60,7 @@ public class ContainerTileInventoryBuilder {
this.tile = tile;
this.parent = parent;
this.rangeStart = parent.slots.size();
if(tile instanceof IUpgradeable){
if (tile instanceof IUpgradeable) {
upgradeSlots((IUpgradeable) tile);
}
}
@ -84,7 +81,7 @@ public class ContainerTileInventoryBuilder {
}
public ContainerTileInventoryBuilder filterSlot(final int index, final int x, final int y,
final Predicate<ItemStack> filter) {
final Predicate<ItemStack> filter) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(filter));
return this;
}
@ -92,20 +89,19 @@ public class ContainerTileInventoryBuilder {
@SuppressWarnings("null")
public ContainerTileInventoryBuilder energySlot(final int index, final int x, final int y) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|| stack.getItem() instanceof IEnergyInterfaceItem));
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|| stack.getItem() instanceof IEnergyInterfaceItem));
return this;
}
@SuppressWarnings("null")
public ContainerTileInventoryBuilder fluidSlot(final int index, final int x, final int y) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(
stack -> stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, EnumFacing.UP)));
stack -> stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, EnumFacing.UP)));
return this;
}
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y)
{
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y) {
this.parent.slots.add(new SlotFurnaceFuel(this.tile, index, x, y));
return this;
}
@ -113,12 +109,12 @@ public class ContainerTileInventoryBuilder {
@Deprecated
public ContainerTileInventoryBuilder upgradeSlot(final int index, final int x, final int y) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
.setFilter(stack -> stack.getItem() instanceof IUpgrade));
.setFilter(stack -> stack.getItem() instanceof IUpgrade));
return this;
}
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable){
if(upgradeable.canBeUpgraded()){
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable) {
if (upgradeable.canBeUpgraded()) {
for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) {
this.parent.slots.add(new UpgradeSlot(upgradeable.getUpgradeInvetory(), i, -19, i * 18 + 12));
}
@ -127,12 +123,9 @@ public class ContainerTileInventoryBuilder {
}
/**
*
* @param supplier
* The supplier must supply a variable holding inside a Short, it
* will be truncated by force.
* @param setter
* The setter to call when the variable has been updated.
* @param supplier The supplier must supply a variable holding inside a Short, it
* will be truncated by force.
* @param setter The setter to call when the variable has been updated.
*/
public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.shortValues.add(Pair.of(supplier, setter));
@ -140,12 +133,9 @@ public class ContainerTileInventoryBuilder {
}
/**
*
* @param supplier
* The supplier it can supply a variable holding in an Integer it
* will be split inside multiples shorts.
* @param setter
* The setter to call when the variable has been updated.
* @param supplier The supplier it can supply a variable holding in an Integer it
* will be split inside multiples shorts.
* @param setter The setter to call when the variable has been updated.
*/
public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.integerValues.add(Pair.of(supplier, setter));
@ -155,7 +145,7 @@ public class ContainerTileInventoryBuilder {
public ContainerTileInventoryBuilder syncEnergyValue() {
if (this.tile instanceof TilePowerAcceptor)
return this.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).getEnergy(),
((TilePowerAcceptor) this.tile)::setEnergy)
((TilePowerAcceptor) this.tile)::setEnergy)
.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).extraPowerStoage,
((TilePowerAcceptor) this.tile)::setExtraPowerStoage);
Core.logHelper.error(this.tile + " is not an instance of TilePowerAcceptor! Energy cannot be synced.");
@ -165,14 +155,14 @@ public class ContainerTileInventoryBuilder {
public ContainerTileInventoryBuilder syncCrafterValue() {
if (this.tile instanceof IRecipeCrafterProvider)
return this
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime,
(currentTickTime) -> ((IRecipeCrafterProvider) this.tile)
.getRecipeCrafter().currentTickTime = currentTickTime)
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks,
(currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile)
.getRecipeCrafter().currentNeededTicks = currentNeededTicks);
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime,
(currentTickTime) -> ((IRecipeCrafterProvider) this.tile)
.getRecipeCrafter().currentTickTime = currentTickTime)
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks,
(currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile)
.getRecipeCrafter().currentNeededTicks = currentNeededTicks);
Core.logHelper
.error(this.tile + " is not an instance of IRecipeCrafterProvider! Craft progress cannot be synced.");
.error(this.tile + " is not an instance of IRecipeCrafterProvider! Craft progress cannot be synced.");
return this;
}

View file

@ -24,14 +24,13 @@
package techreborn.client.container.builder.slot;
import javax.annotation.Nullable;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.lib.ModInfo;
import javax.annotation.Nullable;
public class SpriteSlot extends FilteredSlot {
private final String sprite;

View file

@ -31,7 +31,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import reborncore.api.tile.IUpgrade;
import reborncore.api.tile.IUpgradeable;
import reborncore.common.tile.TileBase;
import reborncore.common.util.Inventory;
import techreborn.client.container.IRightClickHandler;
import techreborn.client.container.builder.BuiltContainer;
@ -46,7 +45,6 @@ public class UpgradeSlot extends Slot implements IRightClickHandler {
super(inventory, index, xPosition, yPosition);
}
@Override
public boolean isItemValid(final ItemStack stack) {
return stack.getItem() instanceof IUpgrade;
@ -59,15 +57,15 @@ public class UpgradeSlot extends Slot implements IRightClickHandler {
@Override
public boolean handleRightClick(int slotID, EntityPlayer player, BuiltContainer container) {
if(inventory instanceof Inventory){
if (inventory instanceof Inventory) {
Inventory inv = (Inventory) inventory;
TileEntity tileEntity = inv.getTileBase();
if(tileEntity instanceof IUpgradeable){
if (tileEntity instanceof IUpgradeable) {
IUpgradeable upgradeable = (IUpgradeable) tileEntity;
if(upgradeable.canBeUpgraded()){
if (upgradeable.canBeUpgraded()) {
ItemStack stack = upgradeable.getUpgradeInvetory().getStackInSlot(slotID);
if(!stack.isEmpty() && stack.getItem() instanceof IUpgrade){
if(player.world.isRemote){
if (!stack.isEmpty() && stack.getItem() instanceof IUpgrade) {
if (player.world.isRemote) {
((IUpgrade) stack.getItem()).handleRightClick(tileEntity, stack, container, slotID);
}
}

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAlloyFurnace;
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;
@ -73,8 +72,8 @@ public class GuiAlloyFurnace extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final 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

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAlloySmelter;
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;
@ -78,8 +77,8 @@ public class GuiAlloySmelter extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final 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

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAssemblingMachine;
public class GuiAssemblingMachine extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/assembling_machine.png");
"textures/gui/assembling_machine.png");
TileAssemblingMachine assemblingmachine;
@ -78,8 +77,8 @@ public class GuiAssemblingMachine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -112,22 +112,22 @@ public class GuiBase extends GuiContainer {
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
builder.drawDefaultBackground(this, guiLeft, guiTop, xSize, ySize);
if(drawPlayerSlots()){
if (drawPlayerSlots()) {
builder.drawPlayerSlots(this, guiLeft + xSize / 2, guiTop + 93, true);
}
if(tryAddUpgrades() && tile instanceof IUpgradeable){
if (tryAddUpgrades() && tile instanceof IUpgradeable) {
IUpgradeable upgradeable = (IUpgradeable) tile;
if(upgradeable.canBeUpgraded()){
if (upgradeable.canBeUpgraded()) {
builder.drawUpgrades(this, upgradeable, guiLeft, guiTop);
}
}
}
public boolean drawPlayerSlots(){
public boolean drawPlayerSlots() {
return true;
}
public boolean tryAddUpgrades(){
public boolean tryAddUpgrades() {
return true;
}

View file

@ -30,13 +30,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_chunkloader.png");
"textures/gui/industrial_chunkloader.png");
TileChunkLoader chunkloader;
private GuiButton plusOneButton;
private GuiButton plusTenButton;
@ -80,9 +79,9 @@ public class GuiChunkLoader extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -29,15 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.generator.TileDieselGenerator;
public class GuiDieselGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/diesel_generator.png");
"textures/gui/diesel_generator.png");
TileDieselGenerator dieselGenerator;
@ -61,14 +59,14 @@ public class GuiDieselGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.dieselGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.dieselGenerator.getEnergy()) + "", 10, 50,
16448255);
16448255);
}
}

View file

@ -26,7 +26,6 @@ package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.tiles.TileDigitalChest;
public class GuiDigitalChest extends GuiBase {
@ -54,12 +53,12 @@ public class GuiDigitalChest extends GuiBase {
if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43,
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
}
if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
}
}
}

View file

@ -32,12 +32,10 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.ClientMultiBlocks;
import techreborn.proxies.ClientProxy;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
@ -47,7 +45,7 @@ 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");
TileEntityFusionController fusionController;
@ -61,16 +59,16 @@ public class GuiFusionReactor extends GuiContainer {
final 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(this.fusionController.getEnergy()), 11, 8,
16448255);
16448255);
this.fontRendererObj.drawString("Coils: " + (this.fusionController.getCoilStatus() == 1 ? "Yes" : "No"), 11, 16,
16448255);
16448255);
if (this.fusionController.getNeededPower() > 1 && this.fusionController.getCrafingTickTime() < 1)
this.fontRendererObj.drawString("Start: "
+ this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy())
+ "%", 11, 24, 16448255);
+ this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy())
+ "%", 11, 24, 16448255);
}
@ -82,10 +80,10 @@ public class GuiFusionReactor extends GuiContainer {
this.buttonList.add(button);
super.initGui();
final BlockPos coordinates = new BlockPos(
this.fusionController.getPos().getX()
this.fusionController.getPos().getX()
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetX() * 2,
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2);
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2);
if (coordinates.equals(MultiblockRenderEvent.anchor)) {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B";
@ -96,7 +94,7 @@ public class GuiFusionReactor extends GuiContainer {
@Override
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
final int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(GuiFusionReactor.texture);
final int k = (this.width - this.xSize) / 2;
@ -126,10 +124,10 @@ public class GuiFusionReactor extends GuiContainer {
final MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = new Location(this.fusionController.getPos().getX(),
this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(),
this.fusionController.getWorld());
this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(),
this.fusionController.getWorld());
MultiblockRenderEvent.anchor = new BlockPos(this.fusionController.getPos().getX(),
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ());
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ());
button.displayString = "A";
} else {

View file

@ -29,14 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.generator.TileGasTurbine;
public class GuiGasTurbine extends GuiContainer {
// TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileGasTurbine gasTurbine;
@ -60,9 +59,9 @@ public class GuiGasTurbine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = "Gas Turbine";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.gasTurbine.tank.getFluidAmount() + "", 10, 30, 16448255);
}

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/implosion_compressor.png");
"textures/gui/implosion_compressor.png");
TileImplosionCompressor compressor;

View file

@ -29,17 +29,15 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileIndustrialElectrolyzer;
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;
public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tileeletrolyzer) {
super(tileeletrolyzer.createContainer(player));
this.xSize = 176;
@ -79,8 +77,8 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final 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

@ -32,13 +32,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fluids.FluidStack;
import techreborn.tiles.multiblock.TileIndustrialSawmill;
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;
@ -82,7 +81,7 @@ public class GuiIndustrialSawmill extends GuiContainer {
if (!this.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);
}
}
}

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileIronFurnace;
public class GuiIronFurnace extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("minecraft",
"textures/gui/container/furnace.png");
"textures/gui/container/furnace.png");
TileIronFurnace furnace;
@ -71,9 +70,9 @@ public class GuiIronFurnace extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
}
}

View file

@ -26,7 +26,6 @@ package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.tiles.TileQuantumChest;
public class GuiQuantumChest extends GuiBase {

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileQuantumTank;
public class GuiQuantumTank extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileQuantumTank quantumTank;
@ -59,9 +58,9 @@ public class GuiQuantumTank extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255);
}

View file

@ -30,13 +30,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileRollingMachine;
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;
public GuiRollingMachine(final EntityPlayer player, final TileRollingMachine tileRollingmachine) {
@ -67,9 +66,9 @@ public class GuiRollingMachine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final 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

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.tiles.TileScrapboxinator;
public class GuiScrapboxinator extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/scrapboxinator.png");
"textures/gui/scrapboxinator.png");
TileScrapboxinator scrapboxinator;
@ -72,8 +71,8 @@ public class GuiScrapboxinator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
4210752);
4210752);
}
}

View file

@ -29,16 +29,14 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil;
import techreborn.tiles.generator.TileSemifluidGenerator;
public class GuiSemifluidGenerator extends GuiContainer {
// TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/semifluid_generator.png");
"textures/gui/semifluid_generator.png");
TileSemifluidGenerator semifluidGenerator;
@ -63,10 +61,10 @@ public class GuiSemifluidGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = "Semifluid Generator";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.semifluidGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
}
}
}

View file

@ -29,15 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil;
import techreborn.tiles.generator.TileThermalGenerator;
public class GuiThermalGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png");
"textures/gui/thermal_generator.png");
TileThermalGenerator thermalGenerator;
@ -62,9 +60,9 @@ public class GuiThermalGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752);
4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.thermalGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.thermalGenerator.getEnergy() + "", 10, 40, 16448255);

View file

@ -333,7 +333,7 @@ public class TRBuilder extends GuiBuilder {
public void drawUpgrades(GuiScreen gui, IUpgradeable upgradeable, int posX, int posY) {
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
gui.drawTexturedModalRect(posX -27, posY + 4, 126, 151, 30, 87);
gui.drawTexturedModalRect(posX - 27, posY + 4, 126, 151, 30, 87);
}
public void drawScrapSlot(GuiScreen gui, int posX, int posY) {

View file

@ -27,7 +27,6 @@ package techreborn.client.gui.upgrades;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -62,7 +61,7 @@ public class GuiSideConfig extends GuiBase {
super.initGui();
this.buttonList.clear();
int i = 0;
for(EnumFacing facing : EnumFacing.VALUES){
for (EnumFacing facing : EnumFacing.VALUES) {
buttonList.add(new GuiButton(facing.getIndex(), guiLeft + 150, guiTop + i++ * 23 + 22, 20, 20, ""));
}
}
@ -72,7 +71,6 @@ public class GuiSideConfig extends GuiBase {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
}
@Override
@ -82,11 +80,11 @@ public class GuiSideConfig extends GuiBase {
int offset = 10;
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
for(EnumFacing facing : EnumFacing.VALUES){
for (EnumFacing facing : EnumFacing.VALUES) {
BlockPos pos = tileEntity.getPos().offset(facing);
IBlockState state = tileEntity.getWorld().getBlockState(pos);
ItemStack stack = state.getBlock().getPickBlock(state, new RayTraceResult(new Vec3d(0, 0, 0), facing, pos), tileEntity.getWorld(), pos, Minecraft.getMinecraft().player);
if(stack != null && !stack.isEmpty() && stack.getItem() != null){
if (stack != null && !stack.isEmpty() && stack.getItem() != null) {
drawCentredString(stack.getDisplayName() + " - " + facing.getName(), offset += 22, 4210752, layer);
itemRender.renderItemIntoGUI(stack, 10, offset - 2);
} else {