Fixed Player disguises

Fixed all disguises
Fixed issue where players would crash upon joining
Fixed issue where disguises would crash when player left and reentered a location where a disguise previously was

This is basically a beta build, FIND BUGS FOR ME! :D
This commit is contained in:
NavidK0
2016-03-14 00:55:36 -04:00
parent 27baf53073
commit 24b6ed702b
7 changed files with 120 additions and 66 deletions

View File

@@ -236,15 +236,15 @@ public class LibsDisguises extends JavaPlugin {
for (WrappedWatchableObject watch : watcher.getWatchableObjects()) {
disguiseValues.setMetaValue(watch.getIndex(), watch.getValue());
// Uncomment when I need to find the new datawatcher values for a class..
int id = watch.getIndex();
Object val = watch.getValue();
Class<?> valClazz = val != null ? watch.getValue().getClass() : null;
try {
val = val.toString();
} catch (Exception e) {
val = val != null ? val.getClass() : "null";
}
System.out.println("Disguise: " + disguiseType + ", ID: " + id + ", Class: " + (val == null ? "null" : valClazz) + ", Value: " + val);
// int id = watch.getIndex();
// Object val = watch.getValue();
// Class<?> valClazz = val != null ? watch.getValue().getClass() : null;
// try {
// val = val.toString();
// } catch (Exception e) {
// val = val != null ? val.getClass() : "null";
// }
// System.out.println("Disguise: " + disguiseType + ", ID: " + id + ", Class: " + (val == null ? "null" : valClazz) + ", Value: " + val);
}
DisguiseSound sound = DisguiseSound.getType(disguiseType.name());
if (sound != null) {