Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //THIS IS JUST FOR WARPING ;-:
- package eu.hangar.seconds;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Start extends JavaPlugin {
- SettingsManager settings = SettingsManager.getInstance();
- public void onEnable() {
- settings.setup(this);
- }
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
- if (!(sender instanceof Player)) {
- sender.sendMessage(ChatColor.RED + "This plugin is for players only!");
- return true;
- }
- Player p = (Player) sender;
- if (cmd.getName().equalsIgnoreCase("tp")) {
- if (args.length == 0) {
- p.sendMessage(ChatColor.RED + "Please specify a player.");
- return true;
- }
- Player target = Bukkit.getServer().getPlayer(args[0]);
- if (target == null) {
- p.sendMessage(ChatColor.RED + "Could not find player " + args[0] + "!");
- return true;
- }
- p.teleport(target.getLocation());
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("setstart")) {
- if (p.hasPermission("set.StartPoint")) {
- settings.getData().set("spawn.world", p.getLocation().getWorld().getName());
- settings.getData().set("spawn.x", p.getLocation().getX());
- settings.getData().set("spawn.y", p.getLocation().getY());
- settings.getData().set("spawn.z", p.getLocation().getZ());
- settings.saveData();
- p.sendMessage(ChatColor.GREEN + "Start set!");
- }else{
- p.sendMessage(ChatColor.DARK_RED + "I'm sorry, you cannot set the death lobby: Insufficient Permissions");
- }
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("TeleStart")) {
- if (settings.getData().getConfigurationSection("spawn") == null) {
- p.sendMessage(ChatColor.RED + "The spawn has not yet been set!");
- return true;
- }
- World w = Bukkit.getServer().getWorld(settings.getData().getString("spawn.world"));
- double x = settings.getData().getDouble("spawn.x");
- double y = settings.getData().getDouble("spawn.y");
- double z = settings.getData().getDouble("spawn.z");
- p.teleport(new Location(w, x, y, z));
- p.sendMessage(ChatColor.GREEN + "This is your start!");
- }
- if (cmd.getName().equalsIgnoreCase("setdeath")) {
- if (p.hasPermission("set.DeathLobby")) {
- settings.getData().set("death.world", p.getLocation().getWorld().getName());
- settings.getData().set("death.x", p.getLocation().getX());
- settings.getData().set("death.y", p.getLocation().getY());
- settings.getData().set("death.z", p.getLocation().getZ());
- settings.saveData();
- p.sendMessage(ChatColor.GREEN + "Death-Lobby set!");
- }else{
- p.sendMessage(ChatColor.DARK_RED + "I'm sorry, you cannot set the death lobby: Insufficient Permissions");
- }
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("TeleDeath")) {
- if (settings.getData().getConfigurationSection("death") == null) {
- p.sendMessage(ChatColor.RED + "The death-lobby has not yet been set!");
- return true;
- }
- World w = Bukkit.getServer().getWorld(settings.getData().getString("death.world"));
- double x = settings.getData().getDouble("death.x");
- double y = settings.getData().getDouble("death.y");
- double z = settings.getData().getDouble("death.z");
- p.teleport(new Location(w, x, y, z));
- p.sendMessage(ChatColor.GREEN + "This is your death-lobby!");
- }
- if (cmd.getName().equalsIgnoreCase("setstep3")) {
- if (p.hasPermission("set.Steps")) {
- settings.getData().set("step3.world", p.getLocation().getWorld().getName());
- settings.getData().set("step3.x", p.getLocation().getX());
- settings.getData().set("step3.y", p.getLocation().getY());
- settings.getData().set("step3.z", p.getLocation().getZ());
- settings.saveData();
- p.sendMessage(ChatColor.DARK_GREEN + "Step 3 set!");
- }else{
- p.sendMessage(ChatColor.DARK_RED + "I'm sorry, you cannot set the Step: Insufficient Permissions");
- }
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("TeleStep3")) {
- if (settings.getData().getConfigurationSection("step3") == null) {
- p.sendMessage(ChatColor.RED + "The 3rd step has not yet been set!");
- return true;
- }
- World w = Bukkit.getServer().getWorld(settings.getData().getString("step3.world"));
- double x = settings.getData().getDouble("step3.x");
- double y = settings.getData().getDouble("step3.y");
- double z = settings.getData().getDouble("step3.z");
- p.teleport(new Location(w, x, y, z));
- p.sendMessage(ChatColor.GREEN + "Teleporrting...");
- }
- if (cmd.getName().equalsIgnoreCase("SetStep2")) {
- if (p.hasPermission("set.Steps")) {
- settings.getData().set("step2.world", p.getLocation().getWorld().getName());
- settings.getData().set("step2.x", p.getLocation().getX());
- settings.getData().set("step2.y", p.getLocation().getY());
- settings.getData().set("step2.z", p.getLocation().getZ());
- settings.saveData();
- p.sendMessage(ChatColor.DARK_GREEN + "The second steps was set!");
- }else{
- p.sendMessage(ChatColor.DARK_RED + "I'm sorry, you cannot set the second step: Insufficient Permissions");
- }
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("TeleStep2")) {
- if (settings.getData().getConfigurationSection("step2") == null) {
- p.sendMessage(ChatColor.RED + "The 2nd step has not yet been set!");
- return true;
- }
- World w = Bukkit.getServer().getWorld(settings.getData().getString("step2.world"));
- double x = settings.getData().getDouble("step2.x");
- double y = settings.getData().getDouble("step2.y");
- double z = settings.getData().getDouble("step2.z");
- p.teleport(new Location(w, x, y, z));
- p.sendMessage(ChatColor.GREEN + "Teleporting to the step2!");
- }
- return false; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement