use of mc.dragons.core.gameobject.floor.Floor in project DragonsOnline by UniverseCraft.
the class FloorCommand method goToFloor.
private void goToFloor(CommandSender sender, String[] args) {
Floor floor = lookupFloor(sender, args[1]);
if (floor == null)
return;
FloorStatus status = floor.getFloorStatus();
boolean access = status == FloorStatus.TESTING || hasPermission(sender, PermissionLevel.BUILDER);
if (!access) {
sender.sendMessage(ChatColor.RED + "Testers can only teleport to floors that are in testing!");
return;
}
user(sender).sendToFloor(floor.getFloorName(), true);
sender.sendMessage(ChatColor.GREEN + "Teleported to floor successfully.");
}
use of mc.dragons.core.gameobject.floor.Floor in project DragonsOnline by UniverseCraft.
the class FloorCommand method pushFloor.
private void pushFloor(CommandSender sender, String[] args) {
if (!requirePermission(sender, PermissionLevel.ADMIN))
return;
Floor floor = lookupFloor(sender, args[1]);
if (floor == null)
return;
if (args.length <= 2 || !args[2].equalsIgnoreCase("--confirm")) {
sender.sendMessage(ChatColor.DARK_RED + "" + ChatColor.UNDERLINE + "/!\\" + ChatColor.RED + " Pushing this floor will copy it into the PRODUCTION STAGING folder. " + "This is an indication that it is ready to be moved to the live production environment. It may be picked up by Apollo Sync at any time. " + ChatColor.BOLD + "Confirm?");
TextComponent confirm = new TextComponent(ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "[CONFIRM]");
confirm.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(ChatColor.GREEN + "Click to confirm push of floor #" + floor.getLevelMin() + " " + floor.getDisplayName())));
confirm.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/floor push " + args[1] + " --confirm"));
sender.spigot().sendMessage(confirm);
return;
}
sender.sendMessage(ChatColor.GREEN + "Pushing floor " + floor.getDisplayName() + "...");
pushFloor(floor);
AUDIT_LOG.savePush(floor, user(sender));
floor.setFloorStatus(FloorStatus.LIVE);
sender.sendMessage(ChatColor.GREEN + "...Complete! Floor status was changed to LIVE");
Bukkit.broadcastMessage(ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "[FLOOR PUSH] " + ChatColor.GREEN + "Floor " + floor.getDisplayName() + " was pushed to production staging! Great work everyone");
}
use of mc.dragons.core.gameobject.floor.Floor in project DragonsOnline by UniverseCraft.
the class FloorCommand method deleteFloor.
private void deleteFloor(CommandSender sender, String[] args) {
if (!requirePermission(sender, PermissionLevel.ADMIN))
return;
Floor floor = lookupFloor(sender, args[1]);
if (floor == null)
return;
if ((floor.isGMLocked() || floor.getFloorStatus() == FloorStatus.LIVE)) {
sender.sendMessage(ChatColor.RED + "This floor cannot currently be deleted (status: " + floor.getFloorStatus() + ")");
return;
}
registry.removeFromDatabase(floor);
AUDIT_LOG.saveEntry(floor, user(sender), "Deleted");
sender.sendMessage(ChatColor.GREEN + "Deleted this floor successfully. World files remain intact. Changes may not fully take effect until a server restart.");
}
use of mc.dragons.core.gameobject.floor.Floor in project DragonsOnline by UniverseCraft.
the class GoToFloorCommand method listFloors.
private void listFloors(CommandSender sender) {
sender.sendMessage(ChatColor.GREEN + "Listing all floors:");
for (GameObject gameObject : registry.getRegisteredObjects(GameObjectType.FLOOR)) {
Floor floor = (Floor) gameObject;
sender.sendMessage(ChatColor.GRAY + "- " + floor.getFloorName() + " [" + floor.getWorldName() + "] [Lv " + floor.getLevelMin() + "]");
}
}
use of mc.dragons.core.gameobject.floor.Floor in project DragonsOnline by UniverseCraft.
the class GoToFloorCommand method goToFloor.
private void goToFloor(CommandSender sender, String[] args) {
Floor floor = lookupFloor(sender, args[0]);
if (floor == null)
return;
user(sender).sendToFloor(floor.getFloorName(), true);
sender.sendMessage(ChatColor.GREEN + "Teleported to floor successfully.");
}
Aggregations