Overclocker upgrades give more power input/storage to machine + add some more info to the tool tip in the gui
Also fix for not calling update client side lower down the chain
This commit is contained in:
parent
fc9e7df2f9
commit
adb12ef43d
4 changed files with 18 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,9 +140,9 @@ public class TileTransformer extends TilePowerAcceptor
|
|||
// IListInfoProvider
|
||||
@Override
|
||||
public void addInfo(List<String> 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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue