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 ea9ac158fcb98b90dfda997e3a1dfa34455f34a1..bceb900e2ceeb46faebc9925a5dc5275ac16d31c 100644 --- a/net/minecraft/world/level/GameRules.java +++ b/net/minecraft/world/level/GameRules.java @@ -277,7 +277,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