• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NetherWarts类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bukkit.material.NetherWarts的典型用法代码示例。如果您正苦于以下问题:Java NetherWarts类的具体用法?Java NetherWarts怎么用?Java NetherWarts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getCropState

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
public String getCropState(BlockState blockState) {
	switch (blockState.getType()) { // .getBlock().getType()) {
	case COCOA:
		return ((CocoaPlant) blockState.getData()).getSize().toString();
	case NETHER_WARTS:
		return ((NetherWarts) blockState.getData()).getState().toString();
	case MELON_STEM:
		return (int) blockState.getBlock().getData() + "";
	case PUMPKIN_STEM:
		return (int) blockState.getBlock().getData() + "";
	case CACTUS:
		return null;
	case BROWN_MUSHROOM:
		return null;
	case RED_MUSHROOM:
		return null;
	case SUGAR_CANE_BLOCK:
		return null;
	default:
		//CropControl.getPlugin().debug("Unable to find CropState match for {0}", blockState);
		return ((Crops) blockState.getData()).getState().toString();
	}
}
 
开发者ID:DevotedMC,项目名称:CropControl,代码行数:24,代码来源:CropControlEventHandler.java


示例2: isApplicable

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
private boolean isApplicable(Block block)
{
	BlockState state = block.getState();
	switch (state.getType())
	{
		case CACTUS:
		case MELON_BLOCK:
		case PUMPKIN:
			return true;
		case CROPS:
			return ((Crops) state.getData()).getState() == CropState.RIPE;
		case NETHER_WARTS:
			return ((NetherWarts) state.getData()).getState() == NetherWartsState.RIPE;
		case COCOA:
			return ((CocoaPlant) state.getData()).getSize() == CocoaPlantSize.LARGE;
		default:
			return false;
	}
}
 
开发者ID:dmulloy2,项目名称:SwornRPG,代码行数:20,代码来源:Herbalism.java


示例3: affectedByGreenTerra

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
/**
 * Determine if a given block should be affected by Green Terra
 *
 * @param blockState The {@link BlockState} of the block to check
 * @return true if the block should affected by Green Terra, false otherwise
 */
public static boolean affectedByGreenTerra(BlockState blockState) {
    switch (blockState.getType()) {
        case BROWN_MUSHROOM:
        case CACTUS:
        case DOUBLE_PLANT:
        case MELON_BLOCK:
        case LONG_GRASS:
        case PUMPKIN:
        case RED_MUSHROOM:
        case RED_ROSE:
        case SUGAR_CANE_BLOCK:
        case VINE:
        case WATER_LILY:
        case YELLOW_FLOWER:
            return true;

        case CARROT:
        case POTATO:
            return blockState.getRawData() == CropState.RIPE.getData();

        case CROPS:
            return ((Crops) blockState.getData()).getState() == CropState.RIPE;

        case NETHER_WARTS:
            return ((NetherWarts) blockState.getData()).getState() == NetherWartsState.RIPE;

        case COCOA:
            return ((CocoaPlant) blockState.getData()).getSize() == CocoaPlantSize.LARGE;

        default:
            return mcMMO.getModManager().isCustomHerbalismBlock(blockState);
    }
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:40,代码来源:BlockUtils.java


示例4: isGrowable

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
private boolean isGrowable(Block block)
{
	BlockState state = block.getState();
	Material material = block.getType();
	MaterialData data = state.getData();

	return data instanceof NetherWarts || data instanceof Crops || data instanceof CocoaPlant
			|| material == Material.SAPLING || material == Material.RED_MUSHROOM || material == Material.BROWN_MUSHROOM;
}
 
开发者ID:dmulloy2,项目名称:SwornRPG,代码行数:10,代码来源:Herbalism.java


示例5: handleBlockState

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
private boolean handleBlockState(BlockState blockState, boolean greenTerra) {
    byte greenThumbStage = getGreenThumbStage();

    blockState.setMetadata(mcMMO.greenThumbDataKey, new FixedMetadataValue(mcMMO.p, (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)));

    switch (blockState.getType()) {
        case CROPS:
            Crops crops = (Crops) blockState.getData();

            if (greenTerra) {
                crops.setState(CropState.MEDIUM);
            }
            else {
                switch (greenThumbStage) {
                    case 4:
                        crops.setState(CropState.SMALL);
                        break;
                    case 3:
                        crops.setState(CropState.VERY_SMALL);
                        break;
                    case 2:
                        crops.setState(CropState.GERMINATED);
                        break;
                    default:
                        crops.setState(CropState.SEEDED);
                        break;
                }
            }

            return true;

        case CARROT:
        case POTATO:
            if (greenTerra) {
                blockState.setRawData(CropState.MEDIUM.getData());
            }
            else {
                blockState.setRawData(greenThumbStage);
            }

            return true;

        case NETHER_WARTS:
            NetherWarts warts = (NetherWarts) blockState.getData();

            if (greenTerra || greenThumbStage > 2) {
                warts.setState(NetherWartsState.STAGE_TWO);
            }
            else if (greenThumbStage == 2) {
                warts.setState(NetherWartsState.STAGE_ONE);
            }
            else {
                warts.setState(NetherWartsState.SEEDED);
            }

            return true;

        case COCOA:
            CocoaPlant plant = (CocoaPlant) blockState.getData();

            if (greenTerra || getGreenThumbStage() > 1) {
                plant.setSize(CocoaPlantSize.MEDIUM);
            }
            else {
                plant.setSize(CocoaPlantSize.SMALL);
            }

            return true;

        default:
            return false;
    }
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:74,代码来源:HerbalismManager.java


示例6: NetherWarts

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
public NetherWarts() {
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:NetherWarts.java


示例7: clone

import org.bukkit.material.NetherWarts; //导入依赖的package包/类
public NetherWarts clone() {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:NetherWarts.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Cart类代码示例发布时间:2022-05-22
下一篇:
Java Identity类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap