mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Fixed pattern "X%Y" with no Y defined throwing an exception.
Fixes WORLDEDIT-2897.
This commit is contained in:
parent
513940a80b
commit
7cf093ad40
@ -713,8 +713,12 @@ public class WorldEdit {
|
||||
// Parse special percentage syntax
|
||||
if (s.matches("[0-9]+(\\.[0-9]*)?%.*")) {
|
||||
String[] p = s.split("%");
|
||||
chance = Double.parseDouble(p[0]);
|
||||
block = getBlock(player, p[1]);
|
||||
if (p.length < 2) {
|
||||
throw new UnknownItemException(s);
|
||||
} else {
|
||||
chance = Double.parseDouble(p[0]);
|
||||
block = getBlock(player, p[1]);
|
||||
}
|
||||
} else {
|
||||
chance = 1;
|
||||
block = getBlock(player, s);
|
||||
|
Loading…
Reference in New Issue
Block a user