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


Java PlayerShearEntityEvent.setCancelled方法代码示例

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


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

示例1: onShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onShear(final PlayerShearEntityEvent e) {
    if (DEBUG) {
        plugin.getLogger().info(e.getEventName());
    }
    if (Util.inWorld(e.getPlayer())) {
        if (actionAllowed(e.getPlayer(), e.getEntity().getLocation(), SettingsFlag.SHEARING)) {
            return;
        }
        // Not allowed
        Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
        e.setCancelled(true);
    }
}
 
开发者ID:tastybento,项目名称:bskyblock,代码行数:15,代码来源:IslandGuard.java

示例2: onShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler
public void onShear(PlayerShearEntityEvent e) {

KingdomFactionsPlayer p = PlayerModule.getInstance().getPlayer(e.getPlayer());
if(p.getSettingsProfile().hasAdminMode()) return;
if(!p.canBuild(e.getEntity().getLocation())) {
	e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 100));
} 
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:10,代码来源:PlayerShearEventListener.java

示例3: onShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
/**
 * Prevents shearing outside the game area
 * @param event
 */
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onShear(final PlayerShearEntityEvent event) {
    if (event.getEntity().getWorld().equals(getBeaconzWorld())) {
        if (getGameMgr().getGame(event.getEntity().getLocation()) == null) {
            event.setCancelled(true);
            event.getPlayer().sendMessage(ChatColor.RED + Lang.errorYouCannotDoThat);
        }
    }
}
 
开发者ID:tastybento,项目名称:beaconz,代码行数:14,代码来源:PlayerMovementListener.java

示例4: onShearEvent

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler
public void onShearEvent(PlayerShearEntityEvent event) {
    Player player = event.getPlayer();
    if (!shearingEnabled || !plugin.isSkyAssociatedWorld(player.getWorld())) {
        return; // Not our concern
    }
    if (hasPermission(player, "usb.mod.bypassprotection")) {
        return;
    }
    if (!plugin.playerIsOnIsland(player)) {
        event.setCancelled(true);
    }
}
 
开发者ID:rlf,项目名称:uSkyBlock,代码行数:14,代码来源:GriefEvents.java

示例5: onPlayerShearEntity

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
/**
 * Used to prevent our tool from shearing sheeps or mushroom cows.
 * <p>
 * The cow seems to disappear, a relog fix that. Cannot be fixed on our side
 * (Minecraft or CBukkit bug).
 */
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerShearEntity(PlayerShearEntityEvent ev)
{
    if (BelovedBlocks.getToolsManager().getFromItem(ev.getPlayer().getItemInHand()) instanceof StoneCutter)
    {
        ev.setCancelled(true);
    }
}
 
开发者ID:zDevelopers,项目名称:BelovedBlocks,代码行数:15,代码来源:BlocksListener.java

示例6: onShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onShear(final PlayerShearEntityEvent e) {
    if (DEBUG) {
        plugin.getLogger().info(e.getEventName());
    }
    if (inWorld(e.getPlayer())) {
        if (actionAllowed(e.getPlayer(), e.getEntity().getLocation(), SettingsFlag.SHEARING)) {
            return;
        }
        // Not allowed
        Util.sendMessage(e.getPlayer(), ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
        e.setCancelled(true);
        return;
    }
}
 
开发者ID:tastybento,项目名称:acidisland,代码行数:16,代码来源:IslandGuard.java

示例7: PlayerShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
public void PlayerShear(final PlayerShearEntityEvent event)
{
	if (!(event.getEntity() instanceof Player))
		return;
	final Player player = (Player) event.getEntity();
	if (plugin.isLoggedIn(player))
		return;
	event.setCancelled(true);
}
 
开发者ID:ST-DDT,项目名称:CrazyLogin,代码行数:11,代码来源:DynamicPlayerListener.java

示例8: onPlayerShearEntity

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerShearEntity(final PlayerShearEntityEvent event) {
    final GeneralRegion cuboid = this.getPlugin().getDb().getPriorByLocation(event.getEntity().getLocation());
    if (cuboid != null && cuboid.getFlag(Flag.FARM) && !cuboid.isUser(event.getPlayer())) {
        event.setCancelled(true);
    }
}
 
开发者ID:Ribesg,项目名称:NPlugins,代码行数:8,代码来源:FarmFlagListener.java

示例9: onPlayerShearEntity

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerShearEntity(PlayerShearEntityEvent event) {
	Player p = event.getPlayer();
	ArenaManager am = SimpleSurvivalGames.instance.getArenaManager();
	
	// Is the current player playing
	if(am.isInArena(p)) {
		ArenaPlayer ap = am.getPlayer(p);
		
		// Is the player in the lobby of the arena
		if(ap.isInLobby()) {
			
			// Has the player a arena spawn assigned
			if(ap.hasAssignedAreanSpawn()) {
				
				// Cancel the event and send a status message
				event.setCancelled(true);
				p.sendMessage(ChatColor.DARK_RED + "It's a shame to make this sheep naked inside the lobby of an arena!");
			}
		}

		// Is the player an spectators
		if(ap.isSpectator()) {
			event.setCancelled(true);
			ap.sendMessage(ChatColor.DARK_RED + "You can't make this sheep naked while spectating!");
		}
	}
}
 
开发者ID:timvisee,项目名称:simple-survival-games,代码行数:29,代码来源:SSGPlayerListener.java

示例10: onPlayerShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
/**
 * Handler that prevents sheep shearing
 *
 * @param e The event
 */
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerShear(PlayerShearEntityEvent e) {
    if (e.getEntity() instanceof Sheep && isFromParty(e.getEntity())) {
        e.setCancelled(true);
    }
}
 
开发者ID:Gibstick,项目名称:DiscoSheep,代码行数:12,代码来源:PartyEvents.java

示例11: onShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler
public void onShear(PlayerShearEntityEvent event) {
    event.setCancelled(true);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:5,代码来源:EnvironmentManager.java

示例12: onPlayerShear

import org.bukkit.event.player.PlayerShearEntityEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onPlayerShear(PlayerShearEntityEvent event) {
    if (listenerService.shouldCancelEvent(event)) {
        event.setCancelled(true);
    }
}
 
开发者ID:AuthMe,项目名称:AuthMeReloaded,代码行数:7,代码来源:PlayerListener.java


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