本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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;
}