diff --git a/gradle.properties b/gradle.properties index 7adb2ae..988626f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,8 @@ # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -mod_version=2.0 +mod_version=2.1 modid=simply_trophies mc_version=1.15.2 -forge_version=31.1.0 +forge_version=31.2.37 mapping=20200202 \ No newline at end of file diff --git a/src/main/java/tfar/simpletrophies/common/config/TrophyConfig.java b/src/main/java/tfar/simpletrophies/common/config/TrophyConfig.java index ff56251..2aadd9c 100644 --- a/src/main/java/tfar/simpletrophies/common/config/TrophyConfig.java +++ b/src/main/java/tfar/simpletrophies/common/config/TrophyConfig.java @@ -23,6 +23,8 @@ public static class ClientConfig { public static ForgeConfigSpec.BooleanValue NO_TEISR; public static ForgeConfigSpec.BooleanValue NO_TESR; public static ForgeConfigSpec.BooleanValue TOOLTIP_CREDITS; + public static ForgeConfigSpec.BooleanValue SHOW_ITEMNAME; + public static ForgeConfigSpec.BooleanValue SHOW_ITEMTOOLTIP; public static ForgeConfigSpec.BooleanValue SHOW_EARNEDAT; public static ForgeConfigSpec.DoubleValue SCALE; @@ -50,6 +52,12 @@ public static class ClientConfig { SHOW_EARNEDAT = builder .comment("Show the date and time you earned the trophy on the tooltip and on hover.") .define("show earnedat",true); + SHOW_ITEMNAME = builder + .comment("Show name of the displayed item.") + .define("show itemname", true); + SHOW_ITEMTOOLTIP = builder + .comment("Show tooltip of the displayed item.") + .define("show tooltip", false); SCALE = builder .comment("Scale of items on trophies") .defineInRange("scale",1.5,0,Double.MAX_VALUE); diff --git a/src/main/java/tfar/simpletrophies/common/item/ItemSimpleTrophy.java b/src/main/java/tfar/simpletrophies/common/item/ItemSimpleTrophy.java index 8538542..3460665 100644 --- a/src/main/java/tfar/simpletrophies/common/item/ItemSimpleTrophy.java +++ b/src/main/java/tfar/simpletrophies/common/item/ItemSimpleTrophy.java @@ -33,7 +33,7 @@ import java.util.ArrayList; import java.util.List; -import static tfar.simpletrophies.common.config.TrophyConfig.ClientConfig.SHOW_EARNEDAT; +import static tfar.simpletrophies.common.config.TrophyConfig.ClientConfig.*; public class ItemSimpleTrophy extends BlockItem { public ItemSimpleTrophy(Block block, Properties properties) { @@ -82,32 +82,36 @@ public void addInformation(ItemStack stack, @Nullable World world, List displayedTooltip = new ArrayList<>(); - displayedStack.getItem().addInformation(displayedStack, world, displayedTooltip, mistake); - displayedTooltip.forEach(s -> tooltip.add(new StringTextComponent(" " + s))); + if(SHOW_ITEMTOOLTIP.get()) { + List displayedTooltip = new ArrayList<>(); + displayedStack.getItem().addInformation(displayedStack, world, displayedTooltip, mistake); + displayedTooltip.forEach(s -> tooltip.add(new StringTextComponent(" ").appendSibling(s))); + } } long time = TrophyHelpers.getEarnTime(stack); if(SHOW_EARNEDAT.get() && time != 0) { - tooltip.add(new TranslationTextComponent("simple_trophies.misc.earnedAt", DateHelpers.epochToString(time))); + tooltip.add(new TranslationTextComponent("simple_trophies.misc.earnedAt", DateHelpers.epochToString(time)).applyTextStyle(TextFormatting.GRAY)); } super.addInformation(stack, world, tooltip, mistake);