// Path: Journey of Legends/aginsun/journey/server/api/GoldKeeper.java
// public class GoldKeeper
// {
// 	private static HashMap<String, Integer> GoldValues = new HashMap<String, Integer>();
// 	
// 	public static int getGoldTotal(EntityPlayer player)
// 	{
// 		if(!GoldValues.containsKey(player.username))
// 		{
// 			return 0;
// 		}
// 		return GoldValues.get(player.username);
// 	}
// 	
// 	public static int getGoldTotal(String username)
// 	{
// 		if(!GoldValues.containsKey(username))
// 		{
// 			return 0;
// 		}
// 		return GoldValues.get(username);
// 	}
// 	
// 	public static void setGold(EntityPlayer player, int GoldValue)
// 	{
// 		GoldValues.put(player.username, GoldValue);
// 	}
// 	
// 	
// 	/**
// 	 * Adds 1 gold coin
// 	 * @param player
// 	 */
// 	public static void addGold(EntityPlayer player)
// 	{
// 		int i = getGoldTotal(player);
// 		i++;
// 		setGold(player, i);
// 	}
// 	
// 	public static void addGold(String username, int amount)
// 	{
// 		int i = GoldValues.get(username);
// 		i += amount;
// 		GoldValues.put(username, i);
// 	}
// 	
// 	/**
// 	 * Add a specific amount of gold
// 	 * 
// 	 * @param player
// 	 * @param amount
// 	 */
// 	public static void addGold(EntityPlayer player, int amount)
// 	{
// 		int i = getGoldTotal(player);
// 		i += amount;
// 		setGold(player, i);
// 	}
// 	
// 	/**
// 	 * Remove a specific amount of gold coins
// 	 * @param player
// 	 * @param amount
// 	 */
// 	public static void removeGold(EntityPlayer player, int amount)
// 	{
// 		int i = getGoldTotal(player);
// 		i -= amount;
// 		setGold(player, i);
// 	}
// }


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.GoldKeeper;
import cpw.mods.fml.common.network.Player;
package aginsun.journey.universal.packets;



public class PacketGold extends PacketJoL
{
	private String username;
	private int GoldValue;
	
	public PacketGold() 
	{
		super(PacketType.GOLD, false);
	}
	
	public PacketGold(String username, int GoldValue)
	{
		super(PacketType.GOLD, false);
		this.username = username;
		this.GoldValue = GoldValue;
	}
	
	@Override
	public void readData(DataInputStream data) throws IOException
	{
		this.username = data.readUTF();
		this.GoldValue = data.readInt();
	}
	
	public void writeData(DataOutputStream dos) throws IOException
	{
		dos.writeUTF(username);
		dos.writeInt(GoldValue);
	}
	
	public void execute(INetworkManager network, Player player)
	{
		EntityPlayer thePlayer = (EntityPlayer)player;
		
// Path: Journey of Legends/aginsun/journey/server/api/GoldKeeper.java
// public class GoldKeeper
// {
// 	private static HashMap<String, Integer> GoldValues = new HashMap<String, Integer>();
// 	
// 	public static int getGoldTotal(EntityPlayer player)
// 	{
// 		if(!GoldValues.containsKey(player.username))
// 		{
// 			return 0;
// 		}
// 		return GoldValues.get(player.username);
// 	}
// 	
// 	public static int getGoldTotal(String username)
// 	{
// 		if(!GoldValues.containsKey(username))
// 		{
// 			return 0;
// 		}
// 		return GoldValues.get(username);
// 	}
// 	
// 	public static void setGold(EntityPlayer player, int GoldValue)
// 	{
// 		GoldValues.put(player.username, GoldValue);
// 	}
// 	
// 	
// 	/**
// 	 * Adds 1 gold coin
// 	 * @param player
// 	 */
// 	public static void addGold(EntityPlayer player)
// 	{
// 		int i = getGoldTotal(player);
// 		i++;
// 		setGold(player, i);
// 	}
// 	
// 	public static void addGold(String username, int amount)
// 	{
// 		int i = GoldValues.get(username);
// 		i += amount;
// 		GoldValues.put(username, i);
// 	}
// 	
// 	/**
// 	 * Add a specific amount of gold
// 	 * 
// 	 * @param player
// 	 * @param amount
// 	 */
// 	public static void addGold(EntityPlayer player, int amount)
// 	{
// 		int i = getGoldTotal(player);
// 		i += amount;
// 		setGold(player, i);
// 	}
// 	
// 	/**
// 	 * Remove a specific amount of gold coins
// 	 * @param player
// 	 * @param amount
// 	 */
// 	public static void removeGold(EntityPlayer player, int amount)
// 	{
// 		int i = getGoldTotal(player);
// 		i -= amount;
// 		setGold(player, i);
// 	}
// }


// Path: Journey of Legends/aginsun/journey/universal/packets/PacketGold.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.GoldKeeper;
import cpw.mods.fml.common.network.Player;

package aginsun.journey.universal.packets;



public class PacketGold extends PacketJoL
{
	private String username;
	private int GoldValue;
	
	public PacketGold() 
	{
		super(PacketType.GOLD, false);
	}
	
	public PacketGold(String username, int GoldValue)
	{
		super(PacketType.GOLD, false);
		this.username = username;
		this.GoldValue = GoldValue;
	}
	
	@Override
	public void readData(DataInputStream data) throws IOException
	{
		this.username = data.readUTF();
		this.GoldValue = data.readInt();
	}
	
	public void writeData(DataOutputStream dos) throws IOException
	{
		dos.writeUTF(username);
		dos.writeInt(GoldValue);
	}
	
	public void execute(INetworkManager network, Player player)
	{
		EntityPlayer thePlayer = (EntityPlayer)player;
		
		GoldKeeper.setGold(thePlayer, GoldValue);	