Fixed a error when custom name longer then 64, fixed derp with a method return
This commit is contained in:
parent
1e511bede0
commit
384a20ab6e
@ -84,13 +84,15 @@ public class LivingWatcher extends FlagWatcher {
|
|||||||
|
|
||||||
public void setCustomName(String name) {
|
public void setCustomName(String name) {
|
||||||
if (!getCustomName().equals(name)) {
|
if (!getCustomName().equals(name)) {
|
||||||
|
if (name.length() > 64)
|
||||||
|
name = name.substring(0, 64);
|
||||||
setValue(10, name);
|
setValue(10, name);
|
||||||
sendData(10);
|
sendData(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCustomNameVisible(boolean display) {
|
public void setCustomNameVisible(boolean display) {
|
||||||
if (this.isCustomNameVisible()) {
|
if (isCustomNameVisible() != display) {
|
||||||
setValue(11, (byte) (display ? 1 : 0));
|
setValue(11, (byte) (display ? 1 : 0));
|
||||||
sendData(11);
|
sendData(11);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user