Hey ich habe ein Plugin geschrieben und das funktioniert irgendwie nicht. Weiß jmd woran das liegt?
Ich habe eine Fehlermeldung bei
Alles andere sollte gehen
Das Plugin soll ScoreBoard und Tabliste beinhalten
Ich habe eine Fehlermeldung bei
Code:
public void getTeam(Player p) {
Alles andere sollte gehen
Das Plugin soll ScoreBoard und Tabliste beinhalten
Java:
package de.rainijdev.scoreboard;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import ru.tehkode.permissions.bukkit.PermissionsEx;
public class SortTab {
public static void registerTeams(Scoreboard board) {
Team owner = board.getTeam("00Owner");
Team admin = board.getTeam("01Admin");
Team dev = board.getTeam("02Developer");
Team mod = board.getTeam("03Moderator");
Team supp = board.getTeam("04Supporter");
Team build = board.getTeam("05Builder");
Team farmer = board.getTeam("06Farmer");
Team yter = board.getTeam("07YTer+");
Team yter2 = board.getTeam("08YouTuber");
Team supreme = board.getTeam("09Supreme");
Team griefer = board.getTeam("10Griefer");
Team titan = board.getTeam("11Titan");
Team legende = board.getTeam("12Legende");
Team ultra = board.getTeam("13Ultra");
Team premium = board.getTeam("14Premium");
Team spieler = board.getTeam("15Spieler");
if(owner == null) {
owner = board.registerNewTeam("00Owner");
}
if(admin == null) {
admin = board.registerNewTeam("01Admin");
}
if(dev == null) {
dev = board.registerNewTeam("02Developer");
}
if(mod == null) {
mod = board.registerNewTeam("03Moderator");
}
if(supp == null) {
supp = board.registerNewTeam("04Supporter");
}
if(build == null) {
build = board.registerNewTeam("05Builder");
}
if(farmer == null) {
farmer = board.registerNewTeam("06Farmer");
}
if(yter == null) {
yter = board.registerNewTeam("07Yter+");
}
if(yter2 == null) {
yter2 = board.registerNewTeam("08YouTuber");
}
if(supreme == null) {
supreme = board.registerNewTeam("09Supreme");
}
if(griefer == null) {
griefer = board.registerNewTeam("10Griefer");
}
if(titan == null) {
titan = board.registerNewTeam("11Titan");
}
if(legende == null) {
legende = board.registerNewTeam("12Legende");
}
if(ultra == null) {
ultra = board.registerNewTeam("13Ultra");
}
if(premium == null) {
premium = board.registerNewTeam("14Premium");
}
if(spieler == null) {
spieler = board.registerNewTeam("15Spieler");
}
owner.setPrefix("§4Owner §7\u2503 §4");
admin.setPrefix("§4Admin §7\u2503 §4");
dev.setPrefix("§eDev §7\u2503 §e");
mod.setPrefix("§cMod §7\u2503 §c");
supp.setPrefix("§9Supp §7\u2503 §9");
build.setPrefix("§2Build §7\u2503 §2");
farmer.setPrefix("§9T-Supp §7\u2503 §9");
yter.setPrefix("§2T-Build §7\u2503 §2");
yter2.setPrefix("§2OF \u2503 §2");
supreme.setPrefix("§5YouTuber \u2503 §5");
griefer.setPrefix("§aEmerald \u2503 §a");
titan.setPrefix("§bDiamond \u2503 §b");
legende.setPrefix("§dVIP \u2503 §d");
ultra.setPrefix("§dVIP \u2503 §d");
premium.setPrefix("§dVIP \u2503 §d");
spieler.setPrefix("§7Spieler \u2503 ");
}
@SuppressWarnings("deprecation")
public static void registerPlayer(Scoreboard board) {
public void getTeam(Player p) {
}
for(Player p2 : Bukkit.getOnlinePlayers()) {
if (p.hasPermission("raini.owner")) {
board.getTeam("00owner").addPlayer(p2);
} else if(p.hasPermission("raini.admin")) {
board.getTeam("01admin").addPlayer(p2);
} else if(p.hasPermission("raini.developer")) {
board.getTeam("02developer").addPlayer(p2);
} else if(p.hasPermission("raini.moderator")) {
board.getTeam("03moderator").addPlayer(p2);
} else if(p.hasPermission("raini.supporter")) {
board.getTeam("04supporter").addPlayer(p2);
} else if(p.hasPermission("raini.builder")) {
board.getTeam("05builder").addPlayer(p2);
} else if(p.hasPermission("raini.farmer")) {
board.getTeam("06farmer").addPlayer(p2);
} else if(p.hasPermission("raini.yter+")) {
board.getTeam("07yter").addPlayer(p2);
} else if(p.hasPermission("raini.yter")) {
board.getTeam("08yter2").addPlayer(p2);
} else if(p.hasPermission("raini.supreme")) {
board.getTeam("09supreme").addPlayer(p2);
} else if(p.hasPermission("raini.griefer")) {
board.getTeam("10griefer").addPlayer(p2);
} else if(p.hasPermission("raini.titan")) {
board.getTeam("11titan").addPlayer(p2);
} else if(p.hasPermission("raini.legende")) {
board.getTeam("12legende").addPlayer(p2);
} else if(p.hasPermission("raini.ultra")) {
board.getTeam("13ultra").addPlayer(p2);
} else if(p.hasPermission("raini.premium")) {
board.getTeam("14premium").addPlayer(p2);
} else {
board.getTeam("15spieler").addPlayer(p2);
}
}
}
public static String getTeamName(Player p) {
if(PermissionsEx.getUser(p).inGroup("owner")) {
return "00owner";
} else if(PermissionsEx.getUser(p).inGroup("admin")) {
return "01admin";
} else if(PermissionsEx.getUser(p).inGroup("developer")) {
return "02developer";
} else if(PermissionsEx.getUser(p).inGroup("moderator")) {
return "03moderator";
} else if(PermissionsEx.getUser(p).inGroup("supporter")) {
return "04supporter";
} else if(PermissionsEx.getUser(p).inGroup("builder")) {
return "05builder";
} else if(PermissionsEx.getUser(p).inGroup("farmer")) {
return "06farmer";
} else if(PermissionsEx.getUser(p).inGroup("yter+")) {
return "07yter";
} else if(PermissionsEx.getUser(p).inGroup("yter")) {
return "08yter2";
} else if(PermissionsEx.getUser(p).inGroup("supreme")) {
return "09supreme";
} else if(PermissionsEx.getUser(p).inGroup("griefer")) {
return "10griefer";
} else if(PermissionsEx.getUser(p).inGroup("titan")) {
return "11titan";
} else if(PermissionsEx.getUser(p).inGroup("legende")) {
return "legende";
} else if(PermissionsEx.getUser(p).inGroup("ultra")) {
return "12ultra";
} else if(PermissionsEx.getUser(p).inGroup("premium")) {
return "12premium";
} else {
return "13spieler";
}
}
}
Zuletzt bearbeitet von einem Moderator: