mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
Fix off-by-one error in DyeColor. Fixes BUKKIT-3938
This commit is contained in:
parent
7d8585ee47
commit
e3acdd7b9a
1 changed files with 2 additions and 2 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Reference in a new issue