mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	More cleanup on PlayerProfile.java
This commit is contained in:
		@@ -19,111 +19,112 @@ import com.gmail.nossr50.m;
 | 
				
			|||||||
import com.gmail.nossr50.mcMMO;
 | 
					import com.gmail.nossr50.mcMMO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class PlayerProfile {
 | 
					public class PlayerProfile {
 | 
				
			||||||
    //HUD
 | 
					 | 
				
			||||||
    private HUDType hud;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    //MISC
 | 
					 | 
				
			||||||
    private String party, invite;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    //TOGGLES
 | 
					 | 
				
			||||||
    private boolean loaded = false, partyhud = true, spoutcraft = false, xpbarlocked = false, placedAnvil = false, partyChatMode = false, adminChatMode = false, godMode = false, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true, 
 | 
					 | 
				
			||||||
    superBreakerInformed = true, blastMiningInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, 
 | 
					 | 
				
			||||||
    serratedStrikesMode, hoePreparationMode = false, shovelPreparationMode = false, swordsPreparationMode = false, fistsPreparationMode = false, pickaxePreparationMode = false, axePreparationMode = false, skullSplitterMode, berserkMode;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    //TIMESTAMPS
 | 
					 | 
				
			||||||
    //ATS = (Time of) Activation Time Stamp
 | 
					 | 
				
			||||||
    //DATS = (Time of) Deactivation Time Stamp
 | 
					 | 
				
			||||||
    private int xpGainATS = 0, recentlyHurt = 0, respawnATS, hoePreparationATS, shovelPreparationATS, swordsPreparationATS, fistsPreparationATS, axePreparationATS, pickaxePreparationATS;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    private SkillType lastgained = null, skillLock = null;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    //MySQL STUFF
 | 
					 | 
				
			||||||
    private int xpbarinc=0, lastlogin=0, userid = 0, bleedticks = 0;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    private String playerName;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    //Time to HashMap this shiz
 | 
					 | 
				
			||||||
    HashMap<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); //Skills and XP
 | 
					 | 
				
			||||||
    HashMap<SkillType, Integer> skillsXp = new HashMap<SkillType, Integer>(); //Skills and XP
 | 
					 | 
				
			||||||
    HashMap<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>(); //Skill ATS
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public PlayerProfile(String name)
 | 
					    final static int MAX_BLEED_TICKS = 10;
 | 
				
			||||||
    {
 | 
					
 | 
				
			||||||
 | 
					    /* HUD */
 | 
				
			||||||
 | 
					    private HUDType hud;
 | 
				
			||||||
 | 
					    private int xpbarinc = 0;
 | 
				
			||||||
 | 
					    private SkillType lastgained;
 | 
				
			||||||
 | 
					    private SkillType skillLock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Party Stuff */
 | 
				
			||||||
 | 
					    private String party;
 | 
				
			||||||
 | 
					    private String invite;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Toggles */
 | 
				
			||||||
 | 
					    private boolean loaded = false;
 | 
				
			||||||
 | 
					    private boolean partyhud = true, spoutcraft = false, xpbarlocked = false;
 | 
				
			||||||
 | 
					    private boolean placedAnvil = false;
 | 
				
			||||||
 | 
					    private boolean partyChatMode = false, partyChatOnly = false, adminChatMode = false;
 | 
				
			||||||
 | 
					    private boolean godMode = false;
 | 
				
			||||||
 | 
					    private boolean greenTerraMode, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, serratedStrikesMode, skullSplitterMode, berserkMode;
 | 
				
			||||||
 | 
					    private boolean greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true,
 | 
				
			||||||
 | 
					                    superBreakerInformed = true, blastMiningInformed = true, serratedStrikesInformed = true, treeFellerInformed = true;
 | 
				
			||||||
 | 
					    private boolean hoePreparationMode = false, shovelPreparationMode = false, swordsPreparationMode = false, fistsPreparationMode = false,
 | 
				
			||||||
 | 
					                    pickaxePreparationMode = false, axePreparationMode = false;
 | 
				
			||||||
 | 
					    private boolean abilityuse = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Timestamps */
 | 
				
			||||||
 | 
					    private int xpGainATS = 0;
 | 
				
			||||||
 | 
					    private int recentlyHurt = 0;
 | 
				
			||||||
 | 
					    private int respawnATS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* mySQL STUFF */
 | 
				
			||||||
 | 
					    private int lastlogin = 0;
 | 
				
			||||||
 | 
					    private int userid = 0;
 | 
				
			||||||
 | 
					    private int bleedticks = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    HashMap<SkillType, Integer> skills = new HashMap<SkillType, Integer>(); //Skills and Levels
 | 
				
			||||||
 | 
					    HashMap<SkillType, Integer> skillsXp = new HashMap<SkillType, Integer>(); //Skills and XP
 | 
				
			||||||
 | 
					    HashMap<AbilityType, Integer> skillsDATS = new HashMap<AbilityType, Integer>();
 | 
				
			||||||
 | 
					    HashMap<ToolType, Integer> toolATS = new HashMap<ToolType, Integer>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private String playerName;
 | 
				
			||||||
 | 
					    private String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public PlayerProfile(String name) {
 | 
				
			||||||
        hud = LoadProperties.defaulthud;
 | 
					        hud = LoadProperties.defaulthud;
 | 
				
			||||||
        //Setup the HashMap for ability DATS
 | 
					        playerName = name;
 | 
				
			||||||
        for(AbilityType abilityType : AbilityType.values())
 | 
					
 | 
				
			||||||
        {
 | 
					        for (AbilityType abilityType : AbilityType.values()) {
 | 
				
			||||||
            skillsDATS.put(abilityType, 0);
 | 
					            skillsDATS.put(abilityType, 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        //Setup the HashMap for the skills
 | 
					        for (SkillType skillType : SkillType.values()) {
 | 
				
			||||||
        for(SkillType skillType : SkillType.values())
 | 
					            if (skillType != SkillType.ALL) {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if(skillType != SkillType.ALL)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                skills.put(skillType, 0);
 | 
					                skills.put(skillType, 0);
 | 
				
			||||||
                skillsXp.put(skillType, 0);
 | 
					                skillsXp.put(skillType, 0);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        playerName = name;
 | 
					        if (LoadProperties.useMySQL) {
 | 
				
			||||||
        if (LoadProperties.useMySQL) 
 | 
					            if (!loadMySQL()) {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if(!loadMySQL()) {
 | 
					 | 
				
			||||||
                addMySQLPlayer();
 | 
					                addMySQLPlayer();
 | 
				
			||||||
                loadMySQL();//This is probably not needed anymore, could just delete
 | 
					                loadMySQL(); //This is probably not needed anymore, could just delete. // So can we remove this whole function, or just this line?
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            if(!load()) { addPlayer();}
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        lastlogin = ((Long) (System.currentTimeMillis()/1000)).intValue();
 | 
					        else if (!load()) {
 | 
				
			||||||
 | 
					            addPlayer();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        lastlogin = ((Long) (System.currentTimeMillis() / 1000)).intValue();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public PlayerProfile(String name, boolean addNew)
 | 
					    /*
 | 
				
			||||||
    {
 | 
					     * Why do we even have this? The only time it's called, it's false.
 | 
				
			||||||
 | 
					     * Why not combine the two?
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public PlayerProfile(String name, boolean addNew) {
 | 
				
			||||||
        hud = LoadProperties.defaulthud;
 | 
					        hud = LoadProperties.defaulthud;
 | 
				
			||||||
        //Setup the HashMap for ability DATS
 | 
					        playerName = name;
 | 
				
			||||||
        for(AbilityType abilityType : AbilityType.values())
 | 
					
 | 
				
			||||||
        {
 | 
					        for (AbilityType abilityType : AbilityType.values()) {
 | 
				
			||||||
            skillsDATS.put(abilityType, 0);
 | 
					            skillsDATS.put(abilityType, 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        //Setup the HashMap for the skills
 | 
					        for (SkillType skillType : SkillType.values()) {
 | 
				
			||||||
        for(SkillType skillType : SkillType.values())
 | 
					            if (skillType != SkillType.ALL) {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if(skillType != SkillType.ALL)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                skills.put(skillType, 0);
 | 
					                skills.put(skillType, 0);
 | 
				
			||||||
                skillsXp.put(skillType, 0);
 | 
					                skillsXp.put(skillType, 0);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        playerName = name;
 | 
					        if (LoadProperties.useMySQL) {
 | 
				
			||||||
        if (LoadProperties.useMySQL) 
 | 
					            if (!loadMySQL() && addNew) {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if(!loadMySQL() && addNew) {
 | 
					 | 
				
			||||||
                addMySQLPlayer();
 | 
					                addMySQLPlayer();
 | 
				
			||||||
                loadMySQL();//This is probably not needed anymore, could just delete
 | 
					                loadMySQL(); //This is probably not needed anymore, could just delete. // So can we remove this whole function, or just this line?
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            if(!load() && addNew) { addPlayer(); loaded = true; }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        lastlogin = ((Long) (System.currentTimeMillis()/1000)).intValue();
 | 
					        else if (!load() && addNew) {
 | 
				
			||||||
 | 
					            addPlayer();
 | 
				
			||||||
 | 
					            loaded = true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        lastlogin = ((Long) (System.currentTimeMillis() / 1000)).intValue();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public int getLastLogin()
 | 
					    public boolean loadMySQL() {
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        return lastlogin;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public int getMySQLuserId()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        return userid;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    public boolean loadMySQL() 
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        Integer id = 0;
 | 
					        Integer id = 0;
 | 
				
			||||||
        id = mcMMO.database.getInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'");
 | 
					        id = mcMMO.database.getInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'");
 | 
				
			||||||
        if(id == 0)
 | 
					        if(id == 0)
 | 
				
			||||||
@@ -202,8 +203,9 @@ public class PlayerProfile {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }        
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void addMySQLPlayer() {
 | 
					    public void addMySQLPlayer() {
 | 
				
			||||||
        Integer id = 0;
 | 
					        Integer id = 0;
 | 
				
			||||||
        mcMMO.database.write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")");
 | 
					        mcMMO.database.write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")");
 | 
				
			||||||
@@ -213,7 +215,7 @@ public class PlayerProfile {
 | 
				
			|||||||
        mcMMO.database.write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"experience (user_id) VALUES ("+id+")");
 | 
					        mcMMO.database.write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"experience (user_id) VALUES ("+id+")");
 | 
				
			||||||
        this.userid = id;
 | 
					        this.userid = id;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public boolean load()
 | 
					    public boolean load()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
@@ -317,7 +319,7 @@ public class PlayerProfile {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public void save()
 | 
					    public void save()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Long timestamp = System.currentTimeMillis()/1000; //Convert to seconds
 | 
					        Long timestamp = System.currentTimeMillis()/1000; //Convert to seconds
 | 
				
			||||||
@@ -440,28 +442,25 @@ public class PlayerProfile {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void resetAllData()
 | 
					    public void resetAllData() {
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //This will reset everything to default values and then save the information to FlatFile/MySQL
 | 
					        //This will reset everything to default values and then save the information to FlatFile/MySQL
 | 
				
			||||||
        for(SkillType skillType : SkillType.values())
 | 
					        for (SkillType skillType : SkillType.values()) {
 | 
				
			||||||
        {
 | 
					            if (skillType != SkillType.ALL) {
 | 
				
			||||||
            if(skillType == SkillType.ALL)
 | 
					                skills.put(skillType, 0);
 | 
				
			||||||
                continue;
 | 
					                skillsXp.put(skillType, 0);
 | 
				
			||||||
            skills.put(skillType, 0);
 | 
					            }
 | 
				
			||||||
            skillsXp.put(skillType, 0);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        for(AbilityType abilityType : AbilityType.values())
 | 
					        for (AbilityType abilityType : AbilityType.values()) {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            skillsDATS.put(abilityType, 0);
 | 
					            skillsDATS.put(abilityType, 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        //Misc stuff
 | 
					        //Misc stuff
 | 
				
			||||||
        party = "";
 | 
					        party = "";
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        save();
 | 
					        save();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public void addPlayer()
 | 
					    public void addPlayer()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
@@ -516,134 +515,170 @@ public class PlayerProfile {
 | 
				
			|||||||
            Bukkit.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString());
 | 
					            Bukkit.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void togglePartyHUD()
 | 
					
 | 
				
			||||||
    {
 | 
					    /*
 | 
				
			||||||
        partyhud = !partyhud;
 | 
					     * mySQL Stuff
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public int getLastLogin() {
 | 
				
			||||||
 | 
					        return lastlogin;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public boolean isLoaded()
 | 
					
 | 
				
			||||||
    {
 | 
					    public int getMySQLuserId() {
 | 
				
			||||||
 | 
					        return userid;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public boolean isLoaded() {
 | 
				
			||||||
        return loaded;
 | 
					        return loaded;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public boolean getPartyHUD()
 | 
					
 | 
				
			||||||
    {
 | 
					    /*
 | 
				
			||||||
 | 
					     * God Mode
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public boolean getGodMode() {
 | 
				
			||||||
 | 
					        return godMode;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void toggleGodMode() {
 | 
				
			||||||
 | 
					        godMode = !godMode;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * Anvil Placement
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void togglePlacedAnvil() {
 | 
				
			||||||
 | 
					        placedAnvil = !placedAnvil;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public Boolean getPlacedAnvil() {
 | 
				
			||||||
 | 
					        return placedAnvil;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * HUD Stuff
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void togglePartyHUD() {
 | 
				
			||||||
 | 
					        partyhud = !partyhud;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public boolean getPartyHUD() {
 | 
				
			||||||
        return partyhud;
 | 
					        return partyhud;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void toggleSpoutEnabled()
 | 
					
 | 
				
			||||||
    {
 | 
					    public void toggleSpoutEnabled() {
 | 
				
			||||||
        spoutcraft = !spoutcraft;
 | 
					        spoutcraft = !spoutcraft;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public HUDType getHUDType()
 | 
					
 | 
				
			||||||
    {
 | 
					    public HUDType getHUDType() {
 | 
				
			||||||
        return hud;
 | 
					        return hud;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void setHUDType(HUDType type)
 | 
					
 | 
				
			||||||
    {
 | 
					    public void setHUDType(HUDType type) {
 | 
				
			||||||
        hud = type;
 | 
					        hud = type;
 | 
				
			||||||
        save();
 | 
					        save();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public boolean getXpBarLocked()
 | 
					
 | 
				
			||||||
    {
 | 
					    public boolean getXpBarLocked() {
 | 
				
			||||||
        return xpbarlocked;
 | 
					        return xpbarlocked;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void toggleXpBarLocked()
 | 
					
 | 
				
			||||||
    {
 | 
					    public void toggleXpBarLocked() {
 | 
				
			||||||
        xpbarlocked = !xpbarlocked;
 | 
					        xpbarlocked = !xpbarlocked;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public int getXpBarInc()
 | 
					
 | 
				
			||||||
    {
 | 
					    public int getXpBarInc() {
 | 
				
			||||||
        return xpbarinc;
 | 
					        return xpbarinc;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void setXpBarInc(int newvalue)
 | 
					
 | 
				
			||||||
    {
 | 
					    public void setXpBarInc(int newvalue) {
 | 
				
			||||||
        xpbarinc = newvalue;
 | 
					        xpbarinc = newvalue;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void setSkillLock(SkillType newvalue)
 | 
					
 | 
				
			||||||
    {
 | 
					    public void setSkillLock(SkillType newvalue) {
 | 
				
			||||||
        skillLock = newvalue;
 | 
					        skillLock = newvalue;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public SkillType getSkillLock()
 | 
					
 | 
				
			||||||
    {
 | 
					    public SkillType getSkillLock() {
 | 
				
			||||||
        return skillLock;
 | 
					        return skillLock;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void setLastGained(SkillType newvalue)
 | 
					
 | 
				
			||||||
    {
 | 
					    public void setLastGained(SkillType newvalue) {
 | 
				
			||||||
        lastgained = newvalue;
 | 
					        lastgained = newvalue;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public SkillType getLastGained()
 | 
					
 | 
				
			||||||
    {
 | 
					    public SkillType getLastGained() {
 | 
				
			||||||
        return lastgained;
 | 
					        return lastgained;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public boolean getAdminChatMode() {return adminChatMode;}
 | 
					    /*
 | 
				
			||||||
    public boolean getPartyChatMode() {return partyChatMode;}
 | 
					     * Chat Stuff
 | 
				
			||||||
    
 | 
					     */
 | 
				
			||||||
    public boolean getGodMode() {return godMode;}
 | 
					
 | 
				
			||||||
    
 | 
					    public boolean getAdminChatMode() {
 | 
				
			||||||
    public void togglePlacedAnvil()
 | 
					        return adminChatMode;
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        placedAnvil = !placedAnvil;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public Boolean getPlacedAnvil()
 | 
					
 | 
				
			||||||
    {
 | 
					    public void toggleAdminChat() {
 | 
				
			||||||
        return placedAnvil;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public void toggleAdminChat()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        adminChatMode = !adminChatMode;
 | 
					        adminChatMode = !adminChatMode;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public void toggleGodMode()
 | 
					    public boolean getPartyChatMode() {
 | 
				
			||||||
    {
 | 
					        return partyChatMode;
 | 
				
			||||||
        godMode = !godMode;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    public void togglePartyChat()
 | 
					    public void togglePartyChat() {
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        partyChatMode = !partyChatMode;
 | 
					        partyChatMode = !partyChatMode;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public boolean isPlayer(String player)
 | 
					    public boolean getPartyChatOnlyToggle() {
 | 
				
			||||||
    {
 | 
					        return partyChatOnly;
 | 
				
			||||||
        return player.equals(Bukkit.getPlayer(playerName));
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public boolean getPartyChatOnlyToggle(){return partyChatOnly;}
 | 
					
 | 
				
			||||||
    public void togglePartyChatOnly(){partyChatOnly = !partyChatOnly;}
 | 
					    public void togglePartyChatOnly() {
 | 
				
			||||||
    public boolean getAbilityUse(){
 | 
					        partyChatOnly = !partyChatOnly;
 | 
				
			||||||
        return abilityuse;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void toggleAbilityUse()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        abilityuse = !abilityuse;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public void decreaseBleedTicks()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        bleedticks--;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public Integer getBleedTicks(){
 | 
					 | 
				
			||||||
        return bleedticks;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public void setBleedTicks(Integer newvalue){
 | 
					 | 
				
			||||||
        bleedticks = newvalue;
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        //Cap maximum ticks at 10
 | 
					 | 
				
			||||||
        if(bleedticks > 10)
 | 
					 | 
				
			||||||
            bleedticks = 10;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public void addBleedTicks(Integer newvalue){
 | 
					 | 
				
			||||||
        bleedticks+=newvalue;
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        //Cap maximum ticks at 10
 | 
					 | 
				
			||||||
        if(bleedticks > 10)
 | 
					 | 
				
			||||||
            bleedticks = 10;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    /*
 | 
					 | 
				
			||||||
     * EXPLOIT PREVENTION
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public long getRespawnATS() {return respawnATS;}
 | 
					 | 
				
			||||||
    public void setRespawnATS(long newvalue) {respawnATS = (int) (newvalue/1000);}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * TOOLS
 | 
					     * Bleed Stuff
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void decreaseBleedTicks() {
 | 
				
			||||||
 | 
					        bleedticks--;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public int getBleedTicks() {
 | 
				
			||||||
 | 
					        return bleedticks;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void resetBleedTicks() {
 | 
				
			||||||
 | 
					        bleedticks = 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void addBleedTicks(int newvalue){
 | 
				
			||||||
 | 
					        bleedticks += newvalue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (bleedticks > MAX_BLEED_TICKS) {
 | 
				
			||||||
 | 
					            bleedticks = MAX_BLEED_TICKS;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * Exploit Prevention
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public long getRespawnATS() {
 | 
				
			||||||
 | 
					        return respawnATS;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void setRespawnATS(long newvalue) {
 | 
				
			||||||
 | 
					        respawnATS = (int) (newvalue / 1000);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * Tools
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -721,28 +756,7 @@ public class PlayerProfile {
 | 
				
			|||||||
     * @return the ATS for the tool
 | 
					     * @return the ATS for the tool
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public long getToolPreparationATS(ToolType tool) {
 | 
					    public long getToolPreparationATS(ToolType tool) {
 | 
				
			||||||
        switch (tool) {
 | 
					        return skillsDATS.get(tool);
 | 
				
			||||||
        case AXE:
 | 
					 | 
				
			||||||
            return axePreparationATS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case FISTS:
 | 
					 | 
				
			||||||
            return fistsPreparationATS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case HOE:
 | 
					 | 
				
			||||||
            return hoePreparationATS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case PICKAXE:
 | 
					 | 
				
			||||||
            return pickaxePreparationATS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case SHOVEL:
 | 
					 | 
				
			||||||
            return shovelPreparationATS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case SWORD:
 | 
					 | 
				
			||||||
            return swordsPreparationATS;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -752,38 +766,12 @@ public class PlayerProfile {
 | 
				
			|||||||
     * @param ATS the ATS of the tool
 | 
					     * @param ATS the ATS of the tool
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public void setToolPreparationATS(ToolType tool, long ATS) {
 | 
					    public void setToolPreparationATS(ToolType tool, long ATS) {
 | 
				
			||||||
        switch (tool) {
 | 
					        int startTime = (int) (ATS / 1000);
 | 
				
			||||||
        case AXE:
 | 
					        toolATS.put(tool, startTime);
 | 
				
			||||||
            axePreparationATS = (int) (ATS / 1000);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case FISTS:
 | 
					 | 
				
			||||||
            fistsPreparationATS = (int) (ATS / 1000);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case HOE:
 | 
					 | 
				
			||||||
            hoePreparationATS = (int) (ATS / 1000);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case PICKAXE:
 | 
					 | 
				
			||||||
            pickaxePreparationATS = (int) (ATS / 1000);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case SHOVEL:
 | 
					 | 
				
			||||||
            shovelPreparationATS = (int) (ATS / 1000);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case SWORD:
 | 
					 | 
				
			||||||
            swordsPreparationATS = (int) (ATS / 1000);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * ABILITIES
 | 
					     * Abilities
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -943,52 +931,72 @@ public class PlayerProfile {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public boolean getAbilityUse() {
 | 
				
			||||||
 | 
					        return abilityuse;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void toggleAbilityUse() {
 | 
				
			||||||
 | 
					        abilityuse = !abilityuse;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * RECENTLY HURT
 | 
					     * Recently Hurt
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public long getRecentlyHurt(){
 | 
					    public long getRecentlyHurt() {
 | 
				
			||||||
        return recentlyHurt;
 | 
					        return recentlyHurt;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void setRecentlyHurt(long newvalue){
 | 
					
 | 
				
			||||||
        recentlyHurt = (int) (newvalue/1000);
 | 
					    public void setRecentlyHurt(long newvalue) {
 | 
				
			||||||
 | 
					        recentlyHurt = (int) (newvalue / 1000);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void skillUp(SkillType skillType, int newvalue)
 | 
					
 | 
				
			||||||
    {
 | 
					    /*
 | 
				
			||||||
        skills.put(skillType, skills.get(skillType)+newvalue);
 | 
					     * Cooldowns
 | 
				
			||||||
    }
 | 
					     */
 | 
				
			||||||
    public Integer getSkillLevel(SkillType skillType)
 | 
					
 | 
				
			||||||
    {
 | 
					    /**
 | 
				
			||||||
        return skills.get(skillType);
 | 
					     * Get the current DATS of a skill.
 | 
				
			||||||
    }
 | 
					     *
 | 
				
			||||||
    public Integer getSkillXpLevel(SkillType skillType)
 | 
					     * @param abilityType Ability to get the DATS for
 | 
				
			||||||
    {
 | 
					     * @return the DATS for the ability
 | 
				
			||||||
        return skillsXp.get(skillType);
 | 
					     */
 | 
				
			||||||
    }
 | 
					    public long getSkillDATS(AbilityType abilityType) {
 | 
				
			||||||
    public void resetSkillXp(SkillType skillType)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        skills.put(skillType, 0);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    public long getSkillDATS(AbilityType abilityType)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        //Is this actually unused, or should it actually be returning the convertedBack variable?
 | 
					 | 
				
			||||||
        //It *is* unused, I don't think I put this here so I'm going to comment it out - nossr50
 | 
					 | 
				
			||||||
        //long convertedBack = skillsDATS.get(abilityType) * 1000;
 | 
					 | 
				
			||||||
        return skillsDATS.get(abilityType);
 | 
					        return skillsDATS.get(abilityType);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void setSkillDATS(AbilityType abilityType, long value)
 | 
					
 | 
				
			||||||
    {
 | 
					    /**
 | 
				
			||||||
        int wearsOff = (int) (value * .001D);
 | 
					     * Set the current DATS of a skill.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param abilityType Ability to set the DATS for
 | 
				
			||||||
 | 
					     * @param DATS the DATS of the ability
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public void setSkillDATS(AbilityType abilityType, long DATS) {
 | 
				
			||||||
 | 
					        int wearsOff = (int) (DATS * .001D);
 | 
				
			||||||
        skillsDATS.put(abilityType, wearsOff);
 | 
					        skillsDATS.put(abilityType, wearsOff);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public void resetCooldowns()
 | 
					
 | 
				
			||||||
    {
 | 
					    /**
 | 
				
			||||||
        for(AbilityType x : skillsDATS.keySet())
 | 
					     * Reset all skill cooldowns.
 | 
				
			||||||
        {
 | 
					     */
 | 
				
			||||||
 | 
					    public void resetCooldowns() {
 | 
				
			||||||
 | 
					        for (AbilityType x : skillsDATS.keySet()) {
 | 
				
			||||||
            skillsDATS.put(x, 0);
 | 
					            skillsDATS.put(x, 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * XP Functions
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public Integer getSkillLevel(SkillType skillType) {
 | 
				
			||||||
 | 
					        return skills.get(skillType);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public Integer getSkillXpLevel(SkillType skillType) {
 | 
				
			||||||
 | 
					        return skillsXp.get(skillType);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Adds XP to the player, doesn't calculate for XP Rate
 | 
					     * Adds XP to the player, doesn't calculate for XP Rate
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -1091,40 +1099,6 @@ public class PlayerProfile {
 | 
				
			|||||||
        lastgained = skillType;
 | 
					        lastgained = skillType;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * Remove XP from a skill.
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * @param skillType Type of skill to modify
 | 
					 | 
				
			||||||
     * @param xp Amount of xp to remove
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public void removeXP(SkillType skillType, int xp) {
 | 
					 | 
				
			||||||
        if (skillType.equals(SkillType.ALL)) {
 | 
					 | 
				
			||||||
            for (SkillType skill : SkillType.values()) {
 | 
					 | 
				
			||||||
                if (skill.equals(SkillType.ALL)) {
 | 
					 | 
				
			||||||
                    continue;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                skillsXp.put(skill, skillsXp.get(skill) - xp);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else {
 | 
					 | 
				
			||||||
            skillsXp.put(skillType, skillsXp.get(skillType) - xp);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void acceptInvite() {
 | 
					 | 
				
			||||||
        party = invite;
 | 
					 | 
				
			||||||
        invite = "";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void modifyInvite(String invitename) {
 | 
					 | 
				
			||||||
        invite = invitename;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public String getInvite() {
 | 
					 | 
				
			||||||
        return invite;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Modify a skill level.
 | 
					     * Modify a skill level.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -1150,8 +1124,6 @@ public class PlayerProfile {
 | 
				
			|||||||
        save();
 | 
					        save();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Add levels to a skill.
 | 
					     * Add levels to a skill.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -1177,8 +1149,6 @@ public class PlayerProfile {
 | 
				
			|||||||
        save();
 | 
					        save();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Get the amount of XP remaining before the next level.
 | 
					     * Get the amount of XP remaining before the next level.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -1189,39 +1159,50 @@ public class PlayerProfile {
 | 
				
			|||||||
        return (int) (1020 + (skills.get(skillType) *  20)); //Do we REALLY need to cast to int here?
 | 
					        return (int) (1020 + (skills.get(skillType) *  20)); //Do we REALLY need to cast to int here?
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * Party Stuff
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void acceptInvite() {
 | 
				
			||||||
 | 
					        party = invite;
 | 
				
			||||||
 | 
					        invite = "";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void modifyInvite(String invitename) {
 | 
				
			||||||
 | 
					        invite = invitename;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public String getInvite() {
 | 
				
			||||||
 | 
					        return invite;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public boolean hasPartyInvite() {
 | 
				
			||||||
 | 
					        if (invite != null && !invite.equals("") && !invite.equals("null")) {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //Store the player's party
 | 
					 | 
				
			||||||
    public void setParty(String newParty) {
 | 
					    public void setParty(String newParty) {
 | 
				
			||||||
        party = newParty;
 | 
					        party = newParty;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //Retrieve the player's party
 | 
					    public String getParty() {
 | 
				
			||||||
    public String getParty() {return party;}
 | 
					        return party;
 | 
				
			||||||
            //Remove party
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void removeParty() {
 | 
					    public void removeParty() {
 | 
				
			||||||
        party = null;
 | 
					        party = null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //Retrieve whether or not the player is in a party
 | 
					
 | 
				
			||||||
    public boolean inParty() 
 | 
					    public boolean inParty() {
 | 
				
			||||||
    {
 | 
					        if (party != null && !party.equals("") && !party.equals("null")) {
 | 
				
			||||||
        if(party != null && !party.equals("") && !party.equals("null")){
 | 
					 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        } else {
 | 
					        }
 | 
				
			||||||
 | 
					        else {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					}
 | 
				
			||||||
    //Retrieve whether or not the player has an invite
 | 
					 | 
				
			||||||
    public boolean hasPartyInvite() {
 | 
					 | 
				
			||||||
        if(invite != null && !invite.equals("") && !invite.equals("null")){
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    public String getPlayerName()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        return playerName;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}    
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -152,7 +152,7 @@ public class mcEntityListener implements Listener {
 | 
				
			|||||||
        Archery.arrowRetrievalCheck(x, plugin);
 | 
					        Archery.arrowRetrievalCheck(x, plugin);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (x instanceof Player) {
 | 
					        if (x instanceof Player) {
 | 
				
			||||||
            Users.getProfile((Player)x).setBleedTicks(0);
 | 
					            Users.getProfile((Player)x).resetBleedTicks();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -190,21 +190,22 @@ public class Skills {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public static void XpCheckSkill(SkillType skillType, Player player) {
 | 
					    public static void XpCheckSkill(SkillType skillType, Player player) {
 | 
				
			||||||
        PlayerProfile PP = Users.getProfile(player);
 | 
					        PlayerProfile PP = Users.getProfile(player);
 | 
				
			||||||
 | 
					        int skillXpLevel = PP.getSkillXpLevel(skillType);
 | 
				
			||||||
 | 
					        int xpToNextLevel = PP.getXpToLevel(skillType);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
 | 
					        if (skillXpLevel >= xpToNextLevel) {
 | 
				
			||||||
            int skillups = 0;
 | 
					            int skillups = 0;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
 | 
					            while (skillXpLevel >= xpToNextLevel) {
 | 
				
			||||||
                if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) {
 | 
					                if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) {
 | 
				
			||||||
                    skillups++;
 | 
					                    skillups++;
 | 
				
			||||||
                    PP.removeXP(skillType, PP.getXpToLevel(skillType));
 | 
					                    PP.addLevels(skillType, 1);
 | 
				
			||||||
                    PP.skillUp(skillType, 1);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
 | 
					                    McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
 | 
				
			||||||
                    Bukkit.getPluginManager().callEvent(eventToFire);
 | 
					                    Bukkit.getPluginManager().callEvent(eventToFire);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else {
 | 
					                else {
 | 
				
			||||||
                    PP.removeXP(skillType, PP.getXpToLevel(skillType));
 | 
					                    PP.addLevels(skillType, 0);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -95,7 +95,7 @@ public class Taming {
 | 
				
			|||||||
                Player target = (Player) entity;
 | 
					                Player target = (Player) entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                target.sendMessage(mcLocale.getString("Combat.StruckByGore"));
 | 
					                target.sendMessage(mcLocale.getString("Combat.StruckByGore"));
 | 
				
			||||||
                Users.getProfile(target).setBleedTicks(2);
 | 
					                Users.getProfile(target).addBleedTicks(2);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                mcBleedTimer.add((LivingEntity) entity);
 | 
					                mcBleedTimer.add((LivingEntity) entity);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user