diff options
author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-09-21 14:22:26 -0700 |
---|---|---|
committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-09-21 14:22:26 -0700 |
commit | 576cb9778a43f59430fc7c0403719368a08b5889 (patch) | |
tree | 5d271f756b54a35bdb4959dcb3012e7c0cec7295 | |
parent | 3d9c9884e3e3875a2fa8ac960f5bd7dce8b77e06 (diff) | |
download | Iceberg-576cb9778a43f59430fc7c0403719368a08b5889.tar.gz Iceberg-576cb9778a43f59430fc7c0403719368a08b5889.tar.bz2 Iceberg-576cb9778a43f59430fc7c0403719368a08b5889.zip |
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.
-rw-r--r-- | gradle.properties | 2 | ||||
-rw-r--r-- | src/main/java/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 <T extends Entity> EntityType<T> registerEntity(String name, EntityType.Builder<T> builder) + { + return registerEntity(name, builder, (Supplier<AttributeModifierMap.MutableAttribute>)null); + } + + protected static <T extends Entity> EntityType<T> registerEntity(String name, EntityType.Builder<T> builder, Supplier<AttributeModifierMap.MutableAttribute> attributes) + { + return registerEntity(name, builder, null, attributes); + } + + @Deprecated protected static <T extends Entity> EntityType<T> registerEntity(String name, EntityType.Builder<T> builder, IRenderFactory<? super T> renderFactory) { return registerEntity(name, builder, renderFactory, null); } + @Deprecated @SuppressWarnings("unchecked") protected static <T extends Entity> EntityType<T> registerEntity(String name, EntityType.Builder<T> builder, IRenderFactory<? super T> renderFactory, Supplier<AttributeModifierMap.MutableAttribute> 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") |