Add BauCommand ML
Dieser Commit ist enthalten in:
Ursprung
0a472091ba
Commit
a4359b6dd5
@ -34,8 +34,6 @@ public class BauCommand {
|
|||||||
|
|
||||||
private BauCommand(){}
|
private BauCommand(){}
|
||||||
|
|
||||||
private static final String UNKNOWN_PLAYER = BungeeCore.CHAT_PREFIX + "§cUnbekannter Spieler";
|
|
||||||
|
|
||||||
public static void onBau(ChatEvent e, String[] command){
|
public static void onBau(ChatEvent e, String[] command){
|
||||||
if(BungeeCore.EVENT_MODE)
|
if(BungeeCore.EVENT_MODE)
|
||||||
return;
|
return;
|
||||||
@ -115,43 +113,43 @@ public class BauCommand {
|
|||||||
|
|
||||||
private static void addmember(ProxiedPlayer p, String[] command){
|
private static void addmember(ProxiedPlayer p, String[] command){
|
||||||
if (command.length == 2) {
|
if (command.length == 2) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau addmember <Spieler>");
|
Message.send("BAU_ADDMEMBER_SYNTAX", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SteamwarUser target = SteamwarUser.get(command[2]);
|
SteamwarUser target = SteamwarUser.get(command[2]);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
BungeeCore.send(p, UNKNOWN_PLAYER);
|
Message.send("UNKNOWN_PLAYER", p);
|
||||||
return;
|
return;
|
||||||
}else if(target.getUuid().equals(p.getUniqueId())) {
|
}else if(target.getUuid().equals(p.getUniqueId())) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu brauchst dich nicht selbst hinzufügen!");
|
Message.send("BAU_ADDMEMBER_SELFADD", p);
|
||||||
return;
|
return;
|
||||||
}else if (BauweltMember.getBauMember(p.getUniqueId(), target.getUuid()) != null) {
|
}else if (BauweltMember.getBauMember(p.getUniqueId(), target.getUuid()) != null) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist bereits Mitglied auf deiner Welt");
|
Message.send("BAU_ADDMEMBER_ISADDED", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
new BauweltMember(p.getUniqueId(), target.getUuid(), true, false, false);
|
new BauweltMember(p.getUniqueId(), target.getUuid(), true, false, false);
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDer Spieler wurde zu deiner Welt hinzugefügt");
|
Message.send("BAU_ADDMEMBER_ADDED", p);
|
||||||
|
|
||||||
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(target.getUuid());
|
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(target.getUuid());
|
||||||
if(z != null)
|
if(z != null)
|
||||||
BungeeCore.send(z, BungeeCore.CHAT_PREFIX + "§aDu wurdest zu der Welt von §6" + p.getName() + " §ahinzugefügt");
|
Message.send("BAU_ADDMEMBER_ADDED_TARGET", p, p.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void teleport(ProxiedPlayer p, String[] command){
|
private static void teleport(ProxiedPlayer p, String[] command){
|
||||||
if (command.length == 2) {
|
if (command.length == 2) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau tp <Spieler>");
|
Message.send("BAU_TP_SYNTAX", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SteamwarUser worldOwner = SteamwarUser.get(command[2]);
|
SteamwarUser worldOwner = SteamwarUser.get(command[2]);
|
||||||
if (worldOwner == null) {
|
if (worldOwner == null) {
|
||||||
BungeeCore.send(p, UNKNOWN_PLAYER);
|
Message.send("UNKNOWN_PLAYER", p);
|
||||||
return;
|
return;
|
||||||
}else if (!p.getUniqueId().equals(worldOwner.getUuid()) && BauweltMember.getBauMember(worldOwner.getUuid(), p.getUniqueId()) == null){
|
}else if (!p.getUniqueId().equals(worldOwner.getUuid()) && BauweltMember.getBauMember(worldOwner.getUuid(), p.getUniqueId()) == null){
|
||||||
SubserverSystem.sendDeniedMessage(p, worldOwner.getUuid());
|
SubserverSystem.sendDeniedMessage(p, worldOwner.getUuid());
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu darfst dich nicht auf diese Welt teleportieren");
|
Message.send("BAU_TP_NOALLOWED", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +212,7 @@ public class BauCommand {
|
|||||||
|
|
||||||
private static void delmember(ProxiedPlayer p, String[] command){
|
private static void delmember(ProxiedPlayer p, String[] command){
|
||||||
if (command.length == 2) {
|
if (command.length == 2) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau delmember <Spieler>");
|
Message.send("BAU_DELMEMBER_SYNTAX", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,19 +221,19 @@ public class BauCommand {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(SteamwarUser.get(target.getMemberID()).getUuid().equals(p.getUniqueId())) {
|
if(SteamwarUser.get(target.getMemberID()).getUuid().equals(p.getUniqueId())) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu kannst dich nicht selbst entfernen!");
|
Message.send("BAU_DELMEMBER_SELFDEL", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
target.remove();
|
target.remove();
|
||||||
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid());
|
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid());
|
||||||
if(z != null){
|
if(z != null){
|
||||||
BungeeCore.send(z, BungeeCore.CHAT_PREFIX + "§cDu wurdest von der Welt von §6" + p.getName() + " §centfernt.");
|
Message.send("BAU_DELMEMBER_DELETED_TARGET", z, p.getName());
|
||||||
Subserver server = Subserver.getSubserver(z);
|
Subserver server = Subserver.getSubserver(z);
|
||||||
if(server != null && server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId()))
|
if(server != null && server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId()))
|
||||||
z.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER));
|
z.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER));
|
||||||
}
|
}
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler wurde entfernt.");
|
Message.send("BAU_DELMEMBER_DELETED", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void delete(ProxiedPlayer p, String[] command){
|
private static void delete(ProxiedPlayer p, String[] command){
|
||||||
@ -255,7 +253,7 @@ public class BauCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void deleteWorld(ProxiedPlayer player, String world) {
|
private static void deleteWorld(ProxiedPlayer player, String world) {
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt.");
|
Message.send("BAU_DELETE_DELETED", player);
|
||||||
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
||||||
for (Subserver subserver : Subserver.getServerList()) {
|
for (Subserver subserver : Subserver.getServerList()) {
|
||||||
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) {
|
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) {
|
||||||
@ -273,7 +271,7 @@ public class BauCommand {
|
|||||||
for (Subserver subserver : Subserver.getServerList()) {
|
for (Subserver subserver : Subserver.getServerList()) {
|
||||||
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
|
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
|
||||||
if(subserver.getServer().getPlayers().isEmpty()){
|
if(subserver.getServer().getPlayers().isEmpty()){
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Server startet bereits.");
|
Message.send("BAU_START_ALREADY", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
subserver.stop();
|
subserver.stop();
|
||||||
@ -291,13 +289,13 @@ public class BauCommand {
|
|||||||
|
|
||||||
private static BauweltMember member(ProxiedPlayer p, SteamwarUser member){
|
private static BauweltMember member(ProxiedPlayer p, SteamwarUser member){
|
||||||
if (member == null) {
|
if (member == null) {
|
||||||
BungeeCore.send(p, UNKNOWN_PLAYER);
|
Message.send("UNKNOWN_PLAYER", p);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
BauweltMember target = BauweltMember.getBauMember(p.getUniqueId(), member.getUuid());
|
BauweltMember target = BauweltMember.getBauMember(p.getUniqueId(), member.getUuid());
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler ist kein Mitglied deiner Welt!");
|
Message.send("BAU_MEMBER_NOMEMBER", p);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
@ -305,7 +303,7 @@ public class BauCommand {
|
|||||||
|
|
||||||
private static BauweltMember toggle(ProxiedPlayer p, String[] command, String subcommand){
|
private static BauweltMember toggle(ProxiedPlayer p, String[] command, String subcommand){
|
||||||
if (command.length == 2) {
|
if (command.length == 2) {
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau " + subcommand + " <Spieler>");
|
Message.send("BAU_MEMBER_TOGGLE_SYNTAX", p, subcommand);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,12 +316,12 @@ public class BauCommand {
|
|||||||
|
|
||||||
if(permission){
|
if(permission){
|
||||||
if(player != null)
|
if(player != null)
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDu kannst nun auf der Welt von §e" + p.getName() + "§a " + what);
|
Message.send("BAU_MEMBER_TOGGLE_TARGET", p, p.getName(), what);
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDer Spieler darf nun " + what);
|
Message.send("BAU_MEMBER_TOGGLE", p, what);
|
||||||
}else{
|
}else{
|
||||||
if(player != null)
|
if(player != null)
|
||||||
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §e" + p.getName() + "§c " + what);
|
Message.send("BAU_MEMBER_TOGGLE_TARGET_OFF", p, p.getName(), what);
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler darf nun nicht mehr " + what);
|
Message.send("BAU_MEMBER_TOGGLE_OFF", p, what);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,9 +116,28 @@ POLLRESULT_HEADER=§eEs haben {0} abgestimmt auf die Frage: §7{1}
|
|||||||
POLLRESULT_LIST=§e{0}§8: §7{1}
|
POLLRESULT_LIST=§e{0}§8: §7{1}
|
||||||
|
|
||||||
#BauCommand
|
#BauCommand
|
||||||
|
BAU_ADDMEMBER_SYNTAX=/bau addmember <Spieler>
|
||||||
|
BAU_ADDMEMBER_SELFADD=§cDu brauchst dich nicht selbst hinzufügen!
|
||||||
|
BAU_ADDMEMBER_ISADDED=§cDieser Spieler ist bereits Mitglied auf deiner Welt
|
||||||
|
BAU_ADDMEMBER_ADDED=§aDer Spieler wurde zu deiner Welt hinzugefügt
|
||||||
|
BAU_ADDMEMBER_ADDED_TARGET=§aDu wurdest zu der Welt von §6{0} §ahinzugefügt
|
||||||
|
BAU_TP_SYNTAX=/bau tp <Spieler>
|
||||||
|
BAU_TP_NOALLOWED=§cDu darfst dich nicht auf diese Welt teleportieren
|
||||||
|
BAU_DELMEMBER_SYNTAX=/bau delmember <Spieler>
|
||||||
|
BAU_DELMEMBER_SELFDEL=§cDu kannst dich nicht selbst entfernen!
|
||||||
|
BAU_DELMEMBER_DELETED=§cDer Spieler wurde entfernt.
|
||||||
|
BAU_DELMEMBER_DELETED_TARGET=§cDu wurdest von der Welt von §6{0} §centfernt.
|
||||||
|
BAU_DELETE_DELETED=§aDeine Welt wird zurückgesetzt.
|
||||||
BAU_DELETE_GUI_NAME=§eWirklich Welt löschen?
|
BAU_DELETE_GUI_NAME=§eWirklich Welt löschen?
|
||||||
BAU_DELETE_GUI_CANCEL=§cAbbrechen
|
BAU_DELETE_GUI_CANCEL=§cAbbrechen
|
||||||
BAU_DELETE_GUI_DELETE=§aLöschen
|
BAU_DELETE_GUI_DELETE=§aLöschen
|
||||||
|
BAU_START_ALREADY=§cDer Server startet bereits.
|
||||||
|
BAU_MEMBER_NOMEMBER=§cDer Spieler ist kein Mitglied deiner Welt!
|
||||||
|
BAU_MEMBER_TOGGLE_SYNTAX=/bau {0} <Spieler>
|
||||||
|
BAU_MEMBER_TOGGLE_TARGET=§aDu kannst nun auf der Welt von §e{0}§a {1}
|
||||||
|
BAU_MEMBER_TOGGLE=§aDer Spieler darf nun {0}
|
||||||
|
BAU_MEMBER_TOGGLE_TARGET_OFF=§cDu kannst nun nicht mehr auf der Welt von §e{0}§c {1}
|
||||||
|
BAU_MEMBER_TOGGLE_OFF=§cDer Spieler darf nun nicht mehr {0}
|
||||||
|
|
||||||
#CheckCommand
|
#CheckCommand
|
||||||
CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8!
|
CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8!
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren