SteamWar/SpigotCore
Archiviert
13
0

WIP: scoreboard #12

Geschlossen
Lixfel möchte 22 Commits von scoreboard nach master mergen
4 geänderte Dateien mit 17 neuen und 36 gelöschten Zeilen
Nur Änderungen aus Commit 28c84fa5e2 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -33,5 +33,10 @@
<version>1.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_8</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -1,7 +1,5 @@
package de.steamwar.scoreboard;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketContainer;
public class SWScoreboard_12 {
@ -9,35 +7,19 @@ public class SWScoreboard_12 {
private SWScoreboard_12() {}
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;
return SWScoreboard_8.getRemovePacket();
}
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;
return SWScoreboard_8.getCreatePacket(title);
}
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;
return SWScoreboard_8.getUpdatePacket(content, line);
}
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;
return SWScoreboard_8.getDisplayPacket(title);
}

Datei anzeigen

@ -33,5 +33,10 @@
<version>1.14</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>steamwar</groupId>
<artifactId>SpigotCore_8</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

Datei anzeigen

@ -9,10 +9,7 @@ public class SWScoreboard_14 {
private SWScoreboard_14() {}
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;
return SWScoreboard_8.getRemovePacket();
}
static PacketContainer getCreatePacket(String title) {
@ -25,19 +22,11 @@ public class SWScoreboard_14 {
}
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;
return SWScoreboard_8.getUpdatePacket(content, line);
}
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;
return SWScoreboard_8.getDisplayPacket(title);
}