mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-25 18:09:17 +00:00
Merge remote-tracking branch 'origin/ver/1.20.6' into ver/1.20.6
This commit is contained in:
@@ -11,12 +11,13 @@ repositories {
|
||||
maven(paperMavenPublicUrl) {
|
||||
content { onlyForConfigurations(configurations.paperclip.name) }
|
||||
}
|
||||
maven("https://maven.nostal.ink/repository/maven-snapshots/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
|
||||
decompiler("org.vineflower:vineflower:1.10.1")
|
||||
paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
|
||||
paperclip("cn.dreeam:quantumleaper:1.0.0-SNAPSHOT")
|
||||
}
|
||||
|
||||
subprojects {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
group = org.dreeam.leaf
|
||||
version = 1.20.6-R0.1-SNAPSHOT
|
||||
|
||||
galeCommit = 454a795cab19c2690483401c2b461a7bb2bd0cbc
|
||||
galeCommit = 6582b9b215859997f52debf81c75dfb7aec3e2ac
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
@@ -140,7 +140,7 @@ index 0b5979723bb30f9011ac64c36d894aa41713ec9b..17e3ee3a73a2347e9f0baa0ed1640a3b
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java b/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java
|
||||
index 3d674eca7d20202d8f811c5c3e3946a12046028a..291f0d7f952f12a6bcdaf6ae5aedaf13d907a7bb 100644
|
||||
index 3d674eca7d20202d8f811c5c3e3946a12046028a..1c087ae6daaa0cdf23f3930eca0af390469eab3d 100644
|
||||
--- a/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java
|
||||
+++ b/src/main/java/org/galemc/gale/version/GaleVersionFetcher.java
|
||||
@@ -5,7 +5,7 @@ package org.galemc.gale.version;
|
||||
@@ -148,7 +148,7 @@ index 3d674eca7d20202d8f811c5c3e3946a12046028a..291f0d7f952f12a6bcdaf6ae5aedaf13
|
||||
|
||||
public GaleVersionFetcher() {
|
||||
- super("ver/1.20.2", "https://github.com/GaleMC/Gale", "Gale", "GaleMC", "GaleMC", "Gale");
|
||||
+ super("ver/1.20.5", "https://github.com/Winds-Studio/Leaf", "Leaf", "Winds-Studio", "Winds-Studio", "Leaf"); // Leaf
|
||||
+ super("ver/1.20.6", "https://github.com/Winds-Studio/Leaf", "Leaf", "Winds-Studio", "Winds-Studio", "Leaf"); // Leaf
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
20
patches/server/0067-Ignore-terminal-provider-warning.patch
Normal file
20
patches/server/0067-Ignore-terminal-provider-warning.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||
Date: Thu, 2 May 2024 20:21:29 -0400
|
||||
Subject: [PATCH] Ignore terminal provider warning
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 05b4d0ae35f203a62079cf19285d09d9d355a033..b6c68c250826698c058b95642850ec42645de2f7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -353,6 +353,9 @@ public class Main {
|
||||
// Paper end - Log Java and OS versioning to help with debugging plugin issues
|
||||
|
||||
printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // Gale - include time in startup logs
|
||||
+
|
||||
+ System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
|
||||
+
|
||||
net.minecraft.server.Main.main(options);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
20
patches/server/0068-Fix-console-freeze-above-JAVA-22.patch
Normal file
20
patches/server/0068-Fix-console-freeze-above-JAVA-22.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
||||
Date: Sat, 4 May 2024 02:46:17 -0400
|
||||
Subject: [PATCH] Fix console freeze above JAVA 22
|
||||
|
||||
Revert to old console provider, Fix https://github.com/PaperMC/Paper/issues/10405
|
||||
Solution refers to https://inside.java/2023/07/31/quality-heads-up
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index b6c68c250826698c058b95642850ec42645de2f7..b4599dae7bc59e67eee22a7b70d148d4f63669b5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -355,6 +355,7 @@ public class Main {
|
||||
printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // Gale - include time in startup logs
|
||||
|
||||
System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
|
||||
+ if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22
|
||||
|
||||
net.minecraft.server.Main.main(options);
|
||||
} catch (Throwable t) {
|
||||
173
patches/server/0069-Faster-Random-Generator.patch
Normal file
173
patches/server/0069-Faster-Random-Generator.patch
Normal file
@@ -0,0 +1,173 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: HaHaWTH <fsjk947@gmail.com>
|
||||
Date: Fri, 3 May 2024 01:12:58 +0800
|
||||
Subject: [PATCH] Faster-Random-Generator
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/RandomSource.java b/src/main/java/net/minecraft/util/RandomSource.java
|
||||
index 7762c8186035fdf60e11d9f1844516b61f442206..c2f0b5933c61168cbde507f04674e95b78e2d7f3 100644
|
||||
--- a/src/main/java/net/minecraft/util/RandomSource.java
|
||||
+++ b/src/main/java/net/minecraft/util/RandomSource.java
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.world.level.levelgen.PositionalRandomFactory;
|
||||
import net.minecraft.world.level.levelgen.RandomSupport;
|
||||
import net.minecraft.world.level.levelgen.SingleThreadedRandomSource;
|
||||
import net.minecraft.world.level.levelgen.ThreadSafeLegacyRandomSource;
|
||||
+import org.dreeam.leaf.util.math.random.TheFasterRandom;
|
||||
|
||||
public interface RandomSource {
|
||||
@Deprecated
|
||||
@@ -23,16 +24,16 @@ public interface RandomSource {
|
||||
|
||||
@Deprecated
|
||||
static RandomSource createThreadSafe() {
|
||||
- return new ThreadSafeLegacyRandomSource(RandomSupport.generateUniqueSeed());
|
||||
- }
|
||||
+ return org.dreeam.leaf.config.modules.opt.FastRNG.enabled ? new TheFasterRandom(RandomSupport.generateFasterSeed()) : new ThreadSafeLegacyRandomSource(RandomSupport.generateUniqueSeed());
|
||||
+ } // Leaf - Faster RNG
|
||||
|
||||
static RandomSource create(long seed) {
|
||||
- return new LegacyRandomSource(seed);
|
||||
- }
|
||||
+ return org.dreeam.leaf.config.modules.opt.FastRNG.enabled ? new TheFasterRandom(seed) : new LegacyRandomSource(seed);
|
||||
+ } // Leaf - Faster RNG
|
||||
|
||||
static RandomSource createNewThreadLocalInstance() {
|
||||
- return new SingleThreadedRandomSource(ThreadLocalRandom.current().nextLong());
|
||||
- }
|
||||
+ return org.dreeam.leaf.config.modules.opt.FastRNG.enabled ? new TheFasterRandom(RandomSupport.generateFasterSeed()) : new SingleThreadedRandomSource(ThreadLocalRandom.current().nextLong());
|
||||
+ } // Leaf - Faster RNG
|
||||
|
||||
RandomSource fork();
|
||||
|
||||
diff --git a/src/main/java/org/dreeam/leaf/config/modules/opt/FastRNG.java b/src/main/java/org/dreeam/leaf/config/modules/opt/FastRNG.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..13b3adcf44f1c41ffda8ee5ceee085be01991324
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/config/modules/opt/FastRNG.java
|
||||
@@ -0,0 +1,31 @@
|
||||
+package org.dreeam.leaf.config.modules.opt;
|
||||
+
|
||||
+import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
+import org.dreeam.leaf.config.ConfigInfo;
|
||||
+import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
+import org.dreeam.leaf.config.IConfigModule;
|
||||
+
|
||||
+public class FastRNG implements IConfigModule {
|
||||
+
|
||||
+ @Override
|
||||
+ public EnumConfigCategory getCategory() {
|
||||
+ return EnumConfigCategory.PERFORMANCE;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getBaseName() {
|
||||
+ return "use_faster_random_generator";
|
||||
+ }
|
||||
+
|
||||
+ @ConfigInfo(baseName = "enabled")
|
||||
+ public static boolean enabled = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public void onLoaded(CommentedFileConfig config) {
|
||||
+ config.setComment("performance.use_faster_random_generator", """
|
||||
+ Use faster random generator? (Up to 100X faster)
|
||||
+ Requires a JVM that supports RandomGenerator and the LXM generators.
|
||||
+ Some JREs don't support this and will cause a crash.
|
||||
+ """);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/util/math/random/TheFasterRandom.java b/src/main/java/org/dreeam/leaf/util/math/random/TheFasterRandom.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c13c8e5a2fba4267eb254e75f993bc6a9b861f6e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/util/math/random/TheFasterRandom.java
|
||||
@@ -0,0 +1,89 @@
|
||||
+package org.dreeam.leaf.util.math.random;
|
||||
+
|
||||
+import net.minecraft.util.RandomSource;
|
||||
+import net.minecraft.world.level.levelgen.BitRandomSource;
|
||||
+import net.minecraft.world.level.levelgen.LegacyRandomSource;
|
||||
+import net.minecraft.world.level.levelgen.PositionalRandomFactory;
|
||||
+
|
||||
+import java.util.random.RandomGenerator;
|
||||
+import java.util.random.RandomGeneratorFactory;
|
||||
+
|
||||
+
|
||||
+public class TheFasterRandom implements BitRandomSource {
|
||||
+ private static final int INT_BITS = 48;
|
||||
+ private static final long SEED_MASK = 0xFFFFFFFFFFFFL;
|
||||
+ private static final long MULTIPLIER = 25214903917L;
|
||||
+ private static final long INCREMENT = 11L;
|
||||
+ private static final RandomGeneratorFactory<RandomGenerator.SplittableGenerator> RANDOM_GENERATOR_FACTORY = RandomGeneratorFactory.of(
|
||||
+ "L64X128MixRandom");
|
||||
+
|
||||
+ private long seed;
|
||||
+ private RandomGenerator.SplittableGenerator randomGenerator;
|
||||
+
|
||||
+ public TheFasterRandom(long seed) {
|
||||
+ this.seed = seed;
|
||||
+ this.randomGenerator = RANDOM_GENERATOR_FACTORY.create(seed);
|
||||
+ }
|
||||
+
|
||||
+ public TheFasterRandom(long seed, RandomGenerator.SplittableGenerator randomGenerator) {
|
||||
+ this.seed = seed;
|
||||
+ this.randomGenerator = randomGenerator;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public RandomSource fork() {
|
||||
+ return new TheFasterRandom(seed, randomGenerator.split());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public PositionalRandomFactory forkPositional() {
|
||||
+ return new LegacyRandomSource.LegacyPositionalRandomFactory(this.seed);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSeed(long seed) {
|
||||
+ this.seed = seed;
|
||||
+ this.randomGenerator = RANDOM_GENERATOR_FACTORY.create(seed);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int next(int bits) {
|
||||
+ // >>> instead of Mojang's >> fixes MC-239059
|
||||
+ return (int) ((seed * MULTIPLIER + INCREMENT & SEED_MASK) >>> INT_BITS - bits);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt() {
|
||||
+ return randomGenerator.nextInt();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt(int bound) {
|
||||
+ return randomGenerator.nextInt(bound);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public long nextLong() {
|
||||
+ return randomGenerator.nextLong();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean nextBoolean() {
|
||||
+ return randomGenerator.nextBoolean();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float nextFloat() {
|
||||
+ return randomGenerator.nextFloat();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextDouble() {
|
||||
+ return randomGenerator.nextDouble();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextGaussian() {
|
||||
+ return randomGenerator.nextGaussian();
|
||||
+ }
|
||||
+}
|
||||
Reference in New Issue
Block a user