Untitled diff

Created Diff never expires
49 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
50 lines
34 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
35 lines
if(sub.equalsIgnoreCase("spawn")){
if(sub.equalsIgnoreCase("spawn")){
if(p.hasPermission("potpvp.spawn")){
if(p.hasPermission("potpvp.spawn")){
if (Main.instance.getConfig().getConfigurationSection("spawn") == null) {
FileConfiguration conf = Main.instance.getConfig();
if (conf.getConfigurationSection("spawn") == null) {
p.getPlayer().sendMessage("§cThe spawn has not yet been set!");
p.getPlayer().sendMessage("§cThe spawn has not yet been set!");
return true;
return true;
}
}
if(contadorempezado == false) {
if(listaDePlayersTeletransportando.contains(p.getUniqueId())){
contadorempezado = true;
conf.getString("messages.spawn-start-cooldown").replace("&", "§"); //Que es esto, no mensaje de "ya estas teletransportando"?
Main.instance.getConfig().getString("messages.spawn-start-cooldown").replace('&', '§');
return true;
new BukkitRunnable(){
}
@EventHandler
listaDePlayersTeletransportando.add(p.getUniqueId());
public void onMove(PlayerMoveEvent e){
conf.getString("messages.spawn-start-cooldown").replace('&', '§');
if(contadorempezado==true){
new BukkitRunnable(){
e.getPlayer().sendMessage(Main.instance.getConfig().getString("messages.spawn-cancel")
public void run(){
.replace('&', '§'));
if(contador > 0) {
this.cancel();
contador = contador-1;
}
DecimalFormat df = new DecimalFormat("#.#");
}
p.sendMessage(conf.getString("messages.spawn-cooldown").replace('&', '§')
public void run(){
.replace("{time}", df.format(contador)));
if(contador > 1) {
} else {
contador = contador-1;
this.cancel();
DecimalFormat df = new DecimalFormat("#.#");
conf.getString("messages.spawn").replace("&", "§");
p.sendMessage(Bukkit.getPluginManager().getPlugin("PotPvP").getConfig()
contador = conf.getInt("spawn-cooldown");
.getString("messages.spawn-cooldown").replace('&', '§')
World w = Bukkit.getWorld(conf.getString("spawn.world"));
.replace("{time}", df.format(contador)));
double x = conf.getDouble("spawn.x");
} else {
double y = conf.getDouble("spawn.y");
this.cancel();
double z = conf.getDouble("spawn.z");
Main.instance.getConfig().getString("messages.spawn").replace("&", "§");
p.teleport(new Location(w,x,y,z));
contador = Main.instance.getConfig().getInt("spawn-cooldown");
listaDePlayersTeletransportando.remove(p.getUniqueId()); //y haz esto en movimiento evento tambien
World w = Bukkit.getWorld(Main.instance.getConfig().getString("spawn.world"));
double x = Main.instance.getConfig().getDouble("spawn.x");
double y = Main.instance.getConfig().getDouble("spawn.y");
double z = Main.instance.getConfig().getDouble("spawn.z");
p.teleport(new Location(w,x,y,z));
Bukkit.getScheduler().runTaskLater(Main.instance, new Runnable(){
@Override
public void run() {
contadorempezado = false;
}
}, Main.instance.getConfig().getInt("spawn-cooldown")*20L);
}
}
}
}.runTaskTimer(Main.instance, 20L, 20L);
}

}.runTaskTimer(Main.instance, 20L, 20L);

}else if(contadorempezado == true){
Main.instance.getConfig().getString("messages.spawn-start-cooldown").replace("&", "§");
}
}
}
}
}