Search in sources :

Example 31 with LocationTag

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

the class VehicleCollidesBlockScriptEvent method onVehicleCollidesBlock.

@EventHandler
public void onVehicleCollidesBlock(VehicleBlockCollisionEvent event) {
    vehicle = new EntityTag(event.getVehicle());
    location = new LocationTag(event.getBlock().getLocation());
    material = new MaterialTag(event.getBlock());
    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) EventHandler(org.bukkit.event.EventHandler)

Example 32 with LocationTag

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

the class PlayerMendsItemScriptEvent method onPlayerItemMend.

@EventHandler
public void onPlayerItemMend(PlayerItemMendEvent event) {
    if (EntityTag.isNPC(event.getPlayer())) {
        return;
    }
    item = new ItemTag(event.getItem());
    location = new LocationTag(event.getPlayer().getLocation());
    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 33 with LocationTag

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

the class PlayerStandsOnScriptEvent method playerStandsOn.

@EventHandler
public void playerStandsOn(PlayerInteractEvent event) {
    if (event.getAction() != Action.PHYSICAL) {
        return;
    }
    material = new MaterialTag(event.getClickedBlock());
    location = new LocationTag(event.getClickedBlock().getLocation());
    this.event = event;
    fire(event);
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) LocationTag(com.denizenscript.denizen.objects.LocationTag) EventHandler(org.bukkit.event.EventHandler)

Example 34 with LocationTag

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

the class PlayerTakesFromLecternScriptEvent method onPlayerTakesFromLectern.

@EventHandler
public void onPlayerTakesFromLectern(PlayerTakeLecternBookEvent event) {
    if (EntityTag.isNPC(event.getPlayer())) {
        return;
    }
    item = new ItemTag(event.getBook());
    location = new LocationTag(event.getLectern().getLocation());
    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 35 with LocationTag

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

the class PlayerWalksOverScriptEvent method onPlayerWalksOver.

@EventHandler
public void onPlayerWalksOver(PlayerMoveEvent event) {
    if (LocationTag.isSameBlock(event.getFrom(), event.getTo())) {
        return;
    }
    if (EntityTag.isNPC(event.getPlayer())) {
        return;
    }
    notable = NoteManager.getSavedId(new LocationTag(event.getTo()).getBlockLocation());
    if (notable == null) {
        return;
    }
    notable = CoreUtilities.toLowerCase(notable);
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) EventHandler(org.bukkit.event.EventHandler)

Aggregations

LocationTag (com.denizenscript.denizen.objects.LocationTag)133 EventHandler (org.bukkit.event.EventHandler)69 EntityTag (com.denizenscript.denizen.objects.EntityTag)45 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)40 MaterialTag (com.denizenscript.denizen.objects.MaterialTag)33 List (java.util.List)21 ItemTag (com.denizenscript.denizen.objects.ItemTag)18 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)15 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)14 ListTag (com.denizenscript.denizencore.objects.core.ListTag)13 NPCTag (com.denizenscript.denizen.objects.NPCTag)12 Location (org.bukkit.Location)11 ArrayList (java.util.ArrayList)8 Entity (org.bukkit.entity.Entity)8 FakeBlock (com.denizenscript.denizen.utilities.blocks.FakeBlock)6 InvalidArgumentsException (com.denizenscript.denizencore.exceptions.InvalidArgumentsException)6 Player (org.bukkit.entity.Player)6 Vector (org.bukkit.util.Vector)6 UUID (java.util.UUID)5 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)5