Added setUpsideDown to PlayerWatcher

This commit is contained in:
libraryaddict 2020-05-10 16:38:36 +12:00
parent 71dbaeebf5
commit e8c7a48c47
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
3 changed files with 9 additions and 5 deletions

View File

@ -199,7 +199,7 @@ public class PlayerDisguise extends TargetedDisguise {
this.upsideDown = upsideDown; this.upsideDown = upsideDown;
if (isDisguiseInUse()) { if (isDisguiseInUse()) {
resendDisguise(getName(), true); resendDisguise(DisguiseConfig.isArmorstandsName() ? getName() : "Dinnerbone", true);
} else { } else {
scoreboardName = null; scoreboardName = null;
} }

View File

@ -37,6 +37,14 @@ public class PlayerWatcher extends LivingWatcher {
((PlayerDisguise) getDisguise()).setNameVisible(nameVisible); ((PlayerDisguise) getDisguise()).setNameVisible(nameVisible);
} }
public boolean isUpsideDown() {
return ((PlayerDisguise) getDisguise()).isUpsideDown();
}
public void setUpsideDown(boolean upsideDown) {
((PlayerDisguise) getDisguise()).setUpsideDown(upsideDown);
}
@RandomDefaultValue @RandomDefaultValue
public String getName() { public String getName() {
return ((PlayerDisguise) getDisguise()).getName(); return ((PlayerDisguise) getDisguise()).getName();

View File

@ -145,10 +145,6 @@ public class ParamInfoManager {
if (watcherClass == PlayerWatcher.class) { if (watcherClass == PlayerWatcher.class) {
try { try {
methods.add(PlayerDisguise.class.getMethod("setDynamicName", boolean.class)); methods.add(PlayerDisguise.class.getMethod("setDynamicName", boolean.class));
if (DisguiseConfig.isArmorstandsName()) {
methods.add(PlayerDisguise.class.getMethod("setUpsideDown", boolean.class));
}
} }
catch (NoSuchMethodException e) { catch (NoSuchMethodException e) {
e.printStackTrace(); e.printStackTrace();