-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
patches/server/0033-Leaves-Fix-villagers-dont-release-memory.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: violetc <58360096+s-yh-china@users.noreply.github.com> | ||
Date: Sat, 22 Jul 2023 12:00:59 +0800 | ||
Subject: [PATCH] Leaves: Fix villagers dont release memory | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java | ||
index 971f2d594ead143f34911eea857203aac5bdd0b5..680b4b889f04afa604baa3513de5338f402b56b4 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java | ||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java | ||
@@ -1185,4 +1185,20 @@ public class Villager extends AbstractVillager implements ReputationEventHandler | ||
|
||
return optional.isPresent() ? worldTime - (Long) optional.get() < 24000L : false; | ||
} | ||
+ | ||
+ // Leaves start - fixes a memory leak when villagers get moved to another world | ||
+ @Nullable | ||
+ @Override | ||
+ public Entity changeDimension(ServerLevel destination) { | ||
+ if (one.tranic.vine.config.VineConfig.Fix.villagersDontReleaseMemory) { | ||
+ this.releaseAllPois(); | ||
+ this.getBrain().eraseMemory(MemoryModuleType.HOME); | ||
+ this.getBrain().eraseMemory(MemoryModuleType.JOB_SITE); | ||
+ this.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE); | ||
+ this.getBrain().eraseMemory(MemoryModuleType.MEETING_POINT); | ||
+ this.refreshBrain(destination); | ||
+ } | ||
+ return super.changeDimension(destination); | ||
+ } | ||
+ // Leaves end - fixes a memory leak when villagers get moved to another world | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.