personalKit #106
@ -138,8 +138,8 @@ public class FightSystem extends JavaPlugin {
|
||||
setFightState(FightState.PRE_RUNNING);
|
||||
|
||||
PersonalKitCreator.closeAll();
|
||||
loadKits(Fight.getBlueTeam());
|
||||
loadKits(Fight.getRedTeam());
|
||||
Fight.getBlueTeam().loadKits();
|
||||
Fight.getRedTeam().loadKits();
|
||||
setAllPlayersGM(GameMode.SURVIVAL);
|
||||
Bukkit.broadcastMessage(PREFIX + "§aDer Kampf beginnt!");
|
||||
|
||||
@ -256,17 +256,6 @@ public class FightSystem extends JavaPlugin {
|
||||
stateDependent.enable();
|
||||
}
|
||||
|
||||
private static void loadKits(FightTeam team){
|
||||
for(FightPlayer allFightPlayers : team.getPlayers()) {
|
||||
if(allFightPlayers.getPlayer() == null)
|
||||
continue;
|
||||
allFightPlayers.getPlayer().getInventory().clear();
|
||||
if(allFightPlayers.getKit() == null)
|
||||
continue;
|
||||
allFightPlayers.getKit().loadToPlayer(allFightPlayers.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
private static void setAllPlayersGM(GameMode gm) {
|
||||
for(FightPlayer fightPlayer: Fight.getBlueTeam().getPlayers()){
|
||||
Fight.setPlayerGamemode(fightPlayer.getPlayer(), gm);
|
||||
|
@ -13,7 +13,9 @@ import de.steamwar.fightsystem.utils.ItemBuilder;
|
||||
import de.steamwar.fightsystem.utils.TechHider;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.sql.NoClipboardException;
|
||||
import de.steamwar.sql.PersonalKit;
|
||||
import de.steamwar.sql.Schematic;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import javafx.util.Pair;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
@ -24,6 +26,7 @@ import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.scoreboard.NameTagVisibility;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
@ -353,6 +356,25 @@ public class FightTeam implements IFightTeam{
|
||||
return currentHearts / maximumHearts;
|
||||
}
|
||||
|
||||
public void loadKits(){
|
||||
for(FightPlayer fightPlayer : players) {
|
||||
if(fightPlayer.getPlayer() == null)
|
||||
continue;
|
||||
fightPlayer.getPlayer().getInventory().clear();
|
||||
|
||||
PersonalKit personalKit = null;
|
||||
if(Config.PersonalKits)
|
||||
personalKit = PersonalKit.get(SteamwarUser.get(fightPlayer.getPlayer().getUniqueId()).getId(), Config.SchematicType.toDB());
|
||||
|
||||
if(personalKit != null){
|
||||
PlayerInventory inventory = fightPlayer.getPlayer().getInventory();
|
||||
inventory.setContents(personalKit.getInventory());
|
||||
inventory.setArmorContents(personalKit.getArmor());
|
||||
}else if(fightPlayer.getKit() != null)
|
||||
fightPlayer.getKit().loadToPlayer(fightPlayer.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
void replaceSync(boolean replace, Material target, Material replacement) {
|
||||
if(!replace)
|
||||
return;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren