mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 10:22:29 +00:00
Fixed LWC and Lockette Support
This commit is contained in:
parent
22442f0429
commit
125d0381a1
@ -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)) {
|
||||||
@ -89,6 +94,7 @@ 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);
|
||||||
ItemStack product = clickType.getProduct();
|
ItemStack product = clickType.getProduct();
|
||||||
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user