From 41d606e4d930dbaf05b215d592068f3d7a1facfa Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:49:14 -0400 Subject: [PATCH] added way to make any item remove the default mc durability tooltip --- .../java/muramasa/antimatter/client/event/ClientEvents.java | 3 ++- .../main/java/muramasa/antimatter/item/ICustomDurability.java | 4 ++++ .../main/java/muramasa/antimatter/tool/IAntimatterTool.java | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 common/src/main/java/muramasa/antimatter/item/ICustomDurability.java diff --git a/common/src/main/java/muramasa/antimatter/client/event/ClientEvents.java b/common/src/main/java/muramasa/antimatter/client/event/ClientEvents.java index a2b39023a..57131af83 100644 --- a/common/src/main/java/muramasa/antimatter/client/event/ClientEvents.java +++ b/common/src/main/java/muramasa/antimatter/client/event/ClientEvents.java @@ -12,6 +12,7 @@ import muramasa.antimatter.client.RenderHelper; import muramasa.antimatter.cover.IHaveCover; import muramasa.antimatter.data.AntimatterDefaultTools; +import muramasa.antimatter.item.ICustomDurability; import muramasa.antimatter.machine.BlockMachine; import muramasa.antimatter.mixin.client.LevelRendererAccessor; import muramasa.antimatter.mixin.client.MultiPlayerGameModeAccessor; @@ -159,7 +160,7 @@ public static void onRenderDebugInfo(ArrayList left) { //TODO still needed? public static void onItemTooltip(ItemStack stack, List tooltips, Player player, TooltipFlag flag) { - if (stack.getItem() instanceof IAntimatterTool tool){ + if (stack.getItem() instanceof ICustomDurability tool){ int j = -1; for (int i = 0; i < tooltips.size(); i++) { Component component = tooltips.get(i); diff --git a/common/src/main/java/muramasa/antimatter/item/ICustomDurability.java b/common/src/main/java/muramasa/antimatter/item/ICustomDurability.java new file mode 100644 index 000000000..7b3d7f6b1 --- /dev/null +++ b/common/src/main/java/muramasa/antimatter/item/ICustomDurability.java @@ -0,0 +1,4 @@ +package muramasa.antimatter.item; + +public interface ICustomDurability { +} diff --git a/common/src/main/java/muramasa/antimatter/tool/IAntimatterTool.java b/common/src/main/java/muramasa/antimatter/tool/IAntimatterTool.java index 2eb65d66a..eb0dfa30f 100644 --- a/common/src/main/java/muramasa/antimatter/tool/IAntimatterTool.java +++ b/common/src/main/java/muramasa/antimatter/tool/IAntimatterTool.java @@ -8,6 +8,7 @@ import muramasa.antimatter.behaviour.*; import muramasa.antimatter.capability.energy.ItemEnergyHandler; import muramasa.antimatter.datagen.providers.AntimatterItemModelProvider; +import muramasa.antimatter.item.ICustomDurability; import muramasa.antimatter.item.ItemBattery; import muramasa.antimatter.material.Material; import muramasa.antimatter.material.MaterialTags; @@ -54,7 +55,7 @@ import static muramasa.antimatter.material.Material.NULL; -public interface IAntimatterTool extends ISharedAntimatterObject, IBasicAntimatterTool, IEnergyItem { +public interface IAntimatterTool extends ISharedAntimatterObject, IBasicAntimatterTool, IEnergyItem, ICustomDurability { AntimatterItemTier getAntimatterItemTier();