From 468fa0e645ff14a780b0f36d79e2538e978d1399 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 10 Apr 2017 20:36:28 +0200 Subject: [PATCH] Include shop's world in error messages --- src/main/java/de/epiceric/shopchest/shop/Shop.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/shop/Shop.java b/src/main/java/de/epiceric/shopchest/shop/Shop.java index 061e24d..f717893 100644 --- a/src/main/java/de/epiceric/shopchest/shop/Shop.java +++ b/src/main/java/de/epiceric/shopchest/shop/Shop.java @@ -55,14 +55,14 @@ public class Shop { Block b = location.getBlock(); if (b.getType() != Material.CHEST && b.getType() != Material.TRAPPED_CHEST) { - ChestNotFoundException ex = new ChestNotFoundException("No Chest found at location: " + b.getX() + "; " + b.getY() + "; " + b.getZ()); + ChestNotFoundException ex = new ChestNotFoundException(String.format("No Chest found in world '%s' at location: %d; %d; %d", b.getWorld().getName(), b.getX(), b.getY(), b.getZ())); plugin.getShopUtils().removeShop(this, plugin.getShopChestConfig().remove_shop_on_error); if (showConsoleMessages) plugin.getLogger().severe(ex.getMessage()); plugin.debug("Failed to create shop (#" + id + ")"); plugin.debug(ex); return false; } else if ((b.getRelative(BlockFace.UP).getType() != Material.AIR) && plugin.getShopChestConfig().show_shop_items) { - NotEnoughSpaceException ex = new NotEnoughSpaceException("No space above chest at location: " + b.getX() + "; " + b.getY() + "; " + b.getZ()); + NotEnoughSpaceException ex = new NotEnoughSpaceException(String.format("No space above chest in world '%s' at location: %d; %d; %d", b.getWorld().getName(), b.getX(), b.getY(), b.getZ())); plugin.getShopUtils().removeShop(this, plugin.getShopChestConfig().remove_shop_on_error); if (showConsoleMessages) plugin.getLogger().severe(ex.getMessage()); plugin.debug("Failed to create shop (#" + id + ")");