Paper/Spigot-Server-Patches/0431-Fix-comparator-behavior-for-EntityPhanton-goal.patch
2020-02-06 21:07:34 -06:00

23 lines
972 B
Diff

From 0b73f7fd0181ed80b76fd44005e9fe83cf1e61f5 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Wed, 22 Jan 2020 21:00:21 +0000
Subject: [PATCH] Fix comparator behavior for EntityPhanton goal
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
index 82323bf4a..90eeddb1a 100644
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
@@ -224,7 +224,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
if (!list.isEmpty()) {
list.sort((entityhuman, entityhuman1) -> {
- return entityhuman.locY() > entityhuman1.locY() ? -1 : 1;
+ return Double.compare(entityhuman1.locY(), entityhuman.locY()); // Paper
});
Iterator iterator = list.iterator();
--
2.25.0