本文整理汇总了Java中org.bukkit.TreeType.DARK_OAK属性的典型用法代码示例。如果您正苦于以下问题:Java TreeType.DARK_OAK属性的具体用法?Java TreeType.DARK_OAK怎么用?Java TreeType.DARK_OAK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.TreeType
的用法示例。
在下文中一共展示了TreeType.DARK_OAK属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTrackedTreeMaterial
public Material getTrackedTreeMaterial(String trackedType) {
if (Material.CHORUS_PLANT.toString().equals(trackedType))
return Material.CHORUS_PLANT;
else {
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;
}
}
}
CropControl.getPlugin().debug("Unable to match tracked tree type material {0}", trackedType);
return null;
}
示例2: getTree
@SuppressWarnings("deprecation")
private TreeType getTree(Block block) {
if (block.getType() == Material.SAPLING) {
switch (block.getData()) {
case 0:
return TreeType.TREE;
case 1:
return TreeType.REDWOOD;
case 2:
return TreeType.BIRCH;
case 3:
return TreeType.SMALL_JUNGLE;
case 4:
return TreeType.ACACIA;
case 5:
return TreeType.DARK_OAK;
}
return TreeType.TREE;
} else {
if (block.getType() == Material.BROWN_MUSHROOM) {
return TreeType.BROWN_MUSHROOM;
} else {
return TreeType.RED_MUSHROOM;
}
}
}
示例3: 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;
}