mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix getDefaultCreatorModId for enchanted books (#5534)
This commit is contained in:
1 parent
1e34f331da
commit
be18bdee88
1 file changed
+3
-7
@@ -1009,14 +1009,10 @@ public class ForgeHooks
|
||||
if (enchantmentsNbt.size() == 1)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompound(0);
|
||||
Enchantment enchantment = Enchantment.getEnchantmentByID(nbttagcompound.getShort("id"));
|
||||
if (enchantment != null)
|
||||
ResourceLocation resourceLocation = ResourceLocation.makeResourceLocation(nbttagcompound.getString("id"));
|
||||
if (resourceLocation != null && ForgeRegistries.ENCHANTMENTS.containsKey(resourceLocation))
|
||||
{
|
||||
ResourceLocation resourceLocation = ForgeRegistries.ENCHANTMENTS.getKey(enchantment);
|
||||
if (resourceLocation != null)
|
||||
{
|
||||
return resourceLocation.getNamespace();
|
||||
}
|
||||
return resourceLocation.getNamespace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user