Remove Identifiable

This commit is contained in:
Yeregorix
2018-11-15 17:02:26 +01:00
parent da259951c7
commit 3cba196ba7
9 changed files with 24 additions and 34 deletions

View File

@@ -157,7 +157,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
try {
ProtocolUtils.writeVarInt(dataToForward, VelocityConstants.FORWARDING_VERSION);
ProtocolUtils.writeString(dataToForward, address);
ProtocolUtils.writeUuid(dataToForward, profile.getUniqueId());
ProtocolUtils.writeUuid(dataToForward, profile.idAsUuid());
ProtocolUtils.writeString(dataToForward, profile.getName());
ProtocolUtils.writeProperties(dataToForward, profile.getProperties());

View File

@@ -109,7 +109,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
.append('\0')
.append(proxyPlayer.getRemoteAddress().getHostString())
.append('\0')
.append(proxyPlayer.getProfile().getUndashedId())
.append(proxyPlayer.getProfile().getId())
.append('\0');
GSON.toJson(proxyPlayer.getProfile().getProperties(), data);
return data.toString();

View File

@@ -100,7 +100,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
@Override
public UUID getUniqueId() {
return profile.getUniqueId();
return profile.idAsUuid();
}
@Override

View File

@@ -142,7 +142,7 @@ public class PlayerListItem implements MinecraftPacket {
}
public static Item from(TabListEntry entry) {
return new Item(entry.getProfile().getUniqueId())
return new Item(entry.getProfile().idAsUuid())
.setName(entry.getProfile().getName())
.setProperties(entry.getProfile().getProperties())
.setLatency(entry.getLatency())

View File

@@ -29,7 +29,7 @@ public class GameProfileSerializer implements JsonSerializer<GameProfile>,
@Override
public JsonElement serialize(GameProfile src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject obj = new JsonObject();
obj.add("id", new JsonPrimitive(src.getUndashedId()));
obj.add("id", new JsonPrimitive(src.getId()));
obj.add("name", new JsonPrimitive(src.getName()));
obj.add("properties", context.serialize(src.getProperties(), propertyList));
return obj;

View File

@@ -45,13 +45,13 @@ public class VelocityTabList implements TabList {
Preconditions.checkNotNull(entry, "entry");
Preconditions.checkArgument(entry.getTabList().equals(this),
"The provided entry was not created by this tab list");
Preconditions.checkArgument(!entries.containsKey(entry.getProfile().getUniqueId()),
Preconditions.checkArgument(!entries.containsKey(entry.getProfile().idAsUuid()),
"this TabList already contains an entry with the same uuid");
PlayerListItem.Item packetItem = PlayerListItem.Item.from(entry);
connection.write(
new PlayerListItem(PlayerListItem.ADD_PLAYER, Collections.singletonList(packetItem)));
entries.put(entry.getProfile().getUniqueId(), entry);
entries.put(entry.getProfile().idAsUuid(), entry);
}
@Override
@@ -141,7 +141,7 @@ public class VelocityTabList implements TabList {
}
void updateEntry(int action, TabListEntry entry) {
if (entries.containsKey(entry.getProfile().getUniqueId())) {
if (entries.containsKey(entry.getProfile().idAsUuid())) {
PlayerListItem.Item packetItem = PlayerListItem.Item.from(entry);
connection.write(new PlayerListItem(action, Collections.singletonList(packetItem)));
}