mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-16 17:16:11 +00:00
Fixes #232 dont allow negative brush radius
This commit is contained in:
parent
cbeaa1a7a0
commit
4f34d1b5d1
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit;
|
package com.sk89q.worldedit;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
import static com.sk89q.worldedit.event.platform.Interaction.HIT;
|
import static com.sk89q.worldedit.event.platform.Interaction.HIT;
|
||||||
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
||||||
|
|
||||||
@ -408,8 +409,9 @@ public final class WorldEdit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void checkMaxBrushRadius(Expression radius) throws MaxBrushRadiusException {
|
public void checkMaxBrushRadius(Expression radius) throws MaxBrushRadiusException {
|
||||||
|
double val = radius.evaluate();
|
||||||
|
checkArgument(val >= 0);
|
||||||
if (getConfiguration().maxBrushRadius > 0) {
|
if (getConfiguration().maxBrushRadius > 0) {
|
||||||
double val = radius.evaluate();
|
|
||||||
if (val > getConfiguration().maxBrushRadius) {
|
if (val > getConfiguration().maxBrushRadius) {
|
||||||
throw new MaxBrushRadiusException();
|
throw new MaxBrushRadiusException();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user