Search in sources :

Example 1 with PlayerScoreboard

use of me.jannik.rplace.scoreboard.PlayerScoreboard in project rPlace by rlqu.

the class PlacePlayer method setScoreboard.

public void setScoreboard() {
    PlayerScoreboard playerScoreboard = new PlayerScoreboard(getPlace().getConfiguration().getMessage("scoreboard-title"));
    setEntries(playerScoreboard);
    playerScoreboard.update();
    playerScoreboard.setScoreboard(getBukkitPlayer());
    getPlace().getScoreboards().put(getBukkitPlayer().getName(), playerScoreboard);
}
Also used : PlayerScoreboard(me.jannik.rplace.scoreboard.PlayerScoreboard)

Example 2 with PlayerScoreboard

use of me.jannik.rplace.scoreboard.PlayerScoreboard in project rPlace by rlqu.

the class PlacePlayer method updateScoreboard.

public void updateScoreboard() {
    if (getPlace().getScoreboards().get(getBukkitPlayer().getName()) == null) {
        setScoreboard();
    }
    PlayerScoreboard playerScoreboard = getPlace().getScoreboards().get(getBukkitPlayer().getName());
    playerScoreboard.clearEntries();
    setEntries(playerScoreboard);
    playerScoreboard.setScoreboard(getBukkitPlayer());
    PacketPlayOutChat packet = new PacketPlayOutChat(new ChatComponentText(getPlace().getConfiguration().getMessage("actionbar")), (byte) 2);
    ((CraftPlayer) getBukkitPlayer()).getHandle().playerConnection.sendPacket(packet);
}
Also used : PacketPlayOutChat(net.minecraft.server.v1_8_R3.PacketPlayOutChat) PlayerScoreboard(me.jannik.rplace.scoreboard.PlayerScoreboard) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) ChatComponentText(net.minecraft.server.v1_8_R3.ChatComponentText)

Aggregations

PlayerScoreboard (me.jannik.rplace.scoreboard.PlayerScoreboard)2 ChatComponentText (net.minecraft.server.v1_8_R3.ChatComponentText)1 PacketPlayOutChat (net.minecraft.server.v1_8_R3.PacketPlayOutChat)1 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)1