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


Java Material.DROPPER属性代码示例

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


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

示例1: onPlaceDropper

@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlaceDropper(final BlockPlaceEvent e) {
	if (!cm.tileLimitEnabled) {
		return;
	}
	if (e.getBlock().getType() == Material.DROPPER) {
		Player p = e.getPlayer();
		if (p.isOp()) {
			return;
		}
		int limit = NeverLagUtils.getMaxPermission(p, "neverlag.limit.dropper.");
		if (limit <= 0) {
			limit = cm.tileLimitDefaultDropper;
		}
		if (isLimit(e.getBlock().getLocation(), Material.DROPPER, limit)) {
			e.setCancelled(true);
			p.sendMessage(i18n.tr("message", limit));
		}
	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:20,代码来源:TilesLimiter.java

示例2: onPlace

@EventHandler
public void onPlace(BlockPlaceEvent e){
    WCUser p = WCSurvival.getPlayer(e.getPlayer());

    if (e.getBlock().getType() == Material.DROPPER && plugin.getCreando().contains(p.getPlayer())){
        if (plugin.getCasinos().contains(e.getBlock().getLocation())) {
            p.sendMessagePrefix(ChatColor.RED + "Este espacio esta ocupado por otra maquina");
            return;
        }
        plugin.getCreando().remove(p.getPlayer());
        plugin.getFiles().getConfig().set("casino.id_" + plugin.getFiles().getID(), Utils.locationToString(e.getBlock().getLocation()));
        plugin.getFiles().saveFiles();
        p.sendMessagePrefix(ChatColor.GREEN + "Máquina añadida " + plugin.getFiles().getCurrentID());
        plugin.getCasinos().add(e.getBlock().getLocation());
    }
}
 
开发者ID:cadox8,项目名称:WC,代码行数:16,代码来源:PlayerEvent.java

示例3: BlockPlaceEvent

@EventHandler
public void BlockPlaceEvent(BlockPlaceEvent e){
    Player p = e.getPlayer();
    Block b = e.getBlock();

    if (e.getItemInHand().getType() == Material.DROPPER && e.getItemInHand().getEnchantments() != null && e.getItemInHand().getEnchantments().containsKey(Enchantment.ARROW_DAMAGE)) {
        Casino c = new Casino(e.getBlockPlaced().getLocation());
        c.effect();
    }

    for(Entity en : p.getNearbyEntities (4D, 4D, 4D)){
        if (en instanceof Player){
            if(en == p) continue;
            if(b.getType() == Material.FIRE){

                if(Files.user.getBoolean("Users." + en.getName() + ".pvp") == false){
                    p.sendMessage(Utils.colorize(PAData.SURVIVAL.getPrefix() + ChatColor.DARK_RED + " No puedes poner ese bloque cerca de un jugador con el pvp desactivado."));
                    e.setCancelled(true);
                }
            }
        }
    }
}
 
开发者ID:cadox8,项目名称:PA,代码行数:23,代码来源:PlayerEvents.java

示例4: onInteract

@EventHandler
public void onInteract(PlayerInteractEvent e) {
    final TOAUser u = TOA.getPlayer(e.getPlayer());

    if (e.getItem() != null) {
        Material m = e.getItem().getType();
        if (m == Material.WRITTEN_BOOK || m == Material.BOW || m == Material.SHEARS || m == Material.DIAMOND_SWORD) return;
        Ability.useAbility(u, e.getItem().getType());
        e.setCancelled(true);
    }

    if (!u.isOnRank(PACmd.Grupo.Builder)) {
        if (e.getClickedBlock() != null) {
            if (e.getClickedBlock().getType().equals(Material.TRAP_DOOR) || e.getClickedBlock().getType().equals(Material.IRON_TRAPDOOR)
                    || e.getClickedBlock().getType().equals(Material.FENCE_GATE) || e.getClickedBlock().getType().equals(Material.FIRE)
                    || e.getClickedBlock().getType().equals(Material.CAULDRON) || e.getClickedBlock().getRelative(BlockFace.UP).getType().equals(Material.FIRE)
                    || e.getClickedBlock().getType() == Material.CHEST || e.getClickedBlock().getType() == Material.TRAPPED_CHEST
                    || e.getClickedBlock().getType() == Material.DROPPER || e.getClickedBlock().getType() == Material.DISPENSER
                    || e.getClickedBlock().getType() == Material.BED_BLOCK || e.getClickedBlock().getType() == Material.BED
                    || e.getClickedBlock().getType() == Material.WORKBENCH || e.getClickedBlock().getType() == Material.BREWING_STAND
                    || e.getClickedBlock().getType() == Material.ANVIL || e.getClickedBlock().getType() == Material.DARK_OAK_FENCE_GATE
                    || e.getClickedBlock().getType() == Material.SPRUCE_FENCE_GATE || e.getClickedBlock().getType() == Material.FURNACE
                    || e.getClickedBlock().getType() == Material.BURNING_FURNACE || e.getClickedBlock().getType() == Material.HOPPER
                    || e.getClickedBlock().getType() == Material.STONE_BUTTON || e.getClickedBlock().getType() == Material.WOOD_BUTTON) {
                e.setCancelled(true);
            }
        }
    }
}
 
开发者ID:cadox8,项目名称:PA,代码行数:29,代码来源:GameEvents.java

示例5: CustomCrafter

public CustomCrafter(ItemStack[] a) {
	super(a, new ItemStack(Material.DROPPER));
	ncon = "container.dropper";
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:4,代码来源:CustomCrafter.java

示例6: isDupeBlock

@SuppressWarnings("deprecation")
private boolean isDupeBlock(Material type) {
	return Material.PISTON_EXTENSION == type || Material.PISTON_STICKY_BASE == type || Material.PISTON_BASE == type
		|| Material.PISTON_MOVING_PIECE == type || Material.PUMPKIN == type || Material.DISPENSER == type
		|| Material.DROPPER == type || type.getId() == 165;
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:6,代码来源:AntiInfiniteRail.java

示例7: onInteract

@EventHandler
public void onInteract(PlayerInteractEvent e) {
    PAUser u = PAServer.getUser(e.getPlayer());

    if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
        if (e.getItem() == null) return;
        e.setCancelled(true);
        if (Cosmetic.useCosmetic(u, e.getItem().getType())) return;

        switch (e.getItem().getType()) {
            case NETHER_STAR:
                e.setCancelled(true);
                LobbyMenu.openMenu(u, LobbyMenu.MenuType.SERVERS);
                break;
            case REDSTONE:
                e.setCancelled(true);
                u.sendMessage(PAData.LOBBY.getPrefix() + "&cNo estamos listos aún");
                //LobbyMenu.openMenu(u, LobbyMenu.MenuType.COSMETICOS);
                break;
            case WOOD_AXE:
                e.setCancelled(true);
                u.sendToServer("cons");
                break;
        }

        if (e.getClickedBlock() == null) return;
        if (e.getClickedBlock().getType() == Material.ENCHANTMENT_TABLE) {
            e.setCancelled(true);
            u.sendMessage(PAData.LOBBY.getPrefix() + "&cActualmente estamos trabajando en esto, disculpen las molestias");
        }
    }

    if (!u.isOnRank(PACmd.Grupo.Builder)) {
        if (e.getClickedBlock() != null) {
            if (e.getClickedBlock().getType().equals(Material.TRAP_DOOR) || e.getClickedBlock().getType().equals(Material.IRON_TRAPDOOR)
                    || e.getClickedBlock().getType().equals(Material.FENCE_GATE) || e.getClickedBlock().getType().equals(Material.FIRE)
                    || e.getClickedBlock().getType().equals(Material.CAULDRON) || e.getClickedBlock().getRelative(BlockFace.UP).getType().equals(Material.FIRE)
                    || e.getClickedBlock().getType() == Material.CHEST || e.getClickedBlock().getType() == Material.TRAPPED_CHEST
                    || e.getClickedBlock().getType() == Material.DROPPER || e.getClickedBlock().getType() == Material.DISPENSER
                    || e.getClickedBlock().getType() == Material.BED_BLOCK || e.getClickedBlock().getType() == Material.BED
                    || e.getClickedBlock().getType() == Material.WORKBENCH || e.getClickedBlock().getType() == Material.BREWING_STAND
                    || e.getClickedBlock().getType() == Material.ANVIL || e.getClickedBlock().getType() == Material.DARK_OAK_FENCE_GATE
                    || e.getClickedBlock().getType() == Material.SPRUCE_FENCE_GATE || e.getClickedBlock().getType() == Material.FURNACE
                    || e.getClickedBlock().getType() == Material.BURNING_FURNACE || e.getClickedBlock().getType() == Material.HOPPER
                    || e.getClickedBlock().getType() == Material.STONE_BUTTON || e.getClickedBlock().getType() == Material.WOOD_BUTTON) {
                e.setCancelled(true);
            }
        }
    }
}
 
开发者ID:cadox8,项目名称:PA,代码行数:50,代码来源:PlayerEvents.java


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