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


Java Material.PUMPKIN属性代码示例

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


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

示例1: onItemSpawn

/**
 * Soup dropping
 *
 * @param event Event
 */
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
    if (event.getEntityType() != EntityType.DROPPED_ITEM)
        return;

    if (event.getEntity().hasMetadata("playerDrop"))
        return;

    Material material = event.getEntity().getItemStack().getType();

    if (material == Material.BROWN_MUSHROOM || material == Material.RED_MUSHROOM)
        event.getEntity().setItemStack(new ItemStack(Material.MUSHROOM_SOUP, 2));
    else if (material == Material.POTATO_ITEM)
        event.getEntity().setItemStack(new ItemStack(Material.BAKED_POTATO, 1));
    else if (material == Material.CARROT_ITEM)
        event.getEntity().setItemStack(new ItemStack(Material.GOLDEN_CARROT, 1));
    else if (material == Material.WHEAT)
        event.getEntity().setItemStack(new ItemStack(Material.BREAD, 1));
    else if (material == Material.PUMPKIN)
        event.getEntity().setItemStack(new ItemStack(Material.PUMPKIN_PIE, 1));
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:27,代码来源:RapidFoodModule.java

示例2: getTrackedTypeMaterial

public Material getTrackedTypeMaterial(String trackedType) {
	for (Material material : harvestableCrops.keySet()) {
		if (material.toString().equals(trackedType))
			return material;
	}

	if (Material.MELON_BLOCK.toString().equals(trackedType))
		return Material.MELON_BLOCK;
	else if (Material.PUMPKIN.toString().equals(trackedType))
		return Material.PUMPKIN;

	for (Byte i = 0; i < 6; i++) {
		if (getSaplingType(i).equals(trackedType)) // TODO: odd structure here
			return Material.SAPLING;
	}

	for (TreeType treeType : TreeType.values()) {
		if (treeType.toString().equals(trackedType)) {
			if (treeType == TreeType.ACACIA || treeType == TreeType.DARK_OAK)
				return Material.LOG_2;
			else if (treeType == TreeType.BROWN_MUSHROOM)
				return Material.HUGE_MUSHROOM_1;
			else if (treeType == TreeType.RED_MUSHROOM)
				return Material.HUGE_MUSHROOM_2;
			else
				return Material.LOG;
		}
	}

	if (Material.CHORUS_PLANT.toString().equals(trackedType))
		return Material.CHORUS_PLANT;

	CropControl.getPlugin().debug("Unable to match tracked type material {0}", trackedType);
	return null;
}
 
开发者ID:DevotedMC,项目名称:CropControl,代码行数:35,代码来源:CropControlEventHandler.java

示例3: getTrackedCropMaterial

public Material getTrackedCropMaterial(String _trackedType) {
	Material trackedType = Material.getMaterial(_trackedType);
	if (Material.MELON_BLOCK.equals(trackedType))
		return Material.MELON_BLOCK;
	else if (Material.PUMPKIN.equals(trackedType))
		return Material.PUMPKIN;
	else {
		for (Material material : harvestableCrops.keySet()) {
			if (material.equals(trackedType))
				return material;
		}
	}
	CropControl.getPlugin().debug("Unable to match tracked crop type material {0}", trackedType);
	return null;
}
 
开发者ID:DevotedMC,项目名称:CropControl,代码行数:15,代码来源:CropControlEventHandler.java

示例4: 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


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