本文整理汇总了Java中org.bukkit.NetherWartsState类的典型用法代码示例。如果您正苦于以下问题:Java NetherWartsState类的具体用法?Java NetherWartsState怎么用?Java NetherWartsState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetherWartsState类属于org.bukkit包,在下文中一共展示了NetherWartsState类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setState
import org.bukkit.NetherWartsState; //导入依赖的package包/类
/**
* Sets the growth state of this nether wart
*
* @param state New growth state of this nether wart
*/
public void setState(NetherWartsState state) {
switch (state) {
case SEEDED:
setData((byte) 0x0);
return;
case STAGE_ONE:
setData((byte) 0x1);
return;
case STAGE_TWO:
setData((byte) 0x2);
return;
case RIPE:
setData((byte) 0x3);
return;
}
}
示例2: isApplicable
import org.bukkit.NetherWartsState; //导入依赖的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;
}
}
示例3: getState
import org.bukkit.NetherWartsState; //导入依赖的package包/类
/**
* Gets the current growth state of this nether wart
*
* @return NetherWartsState of this nether wart
*/
public NetherWartsState getState() {
switch (getData()) {
case 0:
return NetherWartsState.SEEDED;
case 1:
return NetherWartsState.STAGE_ONE;
case 2:
return NetherWartsState.STAGE_TWO;
default:
return NetherWartsState.RIPE;
}
}
示例4: affectedByGreenTerra
import org.bukkit.NetherWartsState; //导入依赖的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);
}
}
示例5: NetherWarts
import org.bukkit.NetherWartsState; //导入依赖的package包/类
public NetherWarts(NetherWartsState state) {
this();
setState(state);
}
示例6: handleBlockState
import org.bukkit.NetherWartsState; //导入依赖的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;
}
}
示例7: NetherWarts
import org.bukkit.NetherWartsState; //导入依赖的package包/类
public NetherWarts(NetherWartsState state) {
}
示例8: getState
import org.bukkit.NetherWartsState; //导入依赖的package包/类
public NetherWartsState getState() {
return null;
}
示例9: setState
import org.bukkit.NetherWartsState; //导入依赖的package包/类
public void setState(NetherWartsState state) {
}