geforkt von SteamWar/BungeeCore
Steamwar-User statt Proxied Player
Dieser Commit ist enthalten in:
Ursprung
d9efeefd2b
Commit
bfd0b11e47
@ -2,6 +2,7 @@ package de.steamwar.bungeecore.commands;
|
|||||||
|
|
||||||
import de.steamwar.bungeecore.BungeeCore;
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
||||||
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -16,16 +17,16 @@ public class IgnoreCommand extends BasicCommand {
|
|||||||
public void execute(CommandSender s, String[] args) {
|
public void execute(CommandSender s, String[] args) {
|
||||||
if (!(s instanceof ProxiedPlayer)) return;
|
if (!(s instanceof ProxiedPlayer)) return;
|
||||||
ProxiedPlayer p = (ProxiedPlayer) s;
|
ProxiedPlayer p = (ProxiedPlayer) s;
|
||||||
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
SteamwarUser target = SteamwarUser.get(args[0]);
|
||||||
if(target == null){
|
if(target == null){
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!");
|
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler wurde nicht in der Datenbank gefunden!");
|
||||||
return;
|
return;
|
||||||
}else if(target.equals(p)){
|
}else if(target.equals(p)){
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?");
|
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?");
|
||||||
return;
|
return;
|
||||||
}else {
|
}else {
|
||||||
IgnoreSystem.ignore(p.getUniqueId(), target.getUniqueId());
|
IgnoreSystem.ignore(p.getUniqueId(), target.getUuid());
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun " + target.getDisplayName() + ".");
|
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun " + target.getUserName() + ".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ package de.steamwar.bungeecore.commands;
|
|||||||
|
|
||||||
import de.steamwar.bungeecore.BungeeCore;
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
||||||
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
public class UnIgnoreCommand extends BasicCommand {
|
public class UnIgnoreCommand extends BasicCommand {
|
||||||
@ -16,13 +16,13 @@ public class UnIgnoreCommand extends BasicCommand {
|
|||||||
public void execute(CommandSender s, String[] args) {
|
public void execute(CommandSender s, String[] args) {
|
||||||
if (!(s instanceof ProxiedPlayer)) return;
|
if (!(s instanceof ProxiedPlayer)) return;
|
||||||
ProxiedPlayer p = (ProxiedPlayer) s;
|
ProxiedPlayer p = (ProxiedPlayer) s;
|
||||||
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
SteamwarUser target = SteamwarUser.get(args[0]);
|
||||||
if(target == null){
|
if(target == null){
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!");
|
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!");
|
||||||
return;
|
return;
|
||||||
}else {
|
}else {
|
||||||
IgnoreSystem.unIgnore(p.getUniqueId(), target.getUniqueId());
|
IgnoreSystem.unIgnore(p.getUniqueId(), target.getUuid());
|
||||||
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + target.getDisplayName() + " wieder.");
|
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du beachtest nun " + target.getUserName() + " wieder.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren