View difference between Paste ID: UD4P49HV and VJWCJP4k
SHOW: | | - or go back to the newest paste.
1
package com.AlexMaass.Test;
2-
2+
 
3
import org.bukkit.Bukkit;
4
import org.bukkit.Location;
5
import org.bukkit.command.Command;
6
import org.bukkit.command.CommandSender;
7
import org.bukkit.entity.Player;
8
import org.bukkit.plugin.java.JavaPlugin;
9-
9+
 
10
public class Main extends JavaPlugin {
11-
11+
 
12-
	public void onEnable() {
12+
        @Override
13-
		getLogger().info("Hello World!");
13+
        public void onEnable() {
14-
	}
14+
                getLogger().info("Hello World!");
15-
15+
        }
16-
	//int points1 = 0, points2 = 0;
16+
 
17-
	private Location spawn1 = new Location(Bukkit.getWorld("New World"), 1287, 65, 805);
17+
        //int points1 = 0, points2 = 0;
18-
	private Location spawn2 = new Location(Bukkit.getWorld("New World"), 1318, 65, 805);
18+
        private final Location spawn1 = new Location(Bukkit.getWorld("New World"), 1287, 65, 805);
19-
	private String player1 = "";
19+
        private final Location spawn2 = new Location(Bukkit.getWorld("New World"), 1318, 65, 805);
20-
	private String player2 = "";
20+
        private String player1 = "";
21-
21+
        private String player2 = "";
22-
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
22+
 
23-
		
23+
        @Override
24-
		if (cmd.getName().equalsIgnoreCase("spleefjoinA")) 
24+
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
25-
		{
25+
               
26-
			
26+
                if (cmd.getName().equalsIgnoreCase("spleefjoinA"))
27-
			if(player1 == "") 
27+
                {
28-
			{
28+
                       
29-
				sender.sendMessage("This works, player 1 is empty :)");
29+
                        if("".equals(player1))
30-
				player1 = ((Player) sender).getUniqueId().toString();
30+
                        {
31-
			} 
31+
                                sender.sendMessage("This works, player 1 is empty :)");
32-
			else 
32+
                                player1 = ((Player) sender).getUniqueId().toString();
33-
			{
33+
                        }
34-
				if(player1 == ((Player) sender).getUniqueId().toString()) 
34+
                        else
35-
				{ 
35+
                        {
36-
					sender.sendMessage("This works too");
36+
                                if(player1 == null ? ((Player) sender).getUniqueId().toString() == null : player1.equals(((Player) sender).getUniqueId().toString()))
37-
					return true;
37+
                                {
38-
				}
38+
                                        sender.sendMessage("This works too");
39-
				sender.sendMessage("This works, player 2 is empty :)");
39+
                                        return true;
40-
				player2 = ((Player) sender).getUniqueId().toString();
40+
                                }
41-
				Bukkit.getPlayer(player1).teleport(spawn1); // spawn1
41+
                                sender.sendMessage("This works, player 2 is empty :)");
42-
				Bukkit.getPlayer(player2).teleport(spawn2); // spawn2
42+
                                player2 = ((Player) sender).getUniqueId().toString();
43-
43+
                                Bukkit.getPlayer(player1).teleport(spawn1); // spawn1
44-
				player1 = "";
44+
                                Bukkit.getPlayer(player2).teleport(spawn2); // spawn2
45-
				player2 = ""; 
45+
 
46-
			}
46+
                                player1 = "";
47-
		}		
47+
                                player2 = "";
48-
		return true;
48+
                        }
49-
	}
49+
                }              
50
                return true;
51
        }
52
}