Fixes #212 now you need to hold shift to see our info
This commit is contained in:
parent
2f88e819a3
commit
12cfe38a50
1 changed files with 19 additions and 18 deletions
|
@ -19,6 +19,7 @@ public class StackToolTipEvent {
|
|||
if (event.itemStack.getItem() instanceof IListInfoProvider) {
|
||||
((IListInfoProvider) event.itemStack.getItem()).addInfo(event.toolTip, false);
|
||||
} else if (event.itemStack.getItem() instanceof IEnergyInterfaceItem) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
int percentage = percentage((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack), (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack));
|
||||
ChatFormatting color;
|
||||
if (percentage <= 10) {
|
||||
|
@ -30,7 +31,6 @@ public class StackToolTipEvent {
|
|||
}
|
||||
event.toolTip.add(color + "" + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack) + ChatFormatting.LIGHT_PURPLE + " stored eu");
|
||||
event.toolTip.add(Color.GREEN + "" + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack) + ChatFormatting.LIGHT_PURPLE + " max eu");
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)){
|
||||
event.toolTip.add(ChatFormatting.GREEN + "" + percentage + "%" + ChatFormatting.LIGHT_PURPLE + " charged");
|
||||
event.toolTip.add(Color.GREEN + "" + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxTransfer(event.itemStack) + ChatFormatting.LIGHT_PURPLE + " eu/tick in/out");
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ public class StackToolTipEvent {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public int percentage(int MaxValue, int CurrentValue) {
|
||||
if (CurrentValue == 0)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue