Update disguises to use EntityEquipment, makes life easier

Update ItemInHand calls to ItemInMainHand and OffHand
Still not ready for use yet, disguises do not work
This commit is contained in:
NavidK0
2016-03-05 23:14:19 -05:00
parent a94d583f0b
commit cf1b15942c
7 changed files with 247 additions and 102 deletions

View File

@@ -228,8 +228,16 @@ 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..
// System.out.print("Disguise: " + disguiseType + ", ID: " + watch.getIndex() + ", Class: "
// + (watch.getValue() == null ? "null" : watch.getValue().getClass()) + ", Value: " + watch.getValue());
//TODO: Recomment this section when finished
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) {