mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 12:19:55 +00:00
Merge branch 'master' of https://github.com/SleepyTrousers/EnderIO.git
This commit is contained in:
commit
d99aa045ba
5 files changed
+18
-49
No files matched your search
@@ -516,22 +516,19 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
((CapBankClientNetwork) nw).requestPowerUpdate(cap, 2);
|
||||
}
|
||||
|
||||
String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
|
||||
if(TooltipAddera.showAdvancedTooltips()) {
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIO"), format, fmt.format(nw.getMaxIO()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip
|
||||
.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIn"), format, fmt.format(nw.getMaxInput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip
|
||||
.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxOut"), format, fmt.format(nw.getMaxOutput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
|
||||
String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
|
||||
String suffix = Util.TAB + Util.ALIGNRIGHT + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
tooltip.add(String.format("%s : %s%s%s", Lang.localize("capbank.maxIO"), format, PowerDisplayUtil.formatPower(nw.getMaxIO()), suffix));
|
||||
tooltip.add(String.format("%s : %s%s%s", Lang.localize("capbank.maxIn"), format, PowerDisplayUtil.formatPower(nw.getMaxInput()), suffix));
|
||||
tooltip.add(String.format("%s : %s%s%s", Lang.localize("capbank.maxOut"), format, PowerDisplayUtil.formatPower(nw.getMaxOutput()), suffix));
|
||||
tooltip.add("");
|
||||
}
|
||||
|
||||
long stored = nw.getEnergyStoredL();
|
||||
long max = nw.getMaxEnergyStoredL();
|
||||
tooltip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(stored), EnumChatFormatting.RESET, EnumChatFormatting.WHITE,
|
||||
fmt.format(max),
|
||||
EnumChatFormatting.RESET));
|
||||
tooltip.add(String.format("%s%s%s / %s%s%s %s", EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(stored), EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(max), EnumChatFormatting.RESET, PowerDisplayUtil.abrevation()));
|
||||
|
||||
int change = Math.round(nw.getAverageChangePerTick());
|
||||
String color = EnumChatFormatting.WHITE.toString();
|
||||
@@ -540,9 +537,7 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
} else if(change < 0) {
|
||||
color = EnumChatFormatting.RED.toString();
|
||||
}
|
||||
tooltip
|
||||
.add(String.format("%s%s%sRF/t ", color, fmt.format(change), " " + EnumChatFormatting.RESET.toString()));
|
||||
|
||||
tooltip.add(String.format("%s%s%s", color, PowerDisplayUtil.formatPowerPerTick(change), " " + EnumChatFormatting.RESET.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,17 +81,6 @@ public class BlockCapacitorBank extends BlockEio implements IGuiHandler, IAdvanc
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List list) {
|
||||
|
||||
ItemStack is = BlockItemCapacitorBank.createItemStackWithPower(0);
|
||||
list.add(is);
|
||||
|
||||
is = BlockItemCapacitorBank.createItemStackWithPower(TileCapacitorBank.BASE_CAP.getMaxEnergyStored());
|
||||
list.add(is);
|
||||
|
||||
is = BlockItemCapacitorBank.createItemStackWithPower(TileCapacitorBank.BASE_CAP.getMaxEnergyStored() / 2);
|
||||
is.setItemDamage(1);
|
||||
list.add(is);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -376,9 +365,9 @@ public class BlockCapacitorBank extends BlockEio implements IGuiHandler, IAdvanc
|
||||
TileCapacitorBank cap = (TileCapacitorBank) te;
|
||||
String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
|
||||
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIO"), format, fmt.format(cap.getMaxIO()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIn"), format, fmt.format(cap.getMaxInput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxOut"), format, fmt.format(cap.getMaxOutput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIO"), format, PowerDisplayUtil.formatPower(cap.getMaxIO()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIn"), format, PowerDisplayUtil.formatPower(cap.getMaxInput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxOut"), format, PowerDisplayUtil.formatPower(cap.getMaxOutput()), Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add("Deprecated. Convert by placing in crafting grid");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,16 +52,6 @@ public class BlockItemCapacitorBank extends ItemBlock implements IEnergyContaine
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack stack = createItemStackWithPower(0);
|
||||
par3List.add(stack);
|
||||
|
||||
stack = createItemStackWithPower(TileCapacitorBank.BASE_CAP.getMaxEnergyStored());
|
||||
par3List.add(stack);
|
||||
|
||||
stack = createItemStackWithPower(TileCapacitorBank.BASE_CAP.getMaxEnergyStored() / 2);
|
||||
stack.setItemDamage(1);
|
||||
par3List.add(stack);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.waila;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,9 +13,6 @@ public interface IWailaInfoProvider {
|
||||
public static final int BIT_DETAILED = 0x4;
|
||||
public static final int ALL_BITS = BIT_BASIC | BIT_COMMON | BIT_DETAILED;
|
||||
|
||||
public static final NumberFormat fmt = NumberFormat.getNumberInstance();
|
||||
|
||||
|
||||
/**
|
||||
* Adds the block's info to the WAILA information
|
||||
* @param tooltip - current list of strings in the WAILA body
|
||||
|
||||
@@ -40,6 +40,7 @@ import crazypants.enderio.gui.TooltipAddera;
|
||||
import crazypants.enderio.machine.IIoConfigurable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.capbank.TileCapBank;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.util.IFacade;
|
||||
import crazypants.util.Lang;
|
||||
@@ -123,7 +124,6 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
registrar.registerNBTProvider(INSTANCE, TileEntityEio.class);
|
||||
|
||||
ConfigHandler.instance().addConfig(EnderIO.MOD_NAME, "facades.hidden", Lang.localize("waila.config.hiddenfacades"));
|
||||
IWailaInfoProvider.fmt.setMaximumFractionDigits(1);
|
||||
}
|
||||
|
||||
// IGNORE deprecation, the new method requires forge 1234 which is too new for cauldron!
|
||||
@@ -243,9 +243,8 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
int stored = accessor.getNBTData().getInteger("storedEnergyRF");
|
||||
int max = accessor.getNBTData().getInteger("maxStoredRF");
|
||||
|
||||
currenttip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(stored), EnumChatFormatting.RESET, EnumChatFormatting.WHITE,
|
||||
fmt.format(max),
|
||||
EnumChatFormatting.RESET));
|
||||
currenttip.add(String.format("%s%s%s / %s%s%s %s", EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(stored), EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(max), EnumChatFormatting.RESET, PowerDisplayUtil.abrevation()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,9 +261,8 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
if(nbtRoot.hasKey("storedEnergyRF")) {
|
||||
int stored = nbtRoot.getInteger("storedEnergyRF");
|
||||
int max = nbtRoot.getInteger("maxStoredRF");
|
||||
currenttip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(stored),
|
||||
EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, fmt.format(max), EnumChatFormatting.RESET));
|
||||
currenttip.add(String.format("%s%s%s / %s%s%s %s", EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(stored), EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(max), EnumChatFormatting.RESET, PowerDisplayUtil.abrevation()));
|
||||
}
|
||||
|
||||
} else if(itemStack.getItem() == EnderIO.itemLiquidConduit) {
|
||||
@@ -276,9 +274,10 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
String fluidName = fluid.getLocalizedName();
|
||||
int fluidAmount = fluid.amount;
|
||||
if(fluidAmount > 0) {
|
||||
// NOTE: using PowerDisplayUtil.formatPower here to handle the non breaking space issue
|
||||
currenttip.add(String.format("%s%s%s%s %s%s%s %s", lockedStr,
|
||||
EnumChatFormatting.WHITE, fluidName, EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, fmt.format(fluidAmount), EnumChatFormatting.RESET,
|
||||
EnumChatFormatting.WHITE, PowerDisplayUtil.formatPower(fluidAmount), EnumChatFormatting.RESET,
|
||||
Fluids.MB()));
|
||||
} else if(fluidTypeLocked) {
|
||||
currenttip.add(String.format("%s%s%s%s", lockedStr,
|
||||
|
||||
Reference in new issue
Block a user