本文整理汇总了Java中net.minecraft.init.Blocks.CLAY属性的典型用法代码示例。如果您正苦于以下问题:Java Blocks.CLAY属性的具体用法?Java Blocks.CLAY怎么用?Java Blocks.CLAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.CLAY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDyeCraftingResult
private static ItemStack getDyeCraftingResult(int meta) {
switch (meta) {
default: return new ItemStack(Items.GHAST_TEAR);
case 1: return new ItemStack(Items.FIRE_CHARGE, 8, 0);
case 2: return new ItemStack(Items.DRAGON_BREATH);
case 3: return new ItemStack(Items.DIAMOND);
case 4: return new ItemStack(Items.GOLD_INGOT);
case 5: return new ItemStack(Items.SLIME_BALL, 4, 0);
case 6: return new ItemStack(Items.SADDLE);
case 7: return new ItemStack(Blocks.CLAY, 8, 0);
case 8: return new ItemStack(Items.IRON_INGOT, 2, 0);
case 9: return new ItemStack(Blocks.STAINED_HARDENED_CLAY, 16, EnumDyeColor.CYAN.getMetadata());
case 10: return new ItemStack(Items.CHORUS_FRUIT);
case 11: return new ItemStack(Blocks.PRISMARINE, 8, 0);
case 12: return new ItemStack(Blocks.DIRT, 3, 0);
case 13: return new ItemStack(Items.EMERALD);
case 14: return new ItemStack(Items.NETHER_WART);
case 15: return new ItemStack(Items.SKULL, 1, 1);
}
}
示例2: generate
public boolean generate(World worldIn, Random rand, BlockPos position)
{
if (worldIn.getBlockState(position).getMaterial() != Material.WATER)
{
return false;
}
else
{
int i = rand.nextInt(this.numberOfBlocks - 2) + 2;
int j = 1;
for (int k = position.getX() - i; k <= position.getX() + i; ++k)
{
for (int l = position.getZ() - i; l <= position.getZ() + i; ++l)
{
int i1 = k - position.getX();
int j1 = l - position.getZ();
if (i1 * i1 + j1 * j1 <= i * i)
{
for (int k1 = position.getY() - 1; k1 <= position.getY() + 1; ++k1)
{
BlockPos blockpos = new BlockPos(k, k1, l);
Block block = worldIn.getBlockState(blockpos).getBlock();
if (block == Blocks.DIRT || block == Blocks.CLAY)
{
worldIn.setBlockState(blockpos, this.block.getDefaultState(), 2);
}
}
}
}
}
return true;
}
}