Rewrite config file system and remove useless patches

This commit is contained in:
MrHua269
2024-02-07 09:16:42 +00:00
parent 541507e23b
commit a9c13dcd70
65 changed files with 1798 additions and 8876 deletions

View File

@@ -1,39 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <novau233@163.com>
Date: Tue, 6 Feb 2024 02:06:42 +0000
Date: Wed, 7 Feb 2024 02:33:00 +0000
Subject: [PATCH] Add config for vanilla random
diff --git a/src/main/java/me/earthme/luminol/LuminolConfig.java b/src/main/java/me/earthme/luminol/LuminolConfig.java
index 8d1ce8eae252fcf05b6a62d2dc467d6d503d3df4..89d8ffc947d265e0e81943ad851e868b622de168 100644
--- a/src/main/java/me/earthme/luminol/LuminolConfig.java
+++ b/src/main/java/me/earthme/luminol/LuminolConfig.java
@@ -19,6 +19,7 @@ public class LuminolConfig {
public static boolean enableSandDuping = false;
public static boolean enableVoidTrading = false;
public static boolean allowIncorrectTripwireUpdating = false;
+ public static boolean useVanillaRandomSource = false;
public static void init() throws IOException {
PARENT_FOLDER.mkdir();
@@ -43,6 +44,7 @@ public class LuminolConfig {
enableSandDuping = get("fixes.enable_sand_duping",enableSandDuping,"If this enabled,The value of safe teleportation will always be false and sand duping will be enabled");
enableVoidTrading = get("fixes.enable_void_trading",enableVoidTrading);
allowIncorrectTripwireUpdating = get("fixes.allow_incorrect_trip_wire_updaing",allowIncorrectTripwireUpdating);
+ useVanillaRandomSource = get("fixes.use_vanilla_random_source",useVanillaRandomSource,"RNG feature related");
}
public static <T> T get(String key,T def){
diff --git a/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java b/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..8ba66e737d36157b3797c308cb9fca804e396915
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/fixes/VanillaRandomSourceConfig.java
@@ -0,0 +1,20 @@
+package me.earthme.luminol.config.modules.fixes;
+
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.EnumConfigCategory;
+import me.earthme.luminol.config.IConfigModule;
+
+public class VanillaRandomSourceConfig implements IConfigModule {
+ @ConfigInfo(baseName = "enable_for_player_entity")
+ public static boolean useLegacyRandomSourceForPlayers = false;
+
+ @Override
+ public EnumConfigCategory getCategory() {
+ return EnumConfigCategory.FIXES;
+ }
+
+ @Override
+ public String getBaseName() {
+ return "vanilla_random_source";
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 4cc0a97c0c3cef23b10930e204039c4450543907..18c9a35624d6d3c94efd5df8e97c4257fd199d0d 100644
index 6b560754382936d4889e5729613077a3401d8740..865804a16fce714497b2c025a869f972787442e3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -565,7 +565,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -563,7 +563,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;
- this.random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
+ this.random = LuminolConfig.useVanillaRandomSource ? RandomSource.create() : SHARED_RANDOM;//Luminol - Add config for vanilla random SHARED_RANDOM // Paper - Share random for entities to make them more random
+ this.random = me.earthme.luminol.config.modules.fixes.VanillaRandomSourceConfig.useLegacyRandomSourceForPlayers ? RandomSource.create() : SHARED_RANDOM;//Luminol - Add config for vanilla random SHARED_RANDOM // Paper - Share random for entities to make them more random
this.remainingFireTicks = -this.getFireImmuneTicks();
this.fluidHeight = new Object2DoubleArrayMap(2);
this.fluidOnEyes = new HashSet();