use of com.ebicep.warlords.game.option.marker.DebugLocationMarker in project Warlords by ebicep.
the class DebugMenuPlayerOptions method openTeleportLocations.
public static void openTeleportLocations(Player player, WarlordsPlayer target) {
Menu menu = new Menu("Teleport To: " + target.getName(), 9 * 5);
Game game = target.getGame();
int x = 0;
int y = 0;
for (DebugLocationMarker marker : game.getMarkers(DebugLocationMarker.class)) {
menu.setItem(x, y, marker.getAsItem(), (m, e) -> {
target.teleport(marker.getLocation());
player.sendMessage(ChatColor.RED + "DEV: " + target.getColoredName() + "§a was teleported to " + marker.getName());
});
x++;
if (x > 8) {
x = 0;
y++;
}
}
menu.setItem(3, 4, MENU_BACK, (m, e) -> openPlayerMenu(player, target));
menu.setItem(4, 4, MENU_CLOSE, ACTION_CLOSE_MENU);
menu.openForPlayer(player);
}
Aggregations