geforkt von Mirrors/FastAsyncWorldEdit
Fixes #232 dont allow negative brush radius
Dieser Commit ist enthalten in:
Ursprung
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 {
|
||||||
if (getConfiguration().maxBrushRadius > 0) {
|
|
||||||
double val = radius.evaluate();
|
double val = radius.evaluate();
|
||||||
|
checkArgument(val >= 0);
|
||||||
|
if (getConfiguration().maxBrushRadius > 0) {
|
||||||
if (val > getConfiguration().maxBrushRadius) {
|
if (val > getConfiguration().maxBrushRadius) {
|
||||||
throw new MaxBrushRadiusException();
|
throw new MaxBrushRadiusException();
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren