Include shop's world in error messages

This commit is contained in:
Eric 2017-04-10 20:36:28 +02:00
parent f6a7f5e3ba
commit 468fa0e645

View File

@ -55,14 +55,14 @@ public class Shop {
Block b = location.getBlock(); Block b = location.getBlock();
if (b.getType() != Material.CHEST && b.getType() != Material.TRAPPED_CHEST) { 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); plugin.getShopUtils().removeShop(this, plugin.getShopChestConfig().remove_shop_on_error);
if (showConsoleMessages) plugin.getLogger().severe(ex.getMessage()); if (showConsoleMessages) plugin.getLogger().severe(ex.getMessage());
plugin.debug("Failed to create shop (#" + id + ")"); plugin.debug("Failed to create shop (#" + id + ")");
plugin.debug(ex); plugin.debug(ex);
return false; return false;
} else if ((b.getRelative(BlockFace.UP).getType() != Material.AIR) && plugin.getShopChestConfig().show_shop_items) { } 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); plugin.getShopUtils().removeShop(this, plugin.getShopChestConfig().remove_shop_on_error);
if (showConsoleMessages) plugin.getLogger().severe(ex.getMessage()); if (showConsoleMessages) plugin.getLogger().severe(ex.getMessage());
plugin.debug("Failed to create shop (#" + id + ")"); plugin.debug("Failed to create shop (#" + id + ")");