diff --git a/src/main/java/techreborn/client/gui/TRBuilder.java b/src/main/java/techreborn/client/gui/TRBuilder.java index 1c3e96fd4..4a83abef1 100644 --- a/src/main/java/techreborn/client/gui/TRBuilder.java +++ b/src/main/java/techreborn/client/gui/TRBuilder.java @@ -38,10 +38,12 @@ import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.client.config.GuiUtils; import net.minecraftforge.fml.common.Loader; +import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import reborncore.api.tile.IUpgradeable; import reborncore.client.guibuilder.GuiBuilder; import reborncore.common.powerSystem.PowerSystem; +import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.init.ModItems; import techreborn.lib.ModInfo; import techreborn.proxies.ClientProxy; @@ -88,6 +90,14 @@ public class TRBuilder extends GuiBuilder { TextFormatting powerColour = TextFormatting.GOLD; list.add(powerColour + PowerSystem.getLocaliszedPowerFormattedNoSuffix(energyStored) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix(maxEnergyStored) + " " + PowerSystem.getDisplayPower().abbreviation); list.add(getPercentageColour(percentage) + "" + percentage + "%" + TextFormatting.GRAY + " Charged"); + if(gui.tile instanceof TilePowerAcceptor && Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak.getKeyCode())){ + ((TilePowerAcceptor) gui.tile).addInfo(list, true); + list.add(""); + list.add(TextFormatting.BLUE + "Click to change display unit"); + } else { + list.add(""); + list.add(TextFormatting.BLUE + Minecraft.getMinecraft().gameSettings.keyBindSneak.getDisplayName() + TextFormatting.GRAY + " more info"); + } net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(list, mouseX, mouseY, gui.width, gui.height, -1, gui.mc.fontRenderer); GlStateManager.disableLighting(); GlStateManager.color(1, 1, 1, 1); diff --git a/src/main/java/techreborn/items/ItemUpgrades.java b/src/main/java/techreborn/items/ItemUpgrades.java index e65a07148..24434eea0 100644 --- a/src/main/java/techreborn/items/ItemUpgrades.java +++ b/src/main/java/techreborn/items/ItemUpgrades.java @@ -123,7 +123,11 @@ public class ItemUpgrades extends ItemTR implements IUpgrade { if (stack.getItemDamage() == 0) { handler.addSpeedMulti(0.25); handler.addPowerMulti(0.75); - + if(machineBase instanceof TilePowerAcceptor){ + TilePowerAcceptor powerAcceptor = (TilePowerAcceptor) machineBase; + powerAcceptor.extraPowerInput += powerAcceptor.getMaxInput(); + powerAcceptor.extraPowerStoage += powerAcceptor.getBaseMaxPower(); + } } if (machineBase instanceof TilePowerAcceptor) { if (stack.getItemDamage() == 2) { diff --git a/src/main/java/techreborn/tiles/TileGenericMachine.java b/src/main/java/techreborn/tiles/TileGenericMachine.java index 3e171a155..4146bdcdf 100644 --- a/src/main/java/techreborn/tiles/TileGenericMachine.java +++ b/src/main/java/techreborn/tiles/TileGenericMachine.java @@ -76,8 +76,8 @@ public abstract class TileGenericMachine extends TilePowerAcceptor // TilePowerAcceptor @Override public void update() { + super.update(); if (!this.world.isRemote) { - super.update(); this.charge(energySlot); } } diff --git a/src/main/java/techreborn/tiles/transformers/TileTransformer.java b/src/main/java/techreborn/tiles/transformers/TileTransformer.java index 053e3bf74..37d161d3f 100644 --- a/src/main/java/techreborn/tiles/transformers/TileTransformer.java +++ b/src/main/java/techreborn/tiles/transformers/TileTransformer.java @@ -140,9 +140,9 @@ public class TileTransformer extends TilePowerAcceptor // IListInfoProvider @Override public void addInfo(List info, boolean isRealTile) { - info.add(TextFormatting.GRAY + "Input Rate: " + TextFormatting.GOLD + getLocaliszedPowerFormatted((int) getBaseMaxInput())); + info.add(TextFormatting.GRAY + "Input Rate: " + TextFormatting.GOLD + getLocaliszedPowerFormatted((int) getMaxInput())); info.add(TextFormatting.GRAY + "Input Tier: " + TextFormatting.GOLD + StringUtils.toFirstCapitalAllLowercase(inputTier.toString())); - info.add(TextFormatting.GRAY + "Output Rate: " + TextFormatting.GOLD + getLocaliszedPowerFormatted((int) getBaseMaxOutput())); + info.add(TextFormatting.GRAY + "Output Rate: " + TextFormatting.GOLD + getLocaliszedPowerFormatted((int) getMaxOutput())); info.add(TextFormatting.GRAY + "Output Tier: " + TextFormatting.GOLD + StringUtils.toFirstCapitalAllLowercase(ouputTier.toString())); }