untested rework of dependent scoreboard source
Dieser Commit ist enthalten in:
Ursprung
b15552ae74
Commit
2b0f64d86d
@ -1,7 +1,15 @@
|
|||||||
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 net.minecraft.server.v1_12_R1.IScoreboardCriteria;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class SWScoreboard_12 {
|
public class SWScoreboard_12 {
|
||||||
|
|
||||||
private SWScoreboard_12() {}
|
private SWScoreboard_12() {}
|
||||||
@ -11,7 +19,13 @@ public class SWScoreboard_12 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void sendCreatePacket(String title, Player player) {
|
static void sendCreatePacket(String title, Player player) {
|
||||||
SWScoreboard_8.sendCreatePacket(title, player);
|
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.getEnumModifier(IScoreboardCriteria.EnumScoreboardHealthDisplay.class, 0).write(0, IScoreboardCriteria.EnumScoreboardHealthDisplay.INTEGER);
|
||||||
|
|
||||||
|
sendPacket(player, createPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sendUpdatePacket(String content, Integer line, Player player) {
|
static void sendUpdatePacket(String content, Integer line, Player player) {
|
||||||
@ -22,5 +36,13 @@ public class SWScoreboard_12 {
|
|||||||
SWScoreboard_8.sendDisplayPacket(player);
|
SWScoreboard_8.sendDisplayPacket(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void sendPacket(Player player, PacketContainer packetContainer) {
|
||||||
|
try {
|
||||||
|
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packetContainer);
|
||||||
|
} catch (InvocationTargetException ex) {
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, "COULD NOT SEND PACKAGE", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren