Search in sources :

Example 16 with ItemTag

use of com.denizenscript.denizen.objects.ItemTag in project Denizen-For-Bukkit by DenizenScript.

the class InventoryPicksUpItemScriptEvent method onInvPicksUpItem.

@EventHandler
public void onInvPicksUpItem(InventoryPickupItemEvent event) {
    this.event = event;
    inventory = InventoryTag.mirrorBukkitInventory(event.getInventory());
    item = new ItemTag(event.getItem().getItemStack());
    fire(event);
}
Also used : ItemTag(com.denizenscript.denizen.objects.ItemTag) EventHandler(org.bukkit.event.EventHandler)

Example 17 with ItemTag

use of com.denizenscript.denizen.objects.ItemTag in project Denizen-For-Bukkit by DenizenScript.

the class ItemMoveScriptEvent method onInventoryMoveItemEvent.

@EventHandler
public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) {
    this.event = event;
    origin = InventoryTag.mirrorBukkitInventory(event.getSource());
    destination = InventoryTag.mirrorBukkitInventory(event.getDestination());
    item = new ItemTag(event.getItem());
    fire(event);
}
Also used : ItemTag(com.denizenscript.denizen.objects.ItemTag) EventHandler(org.bukkit.event.EventHandler)

Example 18 with ItemTag

use of com.denizenscript.denizen.objects.ItemTag in project Denizen-For-Bukkit by DenizenScript.

the class PlayerEmptiesBucketScriptEvent method onBucketEmpty.

@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
    location = new LocationTag(event.getBlockClicked().getLocation());
    item = new ItemTag(event.getBucket());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) ItemTag(com.denizenscript.denizen.objects.ItemTag) EventHandler(org.bukkit.event.EventHandler)

Example 19 with ItemTag

use of com.denizenscript.denizen.objects.ItemTag in project Denizen-For-Bukkit by DenizenScript.

the class PlayerFillsBucketScriptEvent method onBucketFill.

@EventHandler
public void onBucketFill(PlayerBucketFillEvent event) {
    entity = new EntityTag(event.getPlayer());
    location = new LocationTag(event.getBlockClicked().getLocation());
    item = new ItemTag(event.getItemStack());
    material = new MaterialTag(event.getBlockClicked());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) MaterialTag(com.denizenscript.denizen.objects.MaterialTag) EntityTag(com.denizenscript.denizen.objects.EntityTag) ItemTag(com.denizenscript.denizen.objects.ItemTag) EventHandler(org.bukkit.event.EventHandler)

Example 20 with ItemTag

use of com.denizenscript.denizen.objects.ItemTag in project Denizen-For-Bukkit by DenizenScript.

the class PlayersPrepareSmithingTableScriptEvent method onCraftItem.

@EventHandler
public void onCraftItem(PrepareSmithingEvent event) {
    if (event.getInventory().getViewers().isEmpty()) {
        return;
    }
    HumanEntity humanEntity = event.getInventory().getViewers().get(0);
    if (EntityTag.isNPC(humanEntity)) {
        return;
    }
    this.event = event;
    result = new ItemTag(event.getResult());
    this.player = EntityTag.getPlayerFrom(humanEntity);
    this.cancelled = false;
    fire(event);
}
Also used : HumanEntity(org.bukkit.entity.HumanEntity) ItemTag(com.denizenscript.denizen.objects.ItemTag) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ItemTag (com.denizenscript.denizen.objects.ItemTag)77 EventHandler (org.bukkit.event.EventHandler)35 ItemStack (org.bukkit.inventory.ItemStack)20 LocationTag (com.denizenscript.denizen.objects.LocationTag)19 EntityTag (com.denizenscript.denizen.objects.EntityTag)14 ListTag (com.denizenscript.denizencore.objects.core.ListTag)14 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)13 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)9 Item (org.bukkit.entity.Item)7 Argument (com.denizenscript.denizencore.objects.Argument)6 List (java.util.List)6 InvalidArgumentsException (com.denizenscript.denizencore.exceptions.InvalidArgumentsException)5 ScriptTag (com.denizenscript.denizencore.objects.core.ScriptTag)5 HumanEntity (org.bukkit.entity.HumanEntity)5 Player (org.bukkit.entity.Player)5 InventoryTag (com.denizenscript.denizen.objects.InventoryTag)4 BukkitTagContext (com.denizenscript.denizen.tags.BukkitTagContext)4 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)4 ArrayList (java.util.ArrayList)4 MaterialTag (com.denizenscript.denizen.objects.MaterialTag)3