diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/WorldEditIntegration.java b/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/WorldEditIntegration.java index 5ebb4ad1bb..5990bc7d90 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/WorldEditIntegration.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/WorldEditIntegration.java @@ -45,20 +45,25 @@ public void wrapForLogging(EditSessionEvent event) { public > boolean setBlock(BlockVector3 pos, T block) throws WorldEditException { if (block.getBlockType().getMaterial().isAir()) { World world = Bukkit.getWorld(event.getWorld().getName()); - - if (world != null) { - Location l = new Location(world, pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); - + + if (world != null) { + Location l = new Location(world, pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); + + try { if (BlockStorage.hasBlockInfo(l)) { BlockStorage.clearBlockInfo(l); } + } catch (Exception e) { + LOGGER.warn("Failed to clear block storage at " + l.toString(), e); } } + } return getExtent().setBlock(pos, block); } - - }); + + // Re-throw the exception if we can't handle it + throw e; } }