mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-01-03 23:17:37 +01:00
40 lines
2.3 KiB
Diff
40 lines
2.3 KiB
Diff
From 5b5bc715350f2e0c7e44323b34a58b755ab23183 Mon Sep 17 00:00:00 2001
|
|
From: tr7zw <tr7zw@live.de>
|
|
Date: Mon, 11 May 2020 22:07:17 +0200
|
|
Subject: [PATCH] lithium MixinGoalSelector
|
|
|
|
Only replaces the set type, might want to also port the logic rewrite in the future
|
|
---
|
|
.../java/net/minecraft/server/PathfinderGoalSelector.java | 8 ++++++--
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
|
index 95dde66531..8c0c93197f 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
|
@@ -1,7 +1,8 @@
|
|
package net.minecraft.server;
|
|
|
|
import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet; // Paper - remove streams from pathfindergoalselector
|
|
-import com.google.common.collect.Sets;
|
|
+import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
|
|
+
|
|
import java.util.EnumMap;
|
|
import java.util.EnumSet;
|
|
import java.util.Iterator; // Paper - remove streams from pathfindergoalselector
|
|
@@ -26,7 +27,10 @@ public class PathfinderGoalSelector {
|
|
}
|
|
};
|
|
private final Map<PathfinderGoal.Type, PathfinderGoalWrapped> c = new EnumMap(PathfinderGoal.Type.class);
|
|
- private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet();public Set<PathfinderGoalWrapped> getTasks() { return d; }// Paper - OBFHELPER
|
|
+ /**
|
|
+ * Replace the task set with an optimized collection type which performs better for iteration.
|
|
+ */
|
|
+ private final Set<PathfinderGoalWrapped> d = new ObjectLinkedOpenHashSet<PathfinderGoalWrapped>();/* YAPFA better set */public Set<PathfinderGoalWrapped> getTasks() { return d; }// Paper - OBFHELPER
|
|
private final GameProfilerFiller e;
|
|
private final EnumSet<PathfinderGoal.Type> f = EnumSet.noneOf(PathfinderGoal.Type.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
|
|
private final OptimizedSmallEnumSet<PathfinderGoal.Type> goalTypes = new OptimizedSmallEnumSet<>(PathfinderGoal.Type.class); // Paper - remove streams from pathfindergoalselector
|
|
--
|
|
2.25.1.windows.1
|
|
|