From d9829614f265becbb4418060d74973fb19855c84 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Tue, 28 Apr 2020 22:26:16 -0400 Subject: [PATCH] Fixes #408 The issue seems to be that a some upstream code was removed for likely "performance" reasons. Obviously, wrong since it broke stuff. --- .../extension/factory/parser/DefaultBlockParser.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java index eaf4fe3d1..19bc026b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java @@ -381,6 +381,14 @@ public class DefaultBlockParser extends InputParser { // Check if the item is allowed BlockType blockType = state.getBlockType(); + + if (context.isRestricted()) { + Actor actor = context.requireActor(); + if (actor != null && !actor.hasPermission("worldedit.anyblock") + && worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) { + throw new DisallowedUsageException("You are not allowed to use '" + input + "'"); + } + } if (nbt != null) return validate(context, state.toBaseBlock(nbt));