package protocolsupport.protocol.storage;

import java.util.UUID;

import org.apache.commons.lang3.Validate;

import net.md_5.bungee.protocol.packet.Handshake;
import protocolsupport.api.Connection;

public class NetworkDataCache {

	private static final String METADATA_KEY = "__PSB_NDC";

	public static NetworkDataCache getFrom(Connection connection) {
		return (NetworkDataCache) connection.getMetadata(METADATA_KEY);
	}

	public void storeIn(Connection connection) {
		connection.addMetadata(METADATA_KEY, this);
	}

	private Handshake serverHandshake;

	public void setServerHandshake(Handshake serverHandshake) {
		this.serverHandshake = serverHandshake;
	}

	public Handshake getServerHandshake() {
		return serverHandshake;
	}

	private byte[] startGameData;

	public byte[] getStartGameData() {
		return startGameData;
	}

	public void setStartGameData(byte[] startGameData) {
		this.startGameData = startGameData;
	}

	protected String locale = "en_us";

	public void setLocale(String locale) {
		Validate.notNull(locale, "Client locale can't be null");
		this.locale = locale.toLowerCase();
	}

	public String getLocale() {
		return locale;
	}

	private UUID peClientUUID;

	public void setPEClientUUID(UUID uuid) {
		Validate.notNull(uuid, "PE client uuid (identity) can't be null");
		this.peClientUUID = uuid;
	}

	public UUID getPEClientUUID() {
		return peClientUUID;
	}

	private boolean stashingClientPackets = false;

	public boolean isStashingClientPackets() {
		return stashingClientPackets;
	}

	public void setStashingClientPackets(boolean stashingClientPackets) {
		this.stashingClientPackets = stashingClientPackets;
	}

	private String skinData;

	public String getSkinData() {
		return skinData;
	}

	public void setSkinData(String skinData) {
		this.skinData = skinData;
	}

	private String skinGeometry;

	public String getSkinGeometry() {
		return skinGeometry;
	}

	public void setSkinGeometry(String skinGeometry) {
		this.skinGeometry = skinGeometry;
	}

	private float x, y, z;

	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}

	public float getZ() {
		return z;
	}

	public void setSpawnLocation(float x, float y, float z) {
		this.x = x;
		this.y = y;
		this.z = z;
	}

}

@@ -40,75 +40,8 @@
 e;%0A%0A
-import java.util.UUID;%0A%0Aimport org.apache.commons.lang3.Validate;%0A%0A
 impo
@@ -667,1505 +667,6 @@
 %09%7D%0A%0A
-%09private byte%5B%5D startGameData;%0A%0A%09public byte%5B%5D getStartGameData() %7B%0A%09%09return startGameData;%0A%09%7D%0A%0A%09public void setStartGameData(byte%5B%5D startGameData) %7B%0A%09%09this.startGameData = startGameData;%0A%09%7D%0A%0A%09protected String locale = %22en_us%22;%0A%0A%09public void setLocale(String locale) %7B%0A%09%09Validate.notNull(locale, %22Client locale can't be null%22);%0A%09%09this.locale = locale.toLowerCase();%0A%09%7D%0A%0A%09public String getLocale() %7B%0A%09%09return locale;%0A%09%7D%0A%0A%09private UUID peClientUUID;%0A%0A%09public void setPEClientUUID(UUID uuid) %7B%0A%09%09Validate.notNull(uuid, %22PE client uuid (identity) can't be null%22);%0A%09%09this.peClientUUID = uuid;%0A%09%7D%0A%0A%09public UUID getPEClientUUID() %7B%0A%09%09return peClientUUID;%0A%09%7D%0A%0A%09private boolean stashingClientPackets = false;%0A%0A%09public boolean isStashingClientPackets() %7B%0A%09%09return stashingClientPackets;%0A%09%7D%0A%0A%09public void setStashingClientPackets(boolean stashingClientPackets) %7B%0A%09%09this.stashingClientPackets = stashingClientPackets;%0A%09%7D%0A%0A%09private String skinData;%0A%0A%09public String getSkinData() %7B%0A%09%09return skinData;%0A%09%7D%0A%0A%09public void setSkinData(String skinData) %7B%0A%09%09this.skinData = skinData;%0A%09%7D%0A%0A%09private String skinGeometry;%0A%0A%09public String getSkinGeometry() %7B%0A%09%09return skinGeometry;%0A%09%7D%0A%0A%09public void setSkinGeometry(String skinGeometry) %7B%0A%09%09this.skinGeometry = skinGeometry;%0A%09%7D%0A%0A%09private float x, y, z;%0A%0A%09public float getX() %7B%0A%09%09return x;%0A%09%7D%0A%0A%09public float getY() %7B%0A%09%09return y;%0A%09%7D%0A%0A%09public float getZ() %7B%0A%09%09return z;%0A%09%7D%0A%0A%09public void setSpawnLocation(float x, float y, float z) %7B%0A%09%09this.x = x;%0A%09%09this.y = y;%0A%09%09this.z = z;%0A%09%7D%0A%0A
 %7D%0A

Remove remnants of pe support