SteamWar/SpigotCore
Archiviert
13
0

untested rework of dependent scoreboard source

Dieser Commit ist enthalten in:
BuildTools 2019-12-05 19:11:47 +01:00
Ursprung 28c84fa5e2
Commit 7453f0d39b
2 geänderte Dateien mit 29 neuen und 34 gelöschten Zeilen

Datei anzeigen

@ -1,25 +1,23 @@
package de.steamwar.scoreboard;
import com.comphenix.protocol.events.PacketContainer;
public class SWScoreboard_12 {
private SWScoreboard_12() {}
static PacketContainer getRemovePacket() {
return SWScoreboard_8.getRemovePacket();
static void sendRemovePacket() {
SWScoreboard_8.sendRemovePacket();
}
static PacketContainer getCreatePacket(String title) {
return SWScoreboard_8.getCreatePacket(title);
static void sendCreatePacket(String title) {
SWScoreboard_8.sendCreatePacket(title);
}
static PacketContainer getUpdatePacket(String content, Integer line) {
return SWScoreboard_8.getUpdatePacket(content, line);
static void sendUpdatePacket(String content, Integer line) {
SWScoreboard_8.sendUpdatePacket(content, line);
}
static PacketContainer getDisplayPacket(String title) {
return SWScoreboard_8.getDisplayPacket(title);
static void sendDisplayPacket() {
SWScoreboard_8.sendDisplayPacket();
}

Datei anzeigen

@ -8,36 +8,33 @@ public class SWScoreboard_8 {
private SWScoreboard_8() {}
static PacketContainer getRemovePacket() {
PacketContainer remove = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
remove.getStrings().write(0, "AAA");
remove.getBytes().write(0, (byte) 1);
return remove;
static void sendRemovePacket() {
PacketContainer removePacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
removePacket.getStrings().write(0, "AAA");
removePacket.getIntegers().write(0, 1);
//TODO kann vlt entfernt werden -> remove.getStrings().write(1, "integer");
}
static PacketContainer getCreatePacket(String title) {
PacketContainer createpacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
createpacket.getStrings().write(0, "AAA");
createpacket.getBytes().write(0, (byte) 0);
createpacket.getStrings().write(1, title);
createpacket.getStrings().write(2, "integer");
return createpacket;
static void sendCreatePacket(String title) {
PacketContainer createPacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
createPacket.getStrings().write(0, "AAA");
createPacket.getIntegers().write(0, 0);
createPacket.getStrings().write(1, title);
createPacket.getStrings().write(2, "integer");
}
static PacketContainer getUpdatePacket(String content, Integer line) {
PacketContainer update = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_SCORE);
update.getStrings().write(0, content);
update.getBytes().write(0, (byte) 0);
update.getStrings().write(1, "AAA");
update.getIntegers().write(0, line);
return update;
static void sendUpdatePacket(String content, Integer line) {
PacketContainer updatePacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_SCORE);
updatePacket.getStrings().write(0, content);
updatePacket.getStrings().write(1, "AAA");
updatePacket.getIntegers().write(0, line);
updatePacket.getBytes().write(0, (byte) 0);
}
static PacketContainer getDisplayPacket(String title) {
PacketContainer display = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE);
display.getBytes().write(0, (byte) 1);
display.getStrings().write(0, title);
return display;
static void sendDisplayPacket() {
PacketContainer displayPacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE);
displayPacket.getIntegers().write(0, 1);
displayPacket.getStrings().write(0, "AAA");
}