use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class EntitySpawnerSpawnScriptEvent method onSpawnerSpawn.
@EventHandler
public void onSpawnerSpawn(SpawnerSpawnEvent event) {
Entity entity = event.getEntity();
this.entity = new EntityTag(entity);
location = new LocationTag(event.getLocation());
spawnerLocation = new LocationTag(event.getSpawner().getLocation());
this.event = event;
EntityTag.rememberEntity(entity);
fire(event);
EntityTag.forgetEntity(entity);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class EntityTeleportScriptEvent method onPlayerTeleports.
@EventHandler
public void onPlayerTeleports(PlayerTeleportEvent event) {
from = new LocationTag(event.getFrom());
to = new LocationTag(event.getTo());
entity = new EntityTag(event.getPlayer());
cause = event.getCause().name();
this.event = null;
pEvent = event;
fire(event);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class FireworkBurstsScriptEvent method onFireworkBursts.
@EventHandler
public void onFireworkBursts(FireworkExplodeEvent event) {
entity = new EntityTag(event.getEntity());
location = new LocationTag(entity.getLocation());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class EntityTargetsScriptEvent method onEntityTargets.
@EventHandler
public void onEntityTargets(EntityTargetEvent event) {
entity = new EntityTag(event.getEntity());
reason = new ElementTag(event.getReason().toString());
target = event.getTarget() != null ? new EntityTag(event.getTarget()) : null;
location = new LocationTag(event.getEntity().getLocation());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class ProjectileHitsBlockScriptEvent method onProjectileHits.
@EventHandler
public void onProjectileHits(ProjectileHitEvent event) {
projectile = new EntityTag(event.getEntity());
if (projectile.getLocation() == null) {
// No, I can't explain how or why this would ever happen... nonetheless, it appears it does happen sometimes.
return;
}
if (Double.isNaN(projectile.getLocation().getDirection().normalize().getX())) {
// I can't explain this one either. It also chooses to happen whenever it pleases.
return;
}
Block block = event.getHitBlock();
if (block == null) {
return;
}
material = new MaterialTag(block);
shooter = projectile.getShooter();
location = new LocationTag(block.getLocation());
this.event = event;
fire(event);
}
Aggregations