diff --git a/src/main/java/com/minelittlepony/mson/api/EntityRendererRegistry.java b/src/main/java/com/minelittlepony/mson/api/EntityRendererRegistry.java index 9b54622..bd48b0c 100644 --- a/src/main/java/com/minelittlepony/mson/api/EntityRendererRegistry.java +++ b/src/main/java/com/minelittlepony/mson/api/EntityRendererRegistry.java @@ -40,7 +40,7 @@ public interface EntityRendererRegistry { * @param condition Predicate to determine when to use this renderer. * @param constructor The renderer factory */ - > void registerEntityRenderer(EntityType type, Predicate condition, Function constructor); + > void registerEntityRenderer(EntityType type, Predicate condition, Function constructor); /** * Adds a custom block entity renderer. diff --git a/src/main/java/com/minelittlepony/mson/impl/PendingEntityRendererRegistry.java b/src/main/java/com/minelittlepony/mson/impl/PendingEntityRendererRegistry.java index 35c36c5..9da11ff 100644 --- a/src/main/java/com/minelittlepony/mson/impl/PendingEntityRendererRegistry.java +++ b/src/main/java/com/minelittlepony/mson/impl/PendingEntityRendererRegistry.java @@ -35,11 +35,11 @@ public final class PendingEntityRendererRegistry implements EntityRendererRegist @SuppressWarnings("unchecked") public final PendingRegistrations< EntityType, - Map.Entry>, Function>> + Map.Entry>, Function>> > entity = new PendingRegistrations<>(MsonImpl.id("renderers/entity"), (registry, key, entry) -> { entry.getKey() .ifLeft(unit -> registry.registerEntityRenderer(key, entry.getValue())) - .ifRight(condition -> registry.registerEntityRenderer((EntityType)key, (Predicate)condition, entry.getValue())); + .ifRight(condition -> registry.registerEntityRenderer((EntityType)key, condition, entry.getValue())); }); public final PendingRegistrations< BlockEntityType, @@ -56,9 +56,10 @@ public void registerPlayerRenderer(Identifier s entity.register(type, Map.entry(Either.left(Unit.INSTANCE), constructor)); } + @SuppressWarnings("unchecked") @Override - public > void registerEntityRenderer(EntityType type, Predicate condition, Function constructor) { - entity.register(type, Map.entry(Either.right(condition), constructor)); + public > void registerEntityRenderer(EntityType type, Predicate condition, Function constructor) { + entity.register(type, Map.entry(Either.right((Predicate)condition), constructor)); } @Override diff --git a/src/main/java/com/minelittlepony/mson/impl/mixin/MixinEntityRenderDispatcher.java b/src/main/java/com/minelittlepony/mson/impl/mixin/MixinEntityRenderDispatcher.java index 071502c..e456071 100644 --- a/src/main/java/com/minelittlepony/mson/impl/mixin/MixinEntityRenderDispatcher.java +++ b/src/main/java/com/minelittlepony/mson/impl/mixin/MixinEntityRenderDispatcher.java @@ -87,7 +87,7 @@ public void registerPlayerRenderer(Identifier i @SuppressWarnings("unchecked") @Override - public > void registerEntityRenderer(EntityType type, Predicate condition, Function constructor) { + public > void registerEntityRenderer(EntityType type, Predicate condition, Function constructor) { try { if (customEntityRenderers == null) { customEntityRenderers = new HashMap<>();