Add new config option to auto-hide tall disguises, also as a disguise option
This commit is contained in:
@@ -25,7 +25,7 @@ public class DisguiseValues {
|
||||
private double maxHealth;
|
||||
private Class nmsEntityClass;
|
||||
|
||||
public DisguiseValues(DisguiseType type, Class classType, int entitySize, double maxHealth) {
|
||||
public DisguiseValues(DisguiseType type, Class classType, double maxHealth) {
|
||||
values.put(type, this);
|
||||
nmsEntityClass = classType;
|
||||
this.maxHealth = maxHealth;
|
||||
@@ -35,10 +35,18 @@ public class DisguiseValues {
|
||||
return adultBox;
|
||||
}
|
||||
|
||||
public void setAdultBox(FakeBoundingBox newBox) {
|
||||
adultBox = newBox;
|
||||
}
|
||||
|
||||
public FakeBoundingBox getBabyBox() {
|
||||
return babyBox;
|
||||
}
|
||||
|
||||
public void setBabyBox(FakeBoundingBox newBox) {
|
||||
babyBox = newBox;
|
||||
}
|
||||
|
||||
public double getMaxHealth() {
|
||||
return maxHealth;
|
||||
}
|
||||
@@ -46,12 +54,4 @@ public class DisguiseValues {
|
||||
public Class getNmsEntityClass() {
|
||||
return nmsEntityClass;
|
||||
}
|
||||
|
||||
public void setAdultBox(FakeBoundingBox newBox) {
|
||||
adultBox = newBox;
|
||||
}
|
||||
|
||||
public void setBabyBox(FakeBoundingBox newBox) {
|
||||
babyBox = newBox;
|
||||
}
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ public class ParamInfoManager {
|
||||
// Add these last as it's what we want to present to be called the least
|
||||
for (String methodName : new String[]{"setSelfDisguiseVisible", "setHideHeldItemFromSelf",
|
||||
"setHideArmorFromSelf", "setHearSelfDisguise", "setHidePlayer", "setExpires", "setNotifyBar",
|
||||
"setBossBarColor", "setBossBarStyle"}) {
|
||||
"setBossBarColor", "setBossBarStyle", "setHideTallSelfDisguise"}) {
|
||||
try {
|
||||
Class cl = boolean.class;
|
||||
|
||||
|
@@ -1717,7 +1717,7 @@ public class ReflectionManager {
|
||||
|
||||
try {
|
||||
if (disguiseType == DisguiseType.UNKNOWN || disguiseType.isCustom()) {
|
||||
DisguiseValues disguiseValues = new DisguiseValues(disguiseType, null, 0, 0);
|
||||
DisguiseValues disguiseValues = new DisguiseValues(disguiseType, null, 0);
|
||||
|
||||
disguiseValues.setAdultBox(new FakeBoundingBox(0, 0, 0));
|
||||
|
||||
@@ -1758,7 +1758,7 @@ public class ReflectionManager {
|
||||
}
|
||||
}
|
||||
|
||||
DisguiseValues disguiseValues = new DisguiseValues(disguiseType, nmsEntity.getClass(), entitySize,
|
||||
DisguiseValues disguiseValues = new DisguiseValues(disguiseType, nmsEntity.getClass(),
|
||||
bukkitEntity instanceof Damageable ? ((Damageable) bukkitEntity).getMaxHealth() : 0);
|
||||
|
||||
WrappedDataWatcher watcher = WrappedDataWatcher.getEntityWatcher(bukkitEntity);
|
||||
|
@@ -328,7 +328,8 @@ public enum LibsMsg {
|
||||
LD_COMMAND_RELOAD(ChatColor.BLUE + "/libsdisguises reload - " + ChatColor.AQUA +
|
||||
"Reload's the plugin config and possibly blows disguises"),
|
||||
LD_COMMAND_DEBUG(ChatColor.BLUE + "/libsdisguises debug - " + ChatColor.AQUA +
|
||||
"Used to help debug scoreboard issues on a player disguise");
|
||||
"Used to help debug scoreboard issues on a player disguise"),
|
||||
SELF_DISGUISE_HIDDEN(ChatColor.GREEN + "Self disguise hidden as it's too tall..");
|
||||
|
||||
private final String string;
|
||||
|
||||
|
Reference in New Issue
Block a user