mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
Fix off-by-one error in DyeColor. Fixes BUKKIT-3938
By: Acrobot <andrzejp@dysleksja.pl>
This commit is contained in:
@@ -164,7 +164,7 @@ public enum DyeColor {
|
|||||||
*/
|
*/
|
||||||
public static DyeColor getByWoolData(final byte data) {
|
public static DyeColor getByWoolData(final byte data) {
|
||||||
int i = 0xff & data;
|
int i = 0xff & data;
|
||||||
if (i > BY_WOOL_DATA.length) {
|
if (i >= BY_WOOL_DATA.length) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return BY_WOOL_DATA[i];
|
return BY_WOOL_DATA[i];
|
||||||
@@ -179,7 +179,7 @@ public enum DyeColor {
|
|||||||
*/
|
*/
|
||||||
public static DyeColor getByDyeData(final byte data) {
|
public static DyeColor getByDyeData(final byte data) {
|
||||||
int i = 0xff & data;
|
int i = 0xff & data;
|
||||||
if (i > BY_DYE_DATA.length) {
|
if (i >= BY_DYE_DATA.length) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return BY_DYE_DATA[i];
|
return BY_DYE_DATA[i];
|
||||||
|
Reference in New Issue
Block a user