aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2021-09-21 14:22:26 -0700
committerAnthony Hilyard <anthony.hilyard@gmail.com>2021-09-21 14:22:26 -0700
commit576cb9778a43f59430fc7c0403719368a08b5889 (patch)
tree5d271f756b54a35bdb4959dcb3012e7c0cec7295 /src/main/java
parent3d9c9884e3e3875a2fa8ac960f5bd7dce8b77e06 (diff)
downloadIceberg-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.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/registry/AutoRegistry.java15
1 files changed, 14 insertions, 1 deletions
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")