TeamVento/src/main/java/eu/univento/teamvento/utils/WorldEdit.java

42 lines
1.0 KiB
Java

package eu.univento.teamvento.utils;
import eu.univento.core.api.player.CustomPlayer;
import org.bukkit.block.Block;
import java.util.HashMap;
/**
* @author joethei
* @version 0.1
*/
public class WorldEdit {
private static final HashMap<CustomPlayer, Block> pos1 = new HashMap<>();
private static final HashMap<CustomPlayer, Block> pos2 = new HashMap<>();
public static Block getPos1(CustomPlayer p) {
return pos1.containsKey(p) ? pos1.get(p) : null;
}
public static Block getPos2(CustomPlayer p) {
return pos2.containsKey(p) ? pos2.get(p) : null;
}
public static void setPos1(CustomPlayer p, Block b) {
if(pos1.containsKey(p)) {
pos1.remove(p);
}
pos1.put(p, b);
}
public static void setPos2(CustomPlayer p, Block b) {
if(pos2.containsKey(p)) {
pos2.remove(p);
}
pos2.put(p, b);
}
public static boolean hasSetPos(CustomPlayer p) {
return pos1.containsKey(p) && pos2.containsKey(p);
}
}