This commit is contained in:
samczsun 2017-03-09 19:38:29 -05:00 committed by cnr
parent 99534e19c5
commit e45e27ba34

View File

@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.Inventory;
@ -127,11 +128,24 @@ public class HotbarEditor extends MiniPlugin
if (UtilItem.isSimilar(item, _item, UtilItem.ItemAttribute.NAME))
{
event.setCancelled(true);
HotbarInventory.open(event.getPlayer(), this);
}
}
}
@EventHandler
public void onInteract(PlayerInteractEntityEvent event)
{
ItemStack item = event.getPlayer().getItemInHand();
if (UtilItem.isSimilar(item, _item, UtilItem.ItemAttribute.NAME))
{
event.setCancelled(true);
HotbarInventory.open(event.getPlayer(), this);
}
}
public Gladiators getHost()
{
return _host;