本文整理汇总了Java中net.minecraft.init.Blocks.stone方法的典型用法代码示例。如果您正苦于以下问题:Java Blocks.stone方法的具体用法?Java Blocks.stone怎么用?Java Blocks.stone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.stone方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decorate
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
super.decorate(worldIn, rand, pos);
int i = 3 + rand.nextInt(6);
for (int j = 0; j < i; ++j)
{
int k = rand.nextInt(16);
int l = rand.nextInt(28) + 4;
int i1 = rand.nextInt(16);
BlockPos blockpos = pos.add(k, l, i1);
if (worldIn.getBlockState(blockpos).getBlock() == Blocks.stone)
{
worldIn.setBlockState(blockpos, Blocks.emerald_ore.getDefaultState(), 2);
}
}
for (i = 0; i < 7; ++i)
{
int j1 = rand.nextInt(16);
int k1 = rand.nextInt(64);
int l1 = rand.nextInt(16);
this.theWorldGenerator.generate(worldIn, rand, pos.add(j1, k1, l1));
}
}
示例2: createStackedBlock
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
protected ItemStack createStackedBlock(IBlockState state)
{
switch ((BlockSilverfish.EnumType)state.getValue(VARIANT))
{
case COBBLESTONE:
return new ItemStack(Blocks.cobblestone);
case STONEBRICK:
return new ItemStack(Blocks.stonebrick);
case MOSSY_STONEBRICK:
return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.MOSSY.getMetadata());
case CRACKED_STONEBRICK:
return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CRACKED.getMetadata());
case CHISELED_STONEBRICK:
return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CHISELED.getMetadata());
default:
return new ItemStack(Blocks.stone);
}
}
示例3: getEntityItem
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
* Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an
* ItemStack containing Block.stone)
*/
public ItemStack getEntityItem()
{
ItemStack itemstack = this.getDataWatcher().getWatchableObjectItemStack(10);
if (itemstack == null)
{
if (this.worldObj != null)
{
logger.error("Item entity " + this.getEntityId() + " has no item?!");
}
return new ItemStack(Blocks.stone);
}
else
{
return itemstack;
}
}
示例4: BiomeGenSpace
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public BiomeGenSpace(int var1)
{
super(var1);
this.topBlock = Blocks.grass;
this.fillerBlock = Blocks.dirt;
this.stoneBlock = Blocks.stone;
this.spawnableCaveCreatureList.clear();
this.spawnableCreatureList.clear();
this.spawnableMonsterList.clear();
this.spawnableWaterCreatureList.clear();
if (!ConfigManagerCore.disableBiomeTypeRegistrations)
{
BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.COLD, BiomeDictionary.Type.DRY, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.SPOOKY);
}
}
示例5: cacheOre
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
private static void cacheOre(Block b, int meta) {
List key = Arrays.asList(b, meta);
if (!name_cache.containsKey(key) && b != Blocks.stone && b != Blocks.air && b != Blocks.dirt && b != Blocks.grass && b != Blocks.gravel) {
String name = null;
float value = 1f;
int[] ids = OreDictionary.getOreIDs(new ItemStack(b, 1, meta));
if (ids.length > 0) {
String dict_name = OreDictionary.getOreName(ids[0]);
if (dict_name.length() > 3 && dict_name.substring(0, 3).equals("ore")) {
dict_name = dict_name.substring(3);
if (dict_name.length() > 4 && dict_name.substring(0, 4).equals("Poor")) {
dict_name = dict_name.substring(4);
value = (1f/9f);
}
} else if (dict_name.length() > 8 && dict_name.substring(0, 8).equals("denseore")) {
dict_name = dict_name.substring(8);
value = 3f;
}
String norm = normalizeName(dict_name);
if (hasNugget(norm)) {
Prospecting.logger.info("Parsed name: " + norm);
Prospecting.logger.info("Amount: " + value);
name_cache.put(key, norm);
value_cache.put(key, value);
}
}
}
}
示例6: generate
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
while (true)
{
label0:
{
if (position.getY() > 3)
{
if (worldIn.isAirBlock(position.down()))
{
break label0;
}
Block block = worldIn.getBlockState(position.down()).getBlock();
if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.stone)
{
break label0;
}
}
if (position.getY() <= 3)
{
return false;
}
int i1 = this.field_150544_b;
for (int i = 0; i1 >= 0 && i < 3; ++i)
{
int j = i1 + rand.nextInt(2);
int k = i1 + rand.nextInt(2);
int l = i1 + rand.nextInt(2);
float f = (float)(j + k + l) * 0.333F + 0.5F;
for (BlockPos blockpos : BlockPos.getAllInBox(position.add(-j, -k, -l), position.add(j, k, l)))
{
if (blockpos.distanceSq(position) <= (double)(f * f))
{
worldIn.setBlockState(blockpos, this.field_150545_a.getDefaultState(), 4);
}
}
position = position.add(-(i1 + 1) + rand.nextInt(2 + i1 * 2), 0 - rand.nextInt(2), -(i1 + 1) + rand.nextInt(2 + i1 * 2));
}
return true;
}
position = position.down();
}
}
示例7: func_175793_a
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
示例8: generate
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone)
{
return false;
}
else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone)
{
return false;
}
else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone)
{
return false;
}
else
{
int i = 0;
if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone)
{
++i;
}
if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone)
{
++i;
}
if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone)
{
++i;
}
if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone)
{
++i;
}
int j = 0;
if (worldIn.isAirBlock(position.west()))
{
++j;
}
if (worldIn.isAirBlock(position.east()))
{
++j;
}
if (worldIn.isAirBlock(position.north()))
{
++j;
}
if (worldIn.isAirBlock(position.south()))
{
++j;
}
if (i == 3 && j == 1)
{
worldIn.setBlockState(position, this.block.getDefaultState(), 2);
worldIn.forceBlockUpdateTick(this.block, position, rand);
}
return true;
}
}
示例9: getBlockPathWeight
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public float getBlockPathWeight(BlockPos pos)
{
return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.stone ? 10.0F : super.getBlockPathWeight(pos);
}
示例10: func_180519_a
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public void func_180519_a(ChunkPrimer p_180519_1_)
{
for (int i = 0; i < 16; ++i)
{
for (int j = 0; j < 16; ++j)
{
int k = 1;
int l = -1;
IBlockState iblockstate = Blocks.end_stone.getDefaultState();
IBlockState iblockstate1 = Blocks.end_stone.getDefaultState();
for (int i1 = 127; i1 >= 0; --i1)
{
IBlockState iblockstate2 = p_180519_1_.getBlockState(i, i1, j);
if (iblockstate2.getBlock().getMaterial() == Material.air)
{
l = -1;
}
else if (iblockstate2.getBlock() == Blocks.stone)
{
if (l == -1)
{
if (k <= 0)
{
iblockstate = Blocks.air.getDefaultState();
iblockstate1 = Blocks.end_stone.getDefaultState();
}
l = k;
if (i1 >= 0)
{
p_180519_1_.setBlockState(i, i1, j, iblockstate);
}
else
{
p_180519_1_.setBlockState(i, i1, j, iblockstate1);
}
}
else if (l > 0)
{
--l;
p_180519_1_.setBlockState(i, i1, j, iblockstate1);
}
}
}
}
}
}
示例11: getStoneBlock
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
@Override
protected BlockMetaPair getStoneBlock() {
return new BlockMetaPair(Blocks.stone, (byte) 0);
}