当前位置: 首页>>代码示例>>Java>>正文


Java PlayerEggThrowEvent.getPlayer方法代码示例

本文整理汇总了Java中org.bukkit.event.player.PlayerEggThrowEvent.getPlayer方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerEggThrowEvent.getPlayer方法的具体用法?Java PlayerEggThrowEvent.getPlayer怎么用?Java PlayerEggThrowEvent.getPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.event.player.PlayerEggThrowEvent的用法示例。


在下文中一共展示了PlayerEggThrowEvent.getPlayer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEggThrow

import org.bukkit.event.player.PlayerEggThrowEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onEggThrow(final PlayerEggThrowEvent event) {

	final PlayerStat stat = PlayerStat.EGGS_THROWN;

	// Get player
	final Player player = (Player) event.getPlayer();

	// Do general check
	if (!plugin.doGeneralCheck(player, stat))
		return;

	// Update value to new stat.
	plugin.getDataManager().setPlayerInfo(player.getUniqueId(), stat, StatzUtil.makeQuery("uuid",
			player.getUniqueId().toString(), "value", 1, "world", player.getWorld().getName()));

}
 
开发者ID:Staartvin,项目名称:Statz,代码行数:18,代码来源:EggsThrownListener.java

示例2: onEgg

import org.bukkit.event.player.PlayerEggThrowEvent; //导入方法依赖的package包/类
@EventHandler
public void onEgg(PlayerEggThrowEvent e){
    Player p = e.getPlayer();

    if (p.getInventory().getItemInMainHand() == null) return;
    if (!p.getInventory().getItemInMainHand().hasItemMeta() || !p.getInventory().getItemInMainHand().getItemMeta().hasDisplayName()) return;
    if (p.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equalsIgnoreCase(pe.getPokeEgg().getItemMeta().getDisplayName())) {
        e.setHatching(false);
    }
}
 
开发者ID:cadox8,项目名称:WC,代码行数:11,代码来源:CatchMob.java

示例3: PlayerTrownEgg

import org.bukkit.event.player.PlayerEggThrowEvent; //导入方法依赖的package包/类
@EventHandler
public void PlayerTrownEgg(PlayerEggThrowEvent e){
	Location l = e.getEgg().getLocation();
	Player p = e.getPlayer();
	Region r = RedProtect.get().rm.getTopRegion(l);
	
	if (r != null && !r.canBuild(p)){
		e.setHatching(false);
		RPLang.sendMessage(p, "playerlistener.region.canthatch");
	}
}
 
开发者ID:FabioZumbi12,项目名称:RedProtect,代码行数:12,代码来源:RPPlayerListener.java

示例4: onPlayerEggThrow

import org.bukkit.event.player.PlayerEggThrowEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerEggThrow(final PlayerEggThrowEvent e) {
    final Location l = BukkitUtil.getLocation(e.getEgg().getLocation());
    if (PlotSquared.isPlotWorld(l.getWorld())) {
        final Player p = e.getPlayer();
        final PlotPlayer pp = BukkitUtil.getPlayer(p);
        Plot plot = MainUtil.getPlot(l);
        if (plot == null) {
            if (!MainUtil.isPlotAreaAbs(l)) {
                return;
            }
            if (!Permissions.hasPermission(pp, "plots.admin.projectile.road")) {
                MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.projectile.road");
                e.setHatching(false);
                return;
            }
        } else {
            if (!plot.hasOwner()) {
                if (!Permissions.hasPermission(pp, "plots.admin.projectile.unowned")) {
                    MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.projectile.unowned");
                    e.setHatching(false);
                    return;
                }
            } else if (!plot.isAdded(pp.getUUID())) {
                if (!Permissions.hasPermission(pp, "plots.admin.projectile.other")) {
                    if (MainUtil.isPlotArea(l)) {
                        MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.projectile.other");
                        e.setHatching(false);
                        return;
                    }
                }
            }
        }
    }
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:36,代码来源:PlayerEvents.java

示例5: onEgg

import org.bukkit.event.player.PlayerEggThrowEvent; //导入方法依赖的package包/类
@EventHandler
public void onEgg(PlayerEggThrowEvent e) {
    if (!hatchingEnabled || e.getPlayer() == null || !plugin.isSkyAssociatedWorld(e.getPlayer().getWorld())) {
        return;
    }
    if (!plugin.playerIsOnIsland(e.getPlayer())) {
        e.setHatching(false);
    }
}
 
开发者ID:rlf,项目名称:uSkyBlock,代码行数:10,代码来源:GriefEvents.java

示例6: onPlayerEggThrow

import org.bukkit.event.player.PlayerEggThrowEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerEggThrow(PlayerEggThrowEvent event) {
    Location l = BukkitUtil.getLocation(event.getEgg().getLocation());
    PlotArea area = l.getPlotArea();
    if (area == null) {
        return;
    }
    Player player = event.getPlayer();
    PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
    Plot plot = area.getPlot(l);
    if (plot == null) {
        if (!Permissions.hasPermission(plotPlayer, "plots.admin.projectile.road")) {
            MainUtil.sendMessage(plotPlayer, C.NO_PERMISSION_EVENT, "plots.admin.projectile.road");
            event.setHatching(false);
        }
    } else if (!plot.hasOwner()) {
        if (!Permissions.hasPermission(plotPlayer, "plots.admin.projectile.unowned")) {
            MainUtil.sendMessage(plotPlayer, C.NO_PERMISSION_EVENT, "plots.admin.projectile.unowned");
            event.setHatching(false);
        }
    } else if (!plot.isAdded(plotPlayer.getUUID())) {
        if (!Permissions.hasPermission(plotPlayer, "plots.admin.projectile.other")) {
            MainUtil.sendMessage(plotPlayer, C.NO_PERMISSION_EVENT, "plots.admin.projectile.other");
            event.setHatching(false);
        }
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:28,代码来源:PlayerEvents.java


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