mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix NPE when calling ForgeHooks.getDefaultCreatorModId(ItemStack) on Spawn Eggs. Closes #10002
This commit is contained in:
1 file changed
+1
-1
@@ -697,7 +697,7 @@ public final class ForgeHooks {
|
||||
if (potion != null && potion.unwrapKey().isPresent())
|
||||
return potion.unwrapKey().get().location().getNamespace();
|
||||
} else if (item instanceof SpawnEggItem egg) {
|
||||
var resourceLocation = ForgeRegistries.ENTITY_TYPES.getKey(egg.getType(null));
|
||||
var resourceLocation = ForgeRegistries.ENTITY_TYPES.getKey(egg.getType(itemStack));
|
||||
if (resourceLocation != null)
|
||||
return resourceLocation.getNamespace();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user