本文整理了Java中net.minecraft.block.BlockCrops.getMaxAge()
方法的一些代码示例,展示了BlockCrops.getMaxAge()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockCrops.getMaxAge()
方法的具体详情如下:
包路径:net.minecraft.block.BlockCrops
类名称:BlockCrops
方法名:getMaxAge
暂无
代码示例来源:origin: WayofTime/BloodMagic
private static void addPamCrops() {
if (!Loader.isModLoaded("harvestcraft"))
return;
try {
Class<?> pamRegistry = Class.forName("com.pam.harvestcraft.blocks.CropRegistry");
Field names = pamRegistry.getDeclaredField("cropNames");
Method getCrop = pamRegistry.getMethod("getCrop", String.class);
for (String name : (String[]) names.get(null)) {
BlockCrops crop = (BlockCrops) getCrop.invoke(null, name);
HarvestRegistry.registerStandardCrop(crop, crop.getMaxAge());
}
} catch (ClassNotFoundException e) {
BMLog.DEFAULT.error("HarvestCraft integration cancelled; unable to find registry class");
} catch (NoSuchMethodException | NoSuchFieldException e) {
BMLog.DEFAULT.error("HarvestCraft integration cancelled; unable to find crop name mapper");
} catch (IllegalAccessException | InvocationTargetException e) {
BMLog.DEFAULT.error("HarvestCraft integration cancelled; crop name lookup broke");
}
}
}
代码示例来源:origin: SleepyTrousers/EnderCore
resetState = mcblock.getDefaultState().withProperty(BlockBeetroot.BEETROOT_AGE, 0);
} else if (mcblock instanceof BlockCrops) {
meta = ((BlockCrops) mcblock).getMaxAge();
resetMeta = 0;
grownState = mcblock.getDefaultState().withProperty(BlockCrops.AGE, ((BlockCrops) mcblock).getMaxAge());
resetState = mcblock.getDefaultState().withProperty(BlockCrops.AGE, 0);
} else if (mcblock instanceof BlockNetherWart) {
代码示例来源:origin: TehNut/HWYLA
addMaturityTooltip(currenttip, accessor.getMetadata() / (float) ((BlockCrops) block).getMaxAge());
else if (block == melonStem || block == pumpkinStem)
addMaturityTooltip(currenttip, accessor.getMetadata() / 7F);
代码示例来源:origin: ForestryMC/Binnie
int j = ((BlockCrops) this.cropTypeA).getMaxAge();
int k = j / 3;
this.setBlockState(worldIn, this.cropTypeA.getStateFromMeta(MathHelper.getInt(randomIn, k, j)), 1, 1, i, structureBoundingBoxIn);
this.setBlockState(worldIn, this.cropTypeA.getStateFromMeta(MathHelper.getInt(randomIn, k, j)), 2, 1, i, structureBoundingBoxIn);
int l = ((BlockCrops) this.cropTypeB).getMaxAge();
int i1 = l / 3;
this.setBlockState(worldIn, this.cropTypeB.getStateFromMeta(MathHelper.getInt(randomIn, i1, l)), 4, 1, i, structureBoundingBoxIn);
this.setBlockState(worldIn, this.cropTypeB.getStateFromMeta(MathHelper.getInt(randomIn, i1, l)), 5, 1, i, structureBoundingBoxIn);
int j1 = ((BlockCrops) this.cropTypeC).getMaxAge();
int k1 = j1 / 3;
this.setBlockState(worldIn, this.cropTypeC.getStateFromMeta(MathHelper.getInt(randomIn, k1, j1)), 7, 1, i, structureBoundingBoxIn);
this.setBlockState(worldIn, this.cropTypeC.getStateFromMeta(MathHelper.getInt(randomIn, k1, j1)), 8, 1, i, structureBoundingBoxIn);
int l1 = ((BlockCrops) this.cropTypeD).getMaxAge();
int i2 = l1 / 3;
this.setBlockState(worldIn, this.cropTypeD.getStateFromMeta(MathHelper.getInt(randomIn, i2, l1)), 10, 1, i, structureBoundingBoxIn);
内容来源于网络,如有侵权,请联系作者删除!