Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.squallz.wispclasses.objects;
- import com.squallz.wispclasses.enums.ClassType;
- import org.bukkit.boss.BossBar;
- import org.bukkit.entity.Entity;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.scheduler.BukkitTask;
- import java.util.ArrayList;
- import java.util.List;
- public class CPlayer {
- private String uuid;
- private String name;
- private ClassType classType;
- private Boolean inAbilityMode;
- private Double maxMana;
- private transient Boolean stunned;
- private transient List<Ability> abilities;
- private transient Double mana = 50.0;
- private transient List<Entity> minions = new ArrayList<>();
- private transient Integer minionTime = 30;
- private transient Boolean minionsOut = false;
- private transient Integer soulHarvestStacks = 0;
- private transient Boolean isChoosingClass;
- private transient Boolean wandCooldown;
- private transient Integer wandCooldownTime;
- private transient BukkitTask passiveAvoidanceTask = null;
- private transient BossBar manaBar;
- private transient BossBar minionBar;
- private transient Inventory playerInventory;
- public CPlayer (String uuid, String name, ClassType classType, Boolean inAbilityMode, Double maxMana) {
- this.uuid = uuid;
- this.name = name;
- this.classType = classType;
- this.inAbilityMode = inAbilityMode;
- this.stunned = false;
- this.maxMana = maxMana;
- setMana(50.0);
- }
- public ClassType getClassType() {
- return classType;
- }
- public String getUUID() {
- return this.uuid;
- }
- public String getName() {
- return name;
- }
- public Inventory getPlayerInventory() {
- if(playerInventory != null) {
- return playerInventory;
- } else {
- return null;
- }
- }
- public void setPlayerInventory(Inventory inventory) {
- this.playerInventory = inventory;
- }
- public void setAbilities(List<Ability> abilities) {
- this.abilities = abilities;
- }
- public List<Ability> getAbilities() {
- return this.abilities;
- }
- public void setManaBar(BossBar manaBar) {
- this.manaBar = manaBar;
- }
- public BossBar getManaBar() {
- if(manaBar != null) {
- return manaBar;
- } else {
- return null;
- }
- }
- public void setMinionBar(BossBar minionBar) {
- this.minionBar = minionBar;
- }
- public BossBar getMinionBar() {
- if(minionBar != null) {
- return minionBar;
- } else {
- return null;
- }
- }
- public Boolean hasEnoughMana(Integer manaNeeded) {
- if(getMana() != null) {
- if(getMana() >= manaNeeded) {
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- }
- public BukkitTask getPassiveAvoidanceTask() {
- if(passiveAvoidanceTask != null) {
- return passiveAvoidanceTask;
- } else {
- return null;
- }
- }
- public void setPassiveAvoidanceTask(BukkitTask bukkitTask) {
- this.passiveAvoidanceTask = bukkitTask;
- }
- public Boolean hasWandCooldown() {
- if(wandCooldown == null) {
- return false;
- } else {
- return wandCooldown;
- }
- }
- public Integer getWandCooldownTime() {
- if(wandCooldownTime != null) {
- return wandCooldownTime;
- } else {
- return 0;
- }
- }
- public void setWandCooldown(Boolean bool) {
- this.wandCooldown = bool;
- }
- public void setWandCooldownTime(Integer time) {
- this.wandCooldownTime = time;
- }
- public Boolean getIsChoosingClass() {
- if(isChoosingClass != null) {
- return isChoosingClass;
- } else {
- return false;
- }
- }
- public void setIsChoosingClass(Boolean bool) {
- this.isChoosingClass = bool;
- }
- public Integer getSoulHarvestStacks() {
- if(soulHarvestStacks != null) {
- return soulHarvestStacks;
- } else {
- return 0;
- }
- }
- public void addSoulHarvestStack() {
- if(soulHarvestStacks == null) {
- soulHarvestStacks = 0;
- }
- soulHarvestStacks+=1;
- }
- public void removeSoulHarvestStack(Integer amount) {
- soulHarvestStacks -= amount;
- }
- public Ability getAbilityByName(String abilityName) {
- for(Ability abilities : getAbilities()) {
- if(abilities.getName().equalsIgnoreCase(abilityName)) {
- return abilities;
- }
- }
- return null;
- }
- public Boolean isStunned(){
- if(stunned != null) {
- return stunned;
- }
- return false;
- }
- public void setMana(Double mana) {
- this.mana = mana;
- }
- public void setMinionsOut(Boolean bool) {
- this.minionsOut = bool;
- }
- public Boolean hasMinionsOut() {
- if(minionsOut != null) {
- return minionsOut;
- } else {
- return false;
- }
- }
- public double getMinionTime() {
- if(minionTime != null) {
- return minionTime;
- } else {
- return 30;
- }
- }
- public void setMinionTime(Integer minionTime) {
- this.minionTime = minionTime;
- }
- public List<Entity> getMinions() {
- return minions;
- }
- public void addMinion(Entity minion) {
- if(minions == null) {
- this.minions = new ArrayList<>();
- }
- minions.add(minion);
- }
- public void removeMinion(Entity minion) {
- if(minions.contains(minion)) {
- minions.remove(minion);
- }
- }
- public Double getMana() {
- return mana;
- }
- public void stun() {
- this.stunned = true;
- }
- public void unStun() {
- this.stunned = false;
- }
- public boolean isInAbilityMode() {
- return inAbilityMode;
- }
- public Double getMaxMana() {
- return maxMana;
- }
- public void setMaxMana(Double maxMana) {
- this.maxMana = maxMana;
- }
- public void toggleAbilityMode() {
- if(isInAbilityMode()) {
- inAbilityMode = false;
- } else {
- inAbilityMode = true;
- }
- }
- public void setClassType(ClassType classType) {
- this.classType = classType;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement