From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Wed, 31 Jul 2024 12:02:01 +0800 Subject: [PATCH] Add config for vanilla random 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..0e6bfc03be660415c333024b56ac6565e3b61ab1 --- /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",comments = "Related with RNG cracks") + public static boolean useLegacyRandomSourceForPlayers = false; + + @Override + public EnumConfigCategory getCategory() { + return EnumConfigCategory.FIXES; + } + + @Override + public String getBaseName() { + return "use_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 451d4cf162e39acd7ed215f82a5a84f6be6e166a..d98a86e911c6b6bc181d5148e806e2452cb1c6f4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -590,7 +590,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess 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 = 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();