use of net.minecraft.server.v1_13_R2.ScoreboardTeam in project Citizens2 by CitizensDev.
the class NMSImpl method sendTeamPacket.
@Override
public void sendTeamPacket(Player recipient, Team team, int mode) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(team);
if (TEAM_FIELD == null) {
TEAM_FIELD = NMS.getGetter(team.getClass(), "team");
}
try {
ScoreboardTeam nmsTeam = (ScoreboardTeam) TEAM_FIELD.invoke(team);
sendPacket(recipient, new PacketPlayOutScoreboardTeam(nmsTeam, mode));
} catch (Throwable e) {
e.printStackTrace();
}
}
use of net.minecraft.server.v1_13_R2.ScoreboardTeam in project Citizens2 by CitizensDev.
the class NMSImpl method setTeamNameTagVisible.
@Override
public void setTeamNameTagVisible(Team team, boolean visible) {
if (TEAM_FIELD == null) {
TEAM_FIELD = NMS.getField(team.getClass(), "team");
}
ScoreboardTeam nmsTeam;
try {
nmsTeam = (ScoreboardTeam) TEAM_FIELD.get(team);
nmsTeam.setNameTagVisibility(visible ? EnumNameTagVisibility.ALWAYS : EnumNameTagVisibility.NEVER);
} catch (Throwable e) {
e.printStackTrace();
}
}
use of net.minecraft.server.v1_13_R2.ScoreboardTeam in project Citizens2 by CitizensDev.
the class NMSImpl method sendTeamPacket.
@Override
public void sendTeamPacket(Player recipient, Team team, int mode) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(team);
if (TEAM_FIELD == null) {
TEAM_FIELD = NMS.getField(team.getClass(), "team");
}
try {
ScoreboardTeam nmsTeam = (ScoreboardTeam) TEAM_FIELD.get(team);
sendPacket(recipient, new PacketPlayOutScoreboardTeam(nmsTeam, mode));
} catch (Throwable e) {
e.printStackTrace();
}
}
use of net.minecraft.server.v1_13_R2.ScoreboardTeam in project Citizens2 by CitizensDev.
the class NMSImpl method sendTeamPacket.
@Override
public void sendTeamPacket(Player recipient, Team team, int mode) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(team);
if (TEAM_FIELD == null) {
TEAM_FIELD = NMS.getGetter(team.getClass(), "team");
}
try {
ScoreboardTeam nmsTeam = (ScoreboardTeam) TEAM_FIELD.invoke(team);
sendPacket(recipient, new PacketPlayOutScoreboardTeam(nmsTeam, mode));
} catch (Throwable e) {
e.printStackTrace();
}
}
use of net.minecraft.server.v1_13_R2.ScoreboardTeam in project Citizens2 by CitizensDev.
the class NMSImpl method sendTeamPacket.
@Override
public void sendTeamPacket(Player recipient, Team team, int mode) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(team);
if (TEAM_FIELD == null) {
TEAM_FIELD = NMS.getGetter(team.getClass(), "team");
}
try {
ScoreboardTeam nmsTeam = (ScoreboardTeam) TEAM_FIELD.invoke(team);
sendPacket(recipient, new PacketPlayOutScoreboardTeam(nmsTeam, mode));
} catch (Throwable e) {
e.printStackTrace();
}
}
Aggregations