SteamWar/BungeeCore
Archiviert
13
2

Add some new punishments after talking with mods #352

Zusammengeführt
Lixfel hat 8 Commits von Punishment++ nach master 2022-05-01 22:20:01 +02:00 zusammengeführt
2 geänderte Dateien mit 11 neuen und 8 gelöschten Zeilen
Nur Änderungen aus Commit aaf389ea4c werden angezeigt - Alle Commits anzeigen

2
.gitmodules vendored
Datei anzeigen

@ -1,3 +1,3 @@
[submodule "CommonCore"]
path = CommonCore
url = gitea@steamwar.de:SteamWar/CommonCore.git
url = https://steamwar.de/devlabs/SteamWar/CommonCore.git

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.messages.ChatSender;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
@ -43,14 +44,16 @@ public class BrandListener extends BasicListener {
if (!(event.getReceiver() instanceof ProxiedPlayer)) {
return;
}
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
event.setCancelled(true);
String brandString = ChatSender.of(player).parseToLegacy("STEAMWAR_BRAND", ProxyServer.getInstance().getName(), player.getServer().getInfo().getName(), new String(event.getData(), 1, event.getData().length - 1));
ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer();
DefinedPacket.writeString(brandString, brand);
player.sendData(event.getTag(), DefinedPacket.toArray(brand));
brand.release();
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
String brandString = ChatSender.of(player).parseToLegacy("STEAMWAR_BRAND", ProxyServer.getInstance().getName(), player.getServer().getInfo().getName(), new String(event.getData(), 1, event.getData().length - 1));
ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer();
DefinedPacket.writeString(brandString, brand);
player.sendData(event.getTag(), DefinedPacket.toArray(brand));
brand.release();
});
}
}