From 82cb68c3b51ff2d3b8f2e3790bacc08efe9e132f Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Fri, 20 Mar 2020 18:47:52 +0100 Subject: [PATCH] Consistent exception catching in BlockSign#activate() and #deactivate() --- .../java/de/erethon/dungeonsxl/sign/rocker/BlockSign.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/BlockSign.java b/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/BlockSign.java index 68f2e1fc..817eda52 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/BlockSign.java +++ b/core/src/main/java/de/erethon/dungeonsxl/sign/rocker/BlockSign.java @@ -125,7 +125,12 @@ public class BlockSign extends Rocker { @Override public void deactivate() { getSign().getBlock().setType(offBlock.getMaterial()); - MagicValueUtil.setBlockData(getSign().getBlock(), offBlockData); + try { + MagicValueUtil.setBlockData(getSign().getBlock(), offBlockData); + } catch (IllegalArgumentException exception) { + markAsErroneous("onBlock data value " + offBlockData + " cannot be applied to given type " + onBlock.getId()); + return; + } active = false; }