summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAcrobot <andrzejp@dysleksja.pl>2013-04-09 23:55:57 +0200
committerriking <rikingcoding@gmail.com>2013-04-12 18:27:41 -0700
commite3acdd7b9ab53849f16e36c139bb61080c944775 (patch)
tree36694ac1e3417c32f7d820044ba5d2330d3092a8
parent7d8585ee47fe531356a484ec256320144edaa717 (diff)
downloadbukkit-e3acdd7b9ab53849f16e36c139bb61080c944775.tar
bukkit-e3acdd7b9ab53849f16e36c139bb61080c944775.tar.gz
bukkit-e3acdd7b9ab53849f16e36c139bb61080c944775.tar.lz
bukkit-e3acdd7b9ab53849f16e36c139bb61080c944775.tar.xz
bukkit-e3acdd7b9ab53849f16e36c139bb61080c944775.zip
Fix off-by-one error in DyeColor. Fixes BUKKIT-3938
-rw-r--r--src/main/java/org/bukkit/DyeColor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java
index b8e59a46..58f517b8 100644
--- a/src/main/java/org/bukkit/DyeColor.java
+++ b/src/main/java/org/bukkit/DyeColor.java
@@ -164,7 +164,7 @@ public enum DyeColor {
*/
public static DyeColor getByWoolData(final byte data) {
int i = 0xff & data;
- if (i > BY_WOOL_DATA.length) {
+ if (i >= BY_WOOL_DATA.length) {
return null;
}
return BY_WOOL_DATA[i];
@@ -179,7 +179,7 @@ public enum DyeColor {
*/
public static DyeColor getByDyeData(final byte data) {
int i = 0xff & data;
- if (i > BY_DYE_DATA.length) {
+ if (i >= BY_DYE_DATA.length) {
return null;
}
return BY_DYE_DATA[i];