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


Java PlayerArmorStandManipulateEvent类代码示例

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


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

示例1: handle

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void handle(PlayerArmorStandManipulateEvent e)
{
    MobSelector.MobImpl mob = CollectionWrapper.filter(MobSelector.getInstance().getMobs().values(), new Acceptable<MobSelector.MobImpl>() {
        @Override
        public boolean isAccepted(MobSelector.MobImpl value)
        {
            try
            {
                return e.getRightClicked().getEntityId() == (int) value.getDisplayMessage().getClass().getMethod("getEntityId").invoke(value.getDisplayMessage());
            } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e1)
            {
                return false;
            }
        }
    });
    if (mob != null)
    {
        e.setCancelled(true);
    }
}
 
开发者ID:Dytanic,项目名称:CloudNet,代码行数:22,代码来源:ArmorStandListener.java

示例2: ArmorStandGreef

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void ArmorStandGreef(PlayerArmorStandManipulateEvent e){
	if(e.getRightClicked() instanceof ArmorStand){
		ArmorStand clickedA = (ArmorStand) e.getRightClicked();
		if(clickedA.getPassenger() == null){
			ArrayList<Location> all_main_seats = new ArrayList<Location>();
			for(attractie att : Main.r.Attracties.values()){
				for(ArmorStand a : att.getMainSeats())
				{
					all_main_seats.add(a.getLocation());
				}
			}
			if(all_main_seats.contains(clickedA.getLocation())){
				e.setCancelled(true);
			}
		}
	}
}
 
开发者ID:LimitedDani,项目名称:Achtbaan,代码行数:19,代码来源:EntityClick_Listener.java

示例3: onArmorStandManupulation

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void onArmorStandManupulation(PlayerArmorStandManipulateEvent e) {
	KingdomFactionsPlayer p = PlayerModule.getInstance().getPlayer(e.getPlayer());
	if(p.isVanished()) return;
	if(e.isCancelled()) return;
	if(e.getRightClicked() == null) return;
	if(!p.canBuild(e.getRightClicked().getLocation())) {
		e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 200));
	} 
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:11,代码来源:BuildEventListener.java

示例4: ArmorStandGreef

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void ArmorStandGreef(PlayerArmorStandManipulateEvent e){
	if(e.getRightClicked() instanceof ArmorStand){
		ArmorStand clickedA = (ArmorStand) e.getRightClicked();
		if(clickedA.getPassenger() == null){
			ArrayList<ArmorStand> all_main_seats = new ArrayList<ArmorStand>();
			for(Rollercoaster att : Main.r.Attracties.values()){
				all_main_seats.addAll(att.getMainSeats());
			}
			if(all_main_seats.contains(clickedA)){
				e.setCancelled(true);
			}
		}
	}
}
 
开发者ID:LimitedDani,项目名称:Achtbaan,代码行数:16,代码来源:EntityClick_Listener.java

示例5: ArmorStandGreef

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void ArmorStandGreef(PlayerArmorStandManipulateEvent e){
	if(e.getRightClicked() instanceof ArmorStand){
		ArmorStand clickedA = (ArmorStand) e.getRightClicked();
		if(clickedA.getPassenger() == null){
			ArrayList<ArmorStand> all_main_seats = new ArrayList<ArmorStand>();
			for(attractie att : Main.r.Attracties.values()){
				all_main_seats.addAll(att.getMainSeats());
			}
			if(all_main_seats.contains(clickedA)){
				e.setCancelled(true);
			}
		}
	}
}
 
开发者ID:LimitedDani,项目名称:Achtbaan,代码行数:16,代码来源:EntityClick_Listener.java

示例6: onPlayerManipulateArmorStand

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onPlayerManipulateArmorStand(PlayerArmorStandManipulateEvent e) {
    // When clicking an armor stand with an armor item, the armor stand will take it.
    // As a hologram consists of armor stands, they would also take the item.
    ArmorStand armorStand = e.getRightClicked();
    if (Hologram.isPartOfHologram(armorStand)) {
        e.setCancelled(true);
    }
}
 
开发者ID:EpicEricEE,项目名称:ShopChest,代码行数:10,代码来源:ShopInteractListener.java

示例7: onPlayerManipulateArmorStand

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
/**
 * Handles editing items on an ArmorStand
 *
 * @param event The event
 */
@EventHandler
public void onPlayerManipulateArmorStand(PlayerArmorStandManipulateEvent event) {
	Player player = event.getPlayer();
	NovaPlayer nPlayer = PlayerManager.getPlayer(player);
	Location location = event.getRightClicked().getLocation();

	if(RegionManager.get(location) != null
			&& (!plugin.getRegionManager().canInteract(player, location) || (!nPlayer.getPreferences().getBypass() && !nPlayer.hasPermission(GuildPermission.INTERACT)))) {
		event.setCancelled(true);
		Message.CHAT_REGION_DENY_INTERACT.send(player);
	}
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:18,代码来源:RegionInteractListener.java

示例8: onArmorStand

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void onArmorStand(PlayerArmorStandManipulateEvent event) {
    Location location = BukkitUtil.adapt(event.getRightClicked().getLocation());

    if (manager.isPlotWorld(location)) {
        if (event.getPlayer().hasPermission(PermissionNames.ADMIN_BUILDANYWHERE)) {
            return;
        }

        Plot plot = manager.getPlot(location);

        if (plot == null) {
            event.getPlayer().sendMessage(api.C("CannotBuild"));
            event.setCancelled(true);
        } else {
            if (plot.getOwnerId().equals(event.getPlayer().getUniqueId())) {
                return;
            }
            Optional<Plot.AccessLevel> member = plot.isMember(event.getPlayer().getUniqueId());
            if (member.isPresent()) {
                if (member.get().equals(Plot.AccessLevel.TRUSTED) && !api.getServerBridge().getOfflinePlayer(plot.getOwnerId()).isOnline()) {
                    event.getPlayer().sendMessage(api.C("CannotBuild"));
                    event.setCancelled(true);
                } else if (api.isPlotLocked(plot.getId())) {
                    event.getPlayer().sendMessage(api.C("PlotLocked"));
                    event.setCancelled(true);
                }
            } else {
                event.getPlayer().sendMessage(api.C("CannotBuild"));
                event.setCancelled(true);
            }
        }
    }
}
 
开发者ID:WorldCretornica,项目名称:PlotMe-Core,代码行数:35,代码来源:BukkitPlotListener.java

示例9: onArmorStandManip

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void onArmorStandManip(final PlayerArmorStandManipulateEvent event) {
	debug("PlayerArmorStandManipulateEvent(" + event.getPlayer().getName() + ", " + event.getRightClicked().getType() + ", "
			+ event.getArmorStandItem().getType() + ", " + event.getPlayerItem() + ")");

	final ArmorStand entity = event.getRightClicked();
	if (!canInteract(entity, event.getPlayer())) { debug("CANCELLED!"); event.setCancelled(true); }
	else { debug("ALLOWED!"); }
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:10,代码来源:EntityProtectionBreakListener.java

示例10: a

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
private void a(EntityHuman entityhuman, EnumItemSlot enumitemslot, @Nullable ItemStack itemstack, EnumHand enumhand) {
    ItemStack itemstack1 = this.getEquipment(enumitemslot);

    if (itemstack1 == null || (this.bA & 1 << enumitemslot.c() + 8) == 0) {
        if (itemstack1 != null || (this.bA & 1 << enumitemslot.c() + 16) == 0) {
            ItemStack itemstack2;
            // CraftBukkit start
            org.bukkit.inventory.ItemStack armorStandItem = CraftItemStack.asCraftMirror(itemstack1);
            org.bukkit.inventory.ItemStack playerHeldItem = CraftItemStack.asCraftMirror(itemstack);

            Player player = (Player) entityhuman.getBukkitEntity();
            ArmorStand self = (ArmorStand) this.getBukkitEntity();

            EquipmentSlot slot = CraftEquipmentSlot.getSlot(enumitemslot);
            PlayerArmorStandManipulateEvent armorStandManipulateEvent = new PlayerArmorStandManipulateEvent(player,self,playerHeldItem,armorStandItem,slot);
            this.world.getServer().getPluginManager().callEvent(armorStandManipulateEvent);

            if (armorStandManipulateEvent.isCancelled()) {
                return;
            }
            // CraftBukkit end

            if (entityhuman.abilities.canInstantlyBuild && (itemstack1 == null || itemstack1.getItem() == Item.getItemOf(Blocks.AIR)) && itemstack != null) {
                itemstack2 = itemstack.cloneItemStack();
                itemstack2.count = 1;
                this.setSlot(enumitemslot, itemstack2);
            } else if (itemstack != null && itemstack.count > 1) {
                if (itemstack1 == null) {
                    itemstack2 = itemstack.cloneItemStack();
                    itemstack2.count = 1;
                    this.setSlot(enumitemslot, itemstack2);
                    --itemstack.count;
                }
            } else {
                this.setSlot(enumitemslot, itemstack);
                entityhuman.a(enumhand, itemstack1);
            }
        }
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:41,代码来源:EntityArmorStand.java

示例11: onPlayerArmorStandManipulate

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

示例12: onEntityManipulate

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void onEntityManipulate(PlayerArmorStandManipulateEvent event) {
    if(event.getRightClicked().getUniqueId() == entity.getUniqueId())
        event.setCancelled(true);
}
 
开发者ID:ArcadiaPlugins,项目名称:Arcadia-Spigot,代码行数:6,代码来源:Freeze.java

示例13: onArmorStandInteract

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onArmorStandInteract(final PlayerArmorStandManipulateEvent event) {
    cancelUnlessInteracting(event, event.getPlayer());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:EventFilterMatchModule.java

示例14: onArmorStandEdit

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void onArmorStandEdit(PlayerArmorStandManipulateEvent event)
{
    if (!this.canDoAction(event.getPlayer()))
        event.setCancelled(true);
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:7,代码来源:EntityEditionListener.java

示例15: onArmorStandManipulate

import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入依赖的package包/类
@EventHandler
public void onArmorStandManipulate(PlayerArmorStandManipulateEvent event) {
    forbidIfInProtectedTerritory(event.getPlayer(), event.getRightClicked(), event, EQUIP);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:EntityProtectionListener.java


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