Limit the setId to the values length on horse and ocelot
This commit is contained in:
		| @@ -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); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -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); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user