diff --git a/patches/server/0026-Leaf-Use-caffeine-cache-kickPermission-instead-of-us.patch b/patches/server/0026-Leaf-Use-caffeine-cache-kickPermission-instead-of-us.patch new file mode 100644 index 0000000..0c47e9c --- /dev/null +++ b/patches/server/0026-Leaf-Use-caffeine-cache-kickPermission-instead-of-us.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> +Date: Sun, 23 Jun 2024 11:26:20 +0800 +Subject: [PATCH] Leaf: Use caffeine cache kickPermission instead of using + google.common.cache + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index ee8f2fce3b6b2ddd6fb7a767a30dcf4d0e4888e7..9a4f53ebee1c7be2b61ddb203a4d36e138886a52 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -333,19 +333,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + private boolean justTeleported = false; + // CraftBukkit end + +- // Purpur start +- private final com.google.common.cache.LoadingCache kickPermissionCache = com.google.common.cache.CacheBuilder.newBuilder() ++ // Purpur start // Leaf start - Use caffeine cache kickPermission instead of using google.common.cache ++ private final com.github.benmanes.caffeine.cache.LoadingCache kickPermissionCache = com.github.benmanes.caffeine.cache.Caffeine.newBuilder() + .maximumSize(1000) + .expireAfterWrite(1, java.util.concurrent.TimeUnit.MINUTES) +- .build( +- new com.google.common.cache.CacheLoader<>() { +- @Override +- public Boolean load(CraftPlayer player) { +- return player.hasPermission("purpur.bypassIdleKick"); +- } +- } +- ); +- // Purpur end ++ .build(player -> player.hasPermission("purpur.bypassIdleKick")); ++ // Purpur end // Leaf - Use caffeine cache kickPermission instead of using google.common.cache + + @Override + public void tick() { +@@ -416,7 +409,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits + // Purpur start + this.player.setAfk(true); +- if (!this.player.level().purpurConfig.idleTimeoutKick || (!Boolean.parseBoolean(System.getenv("PURPUR_FORCE_IDLE_KICK")) && kickPermissionCache.getUnchecked(this.player.getBukkitEntity()))) { ++ if (!this.player.level().purpurConfig.idleTimeoutKick || (!Boolean.parseBoolean(System.getenv("PURPUR_FORCE_IDLE_KICK")) && kickPermissionCache.get(this.player.getBukkitEntity()))) { // Leaf - Use caffeine cache kickPermission instead of using google.common.cache + return; + } + // Purpur end diff --git a/patches/server/0026-Leaves-Zero-tick-plants.patch b/patches/server/0027-Leaves-Zero-tick-plants.patch similarity index 100% rename from patches/server/0026-Leaves-Zero-tick-plants.patch rename to patches/server/0027-Leaves-Zero-tick-plants.patch diff --git a/patches/server/0027-Leaves-Entity-Utils.patch b/patches/server/0028-Leaves-Entity-Utils.patch similarity index 100% rename from patches/server/0027-Leaves-Entity-Utils.patch rename to patches/server/0028-Leaves-Entity-Utils.patch diff --git a/patches/server/0028-Leaves-Return-nether-portal-fix.patch b/patches/server/0029-Leaves-Return-nether-portal-fix.patch similarity index 100% rename from patches/server/0028-Leaves-Return-nether-portal-fix.patch rename to patches/server/0029-Leaves-Return-nether-portal-fix.patch diff --git a/patches/server/0029-Leaves-Vanilla-hopper.patch b/patches/server/0030-Leaves-Vanilla-hopper.patch similarity index 100% rename from patches/server/0029-Leaves-Vanilla-hopper.patch rename to patches/server/0030-Leaves-Vanilla-hopper.patch diff --git a/patches/server/0030-Leaves-Raider-die-skip-self-raid-check.patch b/patches/server/0031-Leaves-Raider-die-skip-self-raid-check.patch similarity index 100% rename from patches/server/0030-Leaves-Raider-die-skip-self-raid-check.patch rename to patches/server/0031-Leaves-Raider-die-skip-self-raid-check.patch diff --git a/patches/server/0031-Pufferfish-Optimize-entity-coordinate-key.patch b/patches/server/0032-Pufferfish-Optimize-entity-coordinate-key.patch similarity index 95% rename from patches/server/0031-Pufferfish-Optimize-entity-coordinate-key.patch rename to patches/server/0032-Pufferfish-Optimize-entity-coordinate-key.patch index 37258de..a15bfdc 100644 --- a/patches/server/0031-Pufferfish-Optimize-entity-coordinate-key.patch +++ b/patches/server/0032-Pufferfish-Optimize-entity-coordinate-key.patch @@ -27,7 +27,7 @@ index 0e1dedb9baf70bd788a665e3cd7e53aa5f55def3..6c57a4bb3e30f906fddf84957533868a public static long getCoordinateKey(final ChunkPos pair) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 24c4140e44b021728e39310f4e8bb93ada4adc0f..1390bc0f51ea2c957e470135eba1564f02840de9 100644 +index 54065a663adeec4f8d429a14dd1e4f5fd47a6f48..e1b63e185f054b35b1ba522407541b21247e2e1f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -315,7 +315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0032-Pufferfish-Improve-container-checking-with-a-bitset.patch b/patches/server/0033-Pufferfish-Improve-container-checking-with-a-bitset.patch similarity index 100% rename from patches/server/0032-Pufferfish-Improve-container-checking-with-a-bitset.patch rename to patches/server/0033-Pufferfish-Improve-container-checking-with-a-bitset.patch diff --git a/patches/server/0033-Mobtimizations-RePathing-optimization.patch b/patches/server/0034-Mobtimizations-RePathing-optimization.patch similarity index 100% rename from patches/server/0033-Mobtimizations-RePathing-optimization.patch rename to patches/server/0034-Mobtimizations-RePathing-optimization.patch diff --git a/patches/server/0034-Mobtimizations-Optimization-Zombie-Search-And-Destro.patch b/patches/server/0035-Mobtimizations-Optimization-Zombie-Search-And-Destro.patch similarity index 100% rename from patches/server/0034-Mobtimizations-Optimization-Zombie-Search-And-Destro.patch rename to patches/server/0035-Mobtimizations-Optimization-Zombie-Search-And-Destro.patch diff --git a/patches/server/0035-Divine-Implement-Secure-Seed.patch b/patches/server/0036-Divine-Implement-Secure-Seed.patch similarity index 100% rename from patches/server/0035-Divine-Implement-Secure-Seed.patch rename to patches/server/0036-Divine-Implement-Secure-Seed.patch diff --git a/patches/server/0036-Divine-Fix-MC-31819.patch b/patches/server/0037-Divine-Fix-MC-31819.patch similarity index 100% rename from patches/server/0036-Divine-Fix-MC-31819.patch rename to patches/server/0037-Divine-Fix-MC-31819.patch diff --git a/patches/server/0037-Divine-Fix-MC-172801.patch b/patches/server/0038-Divine-Fix-MC-172801.patch similarity index 100% rename from patches/server/0037-Divine-Fix-MC-172801.patch rename to patches/server/0038-Divine-Fix-MC-172801.patch diff --git a/patches/server/0038-Divine-Fix-MC-2025.patch b/patches/server/0039-Divine-Fix-MC-2025.patch similarity index 100% rename from patches/server/0038-Divine-Fix-MC-2025.patch rename to patches/server/0039-Divine-Fix-MC-2025.patch diff --git a/patches/server/0039-Divine-C2ME-reduce_allocs.patch b/patches/server/0040-Divine-C2ME-reduce_allocs.patch similarity index 100% rename from patches/server/0039-Divine-C2ME-reduce_allocs.patch rename to patches/server/0040-Divine-C2ME-reduce_allocs.patch diff --git a/patches/server/0040-Divine-C2ME-opts-math.patch b/patches/server/0041-Divine-C2ME-opts-math.patch similarity index 100% rename from patches/server/0040-Divine-C2ME-opts-math.patch rename to patches/server/0041-Divine-C2ME-opts-math.patch diff --git a/patches/server/0041-Divine-Fix-MC-7569.patch b/patches/server/0042-Divine-Fix-MC-7569.patch similarity index 100% rename from patches/server/0041-Divine-Fix-MC-7569.patch rename to patches/server/0042-Divine-Fix-MC-7569.patch diff --git a/patches/server/0042-Divine-lithium-math.sine_lut.patch b/patches/server/0043-Divine-lithium-math.sine_lut.patch similarity index 100% rename from patches/server/0042-Divine-lithium-math.sine_lut.patch rename to patches/server/0043-Divine-lithium-math.sine_lut.patch diff --git a/patches/server/0043-Divine-lithium-cached_hashcode.patch b/patches/server/0044-Divine-lithium-cached_hashcode.patch similarity index 100% rename from patches/server/0043-Divine-lithium-cached_hashcode.patch rename to patches/server/0044-Divine-lithium-cached_hashcode.patch diff --git a/patches/server/0044-Divine-Fix-MC-93826.patch b/patches/server/0045-Divine-Fix-MC-93826.patch similarity index 100% rename from patches/server/0044-Divine-Fix-MC-93826.patch rename to patches/server/0045-Divine-Fix-MC-93826.patch diff --git a/patches/server/0045-Divine-Fix-MC-110386.patch b/patches/server/0046-Divine-Fix-MC-110386.patch similarity index 100% rename from patches/server/0045-Divine-Fix-MC-110386.patch rename to patches/server/0046-Divine-Fix-MC-110386.patch diff --git a/patches/server/0046-Divine-Fix-MC-98160-and-MC-105103.patch b/patches/server/0047-Divine-Fix-MC-98160-and-MC-105103.patch similarity index 100% rename from patches/server/0046-Divine-Fix-MC-98160-and-MC-105103.patch rename to patches/server/0047-Divine-Fix-MC-98160-and-MC-105103.patch diff --git a/patches/server/0047-Divine-Fix-MC-93018.patch b/patches/server/0048-Divine-Fix-MC-93018.patch similarity index 100% rename from patches/server/0047-Divine-Fix-MC-93018.patch rename to patches/server/0048-Divine-Fix-MC-93018.patch diff --git a/patches/server/0048-Divine-Fix-MC-65198.patch b/patches/server/0049-Divine-Fix-MC-65198.patch similarity index 100% rename from patches/server/0048-Divine-Fix-MC-65198.patch rename to patches/server/0049-Divine-Fix-MC-65198.patch diff --git a/patches/server/0049-Divine-Fix-MC-167242.patch b/patches/server/0050-Divine-Fix-MC-167242.patch similarity index 100% rename from patches/server/0049-Divine-Fix-MC-167242.patch rename to patches/server/0050-Divine-Fix-MC-167242.patch diff --git a/patches/server/0050-Canvas-Dont-load-chunks-to-spawn-phantoms.patch b/patches/server/0051-Canvas-Dont-load-chunks-to-spawn-phantoms.patch similarity index 100% rename from patches/server/0050-Canvas-Dont-load-chunks-to-spawn-phantoms.patch rename to patches/server/0051-Canvas-Dont-load-chunks-to-spawn-phantoms.patch diff --git a/patches/server/0051-CarpetFix-incorrectBounceLogicFix.patch b/patches/server/0052-CarpetFix-incorrectBounceLogicFix.patch similarity index 100% rename from patches/server/0051-CarpetFix-incorrectBounceLogicFix.patch rename to patches/server/0052-CarpetFix-incorrectBounceLogicFix.patch diff --git a/patches/server/0052-CarpetFix-explosionBreaksItemFrameInWaterFix.patch b/patches/server/0053-CarpetFix-explosionBreaksItemFrameInWaterFix.patch similarity index 100% rename from patches/server/0052-CarpetFix-explosionBreaksItemFrameInWaterFix.patch rename to patches/server/0053-CarpetFix-explosionBreaksItemFrameInWaterFix.patch diff --git a/patches/server/0053-Carpet-TIS-Addition-Random-flatten-triangular-distri.patch b/patches/server/0054-Carpet-TIS-Addition-Random-flatten-triangular-distri.patch similarity index 100% rename from patches/server/0053-Carpet-TIS-Addition-Random-flatten-triangular-distri.patch rename to patches/server/0054-Carpet-TIS-Addition-Random-flatten-triangular-distri.patch diff --git a/patches/server/0054-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch b/patches/server/0055-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch similarity index 100% rename from patches/server/0054-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch rename to patches/server/0055-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch diff --git a/patches/server/0055-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch b/patches/server/0056-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch similarity index 100% rename from patches/server/0055-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch rename to patches/server/0056-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch diff --git a/patches/server/0056-ScalableLux-Upstream-Starlight-Fix.patch b/patches/server/0057-ScalableLux-Upstream-Starlight-Fix.patch similarity index 100% rename from patches/server/0056-ScalableLux-Upstream-Starlight-Fix.patch rename to patches/server/0057-ScalableLux-Upstream-Starlight-Fix.patch diff --git a/patches/server/0057-Gale-Use-platform-math-functions.patch b/patches/server/0058-Gale-Use-platform-math-functions.patch similarity index 100% rename from patches/server/0057-Gale-Use-platform-math-functions.patch rename to patches/server/0058-Gale-Use-platform-math-functions.patch diff --git a/patches/server/0058-Gale-Faster-floating-point-positive-modulo.patch b/patches/server/0059-Gale-Faster-floating-point-positive-modulo.patch similarity index 100% rename from patches/server/0058-Gale-Faster-floating-point-positive-modulo.patch rename to patches/server/0059-Gale-Faster-floating-point-positive-modulo.patch diff --git a/patches/server/0059-Gale-Specific-interval-TPS-API.patch b/patches/server/0060-Gale-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0059-Gale-Specific-interval-TPS-API.patch rename to patches/server/0060-Gale-Specific-interval-TPS-API.patch diff --git a/patches/server/0060-Gale-Reduce-block-destruction-packet-allocations.patch b/patches/server/0061-Gale-Reduce-block-destruction-packet-allocations.patch similarity index 100% rename from patches/server/0060-Gale-Reduce-block-destruction-packet-allocations.patch rename to patches/server/0061-Gale-Reduce-block-destruction-packet-allocations.patch diff --git a/patches/server/0061-Gale-Optimize-matching-item-checks.patch b/patches/server/0062-Gale-Optimize-matching-item-checks.patch similarity index 100% rename from patches/server/0061-Gale-Optimize-matching-item-checks.patch rename to patches/server/0062-Gale-Optimize-matching-item-checks.patch diff --git a/patches/server/0062-Gale-Store-mob-counts-in-an-array.patch b/patches/server/0063-Gale-Store-mob-counts-in-an-array.patch similarity index 100% rename from patches/server/0062-Gale-Store-mob-counts-in-an-array.patch rename to patches/server/0063-Gale-Store-mob-counts-in-an-array.patch diff --git a/patches/server/0063-Gale-For-collision-check-has-physics-before-same-veh.patch b/patches/server/0064-Gale-For-collision-check-has-physics-before-same-veh.patch similarity index 94% rename from patches/server/0063-Gale-For-collision-check-has-physics-before-same-veh.patch rename to patches/server/0064-Gale-For-collision-check-has-physics-before-same-veh.patch index b1eefd5..995979a 100644 --- a/patches/server/0063-Gale-For-collision-check-has-physics-before-same-veh.patch +++ b/patches/server/0064-Gale-For-collision-check-has-physics-before-same-veh.patch @@ -16,7 +16,7 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 34fbfdd87e7a7ddcaa22813a55142a559235af51..a806b1ca018091ceef1aa22a03a54d6de45efcd8 100644 +index ca9d63cd2212191ff41b1161f683876c90f701d9..a14906340a6278ee2740b6f0d1a160f8555ba13a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2229,8 +2229,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0064-Canvas-Optimize-Math.round-and-Math.hypot.patch b/patches/server/0065-Canvas-Optimize-Math.round-and-Math.hypot.patch similarity index 100% rename from patches/server/0064-Canvas-Optimize-Math.round-and-Math.hypot.patch rename to patches/server/0065-Canvas-Optimize-Math.round-and-Math.hypot.patch diff --git a/patches/server/0065-MemoryLeakFix-Biome.patch b/patches/server/0066-MemoryLeakFix-Biome.patch similarity index 100% rename from patches/server/0065-MemoryLeakFix-Biome.patch rename to patches/server/0066-MemoryLeakFix-Biome.patch diff --git a/patches/server/0066-Paper-Check-for-block-type-in-SculkSensorBlock-canAc.patch b/patches/server/0067-Paper-Check-for-block-type-in-SculkSensorBlock-canAc.patch similarity index 100% rename from patches/server/0066-Paper-Check-for-block-type-in-SculkSensorBlock-canAc.patch rename to patches/server/0067-Paper-Check-for-block-type-in-SculkSensorBlock-canAc.patch diff --git a/patches/server/0067-lithium-precompute-shape-arrays.patch b/patches/server/0068-lithium-precompute-shape-arrays.patch similarity index 100% rename from patches/server/0067-lithium-precompute-shape-arrays.patch rename to patches/server/0068-lithium-precompute-shape-arrays.patch diff --git a/patches/server/0068-vmp-TypeFilterableList.patch b/patches/server/0069-vmp-TypeFilterableList.patch similarity index 100% rename from patches/server/0068-vmp-TypeFilterableList.patch rename to patches/server/0069-vmp-TypeFilterableList.patch diff --git a/patches/server/0069-Slice-Improve-map-saving-performance.patch b/patches/server/0070-Slice-Improve-map-saving-performance.patch similarity index 100% rename from patches/server/0069-Slice-Improve-map-saving-performance.patch rename to patches/server/0070-Slice-Improve-map-saving-performance.patch diff --git a/patches/server/0070-Slice-noEntityCollisions-for-Entity.patch b/patches/server/0071-Slice-noEntityCollisions-for-Entity.patch similarity index 94% rename from patches/server/0070-Slice-noEntityCollisions-for-Entity.patch rename to patches/server/0071-Slice-noEntityCollisions-for-Entity.patch index 07ad396..a891bb3 100644 --- a/patches/server/0070-Slice-noEntityCollisions-for-Entity.patch +++ b/patches/server/0071-Slice-noEntityCollisions-for-Entity.patch @@ -18,7 +18,7 @@ index ee8e9c0e3690e78f3cc621ddfca89ea4256d4803..0466b04f24830539f2c927481c1c7995 } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 5d34f5a52219474d8ef91a9f030dde4f0c3aa8e5..95ca447e102e505d37a61f5c98f625bc1490a3fb 100644 +index a14906340a6278ee2740b6f0d1a160f8555ba13a..dbbb5db2764098d677ad730652ff43ce9e4e3ca4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -542,6 +542,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess