No nametags
Dieser Commit ist enthalten in:
Ursprung
5770c05d83
Commit
3c10ec6619
@ -26,6 +26,8 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.craftbukkit.v1_15_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_15_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scoreboard.NameTagVisibility;
|
||||||
|
import org.bukkit.scoreboard.Team;
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@ -39,9 +41,17 @@ import java.util.logging.Level;
|
|||||||
|
|
||||||
public class RPlayer extends REntity {
|
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){
|
public RPlayer(UUID uuid, String name, int internalId){
|
||||||
super(internalId, createPlayer(uuid, name));
|
super(internalId, createPlayer(uuid, name));
|
||||||
//TODO Damage
|
//TODO Damage
|
||||||
|
team.addEntry(entity.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -61,6 +71,7 @@ public class RPlayer extends REntity {
|
|||||||
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, (EntityPlayer) entity);
|
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, (EntityPlayer) entity);
|
||||||
for(Player player : Bukkit.getOnlinePlayers())
|
for(Player player : Bukkit.getOnlinePlayers())
|
||||||
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
|
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
|
||||||
|
team.removeEntry(entity.getName());
|
||||||
super.remove();
|
super.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren