mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix a possible NPE for lukeeexd
This commit is contained in:
26
patches/server/0097-Fix-a-possible-NPE-for-lukeeexd.patch
Normal file
26
patches/server/0097-Fix-a-possible-NPE-for-lukeeexd.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From a89057149713a37938c07012120c3119d4a804fb 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 9cae8885d..8d22fd2f5 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
|
||||
|
||||
Reference in New Issue
Block a user