mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-01-12 12:25:03 +08:00
Handle empty damage values in WorldEdit.getBlock(). Fixes #921
This commit is contained in:
parent
204b36edd3
commit
79f2d68e60
@ -340,7 +340,7 @@ public BaseBlock getBlock(LocalPlayer player, String arg,
|
||||
if (data == -1) { // Block data not yet detected
|
||||
// Parse the block data (optional)
|
||||
try {
|
||||
data = typeAndData.length > 1 ? Integer.parseInt(typeAndData[1]) : (allowNoData ? -1 : 0);
|
||||
data = (typeAndData.length > 1 && typeAndData[1].length() > 0) ? Integer.parseInt(typeAndData[1]) : (allowNoData ? -1 : 0);
|
||||
if (data > 15 || (data < 0 && !(allAllowed && data == -1))) {
|
||||
data = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user