Removed ChatColor and replaced with ChatFormatting
This commit is contained in:
parent
edddb552c8
commit
dabe79a877
3 changed files with 13 additions and 78 deletions
|
@ -1,5 +1,6 @@
|
|||
package techreborn.client;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
|
@ -9,8 +10,6 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
import techreborn.api.IListInfoProvider;
|
||||
import techreborn.api.power.IEnergyInterfaceItem;
|
||||
import techreborn.cofhLib.util.helpers.MathHelper;
|
||||
import techreborn.lib.ChatColor;
|
||||
import techreborn.util.Color;
|
||||
|
||||
public class StackToolTipEvent {
|
||||
|
@ -21,19 +20,19 @@ public class StackToolTipEvent {
|
|||
((IListInfoProvider) event.itemStack.getItem()).addInfo(event.toolTip, false);
|
||||
} else if (event.itemStack.getItem() instanceof IEnergyInterfaceItem){
|
||||
int percentage = percentage((int)((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack), (int)((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack));
|
||||
ChatColor color;
|
||||
ChatFormatting color;
|
||||
if(percentage<= 10){
|
||||
color = ChatColor.RED;
|
||||
color = ChatFormatting.RED;
|
||||
} else if(percentage >= 75){
|
||||
color = ChatColor.GREEN;
|
||||
color = ChatFormatting.GREEN;
|
||||
} else {
|
||||
color = ChatColor.YELLOW;
|
||||
color = ChatFormatting.YELLOW;
|
||||
}
|
||||
event.toolTip.add(color + "" + (int)((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack) + ChatColor.LIGHT_PURPLE + " stored eu");
|
||||
event.toolTip.add(Color.GREEN + "" + (int)((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack) + ChatColor.LIGHT_PURPLE + " max eu");
|
||||
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(ChatColor.GREEN +"" + percentage + "%" + ChatColor.LIGHT_PURPLE +" charged");
|
||||
event.toolTip.add(Color.GREEN + "" + (int)((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxTransfer(event.itemStack) + ChatColor.LIGHT_PURPLE + " eu/tick in/out");
|
||||
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");
|
||||
}
|
||||
} else {
|
||||
Block block = Block.getBlockFromItem(event.itemStack.getItem());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue