package us.crast.mondochest.persist;

import org.bukkit.Location;
import org.bukkit.entity.Player;

public class PlayerState {
	private Location lastClickedMaster;
	private State state = State.NORMAL;
	public PlayerState(Player player) {}
	
	/* Getters/Setters */
	public Location getLastClickedMaster() {
		return lastClickedMaster;
	}
	public void setLastClickedMaster(Location lastClickedMaster) {
		this.lastClickedMaster = lastClickedMaster;
	}
	
	public boolean isManagingChest() {
	    return this.state == State.MANAGING_CHEST;
	}
	
	public void setManagingChest() {
	    this.state = State.MANAGING_CHEST;
	}
	
	public void setNormalMode() {
	    this.state = State.NORMAL;
	}
	
	enum State {
	    NORMAL,
	    MANAGING_CHEST;
	}
}

@@ -31,16 +31,42 @@
 rsist;%0A%0A
+import org.bukkit.Bukkit;%0A
 import o
@@ -117,16 +117,47 @@
 .Player;
+%0Aimport org.bukkit.util.Vector;
 %0A%0Apublic
@@ -186,24 +186,22 @@
 private 
-Location
+String
  lastCli
@@ -204,23 +204,59 @@
 tClicked
-Master;
+World;%0A%09private Vector lastClickedVector;%0A%09
 %0A%09privat
@@ -399,38 +399,176 @@
 %09return 
-lastClickedMaster
+new Location(%0A%09%09    Bukkit.getWorld(lastClickedWorld),%0A%09%09    lastClickedVector.getX(),%0A%09%09    lastClickedVector.getY(),%0A%09%09    lastClickedVector.getZ()%0A%09%09)
 ;%0A%09%7D%0A
+%09%0A
 %09public 
@@ -641,21 +641,88 @@
 tClicked
-Maste
+World = lastClickedMaster.getWorld().toString();%0A%09%09this.lastClickedVecto
 r = last
@@ -734,16 +734,27 @@
 edMaster
+.toVector()
 ;%0A%09%7D%0A%09%0A%09

Clean up possible World memory leak in storing locations.