even even even even even even more work

This commit is contained in:
Spottedleaf
2020-06-25 18:53:21 -07:00
parent ec7bd6a7c6
commit cfd598512a
34 changed files with 420 additions and 408 deletions

View File

@@ -66,11 +66,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import java.util.Iterator; // Paper - remove streams from pathfindergoalselector
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import java.util.function.Supplier;
@@ -0,0 +0,0 @@ public class PathfinderGoalSelector {
private final Map<PathfinderGoal.Type, PathfinderGoalWrapped> c = new EnumMap(PathfinderGoal.Type.class);
private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet();private Set<PathfinderGoalWrapped> getTasks() { return d; }// Paper - OBFHELPER
private final GameProfilerFiller e;
private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet(); private Set<PathfinderGoalWrapped> getTasks() { return d; }// Paper - OBFHELPER
private final Supplier<GameProfilerFiller> e;
- private final EnumSet<PathfinderGoal.Type> f = EnumSet.noneOf(PathfinderGoal.Type.class);
+ 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
@@ -104,8 +104,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private static final PathfinderGoal.Type[] PATHFINDER_GOAL_TYPES = PathfinderGoal.Type.values(); // Paper - remove streams from pathfindergoalselector
+
public void doTick() {
this.e.enter("goalCleanup");
- this.c().filter((pathfindergoalwrapped) -> {
GameProfilerFiller gameprofilerfiller = (GameProfilerFiller) this.e.get();
gameprofilerfiller.enter("goalCleanup");
- this.d().filter((pathfindergoalwrapped) -> {
- boolean flag;
-
- if (pathfindergoalwrapped.g()) {
@@ -138,8 +140,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.c.remove(pathfindergoal_type);
@@ -0,0 +0,0 @@ public class PathfinderGoalSelector {
});
this.e.exit();
this.e.enter("goalUpdate");
gameprofilerfiller.exit();
gameprofilerfiller.enter("goalUpdate");
- this.d.stream().filter((pathfindergoalwrapped) -> {
- return !pathfindergoalwrapped.g();
- }).filter((pathfindergoalwrapped) -> {
@@ -203,9 +205,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ wrappedGoal.c();
+ }
+ // Paper end - remove streams from pathfindergoalselector
this.e.exit();
this.e.enter("goalTick");
- this.c().forEach(PathfinderGoalWrapped::e);
gameprofilerfiller.exit();
gameprofilerfiller.enter("goalTick");
- this.d().forEach(PathfinderGoalWrapped::e);
+ // Paper start - remove streams from pathfindergoalselector
+ for (Iterator<PathfinderGoalWrapped> iterator = this.d.iterator(); iterator.hasNext();) {
+ PathfinderGoalWrapped wrappedGoal = iterator.next();
@@ -214,7 +216,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+ // Paper end - remove streams from pathfindergoalselector
this.e.exit();
gameprofilerfiller.exit();
}
@@ -0,0 +0,0 @@ public class PathfinderGoalSelector {