From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Wed, 30 Nov 2022 17:35:06 +0100 Subject: [PATCH] Replace game rules map with optimized collection License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Gale - https://galemc.org This patch is based on the following mixin: "net/caffeinemc/mods/lithium/mixin/collections/gamerules/GameRulesMixin.java" By: 2No2Name <2No2Name@web.de> As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java index d5536dd40a1e9a2e05967652f690abbbca287852..966ca1e0e828e4176e12cbcf8c4a6b16489708de 100644 --- a/net/minecraft/world/level/GameRules.java +++ b/net/minecraft/world/level/GameRules.java @@ -288,7 +288,7 @@ public class GameRules { } private GameRules(Map, GameRules.Value> rules, FeatureFlagSet enabledFeatures) { - this.rules = rules; + this.rules = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(rules); // Gale - Lithium - replace game rules map with optimized collection this.enabledFeatures = enabledFeatures; // Paper start - Perf: Use array for gamerule storage