-
-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mcMMO now alerts you when you progress in a skill
- Loading branch information
Showing
12 changed files
with
155 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/com/gmail/nossr50/runnables/skills/SkillUnlockNotificationTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.gmail.nossr50.runnables.skills; | ||
|
||
import com.gmail.nossr50.datatypes.player.McMMOPlayer; | ||
import com.gmail.nossr50.datatypes.skills.SubSkillType; | ||
import com.gmail.nossr50.util.player.NotificationManager; | ||
import org.bukkit.scheduler.BukkitRunnable; | ||
|
||
|
||
public class SkillUnlockNotificationTask extends BukkitRunnable { | ||
private McMMOPlayer mcMMOPlayer; | ||
private SubSkillType subSkillType; | ||
private int rank; | ||
/** | ||
* Notify a player about a newly unlocked subskill | ||
* @param mcMMOPlayer target player | ||
* @param subSkillType the subskill that they just unlocked | ||
* @param rank the rank of the subskill | ||
*/ | ||
public SkillUnlockNotificationTask(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType, int rank) | ||
{ | ||
this.mcMMOPlayer = mcMMOPlayer; | ||
this.subSkillType = subSkillType; | ||
this.rank = rank; | ||
} | ||
/** | ||
* 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() { | ||
//mcMMOPlayer.getPlayer().sendTitle(subSkillType.getLocaleName(), "Rank "+rank, 7, 20, 7); | ||
NotificationManager.sendPlayerUnlockNotification(mcMMOPlayer, subSkillType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96742e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!