Don't open wizard spell menu if they right clicked a chest

This commit is contained in:
libraryaddict 2015-01-23 23:17:45 +13:00
parent b00deb683e
commit da81d131a7
2 changed files with 6 additions and 7 deletions

View File

@ -179,12 +179,6 @@ public class CompassAddon extends MiniPlugin
event.getDrops().remove(item);
}
@EventHandler
public void InventoryClick(InventoryClickEvent event)
{
//UtilInv.DisallowMovementOf(event, "Target Compass", Material.COMPASS, (byte)0, true);
}
@EventHandler
public void SpectatorTeleport(PlayerInteractEvent event)
{

View File

@ -6,7 +6,9 @@ import nautilus.game.arcade.game.Game.GameState;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
@ -35,7 +37,10 @@ public class WizardSpellMenu extends MiniPlugin
{
Player p = event.getPlayer();
if (event.getAction().name().contains("RIGHT") && p.getInventory().getHeldItemSlot() < 5)
if (event.getAction().name().contains("RIGHT")
&& p.getInventory().getHeldItemSlot() < 5
&& (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.getClickedBlock().getState() instanceof InventoryHolder))
{
_wizardShop.attemptShopOpen(p);