SteamWar/MissileWars
Archiviert
13
0

Fix Indentation

Dieser Commit ist enthalten in:
yoyosource 2021-10-27 20:22:10 +02:00
Ursprung 8457e4f7f2
Commit 2d6e89549e
3 geänderte Dateien mit 22 neuen und 32 gelöschten Zeilen

Datei anzeigen

@ -38,11 +38,11 @@ public class FightWorld {
private static final World world = Bukkit.getWorlds().get(0);
private static final boolean paper = Bukkit.getVersion().contains("git-Paper");
public static boolean isPaper(){
private static boolean isPaper(){
return paper;
}
public static double posToChunk(int pos){
private static double posToChunk(int pos){
return pos / 16.0;
}
@ -62,7 +62,7 @@ public class FightWorld {
return (int) Math.ceil(posToChunk(Config.ArenaMaxZ));
}
public static void forEachChunk(ObjIntConsumer<Integer> executor) {
private static void forEachChunk(ObjIntConsumer<Integer> executor) {
for(int x = getMinChunkX(); x <= getMaxChunkX(); x++)
for(int z = getMinChunkZ(); z <= getMaxChunkZ(); z++)
executor.accept(x, z);
@ -81,7 +81,7 @@ public class FightWorld {
Bukkit.unloadWorld(backup, false);
}
public static void resetChunk(World world, World backup, int x, int z) {
private static void resetChunk(World world, World backup, int x, int z) {
net.minecraft.server.v1_15_R1.World w = ((CraftWorld) world).getHandle();
Chunk chunk = w.getChunkAt(x, z);
Chunk backupChunk = ((CraftWorld) backup).getHandle().getChunkAt(x, z);

Datei anzeigen

@ -28,26 +28,26 @@ import java.util.EnumSet;
public class EndCountdown extends StateDependent {
private BukkitTask task;
private BukkitTask task;
public EndCountdown() {
super(EnumSet.of(FightState.END));
}
public EndCountdown() {
super(EnumSet.of(FightState.END));
}
@Override
public void enable() {
task = Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), this::restart, Config.EndTime);
}
@Override
public void enable() {
task = Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), this::restart, Config.EndTime);
}
private void restart(){
private void restart() {
FightWorld.resetWorld();
MissileWars.waiting();
Bukkit.getOnlinePlayers().forEach(JoinListener::join);
}
MissileWars.waiting();
Bukkit.getOnlinePlayers().forEach(JoinListener::join);
}
@Override
public void disable() {
if(task != null && !task.isCancelled())
task.cancel();
}
@Override
public void disable() {
if (task != null && !task.isCancelled())
task.cancel();
}
}

Datei anzeigen

@ -38,17 +38,7 @@ public class JoinListener extends BasicListener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e){
e.setJoinMessage("§a» " + e.getPlayer().getDisplayName());
if (Config.isChallenge()) {
if (Config.RedLeader.equals(e.getPlayer().getUniqueId())) {
MissileWars.getRedTeam().join(e.getPlayer());
} else if (Config.BlueLeader.equals(e.getPlayer().getUniqueId())) {
MissileWars.getBlueTeam().join(e.getPlayer());
} else {
e.getPlayer().teleport(MissileWars.getRedTeam().getSpawn().toVector().midpoint(MissileWars.getBlueTeam().getSpawn().toVector()).toLocation(e.getPlayer().getWorld()));
}
return;
}
MissileWars.join(e.getPlayer());
join(e.getPlayer());
}
public static void join(Player p) {