mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-08-22 22:53:01 +02:00
Tiny cleanup in ReflectionManager
This commit is contained in:
parent
bdbaa95fae
commit
7f5a6d9dc4
|
@ -65,7 +65,6 @@ public class ReflectionManager {
|
||||||
|
|
||||||
private static final String bukkitVersion = Bukkit.getServer().getClass().getName().split("\\.")[3];
|
private static final String bukkitVersion = Bukkit.getServer().getClass().getName().split("\\.")[3];
|
||||||
private static final Class<?> craftItemClass;
|
private static final Class<?> craftItemClass;
|
||||||
|
|
||||||
private static Method damageAndIdleSoundMethod;
|
private static Method damageAndIdleSoundMethod;
|
||||||
private static final Field entitiesField;
|
private static final Field entitiesField;
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +81,6 @@ public class ReflectionManager {
|
||||||
* names.
|
* names.
|
||||||
*/
|
*/
|
||||||
private static Map<String, Map<String, Map<String, String>>> ForgeMethodMappings;
|
private static Map<String, Map<String, Map<String, String>>> ForgeMethodMappings;
|
||||||
|
|
||||||
private static final Method ihmGet;
|
private static final Method ihmGet;
|
||||||
private static final boolean isForge = Bukkit.getServer().getName().equalsIgnoreCase("Cauldron");
|
private static final boolean isForge = Bukkit.getServer().getName().equalsIgnoreCase("Cauldron");
|
||||||
private static final Field pingField;
|
private static final Field pingField;
|
||||||
|
@ -205,11 +203,6 @@ public class ReflectionManager {
|
||||||
trackerField = getNmsField("WorldServer", "tracker");
|
trackerField = getNmsField("WorldServer", "tracker");
|
||||||
entitiesField = getNmsField("EntityTracker", "trackedEntities");
|
entitiesField = getNmsField("EntityTracker", "trackedEntities");
|
||||||
ihmGet = getNmsMethod("IntHashMap", "get", int.class);
|
ihmGet = getNmsMethod("IntHashMap", "get", int.class);
|
||||||
|
|
||||||
Method m = getNmsMethod("Item", "getItemOf", getNmsClass("Block"));
|
|
||||||
System.out.println(m);
|
|
||||||
|
|
||||||
DisguiseType.ARROW.isMisc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object createEntityInstance(String entityName) {
|
public static Object createEntityInstance(String entityName) {
|
||||||
|
@ -241,8 +234,6 @@ public class ReflectionManager {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===
|
|
||||||
|
|
||||||
private static String dir2fqn(String s) {
|
private static String dir2fqn(String s) {
|
||||||
return s.replaceAll("/", ".");
|
return s.replaceAll("/", ".");
|
||||||
}
|
}
|
||||||
|
@ -327,7 +318,7 @@ public class ReflectionManager {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Object getEntityTrackerEntry(Entity target) throws Exception {
|
public static Object getEntityTrackerEntry(Entity target) throws Exception {
|
||||||
Object world = getWorld(target.getWorld());
|
Object world = getWorld(target.getWorld());
|
||||||
Object tracker = trackerField.get(world);
|
Object tracker = trackerField.get(world);
|
||||||
Object trackedEntities = entitiesField.get(tracker);
|
Object trackedEntities = entitiesField.get(tracker);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user