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


Java Material.LAVA_BUCKET属性代码示例

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


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

示例1: onInteract

@EventHandler
public void onInteract(PlayerBucketEmptyEvent e){
	Player p = e.getPlayer();
	for(Entity en : p.getNearbyEntities (4D, 4D, 4D)){
		if (en instanceof Player){
			if(en == p) continue;
			if(e.getBucket() == Material.LAVA_BUCKET){
				
				if(Files.user.getBoolean("Users." + en.getName() + ".pvp") == false){
						p.sendMessage(Message.prefix + ChatColor.DARK_RED + " No puedes poner ese bloque cerca de un jugador con el pvp desactivado.");
						e.setCancelled(true);
				}
			}
		}
	}
}
 
开发者ID:cadox8,项目名称:WC,代码行数:16,代码来源:PlayerEvent.java

示例2: isInteractableItem

/**
 * checks if this item is interactable
 */
public static boolean isInteractableItem(ItemStack item) {
	if (item == null || item.getType() == Material.AIR) {
		return false;
	}
	if (item.getType().isBlock()) {
		return true;
	}
	if (item.getType() == Material.REDSTONE || item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET) {
		return true;
	}
	if (item.getType() == Material.MONSTER_EGG) {
		return true;
	}
	if (item.getType() == Material.EGG || item.getType() == Material.SNOW_BALL || item.getType() == Material.BOW || item.getType() == Material.ENDER_PEARL || item.getType() == Material.EYE_OF_ENDER || item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.EXP_BOTTLE || item.getType() == Material.FIREWORK_CHARGE) {
		return true;
	}
	if (item.getType().isEdible()) {
		return true;
	}
	return false;
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:24,代码来源:HitboxUtils.java

示例3: onDamageSkull

@EventHandler
public void onDamageSkull(PlayerInteractEvent e) {
	if (cm.isAntiDamageSkull) {
		if (Action.RIGHT_CLICK_BLOCK == e.getAction()) {
			if (e.getItem() != null) {
				Material type = e.getItem().getType();
				if (Material.LAVA_BUCKET == type || Material.WATER_BUCKET == type) {
					fixSkull(e.getClickedBlock().getRelative(BlockFace.UP));
				} else if (Material.ANVIL == type) {
					for (BlockFace face : BLOCKFACE) {
						fixSkull(e.getClickedBlock().getRelative(face));
					}
				}
			}
		}
	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:17,代码来源:AntiDamageSkull.java

示例4: onInteract

@EventHandler
public void onInteract(PlayerBucketEmptyEvent e){
    Player p = e.getPlayer();
    for(Entity en : p.getNearbyEntities (4D, 4D, 4D)){
        if (en instanceof Player){
            if(en == p) continue;
            if(e.getBucket() == Material.LAVA_BUCKET){

                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,代码行数:16,代码来源:PlayerEvents.java

示例5: Fireman

@EventHandler
public void Fireman(PlayerInteractEvent event) {
	// LAVA: 12
	Player p = event.getPlayer();
	if (!Kit.getKit(p).getName().equalsIgnoreCase("fireman") && event.getItem() != null	&& event.getItem().getType() == Material.LAVA_BUCKET) {
		event.setCancelled(true);
		Chat.player(p, "&cOnly players with the \"Fireman\" kit can use lava!");
	}
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:9,代码来源:KitEvents.java

示例6: onPlayerInteract

@EventHandler
  public void onPlayerInteract(PlayerInteractEvent event) {
if (Walls.getSpectators().contains(event.getPlayer().getName())) {
	event.setCancelled(true);
	return;
}

      if (event.getItem()==null) 
          return;
      
      if (!State.PVP && (event.getItem().getType()==Material.FLINT_AND_STEEL || event.getItem().getType()==Material.FIREBALL || event.getItem().getType()==Material.LAVA_BUCKET)) {
          Chat.player(event.getPlayer(), "&cYou are not allowed to use fire before the walls drop!");
          event.setCancelled(true);
      }
  }
 
开发者ID:thekeenant,项目名称:mczone,代码行数:15,代码来源:Events.java

示例7: handleCategoryInventoryClick

private void handleCategoryInventoryClick(InventoryClickEvent ice,
		Game game, Player player) {
	int catSize = getCategoriesSize(player);
	int sizeCategories = getInventorySize(catSize) + 9;
	int rawSlot = ice.getRawSlot();

	if ((rawSlot >= getInventorySize(catSize))
			&& (rawSlot < sizeCategories)) {
		ice.setCancelled(true);

		if (ice.getCurrentItem().getType() == Material.BUCKET) {
			game.getPlayerSettings(player).setOneStackPerShift(false);
			player.playSound(player.getLocation(),
					SoundMachine.get("CLICK", "UI_BUTTON_CLICK"), 10.0F,
					1.0F);
			openCategoryInventory(player);
			return;
		}
		if (ice.getCurrentItem().getType() == Material.LAVA_BUCKET) {
			game.getPlayerSettings(player).setOneStackPerShift(true);
			player.playSound(player.getLocation(),
					SoundMachine.get("CLICK", "UI_BUTTON_CLICK"), 10.0F,
					1.0F);
			openCategoryInventory(player);
			return;
		}

	}

	if (rawSlot >= sizeCategories) {
		if (ice.isShiftClick()) {
			ice.setCancelled(true);
			return;
		}

		ice.setCancelled(false);
		return;
	}

	MerchantCategory clickedCategory = getCategoryByMaterial(ice
			.getCurrentItem().getType());
	if (clickedCategory == null) {
		if (ice.isShiftClick()) {
			ice.setCancelled(true);
			return;
		}

		ice.setCancelled(false);
		return;
	}

	openBuyInventory(clickedCategory, player, game);
}
 
开发者ID:Ldcr993519867,项目名称:BedwarsXP,代码行数:53,代码来源:XPItemShop.java

示例8: isBucket

public static boolean isBucket(Material bucket) {
    return bucket == Material.BUCKET || bucket == Material.LAVA_BUCKET || bucket == Material.WATER_BUCKET || bucket == Material.MILK_BUCKET;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:3,代码来源:Materials.java


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