Address requested changes

- 4534154894 (r50694638)
- 4c1d0bc9a6 (r50694886)
This commit is contained in:
NotMyFault 2021-05-23 23:24:18 +02:00
parent d48808f111
commit 106f9aed79
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
3 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.platform.binding;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.internal.expression.EvaluationException;
@ -9,6 +10,7 @@ import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector2;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import java.util.Locale;
import javax.annotation.Nullable;
@ -73,7 +75,7 @@ public class PrimitiveBindings extends Bindings {
public Boolean getBoolean(String argument) {
switch (argument.toLowerCase(Locale.ROOT)) {
case "":
throw new InputParseException("Invalid empty string instead of boolean");
throw new InputParseException(Caption.of("fawe.error.input-parser-exception"));
case "true":
case "yes":
case "on":
@ -89,7 +91,7 @@ public class PrimitiveBindings extends Bindings {
case "0":
return false;
default:
throw new InputParseException("Invalid boolean " + argument);
throw new InputParseException(Caption.of("fawe.error.invalid-boolean", TextComponent.of(argument)));
}
}

View File

@ -59,11 +59,12 @@ public abstract class BlockBag {
}
fetchBlock(blockState);
} catch (OutOfBlocksException e) {
if (blockState.getBlockType().getMaterial().isAir()) {
BlockState placed = blockState; // TODO BlockType.getBlockBagItem(id, data);
if (placed.getBlockType().getMaterial().isAir()) {
throw e; // TODO: check
}
fetchBlock(blockState);
fetchBlock(placed);
}
}

View File

@ -131,6 +131,8 @@
"fawe.error.no-failure": "This shouldn't result in any failure",
"fawe.error.invalid-bracketing": "Invalid bracketing, are you missing a '{0}'.",
"fawe.error.too-simple": "Complexity must be in the range 0-100",
"fawe.error.input-parser-exception": "Invalid empty string instead of boolean.",
"fawe.error.invalid-boolean": "Invalid boolean {0}",
"fawe.cancel.worldedit.cancel.count": "Cancelled {0} edits.",
"fawe.cancel.worldedit.cancel.reason.confirm": "Use //confirm to execute {2}",