use of net.silentchaos512.gems.api.lib.EnumMaterialTier in project SilentGems by SilentChaos512.
the class GemsClientEvents method onTooltipForToolRod.
private void onTooltipForToolRod(ItemTooltipEvent event, ItemStack stack, ToolPart part, boolean ctrlDown, boolean shiftDown) {
int index = 1;
final String sep = loc.getMiscText("Tooltip.Separator");
List<String> list = event.getToolTip();
ToolPartRod.Stats stats = ((ToolPartRod) part).getStats();
// Tool Rod indicator
list.add(index++, loc.getMiscText("ToolPart.Rod"));
if (ctrlDown) {
// Compatible tiers
String line = "";
for (EnumMaterialTier tier : part.getCompatibleTiers()) {
if (!line.isEmpty())
line += ", ";
line += tier.getLocalizedName();
}
list.add(index++, loc.getMiscText("ToolPart.ValidTiers"));
list.add(index++, " " + line);
list.add(index++, sep);
TextFormatting color = TextFormatting.GOLD;
list.add(index++, color + TooltipHelper.getAsColoredPercentage("HarvestSpeed", stats.harvestSpeedMulti));
// list.add(index++, color + TooltipHelper.get("HarvestLevel", part.getHarvestLevel()));
color = TextFormatting.DARK_GREEN;
list.add(index++, color + TooltipHelper.getAsColoredPercentage("MeleeDamage", stats.meleeDamageMulti));
list.add(index++, color + TooltipHelper.getAsColoredPercentage("MagicDamage", stats.magicDamageMulti));
// list.add(index++, color + TooltipHelper.get("MeleeSpeed", (int) (part.getMeleeSpeed() * 100)));
color = TextFormatting.BLUE;
list.add(index++, color + TooltipHelper.getAsColoredPercentage("Durability", stats.durabilityMulti));
list.add(index++, color + TooltipHelper.getAsColoredPercentage("Enchantability", stats.enchantabilityMulti));
list.add(index++, sep);
// Debug info
if (shiftDown) {
list.add(index++, TextFormatting.DARK_GRAY + "* Part key: " + part.getKey());
}
} else {
list.add(index++, loc.getMiscText("PressCtrl"));
}
}
Aggregations