mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-26 02:28:03 +01:00
More config options for XP bars
This commit is contained in:
parent
92b8d13c71
commit
cf6d95b575
@ -1,4 +1,39 @@
|
||||
package com.gmail.nossr50.runnables.skills;
|
||||
|
||||
public class ExperienceBarHideTask {
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.util.experience.ExperienceBarManager;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class ExperienceBarHideTask extends BukkitRunnable {
|
||||
public final McMMOPlayer mcMMOPlayer;
|
||||
public final PrimarySkillType primarySkillType;
|
||||
public final ExperienceBarManager experienceBarManagerRef;
|
||||
|
||||
public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType)
|
||||
{
|
||||
this.experienceBarManagerRef = experienceBarManagerRef;
|
||||
this.mcMMOPlayer = mcMMOPlayer;
|
||||
this.primarySkillType = primarySkillType;
|
||||
}
|
||||
|
||||
/**
|
||||
* When an object implementing interface <code>Runnable</code> is used
|
||||
* to create a thread, starting the thread causes the object's
|
||||
* <code>run</code> method to be called in that separately executing
|
||||
* thread.
|
||||
* <p>
|
||||
* The general contract of the method <code>run</code> is that it may
|
||||
* take any action whatsoever.
|
||||
*
|
||||
* @see Thread#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
if(experienceBarManagerRef == null || mcMMOPlayer == null)
|
||||
return;
|
||||
|
||||
experienceBarManagerRef.hideExperienceBar(primarySkillType);
|
||||
experienceBarManagerRef.clearTask(primarySkillType);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user