From 019e45572dd9674adf8cadf88da1aeae9f717e8e Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Tue, 1 Mar 2016 16:07:59 -0500 Subject: [PATCH] 1.9 update: Fix entity modifiers Fixes #153 --- ProtocolLib/pom.xml | 4 ++-- .../comphenix/protocol/injector/EntityUtilities.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ProtocolLib/pom.xml b/ProtocolLib/pom.xml index a095eaa6..74be7575 100644 --- a/ProtocolLib/pom.xml +++ b/ProtocolLib/pom.xml @@ -229,13 +229,13 @@ org.spigotmc spigot-api - 1.9-SNAPSHOT + 1.9-R0.1-SNAPSHOT provided org.spigotmc spigot - 1.9-SNAPSHOT + 1.9-R0.1-SNAPSHOT provided diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java index 8eb0031f..9f591b6a 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/EntityUtilities.java @@ -102,7 +102,7 @@ class EntityUtilities { trackedPlayers.removeAll(nmsPlayers); // We have to rely on a NAME once again. Damn it. - // TODO: Make sure this stays up to date with version changes + // TODO: Make sure this stays up to date with version changes - 1.9 if (scanPlayersMethod == null) { scanPlayersMethod = trackerEntry.getClass().getMethod("scanPlayers", List.class); } @@ -233,11 +233,11 @@ class EntityUtilities { if (trackerEntry != null) { if (trackerField == null) { try { - trackerField = trackerEntry.getClass().getField("tracker"); + trackerField = trackerEntry.getClass().getDeclaredField("tracker"); } catch (NoSuchFieldException e) { - // Assume it's the first public entity field then - trackerField = FuzzyReflection.fromObject(trackerEntry).getFieldByType( - "tracker", MinecraftReflection.getEntityClass()); + // Assume it's the first entity field then + trackerField = FuzzyReflection.fromObject(trackerEntry, true) + .getFieldByType("tracker", MinecraftReflection.getEntityClass()); } }