Last Adaptions
Dieser Commit ist enthalten in:
Ursprung
78f78fb6da
Commit
b436560604
@ -6,15 +6,14 @@ import me.yaruma.fightsystem.commands.AkCommand;
|
|||||||
import me.yaruma.fightsystem.fight.*;
|
import me.yaruma.fightsystem.fight.*;
|
||||||
import me.yaruma.fightsystem.listener.*;
|
import me.yaruma.fightsystem.listener.*;
|
||||||
import me.yaruma.fightsystem.manager.FileManager;
|
import me.yaruma.fightsystem.manager.FileManager;
|
||||||
import me.yaruma.fightsystem.utils.countdown.Countdown;
|
import me.yaruma.fightsystem.utils.WorldEdit;
|
||||||
import me.yaruma.fightsystem.utils.countdown.FinishNoPlayersOnline;
|
import me.yaruma.fightsystem.utils.countdown.*;
|
||||||
import me.yaruma.fightsystem.utils.countdown.FinishSetupOver;
|
|
||||||
import me.yaruma.fightsystem.utils.countdown.FinishSpectateOver;
|
|
||||||
import me.yaruma.fightsystem.utils.scoreboard.Scoreboard;
|
import me.yaruma.fightsystem.utils.scoreboard.Scoreboard;
|
||||||
import me.yaruma.fightsystem.winconditions.WinconditionAllDead;
|
import me.yaruma.fightsystem.winconditions.WinconditionAllDead;
|
||||||
import me.yaruma.fightsystem.winconditions.WinconditionCaptainDead;
|
import me.yaruma.fightsystem.winconditions.WinconditionCaptainDead;
|
||||||
import me.yaruma.fightsystem.winconditions.WinconditionPercentSystem;
|
import me.yaruma.fightsystem.winconditions.WinconditionPercentSystem;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@ -225,21 +224,55 @@ public class FightSystem extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPreRunningState() {
|
public void setPreRunningState() {
|
||||||
if(this.fightState == FightState.SETUP) {
|
if(this.fightState != FightState.SETUP)
|
||||||
|
return;
|
||||||
this.fightState = FightState.PRE_RUNNING;
|
this.fightState = FightState.PRE_RUNNING;
|
||||||
|
|
||||||
|
int time = fileManager.getIntegerFromConfig("Times.PreFightDuration");
|
||||||
|
Countdown countdown = new Countdown(time, new FinishPreRunning());
|
||||||
|
countdown.startTimer(this);
|
||||||
|
for(FightPlayer allFightPlayers : Fight.getBlueTeam().getPlayers()) {
|
||||||
|
allFightPlayers.getPlayer().getInventory().clear();
|
||||||
|
}
|
||||||
|
for(FightPlayer allFightPlayers : Fight.getRedTeam().getPlayers()) {
|
||||||
|
allFightPlayers.getPlayer().getInventory().clear();
|
||||||
|
}
|
||||||
|
instance.getFightManager().teleportAllToFightSpawn();
|
||||||
|
WorldEdit.replace(Fight.getBlueTeam().getLeader().getPlayer(), team1cornerX, team1cornerY, team1cornerZ, team1cornerX + schemsizeX, team1cornerY + schemsizeY, team1cornerZ + schemsizeZ);
|
||||||
|
WorldEdit.replace(Fight.getRedTeam().getLeader().getPlayer(), team2cornerX, team2cornerY, team2cornerZ, team2cornerX + schemsizeX, team2cornerY + schemsizeY, team2cornerZ + schemsizeZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setAllPlayersGM(GameMode gm){
|
||||||
|
for(FightPlayer fightPlayer: Fight.getBlueTeam().getPlayers()){
|
||||||
|
fightPlayer.getPlayer().setGameMode(gm);
|
||||||
|
}
|
||||||
|
for(FightPlayer fightPlayer: Fight.getRedTeam().getPlayers()){
|
||||||
|
fightPlayer.getPlayer().setGameMode(gm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRunningState() {
|
public void setRunningState() {
|
||||||
if(this.fightState == FightState.PRE_RUNNING) {
|
if(this.fightState != FightState.PRE_RUNNING)
|
||||||
|
return;
|
||||||
this.fightState = FightState.RUNNING;
|
this.fightState = FightState.RUNNING;
|
||||||
|
|
||||||
|
setAllPlayersGM(GameMode.SURVIVAL);
|
||||||
|
|
||||||
|
if(fileManager.getBooleanFromConfig("WinConditions.Timeout")) {
|
||||||
|
int time = fileManager.getIntegerFromConfig("WinConditionParams.TimeoutTime");
|
||||||
|
Countdown countdown = new Countdown(time, new FinishTimeOver());
|
||||||
|
countdown.startTimer(FightSystem.getPlugin());
|
||||||
}
|
}
|
||||||
|
Bukkit.broadcastMessage("§aArena freigegeben!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpectateState(FightTeam winFightTeam) {
|
public void setSpectateState(FightTeam winFightTeam) {
|
||||||
if(this.fightState == FightState.RUNNING) {
|
if(this.fightState != FightState.RUNNING):
|
||||||
|
return;
|
||||||
this.fightState = FightState.SPECTATE;
|
this.fightState = FightState.SPECTATE;
|
||||||
|
|
||||||
|
setAllPlayersGM(GameMode.SPECTATOR);
|
||||||
|
entern = true;
|
||||||
Bukkit.broadcastMessage(" ");
|
Bukkit.broadcastMessage(" ");
|
||||||
|
|
||||||
if(winFightTeam != null) {
|
if(winFightTeam != null) {
|
||||||
@ -270,7 +303,6 @@ public class FightSystem extends JavaPlugin {
|
|||||||
Countdown countdown = new Countdown(20*60, new FinishSpectateOver());
|
Countdown countdown = new Countdown(20*60, new FinishSpectateOver());
|
||||||
countdown.startTimer(FightSystem.getPlugin());
|
countdown.startTimer(FightSystem.getPlugin());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public int getMoneyToPay(String moneyPath) {
|
public int getMoneyToPay(String moneyPath) {
|
||||||
return fileManager.getIntegerFromConfig(moneyPath);
|
return fileManager.getIntegerFromConfig(moneyPath);
|
||||||
|
@ -128,18 +128,6 @@ public class FightTeam {
|
|||||||
broadcast(FightSystem.PREFIX + "§aEuer Team ist nun bereit!");
|
broadcast(FightSystem.PREFIX + "§aEuer Team ist nun bereit!");
|
||||||
if(Fight.getOpposite(fightTeam).isReady()) {
|
if(Fight.getOpposite(fightTeam).isReady()) {
|
||||||
instance.setPreRunningState();
|
instance.setPreRunningState();
|
||||||
int time = instance.getFileManager().getIntegerFromConfig("Times.PreFightDuration");
|
|
||||||
Countdown countdown = new Countdown(time, new FinishPreRunning());
|
|
||||||
countdown.startTimer(instance);
|
|
||||||
for(FightPlayer allFightPlayers : fightTeam.getPlayers()) {
|
|
||||||
allFightPlayers.getPlayer().getInventory().clear();
|
|
||||||
}
|
|
||||||
for(FightPlayer allFightPlayers : Fight.getOpposite(fightTeam).getPlayers()) {
|
|
||||||
allFightPlayers.getPlayer().getInventory().clear();
|
|
||||||
}
|
|
||||||
instance.getFightManager().teleportAllToFightSpawn();
|
|
||||||
WorldEdit.replace(fightTeam.getLeader().getPlayer(), instance.getTeam1cornerX(), instance.getTeam1cornerY(), instance.getTeam1cornerZ(), instance.getTeam1cornerX() + instance.getSchemsizeX(), instance.getTeam1cornerY() + instance.getSchemsizeY(), instance.getTeam1cornerZ() + instance.getSchemsizeZ());
|
|
||||||
WorldEdit.replace(Fight.getOpposite(fightTeam).getLeader().getPlayer(), instance.getTeam2cornerX(), instance.getTeam2cornerY(), instance.getTeam2cornerZ(), instance.getTeam2cornerX() + instance.getSchemsizeX(), instance.getTeam2cornerY() + instance.getSchemsizeY(), instance.getTeam2cornerZ() + instance.getSchemsizeZ());
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fightTeam.getLeader().getPlayer().getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short) 10).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());
|
fightTeam.getLeader().getPlayer().getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short) 10).removeAllAtributs().addEnchantment(Enchantment.DURABILITY, 1).setDisplayName("§cNicht bereit").build());
|
||||||
|
@ -16,12 +16,5 @@ public class FinishPreRunning implements CountdownCallback {
|
|||||||
@Override
|
@Override
|
||||||
public void countdownFinished() {
|
public void countdownFinished() {
|
||||||
FightSystem.getPlugin().setRunningState();
|
FightSystem.getPlugin().setRunningState();
|
||||||
|
|
||||||
if(fileManager.getBooleanFromConfig("WinConditions.Timeout")) {
|
|
||||||
int time = fileManager.getIntegerFromConfig("WinConditionParams.TimeoutTime");
|
|
||||||
Countdown countdown = new Countdown(time, new FinishTimeOver());
|
|
||||||
countdown.startTimer(FightSystem.getPlugin());
|
|
||||||
}
|
|
||||||
Bukkit.broadcastMessage("§aArena freigegeben!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren