Set the miscDisguise id and data

This commit is contained in:
libraryaddict 2014-06-06 13:59:22 +12:00
parent e3ca6c5b74
commit 6bfa4b3d66
2 changed files with 7 additions and 4 deletions

View File

@ -47,13 +47,16 @@ public class MiscDisguise extends TargetedDisguise {
+ " instead");
}
createDisguise(disguiseType);
this.id = getType().getDefaultId();
this.data = getType().getEntityId();
switch (disguiseType) {
// The only disguises which should use a custom data.
case PAINTING:
((PaintingWatcher) getWatcher()).setArt(Art.values()[Math.max(0, firstParam) % Art.values().length]);
break;
case FALLING_BLOCK:
((FallingBlockWatcher) getWatcher()).setBlock(new ItemStack(Math.max(1, firstParam), 1, (short) Math.max(0, secondParam)));
((FallingBlockWatcher) getWatcher()).setBlock(new ItemStack(Math.max(1, firstParam), 1, (short) Math.max(0,
secondParam)));
break;
case SPLASH_POTION:
((SplashPotionWatcher) getWatcher()).setPotionId(Math.max(0, firstParam));

View File

@ -109,9 +109,9 @@ public class PlayerDisguise extends TargetedDisguise {
}
}
};
WrappedGameProfile obj = DisguiseUtilities.getProfileFromMojang(this.skinToUse, currentLookup);
if (obj != null) {
setSkin(obj);
WrappedGameProfile gameProfile = DisguiseUtilities.getProfileFromMojang(this.skinToUse, currentLookup);
if (gameProfile != null) {
setSkin(gameProfile);
}
}
}