Fix getting entity data serializer id crashing due to improper port to new registry system (#8678)

This commit is contained in:
Sara Freimer authored and GitHub committed 2022-06-08 09:14:41 -07:00
1 parent 9b144f4541
commit ade2b8cc80
1 file changed
-1
@@ -1107,7 +1107,6 @@ public class ForgeHooks
int id = vanilla.getId(serializer);
if (id < 0)
{
id = ((ForgeRegistry<EntityDataSerializer<?>>) ForgeRegistries.DATA_SERIALIZERS).getID(serializer);
// ForgeRegistries.DATA_SERIALIZERS is a deferred register now, so if this method is called too early, the registry will be null
ForgeRegistry<EntityDataSerializer<?>> registry = (ForgeRegistry<EntityDataSerializer<?>>) ForgeRegistries.DATA_SERIALIZERS.get();
if (registry != null)