9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-24 01:09:29 +00:00
Files
DivineMC/patches/server/0033-lithium-collections.gamerules.patch
NONPLAYT 361a0e5785 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@70a76c4 Updated Upstream (Paper)
PurpurMC/Purpur@770fbe6 clean up damage type code for stonecutter and scissor patches
2024-02-12 22:31:57 +03:00

30 lines
1.4 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
Original code by CaffeineMC, licensed under LGPL v3
You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings)
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 4a340bd1f1859e43bb58e68aee4018fdb4ca7a5a..7f9345b195fe34129b28dd6c486abe9a1582364c 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -28,6 +28,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import org.slf4j.Logger;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
public class GameRules {
@@ -142,7 +143,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 - Perf: Use array for gamerule storage
int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1;