diff --git a/src/main/java/knightminer/inspirations/tools/InspirationsTools.java b/src/main/java/knightminer/inspirations/tools/InspirationsTools.java index 781c11da..f38d6cbd 100644 --- a/src/main/java/knightminer/inspirations/tools/InspirationsTools.java +++ b/src/main/java/knightminer/inspirations/tools/InspirationsTools.java @@ -69,6 +69,8 @@ public class InspirationsTools extends ModuleBase { public static Item barometer; public static Item photometer; public static ArrowItem redstoneArrow; + // only used in client proxy, should use Items.SHIELD normally + static Item shield; // The "undyed" compass is White. public static EnumObject waypointCompasses = EnumObject.empty(); @@ -115,7 +117,7 @@ public void registerItems(Register event) { () -> false), DyeColor.values(), "waypoint_compass"); if (Config.shieldEnchantmentTable.get()) { - registry.register(new EnchantableShieldItem(new Item.Properties().maxDamage(Items.SHIELD.getMaxDamage()).group(ItemGroup.COMBAT)), Items.SHIELD); + shield = registry.register(new EnchantableShieldItem(new Item.Properties().maxDamage(Items.SHIELD.getMaxDamage()).group(ItemGroup.COMBAT)), Items.SHIELD); } } diff --git a/src/main/java/knightminer/inspirations/tools/ToolsClientEvents.java b/src/main/java/knightminer/inspirations/tools/ToolsClientEvents.java index 3edb90d7..bc0121db 100644 --- a/src/main/java/knightminer/inspirations/tools/ToolsClientEvents.java +++ b/src/main/java/knightminer/inspirations/tools/ToolsClientEvents.java @@ -31,6 +31,9 @@ static void clientSetup(FMLClientSetupEvent event) { registerModelProperty(InspirationsTools.photometer, "light", new PhotometerPropertyGetter()); IItemPropertyGetter waypointCompass = new WaypointCompassPropertyGetter(); InspirationsTools.waypointCompasses.forEach(compass -> registerModelProperty(compass, "angle", waypointCompass)); + // re-register shield blocking with registry sub shield, not strictly needed unless certain mods decide to register their properties before regsitry events + registerModelProperty(InspirationsTools.shield, "blocking", + (stack, world, entity) -> entity != null && entity.isHandActive() && entity.getActiveItemStack() == stack ? 1.0F : 0.0F); } @SubscribeEvent