Delete some classpath dummy changes, jsonmessage fixed
This commit is contained in:
parent
50ff48ffba
commit
cf4353bedf
@ -1,73 +0,0 @@
|
||||
package net.minecraft.server.v1_7_R4;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PacketPlayOutChat
|
||||
extends Packet
|
||||
{
|
||||
private IChatBaseComponent a;
|
||||
private boolean b;
|
||||
private byte _chatType = 0;
|
||||
|
||||
public PacketPlayOutChat()
|
||||
{
|
||||
this.b = true;
|
||||
}
|
||||
|
||||
public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent)
|
||||
{
|
||||
this(ichatbasecomponent, true);
|
||||
}
|
||||
|
||||
public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, boolean flag)
|
||||
{
|
||||
this.b = true;
|
||||
this.a = ichatbasecomponent;
|
||||
this.b = flag;
|
||||
}
|
||||
|
||||
public PacketPlayOutChat(String text)
|
||||
{
|
||||
this(ChatSerializer.a(text));
|
||||
}
|
||||
|
||||
public void a(PacketDataSerializer packetdataserializer)
|
||||
throws IOException
|
||||
{
|
||||
this.a = ChatSerializer.a(packetdataserializer.c(32767));
|
||||
}
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer)
|
||||
throws IOException
|
||||
{
|
||||
packetdataserializer.a(ChatSerializer.a(this.a));
|
||||
if (packetdataserializer.version >= 16) {
|
||||
packetdataserializer.writeByte(_chatType);
|
||||
}
|
||||
}
|
||||
|
||||
public void setChatType(byte chatType)
|
||||
{
|
||||
_chatType = chatType;
|
||||
}
|
||||
|
||||
public void a(PacketPlayOutListener packetplayoutlistener)
|
||||
{
|
||||
packetplayoutlistener.a(this);
|
||||
}
|
||||
|
||||
public String b()
|
||||
{
|
||||
return String.format("message='%s'", new Object[] { this.a });
|
||||
}
|
||||
|
||||
public boolean d()
|
||||
{
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void handle(PacketListener packetlistener)
|
||||
{
|
||||
a((PacketPlayOutListener)packetlistener);
|
||||
}
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by Fernflower decompiler)
|
||||
//
|
||||
|
||||
package net.minecraft.server.v1_7_R4;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R4.scoreboard.CraftScoreboard;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.util.CraftChatMessage;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.util.com.mojang.authlib.properties.Property;
|
||||
import net.minecraft.util.com.mojang.authlib.properties.PropertyMap;
|
||||
|
||||
public class PacketPlayOutPlayerInfo extends Packet {
|
||||
|
||||
public static final String NOTCH_SKIN = "eyJ0aW1lc3RhbXAiOjE0Mjc4MjgyMzMwNDUsInByb2ZpbGVJZCI6IjA2OWE3OWY0NDRlOTQ3MjZhNWJlZmNhOTBlMzhhYWY1IiwicHJvZmlsZU5hbWUiOiJOb3RjaCIsImlzUHVibGljIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTExNmU2OWE4NDVlMjI3ZjdjYTFmZGRlOGMzNTdjOGM4MjFlYmQ0YmE2MTkzODJlYTRhMWY4N2Q0YWU5NCJ9LCJDQVBFIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2Y2ODhlMGU2OTliM2Q5ZmU0NDhiNWJiNTBhM2EyODhmOWM1ODk3NjJiM2RhZTgzMDg4NDIxMjJkY2I4MSJ9fX0=";
|
||||
public static final String NOTCH_SIGNATURE = "WrBmNqkpkjh6VJY26jOOMNS6oSOPi0MTm9WWc0t4EMUHchUbTd6/1sT2O2zz2s7xwmCeUxuIhvRREa+1bIPzIIbXJLjhxiBWMdTJbQhv6zBb1U2SZb7eb5cYrFTD6rvxy0rOarScxCBdeOXpr1coxrvN8a6VkgLhc/dGhFx0ZmORxELBLFiCNi+4WE//MI+KioAq84Gdf0ltT9ZLWdlHNFV2ynBgcx2MfNTA2lrpdKEUVOYD7xhPoOdHa5d1hzdDxbYPGDgM0FzYjzNUlBx8SLvHEpyBB7XyOsIGnfqrS0ltIDTq82wgLrEwDRncuQN18w6IiQbNK06MZBDyNnIp79mmUYvRj+Zl0dPBrZok2q2uQ08hZ87ufU3jhjY39kr+iEaPYMvfWaBxt3ALjopsZRCGSlEukMzITjeYxhfVKuQ0fhWKRfwWn/Jv2de2h+i+t7nulvN3MV3rJVrS6OXsx87p/vm9biU7Hs07T8VSGONfkxXmsgYEtY6m2egU5pmqFnsKM0MwwnZJ7Sxz2EjiPikoGzJzpv4ncj3rhelIKJKjDk9jSAz7nPzc8/UdOiTrfy4ezr3jFVAVatiKr+kS/HNXHWiCFdufhpG4DVCrSkwkFBJw030pJ6ICVhpuYq5yOswQB5QOp0JDWc2Rdth7SVmvxthSCL9G2ksfm+v7sKw=";
|
||||
|
||||
|
||||
public static final int ADD_PLAYER = 0;
|
||||
public static final int UPDATE_GAMEMODE = 1;
|
||||
public static final int UPDATE_LATENCY = 2;
|
||||
public static final int UPDATE_DISPLAY_NAME = 3;
|
||||
public static final int REMOVE_PLAYER = 4;
|
||||
public int action;
|
||||
public GameProfile player;
|
||||
public int gamemode;
|
||||
public int ping;
|
||||
public String username;
|
||||
public String _tabName;
|
||||
|
||||
public PacketPlayOutPlayerInfo() {
|
||||
}
|
||||
|
||||
public static PacketPlayOutPlayerInfo addPlayer(EntityPlayer player) {
|
||||
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
||||
packet.action = 0;
|
||||
packet.username = player.listName;
|
||||
packet.player = player.getProfile();
|
||||
packet.ping = player.ping;
|
||||
packet.gamemode = player.playerInteractManager.getGameMode().getId();
|
||||
|
||||
packet._tabName = getFormattedName(player);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutPlayerInfo updatePing(EntityPlayer player) {
|
||||
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
||||
packet.action = 2;
|
||||
packet.username = player.listName;
|
||||
packet.player = player.getProfile();
|
||||
packet.ping = player.ping;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutPlayerInfo updateGamemode(EntityPlayer player) {
|
||||
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
||||
packet.action = 1;
|
||||
packet.username = player.listName;
|
||||
packet.player = player.getProfile();
|
||||
packet.gamemode = player.playerInteractManager.getGameMode().getId();
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutPlayerInfo updateDisplayName(EntityPlayer player) {
|
||||
return updateDisplayName(player, getFormattedName(player));
|
||||
}
|
||||
|
||||
public static PacketPlayOutPlayerInfo updateDisplayName(EntityPlayer player, String displayName)
|
||||
{
|
||||
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
||||
packet.action = 3;
|
||||
packet.username = player.listName;
|
||||
packet.player = player.getProfile();
|
||||
packet._tabName = displayName;
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static PacketPlayOutPlayerInfo removePlayer(EntityPlayer player) {
|
||||
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
|
||||
packet.action = 4;
|
||||
packet.username = player.listName;
|
||||
packet.player = player.getProfile();
|
||||
return packet;
|
||||
}
|
||||
|
||||
public void a(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
}
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
if(packetdataserializer.version >= 20) {
|
||||
|
||||
Calendar c = Calendar.getInstance();
|
||||
|
||||
packetdataserializer.b(this.action);
|
||||
packetdataserializer.b(1);
|
||||
packetdataserializer.writeUUID(this.player.getId());
|
||||
switch(this.action) {
|
||||
case 0:
|
||||
packetdataserializer.a(this.player.getName());
|
||||
PropertyMap properties = this.player.getProperties();
|
||||
|
||||
// April Fools
|
||||
if (isAprilFools() && properties.size() == 0)
|
||||
{
|
||||
// add texture if no textures exist
|
||||
properties.put("textures", new Property("textures", NOTCH_SKIN, NOTCH_SIGNATURE));
|
||||
|
||||
}
|
||||
|
||||
packetdataserializer.b(properties.size());
|
||||
Iterator var3 = properties.values().iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
Property property = (Property)var3.next();
|
||||
|
||||
// April Fools
|
||||
if (isAprilFools() && property.getName().equalsIgnoreCase("textures"))
|
||||
{
|
||||
System.out.println("Applying notch texture for : " + property.getName());
|
||||
System.out.println("Skin: " + property.getValue());
|
||||
System.out.println("Signature: " + property.getSignature());
|
||||
packetdataserializer.a(property.getName());
|
||||
packetdataserializer.a(NOTCH_SKIN);
|
||||
packetdataserializer.writeBoolean(true);
|
||||
packetdataserializer.a(NOTCH_SIGNATURE);
|
||||
}
|
||||
else
|
||||
{
|
||||
packetdataserializer.a(property.getName());
|
||||
packetdataserializer.a(property.getValue());
|
||||
|
||||
packetdataserializer.writeBoolean(property.hasSignature());
|
||||
if(property.hasSignature()) {
|
||||
packetdataserializer.a(property.getSignature());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
packetdataserializer.b(this.gamemode);
|
||||
packetdataserializer.b(this.ping);
|
||||
packetdataserializer.writeBoolean(this.username != null);
|
||||
if(this.username != null) {
|
||||
// packetdataserializer.a(ChatSerializer.a(CraftChatMessage.fromString(this.username)[0]));
|
||||
packetdataserializer.a(ChatSerializer.a(CraftChatMessage.fromString(this._tabName)[0]));
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
packetdataserializer.b(this.gamemode);
|
||||
break;
|
||||
case 2:
|
||||
packetdataserializer.b(this.ping);
|
||||
break;
|
||||
case 3:
|
||||
packetdataserializer.writeBoolean(this.username != null);
|
||||
if(this.username != null) {
|
||||
// packetdataserializer.a(ChatSerializer.a(CraftChatMessage.fromString(this.username)[0]));
|
||||
packetdataserializer.a(ChatSerializer.a(CraftChatMessage.fromString(this._tabName)[0]));
|
||||
}
|
||||
case 4:
|
||||
}
|
||||
} else {
|
||||
packetdataserializer.a(this.username);
|
||||
packetdataserializer.writeBoolean(this.action != 4);
|
||||
packetdataserializer.writeShort(this.ping);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void a(PacketPlayOutListener packetplayoutlistener) {
|
||||
packetplayoutlistener.a(this);
|
||||
}
|
||||
|
||||
public void handle(PacketListener packetlistener) {
|
||||
this.a((PacketPlayOutListener)((PacketPlayOutListener)packetlistener));
|
||||
}
|
||||
|
||||
private static String getFormattedName(EntityPlayer player)
|
||||
{
|
||||
String name = player.getName();
|
||||
|
||||
if (isAprilFools()) name = "Notch";
|
||||
|
||||
CraftScoreboard scoreboard = player.getBukkitEntity().getScoreboard();
|
||||
if (scoreboard != null)
|
||||
{
|
||||
Team team = scoreboard.getPlayerTeam(player.getBukkitEntity());
|
||||
if (team != null)
|
||||
name = team.getPrefix() + name + team.getSuffix();
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static boolean isAprilFools()
|
||||
{
|
||||
Calendar c = Calendar.getInstance();
|
||||
|
||||
// return true;
|
||||
return c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1;
|
||||
}
|
||||
}
|
@ -1,121 +0,0 @@
|
||||
package net.minecraft.server.v1_7_R4;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class PacketPlayOutScoreboardTeam
|
||||
extends Packet
|
||||
{
|
||||
private String a = "";
|
||||
private String b = "";
|
||||
private String c = "";
|
||||
private String d = "";
|
||||
private String _nameTagVisibility;
|
||||
private Collection e = new ArrayList();
|
||||
private int f;
|
||||
private int g;
|
||||
|
||||
public PacketPlayOutScoreboardTeam() {}
|
||||
|
||||
public PacketPlayOutScoreboardTeam(ScoreboardTeam scoreboardteam, int i)
|
||||
{
|
||||
this.a = scoreboardteam.getName();
|
||||
this.f = i;
|
||||
if ((i == 0) || (i == 2))
|
||||
{
|
||||
this.b = scoreboardteam.getDisplayName();
|
||||
this.c = scoreboardteam.getPrefix();
|
||||
this.d = scoreboardteam.getSuffix();
|
||||
this.g = scoreboardteam.packOptionData();
|
||||
this._nameTagVisibility = scoreboardteam.getNametagVisibility();
|
||||
}
|
||||
if (i == 0) {
|
||||
this.e.addAll(scoreboardteam.getPlayerNameSet());
|
||||
}
|
||||
}
|
||||
|
||||
public PacketPlayOutScoreboardTeam(ScoreboardTeam scoreboardteam, Collection collection, int i)
|
||||
{
|
||||
if ((i != 3) && (i != 4)) {
|
||||
throw new IllegalArgumentException("Method must be join or leave for player constructor");
|
||||
}
|
||||
if ((collection != null) && (!collection.isEmpty()))
|
||||
{
|
||||
this.f = i;
|
||||
this.a = scoreboardteam.getName();
|
||||
this.e.addAll(collection);
|
||||
this._nameTagVisibility = _nameTagVisibility;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("Players cannot be null/empty");
|
||||
}
|
||||
}
|
||||
|
||||
public void a(PacketDataSerializer packetdataserializer)
|
||||
throws IOException
|
||||
{
|
||||
this.a = packetdataserializer.c(16);
|
||||
this.f = packetdataserializer.readByte();
|
||||
if ((this.f == 0) || (this.f == 2))
|
||||
{
|
||||
this.b = packetdataserializer.c(32);
|
||||
this.c = packetdataserializer.c(16);
|
||||
this.d = packetdataserializer.c(16);
|
||||
this.g = packetdataserializer.readByte();
|
||||
}
|
||||
if ((this.f == 0) || (this.f == 3) || (this.f == 4))
|
||||
{
|
||||
short short1 = packetdataserializer.readShort();
|
||||
for (int i = 0; i < short1; i++) {
|
||||
this.e.add(packetdataserializer.c(40));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer)
|
||||
throws IOException
|
||||
{
|
||||
packetdataserializer.a(this.a);
|
||||
packetdataserializer.writeByte(this.f);
|
||||
if ((this.f == 0) || (this.f == 2))
|
||||
{
|
||||
packetdataserializer.a(this.b);
|
||||
packetdataserializer.a(this.c);
|
||||
packetdataserializer.a(this.d);
|
||||
packetdataserializer.writeByte(this.g);
|
||||
if (packetdataserializer.version >= 16)
|
||||
{
|
||||
packetdataserializer.a(_nameTagVisibility);
|
||||
packetdataserializer.writeByte(EnumChatFormat.WHITE.ordinal());
|
||||
}
|
||||
}
|
||||
if ((this.f == 0) || (this.f == 3) || (this.f == 4))
|
||||
{
|
||||
if (packetdataserializer.version < 16) {
|
||||
packetdataserializer.writeShort(this.e.size());
|
||||
} else {
|
||||
packetdataserializer.b(this.e.size());
|
||||
}
|
||||
Iterator iterator = this.e.iterator();
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
String s = (String)iterator.next();
|
||||
|
||||
packetdataserializer.a(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a(PacketPlayOutListener packetplayoutlistener)
|
||||
{
|
||||
packetplayoutlistener.a(this);
|
||||
}
|
||||
|
||||
public void handle(PacketListener packetlistener)
|
||||
{
|
||||
a((PacketPlayOutListener)packetlistener);
|
||||
}
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
package net.minecraft.server.v1_7_R4;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class ScoreboardTeam
|
||||
extends ScoreboardTeamBase
|
||||
{
|
||||
private final Scoreboard a;
|
||||
private final String b;
|
||||
private final Set c = new HashSet();
|
||||
private String d;
|
||||
private String e = "";
|
||||
private String f = "";
|
||||
private String _nametagVisibility = "always";
|
||||
private boolean g = true;
|
||||
private boolean h = true;
|
||||
|
||||
public ScoreboardTeam(Scoreboard paramScoreboard, String paramString)
|
||||
{
|
||||
this.a = paramScoreboard;
|
||||
this.b = paramString;
|
||||
this.d = paramString;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public String getDisplayName()
|
||||
{
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public void setDisplayName(String paramString)
|
||||
{
|
||||
if (paramString == null) {
|
||||
throw new IllegalArgumentException("Name cannot be null");
|
||||
}
|
||||
this.d = paramString;
|
||||
this.a.handleTeamChanged(this);
|
||||
}
|
||||
|
||||
public Collection getPlayerNameSet()
|
||||
{
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public String getPrefix()
|
||||
{
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public void setPrefix(String paramString)
|
||||
{
|
||||
if (paramString == null) {
|
||||
throw new IllegalArgumentException("Prefix cannot be null");
|
||||
}
|
||||
this.e = paramString;
|
||||
this.a.handleTeamChanged(this);
|
||||
}
|
||||
|
||||
public String getSuffix()
|
||||
{
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public void setSuffix(String paramString)
|
||||
{
|
||||
if (paramString == null) {
|
||||
throw new IllegalArgumentException("Suffix cannot be null");
|
||||
}
|
||||
this.f = paramString;
|
||||
this.a.handleTeamChanged(this);
|
||||
}
|
||||
|
||||
public String getFormattedName(String paramString)
|
||||
{
|
||||
return getPrefix() + paramString + getSuffix();
|
||||
}
|
||||
|
||||
public static String getPlayerDisplayName(ScoreboardTeamBase paramScoreboardTeamBase, String paramString)
|
||||
{
|
||||
if (paramScoreboardTeamBase == null) {
|
||||
return paramString;
|
||||
}
|
||||
return paramScoreboardTeamBase.getFormattedName(paramString);
|
||||
}
|
||||
|
||||
public boolean allowFriendlyFire()
|
||||
{
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public void setAllowFriendlyFire(boolean paramBoolean)
|
||||
{
|
||||
this.g = paramBoolean;
|
||||
this.a.handleTeamChanged(this);
|
||||
}
|
||||
|
||||
public boolean canSeeFriendlyInvisibles()
|
||||
{
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public void setCanSeeFriendlyInvisibles(boolean paramBoolean)
|
||||
{
|
||||
this.h = paramBoolean;
|
||||
this.a.handleTeamChanged(this);
|
||||
}
|
||||
|
||||
public String getNametagVisibility()
|
||||
{
|
||||
return _nametagVisibility;
|
||||
}
|
||||
|
||||
public void setNametagVisibility(String visibility)
|
||||
{
|
||||
_nametagVisibility = visibility;
|
||||
}
|
||||
|
||||
public int packOptionData()
|
||||
{
|
||||
int i = 0;
|
||||
if (allowFriendlyFire()) {
|
||||
i |= 0x1;
|
||||
}
|
||||
if (canSeeFriendlyInvisibles()) {
|
||||
i |= 0x2;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
@ -1,225 +0,0 @@
|
||||
package org.bukkit.craftbukkit.v1_7_R4.scoreboard;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.TeamNameTagVisibility;
|
||||
import net.minecraft.server.v1_7_R4.ScoreboardTeam;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.apache.commons.lang.Validate;
|
||||
|
||||
final class CraftTeam
|
||||
extends CraftScoreboardComponent
|
||||
implements Team
|
||||
{
|
||||
private final ScoreboardTeam team;
|
||||
|
||||
CraftTeam(CraftScoreboard scoreboard, ScoreboardTeam team)
|
||||
{
|
||||
super(scoreboard);
|
||||
this.team = team;
|
||||
scoreboard.teams.put(team.getName(), this);
|
||||
}
|
||||
|
||||
public String getName()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.getName();
|
||||
}
|
||||
|
||||
public String getDisplayName()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.getDisplayName();
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName)
|
||||
throws IllegalStateException
|
||||
{
|
||||
Validate.notNull(displayName, "Display name cannot be null");
|
||||
Validate.isTrue(displayName.length() <= 32, "Display name '" + displayName + "' is longer than the limit of 32 characters");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
this.team.setDisplayName(displayName);
|
||||
}
|
||||
|
||||
public String getPrefix()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.getPrefix();
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix)
|
||||
throws IllegalStateException, IllegalArgumentException
|
||||
{
|
||||
Validate.notNull(prefix, "Prefix cannot be null");
|
||||
Validate.isTrue(prefix.length() <= 32, "Prefix '" + prefix + "' is longer than the limit of 32 characters");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
this.team.setPrefix(prefix);
|
||||
}
|
||||
|
||||
public String getSuffix()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.getSuffix();
|
||||
}
|
||||
|
||||
public void setSuffix(String suffix)
|
||||
throws IllegalStateException, IllegalArgumentException
|
||||
{
|
||||
Validate.notNull(suffix, "Suffix cannot be null");
|
||||
Validate.isTrue(suffix.length() <= 32, "Suffix '" + suffix + "' is longer than the limit of 32 characters");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
this.team.setSuffix(suffix);
|
||||
}
|
||||
|
||||
public boolean allowFriendlyFire()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.allowFriendlyFire();
|
||||
}
|
||||
|
||||
// Mineplex
|
||||
@Override
|
||||
public void setNameTagVisibility(TeamNameTagVisibility visibility) throws IllegalStateException
|
||||
{
|
||||
this.team.setNametagVisibility(visibility.toString());
|
||||
}
|
||||
|
||||
public void setAllowFriendlyFire(boolean enabled)
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
this.team.setAllowFriendlyFire(enabled);
|
||||
}
|
||||
|
||||
public boolean canSeeFriendlyInvisibles()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.canSeeFriendlyInvisibles();
|
||||
}
|
||||
|
||||
public void setCanSeeFriendlyInvisibles(boolean enabled)
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
this.team.setCanSeeFriendlyInvisibles(enabled);
|
||||
}
|
||||
|
||||
public Set<OfflinePlayer> getPlayers()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
ImmutableSet.Builder<OfflinePlayer> players = ImmutableSet.builder();
|
||||
for (Object o : this.team.getPlayerNameSet()) {
|
||||
players.add(Bukkit.getOfflinePlayer(o.toString()));
|
||||
}
|
||||
return players.build();
|
||||
}
|
||||
|
||||
public Set<String> getEntries()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
ImmutableSet.Builder<String> entries = ImmutableSet.builder();
|
||||
for (Object o : this.team.getPlayerNameSet()) {
|
||||
entries.add(o.toString());
|
||||
}
|
||||
return entries.build();
|
||||
}
|
||||
|
||||
public int getSize()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.getPlayerNameSet().size();
|
||||
}
|
||||
|
||||
public void addPlayer(OfflinePlayer player)
|
||||
throws IllegalStateException, IllegalArgumentException
|
||||
{
|
||||
Validate.notNull(player, "OfflinePlayer cannot be null");
|
||||
|
||||
addEntry(player.getName());
|
||||
}
|
||||
|
||||
public void addEntry(String entry)
|
||||
throws IllegalStateException, IllegalArgumentException
|
||||
{
|
||||
Validate.notNull(entry, "Entry cannot be null");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
scoreboard.board.addPlayerToTeam(entry, this.team.getName());
|
||||
}
|
||||
|
||||
public boolean removePlayer(OfflinePlayer player)
|
||||
throws IllegalStateException, IllegalArgumentException
|
||||
{
|
||||
Validate.notNull(player, "OfflinePlayer cannot be null");
|
||||
|
||||
return removeEntry(player.getName());
|
||||
}
|
||||
|
||||
public boolean removeEntry(String entry)
|
||||
throws IllegalStateException, IllegalArgumentException
|
||||
{
|
||||
Validate.notNull(entry, "Entry cannot be null");
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
if (!this.team.getPlayerNameSet().contains(entry)) {
|
||||
return false;
|
||||
}
|
||||
scoreboard.board.removePlayerFromTeam(entry, this.team);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasPlayer(OfflinePlayer player)
|
||||
throws IllegalArgumentException, IllegalStateException
|
||||
{
|
||||
Validate.notNull(player, "OfflinePlayer cannot be null");
|
||||
|
||||
return hasEntry(player.getName());
|
||||
}
|
||||
|
||||
public boolean hasEntry(String entry)
|
||||
throws IllegalArgumentException, IllegalStateException
|
||||
{
|
||||
Validate.notNull("Entry cannot be null");
|
||||
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
return this.team.getPlayerNameSet().contains(entry);
|
||||
}
|
||||
|
||||
public void unregister()
|
||||
throws IllegalStateException
|
||||
{
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
scoreboard.board.removeTeam(this.team);
|
||||
scoreboard.teams.remove(this.team.getName());
|
||||
setUnregistered();
|
||||
}
|
||||
}
|
Binary file not shown.
@ -119,7 +119,7 @@ public class JsonMessage
|
||||
public void send(MessageType messageType, Player... players)
|
||||
{
|
||||
PacketPlayOutChat chatPacket = new PacketPlayOutChat(IChatBaseComponent.ChatSerializer.a(toString()));
|
||||
chatPacket.setChatType(messageType.getId());
|
||||
chatPacket.b = messageType.getId();
|
||||
|
||||
for (Player player : players)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user