3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Fixes #232 dont allow negative brush radius

Dieser Commit ist enthalten in:
Jesse Boyd 2019-11-24 01:30:19 +00:00
Ursprung cbeaa1a7a0
Commit 4f34d1b5d1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F

Datei anzeigen

@ -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();
} }