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


Java Material.BLAZE_POWDER属性代码示例

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


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

示例1: howMuchSpaceForItemAsync

@Override
public int howMuchSpaceForItemAsync(WrappedDirection insertDirection, ItemStack insertion) {
	if (!cachedChunk.isLoaded()) {
		return 0;
	}
	if (isInvLocked(cachedBrewingStand)) {
		return 0;
	}
	if (insertion.getType() == Material.POTION || insertion.getType() == Material.SPLASH_POTION || insertion.getType() == Material.LINGERING_POTION) {
		if (cachedInv.getItem(0) != null && cachedInv.getItem(1) != null && cachedInv.getItem(2) != null) {
			return 0;
		} else {
			return 1;
		}
	} else if (insertDirection.isSide() && insertion.getType() == Material.BLAZE_POWDER) {
		return howManyItemsFit(insertion, cachedInv.getFuel());
	} else if (isBrewingIngredient(insertion)) {
		return howManyItemsFit(insertion, cachedInv.getIngredient());
	} else {
		return 0;
	}
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:22,代码来源:BrewingStandContainer.java

示例2: insertItem

@Override
public ItemStack insertItem(WrappedDirection insertDirection, ItemStack insertion) {
	if (!cachedChunk.isLoaded()) {
		return insertion;
	}
	if (isInvLocked(cachedBrewingStand)) {
		return insertion;
	}
	if (insertion.getType() == Material.POTION || insertion.getType() == Material.SPLASH_POTION || insertion.getType() == Material.LINGERING_POTION) {
		if (cachedInv.getItem(0) == null) {
			cachedInv.setItem(0, insertion);
			return null;
		} else if (cachedInv.getItem(1) == null) {
			cachedInv.setItem(1, insertion);
			return null;
		} else if (cachedInv.getItem(2) == null) {
			cachedInv.setItem(2, insertion);
			return null;
		}
	} else if (insertDirection.isSide() && insertion.getType() == Material.BLAZE_POWDER) {
		ItemStack oldFuel = cachedInv.getFuel();
		cachedInv.setFuel(putItemInSlot(insertion, oldFuel));
		if (insertion == null || insertion.getAmount() == 0) {
			insertion = null;
		}
	} else if (isBrewingIngredient(insertion)) {
		ItemStack oldIngredient = cachedInv.getIngredient();
		cachedInv.setIngredient(putItemInSlot(insertion, oldIngredient));
		if (insertion == null || insertion.getAmount() == 0) {
			insertion = null;
		}
	}
	return insertion;

}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:35,代码来源:BrewingStandContainer.java

示例3: registerRunes

private void registerRunes() {
	Rune rune;
	
	rune = new Rune("Freeze", Material.ICE, 15, -1);
	rune.addDescription(ChatColor.GRAY + "Freezes target");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "10 blocks");
	rune.addDescription(ChatColor.GRAY + "Freeze duration: " + ChatColor.RED + "3 second");
	runes.add(rune);
	
	rune = new Rune("Fire Storm", Material.BLAZE_POWDER, 25, 30);
	rune.addDescription(ChatColor.GRAY + "Sets everyone around on fire");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "2 blocks");
	rune.addDescription(ChatColor.GRAY + "Burning duration: " + ChatColor.RED + "2 seconds");
	runes.add(rune);
	
	rune = new Rune("Slowdown", Material.WEB, 15, 30);
	rune.addDescription(ChatColor.GRAY + "Slows everyone around");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "3 blocks");
	rune.addDescription(ChatColor.GRAY + "Slow Level: " + ChatColor.RED + "I");
	rune.addDescription(ChatColor.GRAY + "Slow duration: " + ChatColor.RED + "5 seconds");
	runes.add(rune);
	
	rune = new Rune("Invisibility", Material.GRASS, 10, 5);
	rune.addDescription(ChatColor.GRAY + "Gives uninterruptible invisibility");
	runes.add(rune);
	
	rune = new Rune("Lightning", Material.FIREWORK, 15, -1);
	rune.addDescription(ChatColor.GRAY + "Strikes lightning at target position");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "20 blocks");
	rune.addDescription(ChatColor.GRAY + "Damage: " + ChatColor.RED + "5 hearts");
	runes.add(rune);
	
	rune = new Rune("Detonate", Material.TNT, 20, -1);
	rune.addDescription(ChatColor.GRAY + "Strikes explosion at your location");
	rune.addDescription(ChatColor.GRAY + "Explosion range: " + ChatColor.RED + "4 blocks");
	rune.addDescription(ChatColor.GRAY + "Damage: " + ChatColor.RED + "3 hearts");
	runes.add(rune);
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:38,代码来源:RuneManager.java

示例4: Oil

public Oil(){
    super(4, Material.BLAZE_POWDER, "GASOLINA", "Munición de calibre medio, usado en escopetas.");
}
 
开发者ID:cadox8,项目名称:WC,代码行数:3,代码来源:Oil.java

示例5: onBrewingClick

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBrewingClick(PlayerInteractEvent event) {
	if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
		return;
	}

	ItemStack itemstack = event.getItem();
	if ((itemstack == null) || (itemstack.getType() != Material.BLAZE_POWDER)) {
		return;
	}
	itemstack = itemstack.clone();

	Block clicked = event.getClickedBlock();
	BlockState state = clicked.getState();
	if (!(state instanceof BrewingStand)) {
		return;
	}
	BrewingStand stand = (BrewingStand) state;

	ItemStack existing = stand.getInventory().getFuel();
	if (existing != null) {
		existing = existing.clone();
	}

	PlayerInventory inventory = event.getPlayer().getInventory();
	switch (event.getHand()) {
		case HAND: {
			inventory.setItemInMainHand(existing);
			break;
		}
		case OFF_HAND: {
			inventory.setItemInOffHand(existing);
			break;
		}
		default: {
			throw new IllegalArgumentException("Unexpected hand slot in interaction: " + event.getHand());
		}
	}
	stand.getInventory().setFuel(itemstack);
	event.setCancelled(true);
}
 
开发者ID:ProtocolSupport,项目名称:ProtocolSupportLegacySupport,代码行数:41,代码来源:BrewingStandFuelHandler.java

示例6: isBrewingIngredient

private static boolean isBrewingIngredient(ItemStack item) {
	if (item.getType() == Material.NETHER_STALK) {
		return true;
	}
	if (item.getType() == Material.SPECKLED_MELON) {
		return true;
	}
	if (item.getType() == Material.GHAST_TEAR) {
		return true;
	}
	if (item.getType() == Material.RABBIT_FOOT) {
		return true;
	}
	if (item.getType() == Material.BLAZE_POWDER) {
		return true;
	}
	if (item.getType() == Material.SPIDER_EYE) {
		return true;
	}
	if (item.getType() == Material.SUGAR) {
		return true;
	}
	if (item.getType() == Material.MAGMA_CREAM) {
		return true;
	}
	if (item.getType() == Material.GLOWSTONE_DUST) {
		return true;
	}
	if (item.getType() == Material.REDSTONE) {
		return true;
	}
	if (item.getType() == Material.FERMENTED_SPIDER_EYE) {
		return true;
	}
	if (item.getType() == Material.GOLDEN_CARROT) {
		return true;
	}
	if (item.getType() == Material.RAW_FISH && item.getData().getData() == 3) {
		return true;
	}
	if (item.getType() == Material.SULPHUR) {
		return true;
	}
	return false;
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:45,代码来源:BrewingStandContainer.java

示例7: registerAbilities

/**
 * Registers all the abilities
 */
private void registerAbilities() {
	abilities = new ArrayList<>();
	Ability ability;
	
	// Haste
	ability = new Ability("Haste", Material.GOLD_BOOTS, 10, 100);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE, ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Gives Haste Effect");
	ability.addDescription(ChatColor.GRAY + "Haste Level: " + ChatColor.RED + "I");
	abilities.add(ability);
	
	// Poison
	ability = new Ability("Poison", Material.BEETROOT, 15, 150);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE));
	ability.addDescription(ChatColor.GRAY + "Poisons target enemy");
	ability.addDescription(ChatColor.GRAY + "Poison Level: " + ChatColor.RED + "I");
	ability.addDescription(ChatColor.GRAY + "Poison Duration: " + ChatColor.RED + "3 seconds");
	abilities.add(ability);
	
	// AoE (4 blocks)
	ability = new Ability("AoE", Material.GOLD_PICKAXE, 20, 750);
	ability.setItems(Arrays.asList(ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Destroys 4 blocks instead of 1");
	abilities.add(ability);
	
	// Magnet
	ability = new Ability("Magnet", Material.DETECTOR_RAIL, 25, 250);
	ability.setItems(Arrays.asList(ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Small chance to get crate key");
	ability.addDescription(ChatColor.GRAY + "Chance: " + ChatColor.RED + "0.01%");
	abilities.add(ability);
	
	// Flame
	ability = new Ability("Flame", Material.BLAZE_POWDER, 15, 750);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE));
	ability.addDescription(ChatColor.GRAY + "Sets target on fire");
	ability.addDescription(ChatColor.GRAY + "Fire Duration: " + ChatColor.RED + "3 seconds");
	abilities.add(ability);
	
	// High Jump
	ability = new Ability("High Jump", Material.ELYTRA, 20, 200);
	ability.setItems(Arrays.asList(ItemType.BOOTS, ItemType.LEGGINGS, ItemType.CHESTPLATE, ItemType.HELMET));
	ability.addDescription(ChatColor.GRAY + "Jump 2 blocks high");
	ability.addDescription(ChatColor.GRAY + "Jump Level: " + ChatColor.RED + "II");
	abilities.add(ability);
	
	// Speed
	ability = new Ability("Speed", Material.FEATHER, 15, 150);
	ability.setItems(Arrays.asList(ItemType.BOOTS, ItemType.LEGGINGS, ItemType.CHESTPLATE, ItemType.HELMET));
	ability.addDescription(ChatColor.GRAY + "Gives speed boost");
	ability.addDescription(ChatColor.GRAY + "Speed Level: " + ChatColor.RED + "I");
	abilities.add(ability);
	
	// Lucky Repair
	ability = new Ability("Lucky Repair", Material.ANVIL, 25, 250);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE, ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Small chance to repair item");
	ability.addDescription(ChatColor.GRAY + "Chance: " + ChatColor.RED + "0.01%");
	abilities.add(ability);
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:63,代码来源:AbilityManager.java


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