13
0
Dieser Commit ist enthalten in:
Lixfel 2020-11-02 16:54:22 +01:00
Ursprung 5770c05d83
Commit 3c10ec6619

Datei anzeigen

@ -26,6 +26,8 @@ import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_15_R1.CraftServer;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.NameTagVisibility;
import org.bukkit.scoreboard.Team;
import javax.net.ssl.HttpsURLConnection;
import java.io.BufferedReader;
@ -39,9 +41,17 @@ import java.util.logging.Level;
public class RPlayer extends REntity {
private static Team team = Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("Replay");
static {
team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
team.setNameTagVisibility(NameTagVisibility.NEVER);
}
public RPlayer(UUID uuid, String name, int internalId){
super(internalId, createPlayer(uuid, name));
//TODO Damage
team.addEntry(entity.getName());
}
@Override
@ -61,6 +71,7 @@ public class RPlayer extends REntity {
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, (EntityPlayer) entity);
for(Player player : Bukkit.getOnlinePlayers())
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
team.removeEntry(entity.getName());
super.remove();
}