diff --git a/src/main/java/com/minelittlepony/unicopia/item/GemstoneItem.java b/src/main/java/com/minelittlepony/unicopia/item/GemstoneItem.java index 3f1f8a68..3f53ad30 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/GemstoneItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/GemstoneItem.java @@ -16,8 +16,10 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; +import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; +import net.minecraft.util.Formatting; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; import net.minecraft.util.TypedActionResult; @@ -31,13 +33,19 @@ public class GemstoneItem extends Item { } @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List list, TooltipContext tooltipContext) { + public void appendTooltip(ItemStack stack, @Nullable World world, List lines, TooltipContext tooltipContext) { if (isEnchanted(stack)) { SpellType key = getSpellKey(stack); Affinity affinity = getAffinity(stack); - list.add(new TranslatableText(key.getTranslationKey(affinity) + ".lore").formatted(affinity.getColor())); + MutableText line = new TranslatableText(key.getTranslationKey(affinity) + ".lore").formatted(affinity.getColor()); + + if (!Unicopia.SIDE.getPlayerSpecies().canCast()) { + line = line.formatted(Formatting.OBFUSCATED); + } + + lines.add(line); } } @@ -63,6 +71,10 @@ public class GemstoneItem extends Item { @Override public Text getName(ItemStack stack) { if (isEnchanted(stack)) { + if (!Unicopia.SIDE.getPlayerSpecies().canCast()) { + return new TranslatableText(getTranslationKey(stack) + ".obfuscated"); + } + return new TranslatableText(getTranslationKey(stack) + ".enchanted", getSpellKey(stack).getName(getAffinity(stack))); } return super.getName(); diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index 014655b3..1187e490 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -32,6 +32,7 @@ "item.unicopia.crystal_shard": "Crystal Shard", "item.unicopia.gemstone": "Gemstone", "item.unicopia.gemstone.enchanted": "%s Gem", + "item.unicopia.gemstone.obfuscated": "Mysterious Gem", "item.unicopia.pegasus_feather": "Pegasus Feather", "item.unicopia.gryphon_feather": "Gryphon Feather",