mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Fix intrusive handlers on dummy objects.
This commit is contained in:
1 parent
c1874bb5ab
commit
eb8fe02a5e
4 files changed
+45
-7
No files matched your search
@@ -236,10 +236,20 @@ class NamespacedHolderHelper<T extends IForgeRegistryEntry<T>>
|
||||
this.frozen = false;
|
||||
}
|
||||
|
||||
boolean isFrozen()
|
||||
{
|
||||
return this.frozen;
|
||||
}
|
||||
|
||||
boolean isIntrusive()
|
||||
{
|
||||
return this.holderLookup != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
Holder<T> onAdded(RegistryManager stage, int id, T newValue, T oldValue)
|
||||
{
|
||||
if (stage != RegistryManager.ACTIVE)
|
||||
if (stage != RegistryManager.ACTIVE && (this.holderLookup == null || !stage.isStaging())) // Intrusive handlers need updating in staging.
|
||||
return null; // Only do holder shit on the active registries, not pending or snapshots.
|
||||
|
||||
ResourceKey<T> key = ResourceKey.create(this.self.key(), newValue.getRegistryName());
|
||||
|
||||
Reference in new issue
Block a user