From a651f03722cd0fd690763d90bb91fc11b75b82ef Mon Sep 17 00:00:00 2001 From: AltronMaxX Date: Sat, 17 Aug 2024 13:35:21 +0400 Subject: [PATCH] Update Folia --- gradle.properties | 2 +- .../server/0027-Purpur-Remove-timings.patch | 16 ++++----- ...45-Luminol-Try-fixing-memory-leaking.patch | 36 +++++++++++++++++++ 3 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 patches/server/0045-Luminol-Try-fixing-memory-leaking.patch diff --git a/gradle.properties b/gradle.properties index c05c368..06698ba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=dev.edenor.foldenor version=1.21.1-R0.1-SNAPSHOT mcVersion=1.21.1 -foliaRef=4ad5d37fad103d9c0149c5fbd8d40c958d19ae29 +foliaRef=9203a7a887eecdccb93a96ca460ce13364842884 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0027-Purpur-Remove-timings.patch b/patches/server/0027-Purpur-Remove-timings.patch index 529ca85..9e05369 100644 --- a/patches/server/0027-Purpur-Remove-timings.patch +++ b/patches/server/0027-Purpur-Remove-timings.patch @@ -1421,7 +1421,7 @@ index da815f30a44cbfe577b75b79e4527930fc6980d7..280b65d9ea6cde9f417057632c305645 return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index b4fec6374803534aa3b5d5e7aec64f68c7c7c356..33f6905706f333904ccd08f5f01ad6276b3fa24d 100644 +index ee258d52d49041a46a31dc63686bd41beb6d3cf3..9302601aca888165e776e36cc5dc5406c5452ccb 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -157,7 +157,6 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1603,7 +1603,7 @@ index bf9d00463627c702c639c7cb625c3eb35c2e44aa..70157d581f8cbe60f86f944e7c2b0ce9 @Nullable private String descriptionId; diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 4c2e8714c64a6fe49554a11471e37078267f1eea..c8bb3d7f299d43326daaa12aa119b0eb37cb4b38 100644 +index b7c1c8e3701fc2d67df34aaf5cebdf78e340f155..d69cf4f9747d1b879c9b66b81390139644d3f511 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -33,14 +33,10 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; @@ -1622,10 +1622,10 @@ index 4c2e8714c64a6fe49554a11471e37078267f1eea..c8bb3d7f299d43326daaa12aa119b0eb private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 42ae955ff55e868f9eedde61a21ec26763fd7700..52e4984b8490867772a0ac3410fd6e1cb97847b6 100644 +index 6bc1db349cb1ff6652f0e48159e7b31b8d99e2e1..234751ee1a71809993ad7a6791595ef98d1fb537 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -683,7 +683,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -688,7 +688,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system if (this.needsDecoration) { @@ -1634,7 +1634,7 @@ index 42ae955ff55e868f9eedde61a21ec26763fd7700..52e4984b8490867772a0ac3410fd6e1c this.needsDecoration = false; java.util.Random random = new java.util.Random(); random.setSeed(this.level.getSeed()); -@@ -703,7 +703,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -708,7 +708,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p } } server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); @@ -1643,7 +1643,7 @@ index 42ae955ff55e868f9eedde61a21ec26763fd7700..52e4984b8490867772a0ac3410fd6e1c } } } -@@ -1059,7 +1059,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -1064,7 +1064,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); gameprofilerfiller.push(this::getType); @@ -1652,7 +1652,7 @@ index 42ae955ff55e868f9eedde61a21ec26763fd7700..52e4984b8490867772a0ac3410fd6e1c profiler.startTimer(timerId); try { // Folia - profiler BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); -@@ -1088,7 +1088,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -1093,7 +1093,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p // Paper end - Prevent block entity and entity crashes // Spigot start } finally { @@ -1797,7 +1797,7 @@ index 802688c2091c3f1a31f02599fb73432811d588ee..2bc35cd9830c562153012a132ab6a67b // Paper end - add timings for scoreboard search } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index f89e08c22bc76dba5df730a83b37324e38d2956d..e94f5248d622a59db4feb05d955885f5b4a23fe2 100644 +index c9e31dcdde9d96edfc12e694065f1f4643bb9db3..585072091a0b6cb7ca627e7d2f482af8ecdcedd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -29,6 +29,7 @@ import net.minecraft.nbt.Tag; diff --git a/patches/server/0045-Luminol-Try-fixing-memory-leaking.patch b/patches/server/0045-Luminol-Try-fixing-memory-leaking.patch new file mode 100644 index 0000000..96ac2bf --- /dev/null +++ b/patches/server/0045-Luminol-Try-fixing-memory-leaking.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AltronMaxX +Date: Sat, 17 Aug 2024 12:58:02 +0400 +Subject: [PATCH] Luminol: Try-fixing-memory-leaking + + +diff --git a/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java b/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java +index 5dc4c8a5b896f519be5414d4a53a71144c225324..7d4f66752c2f380f3c6c552d5bc7907b9ad69c6e 100644 +--- a/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java ++++ b/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java +@@ -549,7 +549,7 @@ public final class RegionizedWorldData { + + public void addLoadedEntity(final Entity entity) { + if (this.loadedEntities.add(entity)) { +- this.toProcessTrackingUnloading.remove(entity); ++ //this.toProcessTrackingUnloading.remove(entity); // Luminol - Try fixing memory leaking + } + } + +@@ -559,7 +559,7 @@ public final class RegionizedWorldData { + + public void removeLoadedEntity(final Entity entity) { + if (this.loadedEntities.remove(entity)) { +- this.toProcessTrackingUnloading.add(entity); ++ //this.toProcessTrackingUnloading.add(entity); // Luminol - Try fixing memory leaking + } + } + +@@ -567,6 +567,7 @@ public final class RegionizedWorldData { + return this.loadedEntities; + } + ++ @java.lang.Deprecated // Luminol - Try fixing memory leaking + public Entity[] takeTrackingUnloads() { + final Entity[] ret = Arrays.copyOf(this.toProcessTrackingUnloading.getRawData(), this.toProcessTrackingUnloading.size(), Entity[].class); +