use of net.aufdemrand.denizencore.objects.Element in project Denizen-For-Bukkit by DenizenScript.
the class EntitySpawnScriptEvent method onEntityInteract.
@EventHandler
public void onEntityInteract(CreatureSpawnEvent event) {
Entity entity = event.getEntity();
this.entity = new dEntity(entity);
location = new dLocation(event.getLocation());
cuboids = new dList();
for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) {
cuboids.add(cuboid.identifySimple());
}
reason = new Element(event.getSpawnReason().name());
cancelled = event.isCancelled();
this.event = event;
dEntity.rememberEntity(entity);
fire();
dEntity.forgetEntity(entity);
event.setCancelled(cancelled);
}
use of net.aufdemrand.denizencore.objects.Element in project Denizen-For-Bukkit by DenizenScript.
the class EntityTargetsScriptEvent method onEntityTargets.
@EventHandler
public void onEntityTargets(EntityTargetEvent event) {
entity = new dEntity(event.getEntity());
reason = new Element(event.getReason().toString());
target = event.getTarget() != null ? new dEntity(event.getTarget()) : null;
location = new dLocation(event.getEntity().getLocation());
cuboids = new dList();
for (dCuboid cuboid : dCuboid.getNotableCuboidsContaining(location)) {
cuboids.add(cuboid.identifySimple());
}
cancelled = event.isCancelled();
this.event = event;
fire();
event.setCancelled(cancelled);
}
use of net.aufdemrand.denizencore.objects.Element in project Denizen-For-Bukkit by DenizenScript.
the class BiomeEnterExitScriptEvent method onPlayerEntersExitsBiome.
@EventHandler
public void onPlayerEntersExitsBiome(PlayerMoveEvent event) {
from = new dLocation(event.getFrom());
to = new dLocation(event.getTo());
old_biome = new Element(from.getBlock().getBiome().name());
new_biome = new Element(to.getBlock().getBiome().name());
if (old_biome.identify().equals(new_biome.identify())) {
return;
}
cancelled = event.isCancelled();
this.event = event;
fire();
event.setCancelled(cancelled);
}
use of net.aufdemrand.denizencore.objects.Element in project Denizen-For-Bukkit by DenizenScript.
the class ItemScrollScriptEvent method onPlayerScrollsHotbar.
@EventHandler
public void onPlayerScrollsHotbar(PlayerItemHeldEvent event) {
new_slot = new Element(event.getNewSlot() + 1);
previous_slot = new Element(event.getPreviousSlot() + 1);
cancelled = event.isCancelled();
this.event = event;
fire();
event.setCancelled(cancelled);
}
use of net.aufdemrand.denizencore.objects.Element in project Denizen-For-Bukkit by DenizenScript.
the class PortalCreateScriptEvent method onPortalCreate.
@EventHandler
public void onPortalCreate(PortalCreateEvent event) {
world = new dWorld(event.getWorld());
reason = new Element(event.getReason().toString());
blocks = new dList();
for (Block block : event.getBlocks()) {
blocks.add(new dLocation(block.getLocation()).identify());
}
this.event = event;
cancelled = event.isCancelled();
fire();
event.setCancelled(cancelled);
}
Aggregations