Skip to content

Commit

Permalink
chore(neoforge): Change to just keep track of the boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
ChampionAsh5357 committed Feb 2, 2025
1 parent b47d554 commit 2ea2e0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
this.narrator.clear();
this.clientLevelTeardownInProgress = true;

+ var connection = this.getConnection() != null ? this.getConnection().getConnection() : null; // Neo: Hold connection to revert after shutdown
+ var shouldRevertRegistriesToFrozen = this.getConnection() != null && this.getConnection().getConnection() != null; // Neo: Track whether to revert registries after disconnect
try {
this.updateScreenAndTick(p_320248_);
if (this.level != null) {
Expand All @@ -345,7 +345,7 @@
}

SkullBlockEntity.clear();
+ if(connection != null) net.neoforged.neoforge.registries.RegistryManager.revertToFrozen(); // Neo: Revert registries to frozen on disconnect
+ if(shouldRevertRegistriesToFrozen) net.neoforged.neoforge.registries.RegistryManager.revertToFrozen(); // Neo: Revert registries to frozen on disconnect
}

public void clearDownloadedResourcePacks() {
Expand Down

0 comments on commit 2ea2e0c

Please sign in to comment.