Fixed a error when custom name longer then 64, fixed derp with a method return

This commit is contained in:
Andrew 2013-07-24 15:57:05 +12:00
parent 1e511bede0
commit 384a20ab6e

View file

@ -84,13 +84,15 @@ public class LivingWatcher extends FlagWatcher {
public void setCustomName(String name) {
if (!getCustomName().equals(name)) {
if (name.length() > 64)
name = name.substring(0, 64);
setValue(10, name);
sendData(10);
}
}
public void setCustomNameVisible(boolean display) {
if (this.isCustomNameVisible()) {
if (isCustomNameVisible() != display) {
setValue(11, (byte) (display ? 1 : 0));
sendData(11);
}