use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class EntityBoundingBox method adjust.
@Override
public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("bounding_box") && mechanism.requireObject(ListTag.class)) {
if (entity.isCitizensNPC()) {
// TODO: Allow editing NPC boxes properly?
return;
}
List<LocationTag> locations = mechanism.valueAsType(ListTag.class).filter(LocationTag.class, mechanism.context);
if (locations.size() == 2) {
BoundingBox boundingBox = new BoundingBox(locations.get(0).toVector(), locations.get(1).toVector());
NMSHandler.getEntityHelper().setBoundingBox(entity.getBukkitEntity(), boundingBox);
modifiedBoxes.add(entity.getUUID());
} else {
mechanism.echoError("Must specify exactly 2 LocationTags in the format '<low>|<high>'!");
}
}
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class BlockFadesScriptEvent method onBlockFades.
@EventHandler
public void onBlockFades(BlockFadeEvent event) {
location = new LocationTag(event.getBlock().getLocation());
material = new MaterialTag(event.getBlock());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class TNTPrimesScriptEvent method tntPrimeEvent.
@EventHandler
public void tntPrimeEvent(TNTPrimeEvent event) {
this.event = event;
location = new LocationTag(event.getBlock().getLocation());
fire(event);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class BellRingScriptEvent method bellRingEvent.
@EventHandler
public void bellRingEvent(BellRingEvent event) {
this.event = event;
location = new LocationTag(event.getBlock().getLocation());
fire(event);
}
use of com.denizenscript.denizen.objects.LocationTag in project Denizen-For-Bukkit by DenizenScript.
the class EntityAddToWorldScriptEvent method onPreCreatureSpawn.
@EventHandler
public void onPreCreatureSpawn(EntityAddToWorldEvent event) {
this.entity = new EntityTag(event.getEntity());
this.location = new LocationTag(event.getEntity().getLocation());
this.event = event;
fire(event);
}
Aggregations