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


Java TreeSpecies.JUNGLE属性代码示例

本文整理汇总了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;
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:21,代码来源:CropCocoa.java

示例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;
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:17,代码来源:CraftBoat.java

示例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;
    }
}
 
开发者ID:CyberdyneCC,项目名称:Thermos-Bukkit,代码行数:34,代码来源:FlowerPot.java

示例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;
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:38,代码来源:Woodcutting.java

示例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;
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-API,代码行数:33,代码来源:FlowerPot.java


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