當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。