Skip to content

Commit

Permalink
Add new gems to lore
Browse files Browse the repository at this point in the history
  • Loading branch information
bowser0000 committed Apr 16, 2024
1 parent 9a29257 commit b13ceee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/me/Danker/features/GemstonesLore.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public void init(ModInitEvent event) {
gemstoneColours.put("Jade", EnumChatFormatting.GREEN);
gemstoneColours.put("Ruby", EnumChatFormatting.RED);
gemstoneColours.put("Opal", EnumChatFormatting.WHITE);
gemstoneColours.put("Aquamarine", EnumChatFormatting.DARK_AQUA);
gemstoneColours.put("Peridot", EnumChatFormatting.DARK_GREEN);
gemstoneColours.put("Citrine", EnumChatFormatting.DARK_RED);
gemstoneColours.put("Onyx", EnumChatFormatting.DARK_GRAY);
}

@SubscribeEvent(priority = EventPriority.HIGHEST)
Expand All @@ -46,7 +50,7 @@ public void onTooltip(ItemTooltipEvent event) {
NBTTagCompound gems = tags.getCompoundTag("gems");
Set<String> set = gems.getKeySet();

if (set.size() == 0) return;
if (set.isEmpty()) return;

int index = Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? 4 : 2;

Expand All @@ -61,15 +65,15 @@ public void onTooltip(ItemTooltipEvent event) {

if (gems.getTag(gem) instanceof NBTTagString) {
gemstone += Utils.capitalizeString(gems.getString(gem)) + " ";
if (gem.startsWith("UNIVERSAL_") || gem.startsWith("MINING_") || gem.startsWith("COMBAT_") || gem.startsWith("DEFENSIVE_")) {
if (gem.startsWith("UNIVERSAL_") || gem.startsWith("MINING_") || gem.startsWith("COMBAT_") || gem.startsWith("DEFENSIVE_") || gem.startsWith("CHISEL_")) {
gemstone += Utils.capitalizeString(gems.getString(gem + "_gem"));
} else {
gemstone += Utils.capitalizeString(gem.substring(0, gem.indexOf("_")));
}
} else if (gems.getTag(gem) instanceof NBTTagCompound) {
String gemQuality = gems.getCompoundTag(gem).getString("quality");
gemstone += Utils.capitalizeString(gemQuality) + " ";
if (gem.startsWith("UNIVERSAL_") || gem.startsWith("MINING_") || gem.startsWith("COMBAT_") || gem.startsWith("DEFENSIVE_")) {
if (gem.startsWith("UNIVERSAL_") || gem.startsWith("MINING_") || gem.startsWith("COMBAT_") || gem.startsWith("DEFENSIVE_") || gem.startsWith("CHISEL_")) {
gemstone += Utils.capitalizeString(gems.getString(gem + "_gem"));
} else {
gemstone += Utils.capitalizeString(gem.substring(0, gem.indexOf("_")));
Expand Down

0 comments on commit b13ceee

Please sign in to comment.