mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-08-24 23:12:51 +02:00
Move setcustomname and setcustomnamevisible to FlagWatcher
This commit is contained in:
parent
7b140d0d36
commit
5115af60a0
|
@ -206,6 +206,31 @@ public class FlagWatcher {
|
|||
return getFlag(5);
|
||||
}
|
||||
|
||||
public String getCustomName() {
|
||||
return (String) getValue(10, null);
|
||||
}
|
||||
|
||||
public boolean hasCustomName() {
|
||||
return getCustomName() != null;
|
||||
}
|
||||
|
||||
public boolean isCustomNameVisible() {
|
||||
return (Byte) getValue(11, (byte) 0) == 1;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
if (name != null && name.length() > 64) {
|
||||
name = name.substring(0, 64);
|
||||
}
|
||||
setValue(10, name);
|
||||
sendData(10);
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean display) {
|
||||
setValue(11, (byte) (display ? 1 : 0));
|
||||
sendData(11);
|
||||
}
|
||||
|
||||
public boolean isRightClicking() {
|
||||
return getFlag(4);
|
||||
}
|
||||
|
|
|
@ -69,10 +69,6 @@ public class LivingWatcher extends FlagWatcher {
|
|||
return clone;
|
||||
}
|
||||
|
||||
public String getCustomName() {
|
||||
return (String) getValue(10, null);
|
||||
}
|
||||
|
||||
public float getHealth() {
|
||||
return (Float) getValue(6, 0F);
|
||||
}
|
||||
|
@ -115,18 +111,10 @@ public class LivingWatcher extends FlagWatcher {
|
|||
return (int) f1 << 16 | (int) f2 << 8 | (int) f3;
|
||||
}
|
||||
|
||||
public boolean hasCustomName() {
|
||||
return getCustomName() != null;
|
||||
}
|
||||
|
||||
public boolean hasPotionEffect(PotionEffectType type) {
|
||||
return potionEffects.contains(type.getId());
|
||||
}
|
||||
|
||||
public boolean isCustomNameVisible() {
|
||||
return (Byte) getValue(11, (byte) 0) == 1;
|
||||
}
|
||||
|
||||
public boolean isMaxHealthSet() {
|
||||
return maxHealthSet;
|
||||
}
|
||||
|
@ -148,19 +136,6 @@ public class LivingWatcher extends FlagWatcher {
|
|||
sendData(7);
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
if (name != null && name.length() > 64) {
|
||||
name = name.substring(0, 64);
|
||||
}
|
||||
setValue(10, name);
|
||||
sendData(10);
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean display) {
|
||||
setValue(11, (byte) (display ? 1 : 0));
|
||||
sendData(11);
|
||||
}
|
||||
|
||||
public void setHealth(float health) {
|
||||
setValue(6, health);
|
||||
sendData(6);
|
||||
|
|
Loading…
Reference in New Issue
Block a user