2015-06-30 00:47:25 +02:00

115 lines
3.0 KiB
Java

package fr.xephi.authme.cache.limbo;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitTask;
public class LimboPlayer {
private String name;
private ItemStack[] inventory;
private ItemStack[] armour;
private Location loc = null;
private BukkitTask timeoutTaskId = null;
private BukkitTask messageTaskId = null;
private GameMode gameMode = GameMode.SURVIVAL;
private boolean operator = false;
private String group = "";
private boolean flying = false;
public LimboPlayer(String name, Location loc, ItemStack[] inventory,
ItemStack[] armour, GameMode gameMode, boolean operator,
String group, boolean flying) {
this.name = name;
this.loc = loc;
this.inventory = inventory;
this.armour = armour;
this.gameMode = gameMode;
this.operator = operator;
this.group = group;
this.flying = flying;
}
public LimboPlayer(String name, Location loc, GameMode gameMode,
boolean operator, String group, boolean flying) {
this.name = name;
this.loc = loc;
this.gameMode = gameMode;
this.operator = operator;
this.group = group;
this.flying = flying;
}
public LimboPlayer(String name, String group) {
this.name = name;
this.group = group;
}
public String getName() {
return name;
}
public Location getLoc() {
return loc;
}
public ItemStack[] getArmour() {
return armour;
}
public ItemStack[] getInventory() {
return inventory;
}
public void setArmour(ItemStack[] armour) {
this.armour = armour;
}
public void setInventory(ItemStack[] inventory) {
this.inventory = inventory;
}
public GameMode getGameMode() {
return gameMode;
}
public boolean getOperator() {
return operator;
}
public String getGroup() {
return group;
}
public void setTimeoutTaskId(BukkitTask i) {
if (this.timeoutTaskId != null) {
if (Bukkit.getScheduler().isCurrentlyRunning(this.timeoutTaskId.getTaskId()) || Bukkit.getScheduler().isQueued(this.timeoutTaskId.getTaskId()))
Bukkit.getScheduler().cancelTask(this.timeoutTaskId.getTaskId());
}
this.timeoutTaskId = i;
}
public BukkitTask getTimeoutTaskId() {
return timeoutTaskId;
}
public void setMessageTaskId(BukkitTask messageTaskId) {
if (this.messageTaskId != null) {
if (Bukkit.getScheduler().isCurrentlyRunning(this.messageTaskId.getTaskId()) || Bukkit.getScheduler().isQueued(this.messageTaskId.getTaskId()))
Bukkit.getScheduler().cancelTask(this.messageTaskId.getTaskId());
}
this.messageTaskId = messageTaskId;
}
public BukkitTask getMessageTaskId() {
return messageTaskId;
}
public boolean isFlying() {
return flying;
}
}