use of io.github.wysohn.triggerreactor.core.manager.trigger.Trigger in project TriggerReactor by wysohn.
the class CommonFunctions method currentAreasAt.
/**
* Get the name of area triggers containing the given location.
*
* @param location the location to check
* @return array of AreaTrigger names. The array can be empty but never null.
*/
public String[] currentAreasAt(Location location) {
AbstractAreaTriggerManager areaManager = plugin.getAreaManager();
String[] names = areaManager.getAreas(LocationUtil.convertToSimpleLocation(location)).stream().map(Map.Entry::getValue).map(Trigger::getInfo).map(TriggerInfo::getTriggerName).toArray(String[]::new);
return names;
}
use of io.github.wysohn.triggerreactor.core.manager.trigger.Trigger in project TriggerReactor by wysohn.
the class LocationBasedTriggerManager method showTriggerInfo.
protected void showTriggerInfo(ICommandSender sender, Block clicked) {
Trigger trigger = getTriggerForLocation(LocationUtil.convertToSimpleLocation(clicked.getLocation()));
if (trigger == null) {
return;
}
sender.sendMessage("- - - - - - - - - - - - - -");
sender.sendMessage("Trigger: " + getTriggerTypeName());
sender.sendMessage("Block Type: " + clicked.getType().name());
sender.sendMessage("Location: " + clicked.getWorld().getName() + "@" + clicked.getLocation().getBlockX() + "," + clicked.getLocation().getBlockY() + "," + clicked.getLocation().getBlockZ());
sender.sendMessage("");
sender.sendMessage("Script:");
sender.sendMessage(trigger.getScript());
sender.sendMessage("- - - - - - - - - - - - - -");
}
use of io.github.wysohn.triggerreactor.core.manager.trigger.Trigger in project TriggerReactor by wysohn.
the class LocationBasedTriggerManager method showTriggerInfo.
@Override
protected void showTriggerInfo(ICommandSender sender, SimpleLocation sloc) {
Trigger trigger = getTriggerForLocation(sloc);
if (trigger == null) {
return;
}
Location loc = LocationUtil.convertToBukkitLocation(sloc);
Block clicked = loc.getBlock();
sender.sendMessage("- - - - - - - - - - - - - -");
sender.sendMessage("Trigger: " + getTriggerTypeName());
sender.sendMessage("Block Type: " + clicked.getType().name());
sender.sendMessage("Location: " + clicked.getWorld().getName() + "@" + clicked.getLocation().getBlockX() + "," + clicked.getLocation().getBlockY() + "," + clicked.getLocation().getBlockZ());
sender.sendMessage("");
sender.sendMessage("Script:");
sender.sendMessage(trigger.getScript());
sender.sendMessage("- - - - - - - - - - - - - -");
}
Aggregations