mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 03:27:19 -05:00
Confirm color[] length before accessing
Avoids ArrayIndexOutOfBoundsException during hasColor()
This commit is contained in:
parent
c8d71ed083
commit
d26b7ca763
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ public class WaterCauldronBlockEntity extends BlockEntity {
|
|||
}
|
||||
|
||||
public boolean hasColor() {
|
||||
return color[0] != -1 && color[1] != -1 && color[2] != -1;
|
||||
return color.length == 3 && color[0] != -1 && color[1] != -1 && color[2] != -1;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
|
|
Loading…
Reference in a new issue