replace #66
@ -107,8 +107,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
|
|
||||||
new PreRunningCountdown();
|
new PreRunningCountdown();
|
||||||
|
|
||||||
Fight.getRedTeam().replaceSync();
|
Fight.replaceSync();
|
||||||
Fight.getBlueTeam().replaceSync();
|
|
||||||
|
|
||||||
|
|||||||
new WinconditionAllDead();
|
new WinconditionAllDead();
|
||||||
new WinconditionCaptainDead();
|
new WinconditionCaptainDead();
|
||||||
|
@ -2,6 +2,7 @@ package de.steamwar.fightsystem.fight;
|
|||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -66,4 +67,15 @@ public class Fight {
|
|||||||
public static void setLevel(int level) {
|
public static void setLevel(int level) {
|
||||||
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.setLevel(level));
|
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.setLevel(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void replaceSync() {
|
||||||
|
if(Config.ReplaceObsidian) {
|
||||||
|
Fight.getRedTeam().replaceSync(true, Material.OBSIDIAN, Material.TNT);
|
||||||
|
Fight.getBlueTeam().replaceSync(true, Material.OBSIDIAN, Material.TNT);
|
||||||
|
}
|
||||||
|
if(Config.ReplaceBedrock) {
|
||||||
|
Fight.getRedTeam().replaceSync(true, Material.BEDROCK, Material.SLIME_BLOCK);
|
||||||
|
Fight.getBlueTeam().replaceSync(true, Material.BEDROCK, Material.SLIME_BLOCK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,10 @@ public class FightTeam implements IFightTeam{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replaceSync() {
|
public void replaceSync(boolean replace, Material target, Material replacement) {
|
||||||
|
if(!replace)
|
||||||
|
return;
|
||||||
|
|
||||||
World world = Bukkit.getWorlds().get(0);
|
World world = Bukkit.getWorlds().get(0);
|
||||||
Location minPoint = new Location(world, cornerX, cornerY, cornerZ);
|
Location minPoint = new Location(world, cornerX, cornerY, cornerZ);
|
||||||
Location maxPoint = new Location(world, (cornerX + Config.SchemsizeX), (cornerY + Config.SchemsizeY), (cornerZ + Config.SchemsizeZ));
|
Location maxPoint = new Location(world, (cornerX + Config.SchemsizeX), (cornerY + Config.SchemsizeY), (cornerZ + Config.SchemsizeZ));
|
||||||
@ -310,11 +313,8 @@ public class FightTeam implements IFightTeam{
|
|||||||
for(int y = minPoint.getBlockY(); y <= maxPoint.getBlockY(); y++) {
|
for(int y = minPoint.getBlockY(); y <= maxPoint.getBlockY(); y++) {
|
||||||
|
|
||||||
Block block = world.getBlockAt(x, y, z);
|
Block block = world.getBlockAt(x, y, z);
|
||||||
|
if(block.getType() == target)
|
||||||
if(Config.ReplaceObsidian && block.getType() == Material.OBSIDIAN)
|
block.setType(replacement);
|
||||||
block.setType(Material.TNT);
|
|
||||||
else if(Config.ReplaceBedrock && block.getType() == Material.BEDROCK)
|
|
||||||
block.setType(Material.SLIME_BLOCK);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Bitte verschiebe das Aufsplitten in Red und Blue Team in die Klasse Fight