// Path: Journey of Legends/aginsun/journey/server/api/LevelKeeper.java
// public class LevelKeeper 
// {
// 	private static HashMap<String, Integer> LevelMap = new HashMap<String, Integer>();
// 	private static HashMap<String, Integer> StatPointsMap = new HashMap<String, Integer>();
// 	
// 	public static void setLevel(EntityPlayer player, int amount)
// 	{
// 		LevelMap.put(player.username, amount);
// 	}
// 	
// 	public static int getLevel(EntityPlayer player)
// 	{
// 		if(LevelMap.containsKey(player.username))
// 			return LevelMap.get(player.username);
// 		else
// 			return 1;
// 	}
// 	
// 	public static void addLevel(EntityPlayer player)
// 	{
// 		int x = getLevel(player);
// 		x++;
// 		setLevel(player, x);
// 	}
// 	
// 	public static void setSP(EntityPlayer player, int amount)
// 	{
// 		StatPointsMap.put(player.username, amount);
// 	}
// 	
// 	public static int getSP(EntityPlayer player)
// 	{
// 		if(StatPointsMap.containsKey(player.username))
// 			return StatPointsMap.get(player.username);
// 		else
// 			return 0;
// 	}
// 	
// 	public static void addSP(EntityPlayer player, int amount)
// 	{
// 		int x = getSP(player);
// 		x += amount;
// 		setSP(player, x);
// 	}
// 	
// 	public static void decreaseSP(EntityPlayer player, int amount)
// 	{
// 		int x = getSP(player);
// 		x -= amount;
// 		setSP(player, x);
// 	}
// }


import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import aginsun.journey.server.api.LevelKeeper;
import cpw.mods.fml.common.network.Player;

	public PacketLevel(String username, int level, int SP) 
	{
		super(PacketType.LEVEL, false);
		this.username = username;
		this.level = level;
		this.SP = SP;
	}

	@Override
	public void readData(DataInputStream data) throws IOException 
	{
		this.username = data.readUTF();
		this.level = data.readInt();
		this.SP = data.readInt();
	}

	@Override
	public void writeData(DataOutputStream dos) throws IOException 
	{
		dos.writeUTF(username);
		dos.writeInt(level);
		dos.writeInt(SP);
	}

	@Override
	public void execute(INetworkManager network, Player thePlayer) 
	{
		EntityPlayer player = (EntityPlayer) thePlayer;
		
// Path: Journey of Legends/aginsun/journey/server/api/LevelKeeper.java
// public class LevelKeeper 
// {
// 	private static HashMap<String, Integer> LevelMap = new HashMap<String, Integer>();
// 	private static HashMap<String, Integer> StatPointsMap = new HashMap<String, Integer>();
// 	
// 	public static void setLevel(EntityPlayer player, int amount)
// 	{
// 		LevelMap.put(player.username, amount);
// 	}
// 	
// 	public static int getLevel(EntityPlayer player)
// 	{
// 		if(LevelMap.containsKey(player.username))
// 			return LevelMap.get(player.username);
// 		else
// 			return 1;
// 	}
// 	
// 	public static void addLevel(EntityPlayer player)
// 	{
// 		int x = getLevel(player);
// 		x++;
// 		setLevel(player, x);
// 	}
// 	
// 	public static void setSP(EntityPlayer player, int amount)
// 	{
// 		StatPointsMap.put(player.username, amount);
// 	}
// 	
// 	public static int getSP(EntityPlayer player)
// 	{
// 		if(StatPointsMap.containsKey(player.username))
// 			return StatPointsMap.get(player.username);
// 		else
// 			return 0;
// 	}
// 	
// 	public static void addSP(EntityPlayer player, int amount)
// 	{
// 		int x = getSP(player);
// 		x += amount;
// 		setSP(player, x);
// 	}
// 	
// 	public static void decreaseSP(EntityPlayer player, int amount)
// 	{
// 		int x = getSP(player);
// 		x -= amount;
// 		setSP(player, x);
// 	}
// }


// Path: Journey of Legends/aginsun/journey/universal/packets/PacketLevel.java
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import aginsun.journey.server.api.LevelKeeper;
import cpw.mods.fml.common.network.Player;


	public PacketLevel(String username, int level, int SP) 
	{
		super(PacketType.LEVEL, false);
		this.username = username;
		this.level = level;
		this.SP = SP;
	}

	@Override
	public void readData(DataInputStream data) throws IOException 
	{
		this.username = data.readUTF();
		this.level = data.readInt();
		this.SP = data.readInt();
	}

	@Override
	public void writeData(DataOutputStream dos) throws IOException 
	{
		dos.writeUTF(username);
		dos.writeInt(level);
		dos.writeInt(SP);
	}

	@Override
	public void execute(INetworkManager network, Player thePlayer) 
	{
		EntityPlayer player = (EntityPlayer) thePlayer;
		
		LevelKeeper.setLevel(player, level);