org.bukkit.Achievement Java Examples

The following examples show how to use org.bukkit.Achievement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrettyUtil.java    From DiscordSRV with GNU General Public License v3.0 5 votes vote down vote up
/**
 * turn "ACHIEVEMENT_NAME" into "Achievement Name"
 * @param achievement achievement to beautify
 * @return pretty achievement name
 */
@SuppressWarnings("deprecation")
public static String beautify(Achievement achievement) {
    if (achievement == null) return "<✗>";

    return Arrays.stream(achievement.name().toLowerCase().split("_"))
            .map(s -> s.substring(0, 1).toUpperCase() + s.substring(1))
            .collect(Collectors.joining(" "));
}
 
Example #2
Source File: PlayerAchievementAwardedEvent.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public PlayerAchievementAwardedEvent(Player player, Achievement achievement) {
    super(player);
    this.achievement = achievement;
}
 
Example #3
Source File: CraftStatistic.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public static org.bukkit.Achievement getBukkitAchievement(net.minecraft.stats.Achievement achievement) {
    return getBukkitAchievementByName(achievement.statId);
}
 
Example #4
Source File: CraftStatistic.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public static org.bukkit.Achievement getBukkitAchievementByName(String name) {
    return achievements.get(name);
}
 
Example #5
Source File: CraftStatistic.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public static net.minecraft.stats.Achievement getNMSAchievement(org.bukkit.Achievement achievement) {
    return (net.minecraft.stats.Achievement) StatList.func_151177_a(achievements.inverse().get(achievement));
}
 
Example #6
Source File: CraftMagicNumbers.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Achievement getAchievementFromInternalName(String name) {
    return CraftStatistic.getBukkitAchievementByName(name);
}
 
Example #7
Source File: PlayerAchievementAwardedEvent.java    From Kettle with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets the Achievement being awarded.
 *
 * @return the achievement being awarded
 */
public Achievement getAchievement() {
    return achievement;
}