From ddbfa0e9bfa06c21c9862dd3d02475f5688b7bce Mon Sep 17 00:00:00 2001 From: Up Date: Wed, 28 Feb 2024 10:25:41 +0100 Subject: [PATCH] more generics fixes --- .../api/client/event/RegisterBlockEntityRenderersEvent.java | 2 +- .../api/client/event/RegisterEntityRenderersEvent.java | 2 +- .../api/client/event/RegisterParticleFactoriesEvent.java | 6 +++--- .../impl/registry/RegisterParticleFactoriesEventImpl.java | 6 +++--- .../mixin/internal/RegisterRenderersEventMixin.java | 4 ++-- .../registry/RegisterBlockEntityRenderersEventImpl.java | 2 +- .../impl/registry/RegisterEntityRenderersEventImpl.java | 2 +- .../impl/registry/RegisterParticleFactoriesEventImpl.java | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterBlockEntityRenderersEvent.java b/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterBlockEntityRenderersEvent.java index d398f46..4741aa0 100644 --- a/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterBlockEntityRenderersEvent.java +++ b/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterBlockEntityRenderersEvent.java @@ -9,7 +9,7 @@ public interface RegisterBlockEntityRenderersEvent { - void registerRenderer(Supplier> blockEntityType, BlockEntityRendererProvider blockEntityRendererProvider); + void registerRenderer(Supplier> blockEntityType, BlockEntityRendererProvider blockEntityRendererProvider); Event EVENT = Event.create(Callback.class, callbacks -> event -> { for (Callback callback : callbacks) { diff --git a/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterEntityRenderersEvent.java b/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterEntityRenderersEvent.java index a7a504c..8df1437 100644 --- a/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterEntityRenderersEvent.java +++ b/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterEntityRenderersEvent.java @@ -9,7 +9,7 @@ public interface RegisterEntityRenderersEvent { - void registerRenderer(Supplier> entityType, EntityRendererProvider entityRendererProvider); + void registerRenderer(Supplier> entityType, EntityRendererProvider entityRendererProvider); Event EVENT = Event.create(Callback.class, callbacks -> event -> { for (Callback callback : callbacks) { diff --git a/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterParticleFactoriesEvent.java b/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterParticleFactoriesEvent.java index 7bac7c5..ef625d2 100644 --- a/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterParticleFactoriesEvent.java +++ b/Common/src/main/java/dev/upcraft/sparkweave/api/client/event/RegisterParticleFactoriesEvent.java @@ -16,10 +16,10 @@ public interface RegisterParticleFactoriesEvent { } }); - void registerSpecial(Supplier> type, ParticleProvider provider); + > void registerSpecial(Supplier type, ParticleProvider provider); // copying from ParticleEngine because fabric does not expose this method - default void registerSprite(Supplier> type, ParticleProvider.Sprite sprite) { + default > void registerSprite(Supplier type, ParticleProvider.Sprite sprite) { registerSpriteSet(type, spriteSet -> (t, level, x, y, z, velocityX, velocityY, velocityZ) -> { var particle = sprite.createParticle(t, level, x, y, z, velocityX, velocityY, velocityZ); if (particle != null) { @@ -30,7 +30,7 @@ default void registerSprite(Supplier }); } - void registerSpriteSet(Supplier> type, SpriteParticleRegistration registration); + > void registerSpriteSet(Supplier type, SpriteParticleRegistration registration); @FunctionalInterface interface Callback { diff --git a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/impl/registry/RegisterParticleFactoriesEventImpl.java b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/impl/registry/RegisterParticleFactoriesEventImpl.java index bce3b95..a643592 100644 --- a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/impl/registry/RegisterParticleFactoriesEventImpl.java +++ b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/impl/registry/RegisterParticleFactoriesEventImpl.java @@ -12,17 +12,17 @@ public record RegisterParticleFactoriesEventImpl( RegisterParticleProvidersEvent event) implements RegisterParticleFactoriesEvent { @Override - public void registerSpecial(Supplier> type, ParticleProvider provider) { + public > void registerSpecial(Supplier type, ParticleProvider provider) { event.registerSpecial(type.get(), provider); } @Override - public void registerSpriteSet(Supplier> type, SpriteParticleRegistration registration) { + public > void registerSpriteSet(Supplier type, SpriteParticleRegistration registration) { event.registerSpriteSet(type.get(), registration); } @Override - public void registerSprite(Supplier> type, ParticleProvider.Sprite sprite) { + public > void registerSprite(Supplier type, ParticleProvider.Sprite sprite) { event.registerSprite(type.get(), sprite); } } diff --git a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/mixin/internal/RegisterRenderersEventMixin.java b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/mixin/internal/RegisterRenderersEventMixin.java index 23ca232..d6ba0c6 100644 --- a/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/mixin/internal/RegisterRenderersEventMixin.java +++ b/NeoForge/src/main/java/dev/upcraft/sparkweave/neoforge/mixin/internal/RegisterRenderersEventMixin.java @@ -29,11 +29,11 @@ public abstract class RegisterRenderersEventMixin implements RegisterEntityRende @Shadow public abstract void registerEntityRenderer(EntityType entityType, EntityRendererProvider entityRendererProvider); - public void registerBlockEntityRenderer$registerRenderer(Supplier> blockEntityType, BlockEntityRendererProvider blockEntityRendererProvider) { + public void registerBlockEntityRenderer$registerRenderer(Supplier> blockEntityType, BlockEntityRendererProvider blockEntityRendererProvider) { this.registerBlockEntityRenderer(blockEntityType.get(), blockEntityRendererProvider); } - public void registerEntityRenderers$registerRenderer(Supplier> entityType, EntityRendererProvider entityRendererProvider) { + public void registerEntityRenderers$registerRenderer(Supplier> entityType, EntityRendererProvider entityRendererProvider) { this.registerEntityRenderer(entityType.get(), entityRendererProvider); } } diff --git a/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterBlockEntityRenderersEventImpl.java b/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterBlockEntityRenderersEventImpl.java index a0a5820..5b419f3 100644 --- a/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterBlockEntityRenderersEventImpl.java +++ b/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterBlockEntityRenderersEventImpl.java @@ -11,7 +11,7 @@ public class RegisterBlockEntityRenderersEventImpl implements RegisterBlockEntityRenderersEvent { @Override - public void registerRenderer(Supplier> blockEntityType, BlockEntityRendererProvider blockEntityRendererProvider) { + public void registerRenderer(Supplier> blockEntityType, BlockEntityRendererProvider blockEntityRendererProvider) { BlockEntityRenderers.register(blockEntityType.get(), blockEntityRendererProvider); } } diff --git a/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterEntityRenderersEventImpl.java b/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterEntityRenderersEventImpl.java index 0538536..8436f99 100644 --- a/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterEntityRenderersEventImpl.java +++ b/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterEntityRenderersEventImpl.java @@ -11,7 +11,7 @@ public class RegisterEntityRenderersEventImpl implements RegisterEntityRenderersEvent { @Override - public void registerRenderer(Supplier> entityType, EntityRendererProvider entityRendererProvider) { + public void registerRenderer(Supplier> entityType, EntityRendererProvider entityRendererProvider) { EntityRendererRegistry.register(entityType.get(), entityRendererProvider); } } diff --git a/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterParticleFactoriesEventImpl.java b/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterParticleFactoriesEventImpl.java index f610451..d937626 100644 --- a/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterParticleFactoriesEventImpl.java +++ b/Quilt/src/main/java/dev/upcraft/sparkweave/quilt/impl/registry/RegisterParticleFactoriesEventImpl.java @@ -11,12 +11,12 @@ public class RegisterParticleFactoriesEventImpl implements RegisterParticleFactoriesEvent { @Override - public void registerSpecial(Supplier> type, ParticleProvider provider) { + public > void registerSpecial(Supplier type, ParticleProvider provider) { ParticleFactoryRegistry.getInstance().register(type.get(), provider); } @Override - public void registerSpriteSet(Supplier> type, SpriteParticleRegistration registration) { + public > void registerSpriteSet(Supplier type, SpriteParticleRegistration registration) { ParticleFactoryRegistry.getInstance().register(type.get(), registration::create); } }