From 576cb9778a43f59430fc7c0403719368a08b5889 Mon Sep 17 00:00:00 2001 From: Anthony Hilyard Date: Tue, 21 Sep 2021 14:22:26 -0700 Subject: Added new methods for entity registration without supplying a renderfactory. Deprecated old entity registration methods. Fixed bug in automatic sound registration that made sounds not work in multiplayer. --- gradle.properties | 2 +- .../com/anthonyhilyard/iceberg/registry/AutoRegistry.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e56ce4a..bab15c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,6 @@ org.gradle.daemon=false name=Iceberg group=com.anthonyhilyard.iceberg author=anthonyhilyard -version=1.0.6 +version=1.0.8 mcVersion=1.16.5 forgeVersion=36.2.2 \ No newline at end of file diff --git a/src/main/java/com/anthonyhilyard/iceberg/registry/AutoRegistry.java b/src/main/java/com/anthonyhilyard/iceberg/registry/AutoRegistry.java index c42a8d0..a9b983e 100644 --- a/src/main/java/com/anthonyhilyard/iceberg/registry/AutoRegistry.java +++ b/src/main/java/com/anthonyhilyard/iceberg/registry/AutoRegistry.java @@ -106,11 +106,23 @@ public abstract class AutoRegistry } } + protected static EntityType registerEntity(String name, EntityType.Builder builder) + { + return registerEntity(name, builder, (Supplier)null); + } + + protected static EntityType registerEntity(String name, EntityType.Builder builder, Supplier attributes) + { + return registerEntity(name, builder, null, attributes); + } + + @Deprecated protected static EntityType registerEntity(String name, EntityType.Builder builder, IRenderFactory renderFactory) { return registerEntity(name, builder, renderFactory, null); } + @Deprecated @SuppressWarnings("unchecked") protected static EntityType registerEntity(String name, EntityType.Builder builder, IRenderFactory renderFactory, Supplier attributes) { @@ -142,7 +154,8 @@ public abstract class AutoRegistry throw new RuntimeException("AutoRegistry was not initialized with mod id!"); } - return new SoundEvent(new ResourceLocation(MODID, name)); + ResourceLocation resourceLocation = new ResourceLocation(MODID, name); + return new SoundEvent(resourceLocation).setRegistryName(resourceLocation); } @SuppressWarnings("unchecked") -- cgit