Add rune type colors Ritual Diviner tooltip
Fixes casing for direction as well. IE: north -> North
This commit is contained in:
parent
253da93b3e
commit
dce6bf1e93
|
@ -3,18 +3,25 @@ package WayofTime.bloodmagic.api.ritual;
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public enum EnumRuneType implements IStringSerializable
|
public enum EnumRuneType implements IStringSerializable
|
||||||
{
|
{
|
||||||
BLANK,
|
BLANK(TextFormatting.GRAY),
|
||||||
WATER,
|
WATER(TextFormatting.AQUA),
|
||||||
FIRE,
|
FIRE(TextFormatting.RED),
|
||||||
EARTH,
|
EARTH(TextFormatting.GREEN),
|
||||||
AIR,
|
AIR(TextFormatting.WHITE),
|
||||||
DUSK,
|
DUSK(TextFormatting.DARK_GRAY),
|
||||||
DAWN;
|
DAWN(TextFormatting.GOLD);
|
||||||
|
|
||||||
|
public final TextFormatting colorCode;
|
||||||
|
|
||||||
|
EnumRuneType(TextFormatting colorCode) {
|
||||||
|
this.colorCode = colorCode;
|
||||||
|
}
|
||||||
|
|
||||||
public static EnumRuneType byMetadata(int meta)
|
public static EnumRuneType byMetadata(int meta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.item;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.util.Utils;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
@ -202,7 +203,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
||||||
|
|
||||||
if (sneaking)
|
if (sneaking)
|
||||||
{
|
{
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "currentDirection", getDirection(stack)));
|
tooltip.add(TextHelper.localize(tooltipBase + "currentDirection", Utils.toFancyCasing(getDirection(stack).getName())));
|
||||||
tooltip.add("");
|
tooltip.add("");
|
||||||
ArrayList<RitualComponent> componentList = ritual.getComponents();
|
ArrayList<RitualComponent> componentList = ritual.getComponents();
|
||||||
|
|
||||||
|
@ -213,11 +214,10 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
||||||
int earthRunes = 0;
|
int earthRunes = 0;
|
||||||
int duskRunes = 0;
|
int duskRunes = 0;
|
||||||
int dawnRunes = 0;
|
int dawnRunes = 0;
|
||||||
int totalRunes = 0;
|
int totalRunes = componentList.size();
|
||||||
|
|
||||||
for (RitualComponent component : componentList)
|
for (RitualComponent component : componentList)
|
||||||
{
|
{
|
||||||
totalRunes++;
|
|
||||||
switch (component.getRuneType())
|
switch (component.getRuneType())
|
||||||
{
|
{
|
||||||
case BLANK:
|
case BLANK:
|
||||||
|
@ -245,33 +245,19 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blankRunes > 0)
|
if (blankRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.BLANK.colorCode + TextHelper.localize(tooltipBase + "blankRune", blankRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "blankRune", blankRunes));
|
|
||||||
}
|
|
||||||
if (waterRunes > 0)
|
if (waterRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.WATER.colorCode + TextHelper.localize(tooltipBase + "waterRune", waterRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "waterRune", waterRunes));
|
|
||||||
}
|
|
||||||
if (airRunes > 0)
|
if (airRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.AIR.colorCode + TextHelper.localize(tooltipBase + "airRune", airRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "airRune", airRunes));
|
|
||||||
}
|
|
||||||
if (fireRunes > 0)
|
if (fireRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.FIRE.colorCode + TextHelper.localize(tooltipBase + "fireRune", fireRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "fireRune", fireRunes));
|
|
||||||
}
|
|
||||||
if (earthRunes > 0)
|
if (earthRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.EARTH.colorCode + TextHelper.localize(tooltipBase + "earthRune", earthRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "earthRune", earthRunes));
|
|
||||||
}
|
|
||||||
if (duskRunes > 0)
|
if (duskRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.DUSK.colorCode + TextHelper.localize(tooltipBase + "duskRune", duskRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "duskRune", duskRunes));
|
|
||||||
}
|
|
||||||
if (dawnRunes > 0)
|
if (dawnRunes > 0)
|
||||||
{
|
tooltip.add(EnumRuneType.DAWN.colorCode + TextHelper.localize(tooltipBase + "dawnRune", dawnRunes));
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "dawnRune", dawnRunes));
|
|
||||||
}
|
|
||||||
|
|
||||||
tooltip.add("");
|
tooltip.add("");
|
||||||
tooltip.add(TextHelper.localize(tooltipBase + "totalRune", totalRunes));
|
tooltip.add(TextHelper.localize(tooltipBase + "totalRune", totalRunes));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package WayofTime.bloodmagic.util;
|
package WayofTime.bloodmagic.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockPortal;
|
import net.minecraft.block.BlockPortal;
|
||||||
|
@ -86,6 +87,10 @@ public class Utils
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String toFancyCasing(String input) {
|
||||||
|
return String.valueOf(input.charAt(0)).toUpperCase(Locale.ENGLISH) + input.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param tile
|
* @param tile
|
||||||
* - The {@link TileInventory} to input the item to
|
* - The {@link TileInventory} to input the item to
|
||||||
|
|
Loading…
Reference in a new issue