From e0240c10442901e4e657f371bd49ab2f426e3365 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 18 Nov 2013 04:43:42 +1300 Subject: [PATCH] Limit the setId to the values length on horse and ocelot --- .../disguise/disguisetypes/watchers/HorseWatcher.java | 4 ++-- .../disguise/disguisetypes/watchers/OcelotWatcher.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java index f8782cf9..9100dae4 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java @@ -82,7 +82,7 @@ public class HorseWatcher extends AgeableWatcher { } public void setColorId(int color) { - setValue(20, color & 0xFF | getStyle().ordinal() << 8); + setValue(20, (color % Color.values().length) & 0xFF | getStyle().ordinal() << 8); sendData(20); } @@ -123,7 +123,7 @@ public class HorseWatcher extends AgeableWatcher { } public void setStyleId(int style) { - setValue(20, getColor().ordinal() & 0xFF | style << 8); + setValue(20, getColor().ordinal() & 0xFF | (style % Style.values().length) << 8); sendData(20); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java index d54e6af1..5fc43c35 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java @@ -40,7 +40,7 @@ public class OcelotWatcher extends AgeableWatcher { } public void setTypeId(int type) { - setValue(18, (byte) type); + setValue(18, (byte) (type % Type.values().length)); sendData(18); } }