9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0253-Replace-EntitySelectorOptions-map-with-optimized-col.patch
hayanesuru 043cb215fd Optimize canHoldAnyFluid in canMaybePassThrough (#527)
* optimize canHoldAnyFluid in canMaybePassThrough

* rebuild patches

* support reload
2025-10-12 14:26:33 -04:00

29 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
Date: Tue, 9 Nov 2077 00:00:00 +0800
Subject: [PATCH] Replace EntitySelectorOptions map with optimized collection
diff --git a/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java b/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
index 3b945ac061f192b09dd86e8627dacf11b190d2d9..9e2fd3684260fad1d94a795cb5617c5ccc231adc 100644
--- a/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
+++ b/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
@@ -357,7 +357,7 @@ public class EntitySelectorOptions {
}, entitySelectorParser -> true, Component.translatable("argument.entity.options.nbt.description"));
register("scores", parser -> {
StringReader reader = parser.getReader();
- Map<String, MinMaxBounds.Ints> map = Maps.newHashMap();
+ it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<String, MinMaxBounds.Ints> map = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Leaf - Replace options map with optimized collection
reader.expect('{');
reader.skipWhitespace();
@@ -380,7 +380,7 @@ public class EntitySelectorOptions {
parser.addPredicate(entity -> {
Scoreboard scoreboard = entity.getServer().getScoreboard();
- for (Entry<String, MinMaxBounds.Ints> entry : map.entrySet()) {
+ for (Entry<String, MinMaxBounds.Ints> entry : map.object2ObjectEntrySet()) { // Leaf - Replace options map with optimized collection
Objective objective = scoreboard.getObjective(entry.getKey());
if (objective == null) {
return false;