Fixed LWC and Lockette Support

This commit is contained in:
Eric 2015-09-04 13:41:24 +02:00
parent 22442f0429
commit 125d0381a1

View File

@ -13,6 +13,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
@ -32,7 +33,7 @@ import de.epiceric.shopchest.utils.EnchantmentNames;
import de.epiceric.shopchest.utils.ItemNames; import de.epiceric.shopchest.utils.ItemNames;
import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.interfaces.Utils; import de.epiceric.shopchest.interfaces.Utils;
import net.md_5.bungee.api.ChatColor;
import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse; import net.milkbowl.vault.economy.EconomyResponse;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
@ -55,6 +56,8 @@ public class InteractShop implements Listener{
Block b = e.getClickedBlock(); Block b = e.getClickedBlock();
Player p = e.getPlayer(); Player p = e.getPlayer();
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + p.getName() + " clicked block.");
if (e.getAction() == Action.RIGHT_CLICK_BLOCK || e.getAction() == Action.LEFT_CLICK_BLOCK) { if (e.getAction() == Action.RIGHT_CLICK_BLOCK || e.getAction() == Action.LEFT_CLICK_BLOCK) {
if (b.getType().equals(Material.CHEST) || b.getType().equals(Material.TRAPPED_CHEST)) { if (b.getType().equals(Material.CHEST) || b.getType().equals(Material.TRAPPED_CHEST)) {
@ -68,6 +71,8 @@ public class InteractShop implements Listener{
case CREATE: case CREATE:
e.setCancelled(true); e.setCancelled(true);
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + p.getName() + " created shop.");
if (!p.isOp() || !perm.has(p, "shopchest.create.protected")) { if (!p.isOp() || !perm.has(p, "shopchest.create.protected")) {
if (ShopChest.lockette) { if (ShopChest.lockette) {
if (Lockette.isProtected(b)) { if (Lockette.isProtected(b)) {
@ -87,7 +92,8 @@ public class InteractShop implements Listener{
} }
} }
} }
} }
if (!ShopUtils.isShop(b.getLocation())) { if (!ShopUtils.isShop(b.getLocation())) {
ClickType clickType = ClickType.getPlayerClickType(p); ClickType clickType = ClickType.getPlayerClickType(p);
@ -107,6 +113,8 @@ public class InteractShop implements Listener{
case INFO: case INFO:
e.setCancelled(true); e.setCancelled(true);
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + p.getName() + " retrieved info.");
if (ShopUtils.isShop(b.getLocation())) { if (ShopUtils.isShop(b.getLocation())) {
Shop shop = ShopUtils.getShop(b.getLocation()); Shop shop = ShopUtils.getShop(b.getLocation());
@ -122,6 +130,8 @@ public class InteractShop implements Listener{
case REMOVE: case REMOVE:
e.setCancelled(true); e.setCancelled(true);
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + p.getName() + " removed shop.");
if (ShopUtils.isShop(b.getLocation())) { if (ShopUtils.isShop(b.getLocation())) {
Shop shop = ShopUtils.getShop(b.getLocation()); Shop shop = ShopUtils.getShop(b.getLocation());