本文整理汇总了Java中org.bukkit.TreeSpecies.JUNGLE属性的典型用法代码示例。如果您正苦于以下问题:Java TreeSpecies.JUNGLE属性的具体用法?Java TreeSpecies.JUNGLE怎么用?Java TreeSpecies.JUNGLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.TreeSpecies
的用法示例。
在下文中一共展示了TreeSpecies.JUNGLE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findJungleLog
/**
* Finds a jungle log around this crop block.
* @param crop The block to check around.
* @return The rotation for which a jungle log was found, null otherwise.
*/
private BlockRotation findJungleLog(BlockLocation crop) {
for (BlockRotation r : BlockRotation.values()) {
Block block = crop.getRelative(r.getYawFace()).getBlock();
if (block.getType() == Material.LOG) {
BlockState state = block.getState();
try {
Tree tree = (Tree) state.getData();
if (tree.getSpecies() == TreeSpecies.JUNGLE) {
return r;
}
} catch (ClassCastException e) {
}
}
}
return null;
}
示例2: getTreeSpecies
public static TreeSpecies getTreeSpecies(EntityBoat.EnumBoatType boatType) {
switch (boatType) {
case SPRUCE:
return TreeSpecies.REDWOOD;
case BIRCH:
return TreeSpecies.BIRCH;
case JUNGLE:
return TreeSpecies.JUNGLE;
case ACACIA:
return TreeSpecies.ACACIA;
case DARK_OAK:
return TreeSpecies.DARK_OAK;
case OAK:
default:
return TreeSpecies.GENERIC;
}
}
示例3: getContents
/**
* Get the material in the flower pot
*
* @return material MaterialData for the block currently in the flower pot
* or null if empty
*/
public MaterialData getContents() {
switch (getData()) {
case 1:
return new MaterialData(Material.RED_ROSE);
case 2:
return new MaterialData(Material.YELLOW_FLOWER);
case 3:
return new Tree(TreeSpecies.GENERIC);
case 4:
return new Tree(TreeSpecies.REDWOOD);
case 5:
return new Tree(TreeSpecies.BIRCH);
case 6:
return new Tree(TreeSpecies.JUNGLE);
case 7:
return new MaterialData(Material.RED_MUSHROOM);
case 8:
return new MaterialData(Material.BROWN_MUSHROOM);
case 9:
return new MaterialData(Material.CACTUS);
case 10:
return new MaterialData(Material.DEAD_BUSH);
case 11:
return new LongGrass(GrassSpecies.FERN_LIKE);
default:
return null;
}
}
示例4: getExperienceFromLog
/**
* Retrieves the experience reward from a log
*
* @param blockState Log being broken
* @param experienceGainMethod How the log is being broken
* @return Amount of experience
*/
protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) {
// Mushrooms aren't trees so we could never get species data from them
switch (blockState.getType()) {
case HUGE_MUSHROOM_1:
return ExperienceConfig.getInstance().getWoodcuttingXPHugeBrownMushroom();
case HUGE_MUSHROOM_2:
return ExperienceConfig.getInstance().getWoodcuttingXPHugeRedMushroom();
default:
break;
}
if (mcMMO.getModManager().isCustomLog(blockState)) {
return mcMMO.getModManager().getBlock(blockState).getXpGain();
}
//TODO Remove this workaround when casting to Tree works again
TreeSpecies species = TreeSpecies.GENERIC;
if (blockState.getData() instanceof Tree) {
species = ((Tree) blockState.getData()).getSpecies();
}
int xp = ExperienceConfig.getInstance().getWoodcuttingTreeXP(species);
if (species == TreeSpecies.JUNGLE && experienceGainMethod == ExperienceGainMethod.TREE_FELLER) {
xp *= 0.5;
}
return xp;
}
示例5: getContents
/**
* Get the material in the flower pot
*
* @return material MaterialData for the block currently in the flower pot or null if empty
*/
public MaterialData getContents() {
switch (getData()) {
case 1:
return new MaterialData(Material.RED_ROSE);
case 2:
return new MaterialData(Material.YELLOW_FLOWER);
case 3:
return new Tree(TreeSpecies.GENERIC);
case 4:
return new Tree(TreeSpecies.REDWOOD);
case 5:
return new Tree(TreeSpecies.BIRCH);
case 6:
return new Tree(TreeSpecies.JUNGLE);
case 7:
return new MaterialData(Material.RED_MUSHROOM);
case 8:
return new MaterialData(Material.BROWN_MUSHROOM);
case 9:
return new MaterialData(Material.CACTUS);
case 10:
return new MaterialData(Material.DEAD_BUSH);
case 11:
return new LongGrass(GrassSpecies.FERN_LIKE);
default:
return null;
}
}