• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PlayerAchievementAwardedEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bukkit.event.player.PlayerAchievementAwardedEvent的典型用法代码示例。如果您正苦于以下问题:Java PlayerAchievementAwardedEvent类的具体用法?Java PlayerAchievementAwardedEvent怎么用?Java PlayerAchievementAwardedEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PlayerAchievementAwardedEvent类属于org.bukkit.event.player包,在下文中一共展示了PlayerAchievementAwardedEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: load

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
public static void load() {
    Registration.registerEnum(Achievement.class, "achievement", Achievement.values())
            .document("Achievement", "1.4.10", "An achievement that a player can get. "
                    + "Note that achievements were removed in Minecraft 1.12 and thus this syntax will not work if you are running Bukkit/Spigot 1.12 and above.");
    Registration.registerEffect(EffAwardAch.class, "award achieve[ment] %achievement% to %player%")
            .document("Award Achievement", "1.4.10", "Awards the specified achievement to the specified player. "
                    + "Note that achievements were removed in Minecraft 1.12 and thus this syntax will not work if you are running Bukkit/Spigot 1.12 and above.");
    Registration.registerEffect(EffRemoveAch.class, "remove achieve[ment] %achievement% from %player%")
            .document("Remove Achievement", "1.4.10", "Removes the specified achievement from the specified player. "
                    + "Note that achievements were removed in Minecraft 1.12 and thus this syntax will not work if you are running Bukkit/Spigot 1.12 and above.");
    Registration.registerEvent("Achievement Award", EvtAchAward.class, PlayerAchievementAwardedEvent.class, "achieve[ment] [%-achievement%] award", "award of achieve[ment] [%-achievement%]")
            .document("Achievement Award", "1.4.10", "Called when a player is awarded either the specified achievement or any achievement. "
                    + "Note that achievements were removed in Minecraft 1.12 and thus this syntax will not work if you are running Bukkit/Spigot 1.12 and above.")
            .eventValue(Achievement.class, "1.4.10", "The achievement that was awarded.");
    Registration.registerEventValue(PlayerAchievementAwardedEvent.class, Achievement.class, PlayerAchievementAwardedEvent::getAchievement);
    Registration.registerExpression(ExprParentAch.class,Achievement.class, ExpressionType.PROPERTY,"parent of achieve[ment] %achievement%")
            .document("Parent of Achievement", "1.4.10", "An expression for the parent achievement of the specified achievement. "
                    + "Note that achievements were removed in Minecraft 1.12 and thus this syntax will not work if you are running Bukkit/Spigot 1.12 and above.");
    Registration.registerExpression(ExprAllAch.class,Achievement.class,ExpressionType.PROPERTY,"achieve[ment]s of %player%", "%player%'s achieve[ment]s")
            .document("Achievements of Player", "1.4.10", "An expression for a list of the achievements that the specified player has.");
    Registration.registerExpressionCondition(CondHasAch.class,ExpressionType.PROPERTY,"%player% has achieve[ment] %achievement%")
            .document("Player has Achievement", "1.4.10", "Checks whether the specified player has the specified achievement.");
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:24,代码来源:AchievementMundo.java


示例2: PlayerAchievementAwardedEvent

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void PlayerAchievementAwardedEvent(PlayerAchievementAwardedEvent event) {
    // return if achievement messages are disabled
    if (StringUtils.isBlank(LangUtil.Message.PLAYER_ACHIEVEMENT.toString())) return;

    // return if achievement or player objects are fucking knackered because this can apparently happen for some reason
    if (event == null || event.getAchievement() == null || event.getPlayer() == null) return;

    // turn "SHITTY_ACHIEVEMENT_NAME" into "Shitty Achievement Name"
    String achievementName = PrettyUtil.beautify(event.getAchievement());

    String discordMessage = LangUtil.Message.PLAYER_ACHIEVEMENT.toString()
            .replaceAll("%time%|%date%", TimeUtil.timeStamp())
            .replace("%username%", event.getPlayer().getName())
            .replace("%displayname%", event.getPlayer().getDisplayName())
            .replace("%world%", event.getPlayer().getWorld().getName())
            .replace("%achievement%", achievementName);
    if (PluginUtil.pluginHookIsEnabled("placeholderapi")) discordMessage = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(event.getPlayer(), discordMessage);

    DiscordUtil.sendMessage(DiscordSRV.getPlugin().getMainTextChannel(), DiscordUtil.strip(discordMessage));
}
 
开发者ID:Scarsz,项目名称:DiscordSRV,代码行数:22,代码来源:PlayerAchievementsListener.java


示例3: onPlayerAchievement

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler
public void onPlayerAchievement(PlayerAchievementAwardedEvent event){
	Achievement a = event.getAchievement();
	for(String s : bonusTags.keySet()){
		BonusTag t = bonusTags.get(s);
		if(t instanceof AchievementTag){
			AchievementTag tag = (AchievementTag) t;
			Achievement a2 = tag.getAchievement();
			if(a2 == a){
				String id = tag.getIdentifier();
				ArrayList<String> certs = database.getCertsOfPlayer(event.getPlayer().getUniqueId());
				if(!certs.contains(id)){
					certs.add(id);
				}
				database.updateCertsOfPlayer(event.getPlayer().getUniqueId(), certs);
				event.getPlayer().sendMessage("You have unlocked the tag " + tag.getTagFormatted() + ", do /certs tag to set it.");
				return;
			}
		}
	}
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:22,代码来源:SQRankup2.java


示例4: check

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@Override
public boolean check(Event event) {
	if (event instanceof PlayerAchievementAwardedEvent) {
		if (ach != null) {
			if (((PlayerAchievementAwardedEvent) event).getAchievement() == ach.getSingle()) return true;
			else return false;
		} else return true;
	} else return false;
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:10,代码来源:EvtAchAward.java


示例5: inventoryOpen

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler
public void inventoryOpen(PlayerAchievementAwardedEvent event) {
	event.setCancelled(true);
	if (event.getAchievement() == Achievement.OPEN_INVENTORY) {
		if (!(event.getPlayer().getGameMode().equals(GameMode.CREATIVE))) {
			Inventory inv = Bukkit.createInventory(null, 54, "NIGDY NIE DOSTANIESZ SW. EQ!");
			inv.setContents(event.getPlayer().getInventory().getContents());
			event.getPlayer().openInventory(inv);
		}
	}
}
 
开发者ID:xdev-pl,项目名称:LeagueOfLegends,代码行数:12,代码来源:PlayerAchievementAwardedList.java


示例6: achievementAwarded

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler
public void achievementAwarded(PlayerAchievementAwardedEvent a) {
	if (eA.mA.i() > 5 && eA.mA.i() < 8 && eA.mE.getIngamePlayers().contains(a.getPlayer().getName())) {
		return;
	}
	a.setCancelled(true);
}
 
开发者ID:Thomaz2Fast,项目名称:Ultra-Hardcore-1.8,代码行数:8,代码来源:EvGame.java


示例7: hideAchievement

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler
public void hideAchievement(PlayerAchievementAwardedEvent e) {
	XPlayer xp = pl.getManagers().getPlayerManager().getPlayer(e.getPlayer().getName());
	if(xp.isVanished()) {
		e.setCancelled(true);
	}
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:8,代码来源:VanishArchievementEvent.java


示例8: PlayerAchievementsListener

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
public PlayerAchievementsListener() {
    if (PlayerAchievementAwardedEvent.class.isAnnotationPresent(Deprecated.class)) return;

    Bukkit.getPluginManager().registerEvents(this, DiscordSRV.getPlugin());
}
 
开发者ID:Scarsz,项目名称:DiscordSRV,代码行数:6,代码来源:PlayerAchievementsListener.java


示例9: onPlayerAchievementAwarded

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler
public void onPlayerAchievementAwarded(PlayerAchievementAwardedEvent event) {
	if(!event.getPlayer().getUniqueId().equals(plugin.activePlayer.player.getUniqueId())) {
		event.setCancelled(true);
	}
}
 
开发者ID:freundTech,项目名称:OneSlotServer,代码行数:7,代码来源:PlayerListener.java


示例10: onAchievement

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler
public void onAchievement(PlayerAchievementAwardedEvent e) {
	e.setCancelled(true);
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:5,代码来源:AchievementEvent.java


示例11: achievementEvent

import org.bukkit.event.player.PlayerAchievementAwardedEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void achievementEvent(final PlayerAchievementAwardedEvent e) {
	
}
 
开发者ID:RichardsProjects,项目名称:AutismChat3,代码行数:5,代码来源:AchievementEvent.java



注:本文中的org.bukkit.event.player.PlayerAchievementAwardedEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QzoneShare类代码示例发布时间:2022-05-21
下一篇:
Java ISharedTextColors类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap