rework of multiversion support
Dieser Commit ist enthalten in:
Ursprung
39c6d04daf
Commit
28c84fa5e2
@ -33,5 +33,10 @@
|
|||||||
<version>1.12</version>
|
<version>1.12</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>steamwar</groupId>
|
||||||
|
<artifactId>SpigotCore_8</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -1,7 +1,5 @@
|
|||||||
package de.steamwar.scoreboard;
|
package de.steamwar.scoreboard;
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
|
||||||
import com.comphenix.protocol.events.PacketContainer;
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
|
|
||||||
public class SWScoreboard_12 {
|
public class SWScoreboard_12 {
|
||||||
@ -9,35 +7,19 @@ public class SWScoreboard_12 {
|
|||||||
private SWScoreboard_12() {}
|
private SWScoreboard_12() {}
|
||||||
|
|
||||||
static PacketContainer getRemovePacket() {
|
static PacketContainer getRemovePacket() {
|
||||||
PacketContainer remove = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
|
return SWScoreboard_8.getRemovePacket();
|
||||||
remove.getStrings().write(0, "AAA");
|
|
||||||
remove.getBytes().write(0, (byte) 1);
|
|
||||||
return remove;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PacketContainer getCreatePacket(String title) {
|
static PacketContainer getCreatePacket(String title) {
|
||||||
PacketContainer createpacket = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
|
return SWScoreboard_8.getCreatePacket(title);
|
||||||
createpacket.getStrings().write(0, "AAA");
|
|
||||||
createpacket.getBytes().write(0, (byte) 0);
|
|
||||||
createpacket.getStrings().write(1, title);
|
|
||||||
createpacket.getStrings().write(2, "integer");
|
|
||||||
return createpacket;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PacketContainer getUpdatePacket(String content, Integer line) {
|
static PacketContainer getUpdatePacket(String content, Integer line) {
|
||||||
PacketContainer update = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_SCORE);
|
return SWScoreboard_8.getUpdatePacket(content, line);
|
||||||
update.getStrings().write(0, content);
|
|
||||||
update.getBytes().write(0, (byte) 0);
|
|
||||||
update.getStrings().write(1, "AAA");
|
|
||||||
update.getIntegers().write(0, line);
|
|
||||||
return update;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PacketContainer getDisplayPacket(String title) {
|
static PacketContainer getDisplayPacket(String title) {
|
||||||
PacketContainer display = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE);
|
return SWScoreboard_8.getDisplayPacket(title);
|
||||||
display.getBytes().write(0, (byte) 1);
|
|
||||||
display.getStrings().write(0, title);
|
|
||||||
return display;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,5 +33,10 @@
|
|||||||
<version>1.14</version>
|
<version>1.14</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>steamwar</groupId>
|
||||||
|
<artifactId>SpigotCore_8</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -9,10 +9,7 @@ public class SWScoreboard_14 {
|
|||||||
private SWScoreboard_14() {}
|
private SWScoreboard_14() {}
|
||||||
|
|
||||||
static PacketContainer getRemovePacket() {
|
static PacketContainer getRemovePacket() {
|
||||||
PacketContainer remove = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_OBJECTIVE);
|
return SWScoreboard_8.getRemovePacket();
|
||||||
remove.getStrings().write(0, "AAA");
|
|
||||||
remove.getBytes().write(0, (byte) 1);
|
|
||||||
return remove;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PacketContainer getCreatePacket(String title) {
|
static PacketContainer getCreatePacket(String title) {
|
||||||
@ -25,19 +22,11 @@ public class SWScoreboard_14 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PacketContainer getUpdatePacket(String content, Integer line) {
|
static PacketContainer getUpdatePacket(String content, Integer line) {
|
||||||
PacketContainer update = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_SCORE);
|
return SWScoreboard_8.getUpdatePacket(content, line);
|
||||||
update.getStrings().write(0, content);
|
|
||||||
update.getBytes().write(0, (byte) 0);
|
|
||||||
update.getStrings().write(1, "AAA");
|
|
||||||
update.getIntegers().write(0, line);
|
|
||||||
return update;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PacketContainer getDisplayPacket(String title) {
|
static PacketContainer getDisplayPacket(String title) {
|
||||||
PacketContainer display = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE);
|
return SWScoreboard_8.getDisplayPacket(title);
|
||||||
display.getBytes().write(0, (byte) 1);
|
|
||||||
display.getStrings().write(0, title);
|
|
||||||
return display;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren