From a3f3dbab2f8604fd2dea3f5ccdd93ec1747730e8 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:34:29 -0500 Subject: [PATCH] Paper: Fix: move to jline-terminal-ffm on java 22+ and fall back to jni on 21 --- ...o-jline-terminal-ffm-on-java-22-and-.patch | 29 +++++++++++++++++++ ...25-Dont-send-useless-entity-packets.patch} | 0 ...n-t-spawn-if-lastSpawnState-is-null.patch} | 0 ...patch => 0127-Multithreaded-Tracker.patch} | 0 ...> 0128-Nitori-Async-playerdata-Save.patch} | 0 ...atch => 0129-Change-max-stack-count.patch} | 0 ...plexity-to-make-block-isValid-calls.patch} | 0 ...e-nearby-alive-players-for-spawning.patch} | 0 ...atch => 0132-Cache-blockstate-cache.patch} | 0 ....patch => 0133-Asynchronous-locator.patch} | 0 ...tities-in-NearestLivingEntitySensor.patch} | 0 ...uce-memory-footprint-of-CompoundTag.patch} | 0 ... 0136-Optimize-Entity-distanceToSqr.patch} | 0 ...e-snapshots-for-TileEntity-getOwner.patch} | 2 +- ...ault-don-t-use-blockstate-snapshots.patch} | 0 ... => 0139-Cache-tile-entity-position.patch} | 0 ...patch => 0140-TT20-Lag-compensation.patch} | 0 ...behavior-in-fluid-caused-by-inconsi.patch} | 2 +- ...tch => 0142-C2ME-Reduce-Allocations.patch} | 0 ...cessary-calculations-if-player-is-n.patch} | 0 ...til.patch => 0144-Lithium-fast-util.patch} | 0 ...atch => 0145-Lithium-CompactSineLUT.patch} | 0 ...> 0146-Lithium-IterateOutwardsCache.patch} | 0 ...st.patch => 0147-Lithium-HashedList.patch} | 0 ...ncExecutor-for-MAIN_WORKER_EXECUTOR.patch} | 0 ... => 0149-Better-inline-world-height.patch} | 0 ...read-safe-ban-list-date-format-pars.patch} | 0 ...tartEachNonRunningBehavior-in-Brain.patch} | 0 ... => 0152-Lithium-equipment-tracking.patch} | 0 ...CraftServer-getworlds-list-creation.patch} | 0 ...> 0154-C2ME-Optimize-world-gen-math.patch} | 0 31 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 patches/server/0124-Paper-Fix-move-to-jline-terminal-ffm-on-java-22-and-.patch rename patches/server/{0124-Dont-send-useless-entity-packets.patch => 0125-Dont-send-useless-entity-packets.patch} (100%) rename patches/server/{0125-Don-t-spawn-if-lastSpawnState-is-null.patch => 0126-Don-t-spawn-if-lastSpawnState-is-null.patch} (100%) rename patches/server/{0126-Multithreaded-Tracker.patch => 0127-Multithreaded-Tracker.patch} (100%) rename patches/server/{0127-Nitori-Async-playerdata-Save.patch => 0128-Nitori-Async-playerdata-Save.patch} (100%) rename patches/server/{0128-Change-max-stack-count.patch => 0129-Change-max-stack-count.patch} (100%) rename patches/server/{0129-Reduce-object-complexity-to-make-block-isValid-calls.patch => 0130-Reduce-object-complexity-to-make-block-isValid-calls.patch} (100%) rename patches/server/{0130-Optimize-nearby-alive-players-for-spawning.patch => 0131-Optimize-nearby-alive-players-for-spawning.patch} (100%) rename patches/server/{0131-Cache-blockstate-cache.patch => 0132-Cache-blockstate-cache.patch} (100%) rename patches/server/{0132-Asynchronous-locator.patch => 0133-Asynchronous-locator.patch} (100%) rename patches/server/{0133-Smart-sort-entities-in-NearestLivingEntitySensor.patch => 0134-Smart-sort-entities-in-NearestLivingEntitySensor.patch} (100%) rename patches/server/{0134-Further-reduce-memory-footprint-of-CompoundTag.patch => 0135-Further-reduce-memory-footprint-of-CompoundTag.patch} (100%) rename patches/server/{0135-Optimize-Entity-distanceToSqr.patch => 0136-Optimize-Entity-distanceToSqr.patch} (100%) rename patches/server/{0136-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch => 0137-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch} (96%) rename patches/server/{0137-EMC-Default-don-t-use-blockstate-snapshots.patch => 0138-EMC-Default-don-t-use-blockstate-snapshots.patch} (100%) rename patches/server/{0138-Cache-tile-entity-position.patch => 0139-Cache-tile-entity-position.patch} (100%) rename patches/server/{0139-TT20-Lag-compensation.patch => 0140-TT20-Lag-compensation.patch} (100%) rename patches/server/{0140-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch => 0141-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch} (94%) rename patches/server/{0141-C2ME-Reduce-Allocations.patch => 0142-C2ME-Reduce-Allocations.patch} (100%) rename patches/server/{0142-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch => 0143-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch} (100%) rename patches/server/{0143-Lithium-fast-util.patch => 0144-Lithium-fast-util.patch} (100%) rename patches/server/{0144-Lithium-CompactSineLUT.patch => 0145-Lithium-CompactSineLUT.patch} (100%) rename patches/server/{0145-Lithium-IterateOutwardsCache.patch => 0146-Lithium-IterateOutwardsCache.patch} (100%) rename patches/server/{0146-Lithium-HashedList.patch => 0147-Lithium-HashedList.patch} (100%) rename patches/server/{0147-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch => 0148-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch} (100%) rename patches/server/{0148-Better-inline-world-height.patch => 0149-Better-inline-world-height.patch} (100%) rename patches/server/{0149-Use-faster-and-thread-safe-ban-list-date-format-pars.patch => 0150-Use-faster-and-thread-safe-ban-list-date-format-pars.patch} (100%) rename patches/server/{0150-Collect-then-startEachNonRunningBehavior-in-Brain.patch => 0151-Collect-then-startEachNonRunningBehavior-in-Brain.patch} (100%) rename patches/server/{0151-Lithium-equipment-tracking.patch => 0152-Lithium-equipment-tracking.patch} (100%) rename patches/server/{0152-Faster-CraftServer-getworlds-list-creation.patch => 0153-Faster-CraftServer-getworlds-list-creation.patch} (100%) rename patches/server/{0153-C2ME-Optimize-world-gen-math.patch => 0154-C2ME-Optimize-world-gen-math.patch} (100%) diff --git a/patches/server/0124-Paper-Fix-move-to-jline-terminal-ffm-on-java-22-and-.patch b/patches/server/0124-Paper-Fix-move-to-jline-terminal-ffm-on-java-22-and-.patch new file mode 100644 index 000000000..348bf34db --- /dev/null +++ b/patches/server/0124-Paper-Fix-move-to-jline-terminal-ffm-on-java-22-and-.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MiniDigger | Martin +Date: Sun, 17 Nov 2024 20:31:50 +0100 +Subject: [PATCH] Paper: Fix: move to jline-terminal-ffm on java 22+ and fall + back to jni on 21 + +Original license: GPLv3 +Original project: https://github.com/PaperMC/Paper +Paper pull request: https://github.com/PaperMC/Paper/pull/11631 + +Ported from Paper 1.21.3 +Also see Leaf's Fix-console-freeze-above-JAVA-22.patch + +ffm requires 1) native access allowed (the jdk cracks down on undocumented native access in 22) and 2) reverting the default console back to java.base, so the internal jline doesnt take over + +diff --git a/build.gradle.kts b/build.gradle.kts +index 068ec805a51764fbe22b91578797e553a7bca1f8..572af93c43a66e6ae17b4aee219a87c5168e3dfa 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -31,7 +31,8 @@ dependencies { + // Leaf end - Libraries + + // Paper start +- implementation("org.jline:jline-terminal-jansi:3.27.1") // Leaf - Bump Dependencies ++ implementation("org.jline:jline-terminal-ffm:3.27.1") // Paper - use ffm on java 22+ ++ implementation("org.jline:jline-terminal-jni:3.27.1") // Paper - fall back to jni on java 21 + implementation("net.minecrell:terminalconsoleappender:1.3.0") + implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file + /* diff --git a/patches/server/0124-Dont-send-useless-entity-packets.patch b/patches/server/0125-Dont-send-useless-entity-packets.patch similarity index 100% rename from patches/server/0124-Dont-send-useless-entity-packets.patch rename to patches/server/0125-Dont-send-useless-entity-packets.patch diff --git a/patches/server/0125-Don-t-spawn-if-lastSpawnState-is-null.patch b/patches/server/0126-Don-t-spawn-if-lastSpawnState-is-null.patch similarity index 100% rename from patches/server/0125-Don-t-spawn-if-lastSpawnState-is-null.patch rename to patches/server/0126-Don-t-spawn-if-lastSpawnState-is-null.patch diff --git a/patches/server/0126-Multithreaded-Tracker.patch b/patches/server/0127-Multithreaded-Tracker.patch similarity index 100% rename from patches/server/0126-Multithreaded-Tracker.patch rename to patches/server/0127-Multithreaded-Tracker.patch diff --git a/patches/server/0127-Nitori-Async-playerdata-Save.patch b/patches/server/0128-Nitori-Async-playerdata-Save.patch similarity index 100% rename from patches/server/0127-Nitori-Async-playerdata-Save.patch rename to patches/server/0128-Nitori-Async-playerdata-Save.patch diff --git a/patches/server/0128-Change-max-stack-count.patch b/patches/server/0129-Change-max-stack-count.patch similarity index 100% rename from patches/server/0128-Change-max-stack-count.patch rename to patches/server/0129-Change-max-stack-count.patch diff --git a/patches/server/0129-Reduce-object-complexity-to-make-block-isValid-calls.patch b/patches/server/0130-Reduce-object-complexity-to-make-block-isValid-calls.patch similarity index 100% rename from patches/server/0129-Reduce-object-complexity-to-make-block-isValid-calls.patch rename to patches/server/0130-Reduce-object-complexity-to-make-block-isValid-calls.patch diff --git a/patches/server/0130-Optimize-nearby-alive-players-for-spawning.patch b/patches/server/0131-Optimize-nearby-alive-players-for-spawning.patch similarity index 100% rename from patches/server/0130-Optimize-nearby-alive-players-for-spawning.patch rename to patches/server/0131-Optimize-nearby-alive-players-for-spawning.patch diff --git a/patches/server/0131-Cache-blockstate-cache.patch b/patches/server/0132-Cache-blockstate-cache.patch similarity index 100% rename from patches/server/0131-Cache-blockstate-cache.patch rename to patches/server/0132-Cache-blockstate-cache.patch diff --git a/patches/server/0132-Asynchronous-locator.patch b/patches/server/0133-Asynchronous-locator.patch similarity index 100% rename from patches/server/0132-Asynchronous-locator.patch rename to patches/server/0133-Asynchronous-locator.patch diff --git a/patches/server/0133-Smart-sort-entities-in-NearestLivingEntitySensor.patch b/patches/server/0134-Smart-sort-entities-in-NearestLivingEntitySensor.patch similarity index 100% rename from patches/server/0133-Smart-sort-entities-in-NearestLivingEntitySensor.patch rename to patches/server/0134-Smart-sort-entities-in-NearestLivingEntitySensor.patch diff --git a/patches/server/0134-Further-reduce-memory-footprint-of-CompoundTag.patch b/patches/server/0135-Further-reduce-memory-footprint-of-CompoundTag.patch similarity index 100% rename from patches/server/0134-Further-reduce-memory-footprint-of-CompoundTag.patch rename to patches/server/0135-Further-reduce-memory-footprint-of-CompoundTag.patch diff --git a/patches/server/0135-Optimize-Entity-distanceToSqr.patch b/patches/server/0136-Optimize-Entity-distanceToSqr.patch similarity index 100% rename from patches/server/0135-Optimize-Entity-distanceToSqr.patch rename to patches/server/0136-Optimize-Entity-distanceToSqr.patch diff --git a/patches/server/0136-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch b/patches/server/0137-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch similarity index 96% rename from patches/server/0136-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch rename to patches/server/0137-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch index 71b573c32..c4dd74a16 100644 --- a/patches/server/0136-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch +++ b/patches/server/0137-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EMC: Don't use snapshots for TileEntity::getOwner Original license: MIT Original project: https://github.com/starlis/empirecraft -Also see EMC-Default-don-t-use-blockstate-snapshots.patch +Also see Leaf's EMC-Default-don-t-use-blockstate-snapshots.patch 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 73c9f91457683e8e6bd8293b4393ccbd984eddb7..7b38835bdac33dce9ed7ca1c0b3d43fdc2224d0c 100644 diff --git a/patches/server/0137-EMC-Default-don-t-use-blockstate-snapshots.patch b/patches/server/0138-EMC-Default-don-t-use-blockstate-snapshots.patch similarity index 100% rename from patches/server/0137-EMC-Default-don-t-use-blockstate-snapshots.patch rename to patches/server/0138-EMC-Default-don-t-use-blockstate-snapshots.patch diff --git a/patches/server/0138-Cache-tile-entity-position.patch b/patches/server/0139-Cache-tile-entity-position.patch similarity index 100% rename from patches/server/0138-Cache-tile-entity-position.patch rename to patches/server/0139-Cache-tile-entity-position.patch diff --git a/patches/server/0139-TT20-Lag-compensation.patch b/patches/server/0140-TT20-Lag-compensation.patch similarity index 100% rename from patches/server/0139-TT20-Lag-compensation.patch rename to patches/server/0140-TT20-Lag-compensation.patch diff --git a/patches/server/0140-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch b/patches/server/0141-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch similarity index 94% rename from patches/server/0140-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch rename to patches/server/0141-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch index c549f990d..a17cd81fe 100644 --- a/patches/server/0140-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch +++ b/patches/server/0141-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch @@ -10,7 +10,7 @@ This issue caused by inconsistent fluid count, because of a condition change in LevelChunkSection#setBlockState, introduced by Moonrise's block count optimisation diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 976d72b611011cccf4b4efadc9772ce1c68ef5ee..1309fa679b4e73645fac6ae04044709915092574 100644 +index 6a19390aff7c8f7170467d2c6306b00779f23082..d0bbbd2044809bdb1273248297f5d9fb87011189 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4797,7 +4797,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0141-C2ME-Reduce-Allocations.patch b/patches/server/0142-C2ME-Reduce-Allocations.patch similarity index 100% rename from patches/server/0141-C2ME-Reduce-Allocations.patch rename to patches/server/0142-C2ME-Reduce-Allocations.patch diff --git a/patches/server/0142-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch b/patches/server/0143-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch similarity index 100% rename from patches/server/0142-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch rename to patches/server/0143-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch diff --git a/patches/server/0143-Lithium-fast-util.patch b/patches/server/0144-Lithium-fast-util.patch similarity index 100% rename from patches/server/0143-Lithium-fast-util.patch rename to patches/server/0144-Lithium-fast-util.patch diff --git a/patches/server/0144-Lithium-CompactSineLUT.patch b/patches/server/0145-Lithium-CompactSineLUT.patch similarity index 100% rename from patches/server/0144-Lithium-CompactSineLUT.patch rename to patches/server/0145-Lithium-CompactSineLUT.patch diff --git a/patches/server/0145-Lithium-IterateOutwardsCache.patch b/patches/server/0146-Lithium-IterateOutwardsCache.patch similarity index 100% rename from patches/server/0145-Lithium-IterateOutwardsCache.patch rename to patches/server/0146-Lithium-IterateOutwardsCache.patch diff --git a/patches/server/0146-Lithium-HashedList.patch b/patches/server/0147-Lithium-HashedList.patch similarity index 100% rename from patches/server/0146-Lithium-HashedList.patch rename to patches/server/0147-Lithium-HashedList.patch diff --git a/patches/server/0147-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch b/patches/server/0148-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch similarity index 100% rename from patches/server/0147-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch rename to patches/server/0148-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch diff --git a/patches/server/0148-Better-inline-world-height.patch b/patches/server/0149-Better-inline-world-height.patch similarity index 100% rename from patches/server/0148-Better-inline-world-height.patch rename to patches/server/0149-Better-inline-world-height.patch diff --git a/patches/server/0149-Use-faster-and-thread-safe-ban-list-date-format-pars.patch b/patches/server/0150-Use-faster-and-thread-safe-ban-list-date-format-pars.patch similarity index 100% rename from patches/server/0149-Use-faster-and-thread-safe-ban-list-date-format-pars.patch rename to patches/server/0150-Use-faster-and-thread-safe-ban-list-date-format-pars.patch diff --git a/patches/server/0150-Collect-then-startEachNonRunningBehavior-in-Brain.patch b/patches/server/0151-Collect-then-startEachNonRunningBehavior-in-Brain.patch similarity index 100% rename from patches/server/0150-Collect-then-startEachNonRunningBehavior-in-Brain.patch rename to patches/server/0151-Collect-then-startEachNonRunningBehavior-in-Brain.patch diff --git a/patches/server/0151-Lithium-equipment-tracking.patch b/patches/server/0152-Lithium-equipment-tracking.patch similarity index 100% rename from patches/server/0151-Lithium-equipment-tracking.patch rename to patches/server/0152-Lithium-equipment-tracking.patch diff --git a/patches/server/0152-Faster-CraftServer-getworlds-list-creation.patch b/patches/server/0153-Faster-CraftServer-getworlds-list-creation.patch similarity index 100% rename from patches/server/0152-Faster-CraftServer-getworlds-list-creation.patch rename to patches/server/0153-Faster-CraftServer-getworlds-list-creation.patch diff --git a/patches/server/0153-C2ME-Optimize-world-gen-math.patch b/patches/server/0154-C2ME-Optimize-world-gen-math.patch similarity index 100% rename from patches/server/0153-C2ME-Optimize-world-gen-math.patch rename to patches/server/0154-C2ME-Optimize-world-gen-math.patch