Merge pull request #269 from Gabscap/fix-entity-tracker

Add null-check to "Entity Tracking Improvement"
This commit is contained in:
Zach 2016-05-06 09:47:21 -05:00
commit cc7e114f6b
1 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
From bdd0f358b6e4a313c664157ba9c4853e64027cff Mon Sep 17 00:00:00 2001 From b79285255316a04113c3513fb1b135da76fba830 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Mon, 17 Jun 2013 01:24:00 -0400 Date: Mon, 17 Jun 2013 01:24:00 -0400
Subject: [PATCH] Entity Tracking Improvements Subject: [PATCH] Entity Tracking Improvements
@ -19,7 +19,7 @@ index 3a40897..0a4de90 100644
if (bukkitEntity == null) { if (bukkitEntity == null) {
bukkitEntity = CraftEntity.getEntity(world.getServer(), this); bukkitEntity = CraftEntity.getEntity(world.getServer(), this);
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index a012d20..a79e97e 100644 index a012d20..c0b9e8a 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -49,6 +49,7 @@ public class EntityTrackerEntry { @@ -49,6 +49,7 @@ public class EntityTrackerEntry {
@ -30,7 +30,7 @@ index a012d20..a79e97e 100644
this.tracker = entity; this.tracker = entity;
this.e = i; this.e = i;
this.f = j; this.f = j;
@@ -440,17 +441,55 @@ public class EntityTrackerEntry { @@ -440,17 +441,59 @@ public class EntityTrackerEntry {
this.tracker.b(entityplayer); this.tracker.b(entityplayer);
entityplayer.d(this.tracker); entityplayer.d(this.tracker);
@ -77,7 +77,11 @@ index a012d20..a79e97e 100644
+ } + }
+ private void updatePassengers(EntityPlayer player) { + private void updatePassengers(EntityPlayer player) {
+ if (tracker.isVehicle()) { + if (tracker.isVehicle()) {
+ tracker.passengers.forEach((e) -> e.tracker.updatePlayer(player)); + tracker.passengers.forEach((e) -> {
+ if (e.tracker != null) {
+ e.tracker.updatePlayer(player);
+ }
+ });
+ player.playerConnection.sendPacket(new PacketPlayOutMount(this.tracker)); + player.playerConnection.sendPacket(new PacketPlayOutMount(this.tracker));
+ } + }
+ } + }
@ -86,7 +90,7 @@ index a012d20..a79e97e 100644
double d0 = entityplayer.locX - (double) this.xLoc / 4096.0D; double d0 = entityplayer.locX - (double) this.xLoc / 4096.0D;
double d1 = entityplayer.locZ - (double) this.zLoc / 4096.0D; double d1 = entityplayer.locZ - (double) this.zLoc / 4096.0D;
int i = Math.min(this.e, this.f); int i = Math.min(this.e, this.f);
@@ -590,6 +629,7 @@ public class EntityTrackerEntry { @@ -590,6 +633,7 @@ public class EntityTrackerEntry {
this.trackedPlayers.remove(entityplayer); this.trackedPlayers.remove(entityplayer);
this.tracker.c(entityplayer); this.tracker.c(entityplayer);
entityplayer.c(this.tracker); entityplayer.c(this.tracker);
@ -95,5 +99,5 @@ index a012d20..a79e97e 100644
} }
-- --
2.8.2 2.8.1