Not stable version
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
ba981309c6
Commit
2bc12730ea
@ -74,6 +74,11 @@ public class FightSystem extends JavaPlugin {
|
|||||||
this.fightManager = new FightManager();
|
this.fightManager = new FightManager();
|
||||||
this.scoreboard = new Scoreboard(plugin);
|
this.scoreboard = new Scoreboard(plugin);
|
||||||
|
|
||||||
|
Fight.getRedTeam().setName(fileManager.getStringFromConfig("Output.TeamRedName"));
|
||||||
|
Fight.getRedTeam().setPrefix(fileManager.getStringFromConfig("Output.TeamRedColor"));
|
||||||
|
Fight.getBlueTeam().setPrefix(fileManager.getStringFromConfig("Output.TeamBlueName"));
|
||||||
|
Fight.getBlueTeam().setPrefix(fileManager.getStringFromConfig("Output.TeamBlueColor"));
|
||||||
|
|
||||||
//Load config
|
//Load config
|
||||||
schemsizeX = fileManager.getIntegerFromConfig("Arena.Schemsize.x");
|
schemsizeX = fileManager.getIntegerFromConfig("Arena.Schemsize.x");
|
||||||
schemsizeY = fileManager.getIntegerFromConfig("Arena.Schemsize.y");
|
schemsizeY = fileManager.getIntegerFromConfig("Arena.Schemsize.y");
|
||||||
|
@ -18,6 +18,8 @@ public class FightTeam {
|
|||||||
private FightSystem plugin;
|
private FightSystem plugin;
|
||||||
private boolean ready;
|
private boolean ready;
|
||||||
private ArrayList<Player> invited;
|
private ArrayList<Player> invited;
|
||||||
|
private String name;
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
public FightTeam(Player leader, FightSystem plugin) {
|
public FightTeam(Player leader, FightSystem plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@ -173,4 +175,20 @@ public class FightTeam {
|
|||||||
public void setInvited(ArrayList<Player> invited) {
|
public void setInvited(ArrayList<Player> invited) {
|
||||||
this.invited = invited;
|
this.invited = invited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrefix() {
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrefix(String prefix) {
|
||||||
|
this.prefix = prefix;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class FileManager
|
|||||||
this.config = instance.getConfig();
|
this.config = instance.getConfig();
|
||||||
this.config.options().copyDefaults(true);
|
this.config.options().copyDefaults(true);
|
||||||
this.file = new File(instance.getDataFolder(), "config.yml");
|
this.file = new File(instance.getDataFolder(), "config.yml");
|
||||||
instance.saveConfig();
|
//instance.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reloadFiles(FightSystem instance) {
|
public void reloadFiles(FightSystem instance) {
|
||||||
|
@ -28,27 +28,15 @@ public class Scoreboard {
|
|||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
|
|
||||||
private String PREFIX;
|
|
||||||
private String NAME;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if(getIndexDisplay(index) != null) {
|
if(getIndexDisplay(index) != null) {
|
||||||
|
|
||||||
if(getIndexDisplay(index) == Fight.redTeam) {
|
|
||||||
this.PREFIX = FightSystem.getPlugin().getFileManager().getStringFromConfig("Output.TeamRedColor");
|
|
||||||
this.NAME = FightSystem.getPlugin().getFileManager().getStringFromConfig("Output.TeamRedName");
|
|
||||||
}
|
|
||||||
if(getIndexDisplay(index) == Fight.blueTeam) {
|
|
||||||
this.PREFIX = FightSystem.getPlugin().getFileManager().getStringFromConfig("Output.TeamBlueColor");
|
|
||||||
this.NAME = FightSystem.getPlugin().getFileManager().getStringFromConfig("Output.TeamBlueName");
|
|
||||||
}
|
|
||||||
|
|
||||||
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
objective.setDisplayName("§6Info " + PREFIX + NAME);
|
objective.setDisplayName("§6Info " + getIndexDisplay(index).getPrefix() + getIndexDisplay(index).getName());
|
||||||
|
|
||||||
for(int i = 0; i < getIndexDisplay(index).getPlayers().size(); i++) {
|
for(int i = 0; i < getIndexDisplay(index).getPlayers().size(); i++) {
|
||||||
objective.getScore(PREFIX + getIndexDisplay(index).getPlayers().get(i).getPlayer().getDisplayName() + " §8: " + "§6" + getIndexDisplay(index).getPlayers().get(i).getPlayer().getHealth()).setScore(i);
|
objective.getScore(getIndexDisplay(index).getPrefix() + getIndexDisplay(index).getPlayers().get(i).getPlayer().getDisplayName() + " §8: " + "§6" + getIndexDisplay(index).getPlayers().get(i).getPlayer().getHealth()).setScore(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren