mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
27 lines
1.4 KiB
Diff
27 lines
1.4 KiB
Diff
From e73d5d6a8519d763d801f66c0bb7098e83dafdbd Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Tue, 18 Feb 2020 20:09:30 -0600
|
|
Subject: [PATCH] Fix a possible NPE for lukeeexd
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityPhantom.java | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
index 9cae8885d2..8d22fd2f50 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
@@ -474,7 +474,8 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
}
|
|
|
|
private void g() {
|
|
- EntityPhantom.this.d = (new BlockPosition(EntityPhantom.this.getGoalTarget())).up(20 + EntityPhantom.this.random.nextInt(20));
|
|
+ EntityLiving target = EntityPhantom.this.getGoalTarget(); if (target == null) return; // Purpur - this _shouldn't_ be needed at all...
|
|
+ EntityPhantom.this.d = (new BlockPosition(target)).up(20 + EntityPhantom.this.random.nextInt(20)); // Purpur
|
|
if (EntityPhantom.this.d.getY() < EntityPhantom.this.world.getSeaLevel()) {
|
|
EntityPhantom.this.d = new BlockPosition(EntityPhantom.this.d.getX(), EntityPhantom.this.world.getSeaLevel() + 1, EntityPhantom.this.d.getZ());
|
|
}
|
|
--
|
|
2.24.0
|
|
|