Fix comparator behavior for EntityPhanton goal

This commit is contained in:
Shane Freeder 2020-01-22 21:01:28 +00:00
parent f11d64728f
commit 8a0b371c68
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -0,0 +1,22 @@
From df1d49de0853ff664ca2be4c8fae3dac6bd7e707 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 82323bf4ac..90eeddb1af 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