mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-03 08:49:32 +01:00
Fixed errors and errors with getPerverts for velocity packets
This commit is contained in:
parent
95b6c40b7a
commit
2f7f5ef43c
@ -2,6 +2,7 @@ package me.libraryaddict.disguise.disguisetypes;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -282,11 +283,11 @@ public abstract class Disguise {
|
||||
Object entityTrackerEntry = trackedEntities.getClass().getMethod("get", int.class)
|
||||
.invoke(trackedEntities, getEntity().getEntityId());
|
||||
if (entityTrackerEntry != null) {
|
||||
Field field = ReflectionManager.getNmsClass("Entity").getField("getBukkitEntity");
|
||||
Method method = ReflectionManager.getNmsClass("Entity").getMethod("getBukkitEntity");
|
||||
HashSet trackedPlayers = (HashSet) entityTrackerEntry.getClass().getField("trackedPlayers")
|
||||
.get(entityTrackerEntry);
|
||||
for (Object p : trackedPlayers) {
|
||||
players.add((Player) field.get(p));
|
||||
players.add((Player) method.invoke(p));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user