"Downgrade" Vineflower to 1.10.1 release (#10423)
* "Downgrade" Vineflower to 1.10.1 release The main thing we lose from the 1.11 snapshots is a recent fix for redundant casts. * Thanks intellij * a
This commit is contained in:
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return null;
|
||||
} else {
|
||||
- Map<Target, BlockPos> map = positions.stream()
|
||||
- .collect(Collectors.toMap(pos -> this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), Function.identity()));
|
||||
- .collect(Collectors.toMap(pos -> this.nodeEvaluator.getGoal((double)pos.getX(), (double)pos.getY(), (double)pos.getZ()), Function.identity()));
|
||||
+ // Paper start - Perf: remove streams and optimize collection
|
||||
+ List<Map.Entry<Target, BlockPos>> map = Lists.newArrayList();
|
||||
+ for (BlockPos pos : positions) {
|
||||
@@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int i = 0;
|
||||
- Set<Target> set3 = Sets.newHashSetWithExpectedSize(set.size());
|
||||
+ List<Map.Entry<Target, BlockPos>> entryList = Lists.newArrayListWithExpectedSize(positions.size()); // Paper - optimize collection
|
||||
int j = (int)(this.maxVisitedNodes * rangeMultiplier);
|
||||
int j = (int)((float)this.maxVisitedNodes * rangeMultiplier);
|
||||
|
||||
while (!this.openSet.isEmpty()) {
|
||||
@@ -0,0 +0,0 @@ public class PathFinder {
|
||||
@@ -68,7 +68,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ for (int i1 = 0; i1 < positions.size(); i1++) {
|
||||
+ final Map.Entry<Target, BlockPos> entry = positions.get(i1);
|
||||
+ Target target = entry.getKey();
|
||||
if (node.distanceManhattan(target) <= distance) {
|
||||
if (node.distanceManhattan(target) <= (float)distance) {
|
||||
target.setReached();
|
||||
- set3.add(target);
|
||||
+ entryList.add(entry);
|
||||
|
||||
Reference in New Issue
Block a user