diff --git a/src/main/java/net/neoforged/neoforge/common/CommonHooks.java b/src/main/java/net/neoforged/neoforge/common/CommonHooks.java index d81c78914c..8fd6a6b2ed 100644 --- a/src/main/java/net/neoforged/neoforge/common/CommonHooks.java +++ b/src/main/java/net/neoforged/neoforge/common/CommonHooks.java @@ -45,6 +45,7 @@ import net.minecraft.core.Holder; import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup.RegistryLookup; +import net.minecraft.core.HolderOwner; import net.minecraft.core.HolderSet; import net.minecraft.core.Registry; import net.minecraft.core.component.DataComponentMap; @@ -1340,6 +1341,11 @@ public Stream> listTags() { public Optional> get(TagKey key) { return Optional.of(HolderSet.emptyNamed(lookup, key)); } + + @Override + public boolean canSerializeIn(HolderOwner other) { + return Delegate.super.canSerializeIn(other) || other == lookup; + } }; }