mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-26 06:53:08 +00:00
Added color constants.
This commit is contained in:
1 parent
28d19ef015
commit
9c121fb5c8
3 files changed
+39
-27
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
public class SpecialChars {
|
||||
|
||||
public static String MCStyle = "\u00A7";
|
||||
|
||||
public static String BLACK = MCStyle + "0";
|
||||
public static String DBLUE = MCStyle + "1";
|
||||
public static String DGREEN = MCStyle + "2";
|
||||
public static String DAQUA = MCStyle + "3";
|
||||
public static String DRED = MCStyle + "4";
|
||||
public static String DPURPLE = MCStyle + "5";
|
||||
public static String GOLD = MCStyle + "6";
|
||||
public static String GRAY = MCStyle + "7";
|
||||
public static String DGRAY = MCStyle + "8";
|
||||
public static String BLUE = MCStyle + "9";
|
||||
public static String GREEN = MCStyle + "a";
|
||||
public static String AQUA = MCStyle + "b";
|
||||
public static String RED = MCStyle + "c";
|
||||
public static String LPURPLE = MCStyle + "d";
|
||||
public static String YELLOW = MCStyle + "e";
|
||||
public static String WHITE = MCStyle + "f";
|
||||
|
||||
public static String OBF = MCStyle + "k";
|
||||
public static String BOLD = MCStyle + "l";
|
||||
public static String STRIKE = MCStyle + "m";
|
||||
public static String UNDER = MCStyle + "n";
|
||||
public static String ITALIC = MCStyle + "o";
|
||||
public static String RESET = MCStyle + "r";
|
||||
|
||||
public static String WailaStyle = "\u00A4";
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package mcp.mobius.waila.handlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static mcp.mobius.waila.SpecialChars.*;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
@@ -61,33 +62,8 @@ public class HUDHandlerWaila implements IWailaDataProvider {
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
String modName = ModIdentification.nameFromStack(itemStack);
|
||||
if (modName != null && !modName.equals(""))
|
||||
currenttip.add("\u00A79\u00A7o" + modName);
|
||||
currenttip.add(BLUE + ITALIC + modName);
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public ItemStack identifyHighlight(World world, EntityPlayer player, MovingObjectPosition mop) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTextData(ItemStack itemStack, World world, EntityPlayer player, MovingObjectPosition mop, List<String> currenttip, Layout layout) {
|
||||
|
||||
if (layout == Layout.FOOTER){
|
||||
String modName = ModIdentification.nameFromStack(itemStack);
|
||||
if (modName != null && !modName.equals(""))
|
||||
currenttip.add("\u00A79\u00A7o" + modName);
|
||||
} else if (layout == Layout.HEADER && ConfigHandler.instance().getConfig(Constants.CFG_WAILA_METADATA, false)){
|
||||
if (currenttip.size() == 0)
|
||||
currenttip.add("< Unnamed >");
|
||||
else{
|
||||
String name = currenttip.get(0);
|
||||
currenttip.set(0, name + String.format(" %s:%s", world.getBlockId(mop.blockX, mop.blockY, mop.blockZ), world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ)));
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import mcp.mobius.waila.api.impl.MetaDataProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
@@ -55,7 +57,8 @@ public class WailaTickHandler implements ITickHandler {
|
||||
if (target != null){
|
||||
DataAccessor accessor = DataAccessor.instance;
|
||||
accessor.set(world, player, target);
|
||||
ItemStack targetStack = RayTracing.instance().getTargetStack();
|
||||
ItemStack targetStack = RayTracing.instance().getTargetStack();
|
||||
|
||||
if (targetStack != null){
|
||||
this.currenttip.clear();
|
||||
|
||||
|
||||
Reference in new issue
Block a user