9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-20 15:29:15 +00:00
Files
DivineMC/patches/server/0028-lithium-collections.gamerules.patch
2023-04-11 22:44:13 +03:00

28 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:28:01 +0300
Subject: [PATCH] lithium: collections.gamerules
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 6fa00d9239546aa82b9e92e25a33103868084c38..d91f1c58d8176036737ed2ad7914d27c3d684d6c 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -27,6 +27,7 @@ import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import org.slf4j.Logger;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
public class GameRules {
@@ -127,7 +128,7 @@ public class GameRules {
}
private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) {
- this.rules = rules;
+ this.rules = new Object2ObjectOpenHashMap<>(rules); // DivineMC - lithium: collections.gamerules
// Paper start
int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1;