Consistent exception catching in BlockSign#activate() and #deactivate()

This commit is contained in:
Daniel Saukel 2020-03-20 18:47:52 +01:00
parent f19417ceeb
commit 82cb68c3b5

View File

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