Add setUnsafeSize to Slime disguises

This commit is contained in:
libraryaddict 2023-01-25 02:16:21 +13:00
parent bce4e96f55
commit f5cc86f8d5
2 changed files with 12 additions and 4 deletions

View File

@ -30,6 +30,10 @@ public class SlimeWatcher extends InsentientWatcher {
size = 50;
}
setUnsafeSize(size);
}
public void setUnsafeSize(int size) {
if (hasValue(MetaIndex.SLIME_SIZE) && getData(MetaIndex.SLIME_SIZE) == size) {
return;
}
@ -39,4 +43,8 @@ public class SlimeWatcher extends InsentientWatcher {
updateNameHeight();
}
public int getUnsafeSize() {
return getSize();
}
}

View File

@ -410,10 +410,10 @@ public class DisguisePermissions {
}
if (sender instanceof Player && !sender.isOp() && !DisguiseConfig.isExplicitDisguisePermissions()) {
storage.permittedOptions.remove("setYModifier");
storage.negatedOptions.add("setYModifier");
storage.permittedOptions.remove("setNameYModifier");
storage.negatedOptions.add("setNameYModifier");
for (String unsafeMethod : new String[]{"setYModifier", "setNameYModifier"}) {
storage.permittedOptions.remove(unsafeMethod);
storage.negatedOptions.add(unsafeMethod);
}
}
disguises.add(storage);