Search in sources :

Example 1 with MaterialTag

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

the class BlockBuiltScriptEvent method onBlockBuilt.

@EventHandler
public void onBlockBuilt(BlockCanBuildEvent event) {
    location = new LocationTag(event.getBlock().getLocation());
    old_material = new MaterialTag(event.getBlock());
    new_material = new MaterialTag(event.getBlockData());
    cancelled = !event.isBuildable();
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) MaterialTag(com.denizenscript.denizen.objects.MaterialTag) EventHandler(org.bukkit.event.EventHandler)

Example 2 with MaterialTag

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

the class BlockDispensesScriptEvent method onBlockDispenses.

@EventHandler
public void onBlockDispenses(BlockDispenseEvent event) {
    location = new LocationTag(event.getBlock().getLocation());
    material = new MaterialTag(event.getBlock());
    item = new ItemTag(event.getItem());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) MaterialTag(com.denizenscript.denizen.objects.MaterialTag) ItemTag(com.denizenscript.denizen.objects.ItemTag) EventHandler(org.bukkit.event.EventHandler)

Example 3 with MaterialTag

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

the class PistonRetractsScriptEvent method onPistonRetracts.

@EventHandler
public void onPistonRetracts(BlockPistonRetractEvent event) {
    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) EventHandler(org.bukkit.event.EventHandler)

Example 4 with MaterialTag

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

the class BlockPhysicsScriptEvent method onBlockPhysics.

@EventHandler
public void onBlockPhysics(BlockPhysicsEvent event) {
    Material changedType = event.getChangedType();
    if (changedType == Material.REDSTONE_WIRE || changedType == Material.COMPARATOR || changedType == Material.REPEATER) {
        return;
    }
    location = new LocationTag(event.getBlock().getLocation());
    material = new MaterialTag(location.getBlock());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) MaterialTag(com.denizenscript.denizen.objects.MaterialTag) Material(org.bukkit.Material) EventHandler(org.bukkit.event.EventHandler)

Example 5 with MaterialTag

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

the class LeafDecaysScriptEvent method onLeafDecays.

@EventHandler
public void onLeafDecays(LeavesDecayEvent event) {
    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) EventHandler(org.bukkit.event.EventHandler)

Aggregations

MaterialTag (com.denizenscript.denizen.objects.MaterialTag)51 LocationTag (com.denizenscript.denizen.objects.LocationTag)33 EventHandler (org.bukkit.event.EventHandler)21 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)9 EntityTag (com.denizenscript.denizen.objects.EntityTag)8 Material (org.bukkit.Material)8 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)7 BlockData (org.bukkit.block.data.BlockData)7 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)6 ListTag (com.denizenscript.denizencore.objects.core.ListTag)6 ItemStack (org.bukkit.inventory.ItemStack)6 List (java.util.List)4 Block (org.bukkit.block.Block)4 PlayerChangesSignScriptEvent (com.denizenscript.denizen.events.player.PlayerChangesSignScriptEvent)3 ItemTag (com.denizenscript.denizen.objects.ItemTag)3 SignChangeEvent (org.bukkit.event.block.SignChangeEvent)3 InvalidArgumentsException (com.denizenscript.denizencore.exceptions.InvalidArgumentsException)2 ScriptEntry (com.denizenscript.denizencore.scripts.ScriptEntry)2 HashSet (java.util.HashSet)2 BlockPos (net.minecraft.core.BlockPos)2