From 95e4b30e6acfba5f83a87f8f2d2ceae26954864d Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 3 Aug 2016 15:34:37 +0200 Subject: [PATCH] Fix BossShopSign --- .../dre2n/dungeonsxl/sign/BossShopSign.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java b/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java index d4dc95e4..12d45160 100644 --- a/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java +++ b/core/src/main/java/io/github/dre2n/dungeonsxl/sign/BossShopSign.java @@ -17,8 +17,7 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerEscapeEvent; -import io.github.dre2n.dungeonsxl.player.DGamePlayer; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; import io.github.dre2n.dungeonsxl.world.DGameWorld; import org.black_ixx.bossshop.BossShop; @@ -38,10 +37,29 @@ public class BossShopSign extends DSign { private DSignType type = DSignTypeDefault.BOSS_SHOP; + private String shopName; + public BossShopSign(Sign sign, String[] lines, DGameWorld gameWorld) { super(sign, lines, gameWorld); } + /* Getters and setters*/ + /** + * @return the name of the shop + */ + public String getShopName() { + return shopName; + } + + /** + * @param name + * the name of the shop + */ + public void setShopName(String name) { + shopName = name; + } + + /* Actions */ @Override public boolean check() { return true; @@ -54,6 +72,8 @@ public class BossShopSign extends DSign { return; } + shopName = lines[1]; + if (!getTriggers().isEmpty()) { getSign().getBlock().setType(Material.AIR); return; @@ -88,7 +108,7 @@ public class BossShopSign extends DSign { if (shop != null) { bossShop.getAPI().openShop(player, shop); } else { - MessageUtil.sendMessage(player, ChatColor.RED + "Shop " + shopName + " not found..."); + MessageUtil.sendMessage(player, DMessages.ERROR_NO_SUCH_SHOP.getMessage(shopName)); } }