Java Code Examples for net.minecraft.init.Blocks.stone()
The following are Jave code examples for showing how to use
stone() of the
net.minecraft.init.Blocks
class.
You can vote up the examples you like. Your votes will be used in our system to get
more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft File: BiomeGenHills.java View Source Code | 6 votes |
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)); } }
Example 2
Project: BaseClient File: BlockSilverfish.java View Source Code | 6 votes |
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); } }
Example 3
Project: DecompiledMinecraft File: EntityItem.java View Source Code | 6 votes |
/** * 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; } }
Example 4
Project: DecompiledMinecraft File: BlockSilverfish.java View Source Code | 6 votes |
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); } }
Example 5
Project: DecompiledMinecraft File: BiomeGenHills.java View Source Code | 6 votes |
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)); } }
Example 6
Project: TRAPPIST-1 File: BiomeGenSpace.java View Source Code | 6 votes |
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); } }
Example 7
Project: BaseClient File: BlockSilverfish.java View Source Code | 6 votes |
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); } }
Example 8
Project: Prospecting File: OreDictCache.java View Source Code | 5 votes |
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); } } } }
Example 9
Project: DecompiledMinecraft File: WorldGenBlockBlob.java View Source Code | 4 votes |
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(); } }
Example 10
Project: BaseClient File: WorldGenBlockBlob.java View Source Code | 4 votes |
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(); } }
Example 11
Project: DecompiledMinecraft File: MapGenCaves.java View Source Code | 4 votes |
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)))))))); }
Example 12
Project: BaseClient File: WorldGenLiquids.java View Source Code | 4 votes |
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; } }
Example 13
Project: BaseClient File: MapGenCaves.java View Source Code | 4 votes |
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)))))))); }
Example 14
Project: BaseClient File: EntitySilverfish.java View Source Code | 4 votes |
public float getBlockPathWeight(BlockPos pos) { return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.stone ? 10.0F : super.getBlockPathWeight(pos); }
Example 15
Project: DecompiledMinecraft File: MapGenCaves.java View Source Code | 4 votes |
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)))))))); }
Example 16
Project: DecompiledMinecraft File: ChunkProviderEnd.java View Source Code | 4 votes |
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); } } } } } }
Example 17
Project: DecompiledMinecraft File: EntitySilverfish.java View Source Code | 4 votes |
public float getBlockPathWeight(BlockPos pos) { return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.stone ? 10.0F : super.getBlockPathWeight(pos); }
Example 18
Project: BaseClient File: MapGenCaves.java View Source Code | 4 votes |
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)))))))); }
Example 19
Project: TRAPPIST-1 File: ChunkProviderTrappistOneB.java View Source Code | 4 votes |
@Override protected BlockMetaPair getStoneBlock() { return new BlockMetaPair(Blocks.stone, (byte) 0); }
Example 20
Project: TRAPPIST-1 File: ChunkProviderTrappistOneC.java View Source Code | 4 votes |
@Override protected BlockMetaPair getStoneBlock() { return new BlockMetaPair(Blocks.stone, (byte) 0); }