From 106f9aed7994831666d7857c22a6836c878309e0 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 23 May 2021 23:24:18 +0200 Subject: [PATCH] Address requested changes - https://github.com/IntellectualSites/FastAsyncWorldEdit/commit/453415489439f1cff3f619bd5ad62536636eda7e#r50694638 - https://github.com/IntellectualSites/FastAsyncWorldEdit/commit/4c1d0bc9a6299a08929f78641c6e81b1009a7848#r50694886 --- .../extension/platform/binding/PrimitiveBindings.java | 6 ++++-- .../java/com/sk89q/worldedit/extent/inventory/BlockBag.java | 5 +++-- worldedit-core/src/main/resources/lang/strings.json | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java index 73533afba..cfa4b92b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/PrimitiveBindings.java @@ -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))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java index ff17d6a97..fb34aaf51 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/inventory/BlockBag.java @@ -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); } } diff --git a/worldedit-core/src/main/resources/lang/strings.json b/worldedit-core/src/main/resources/lang/strings.json index 0c1f793fe..766b68d87 100644 --- a/worldedit-core/src/main/resources/lang/strings.json +++ b/worldedit-core/src/main/resources/lang/strings.json @@ -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}",