net.minecraft.block.BlockFlower Java Examples
The following examples show how to use
net.minecraft.block.BlockFlower.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BiomeLushHills.java From CommunityMod with GNU Lesser General Public License v2.1 | 6 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.9D) { int j = rand.nextInt(4); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } }
Example #2
Source File: BiomeMeadow.java From Traverse-Legacy-1-12-2 with MIT License | 6 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.8D) { int j = rand.nextInt(5); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } }
Example #3
Source File: BiomeMeadow.java From Traverse-Legacy-1-12-2 with MIT License | 6 votes |
public BiomeMeadow() { super(properties); decorator.treesPerChunk = 0; decorator.extraTreeChance = 0.2F; decorator.flowersPerChunk = 15; decorator.grassPerChunk = 15; decorator.reedsPerChunk = 2; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 4)); spawnableCreatureList.add(new SpawnListEntry(EntityDonkey.class, 1, 1, 2)); this.flowers.clear(); for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10); } }
Example #4
Source File: BiomeWoodlands.java From Traverse-Legacy-1-12-2 with MIT License | 6 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.8D) { int j = rand.nextInt(4); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } }
Example #5
Source File: BiomeLushHills.java From Traverse-Legacy-1-12-2 with MIT License | 6 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.9D) { int j = rand.nextInt(4); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } }
Example #6
Source File: BiomeMeadow.java From CommunityMod with GNU Lesser General Public License v2.1 | 6 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.8D) { int j = rand.nextInt(5); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } }
Example #7
Source File: BiomeMeadow.java From CommunityMod with GNU Lesser General Public License v2.1 | 6 votes |
public BiomeMeadow() { super(properties); decorator.treesPerChunk = 0; decorator.extraTreeChance = 0.2F; decorator.flowersPerChunk = 15; decorator.grassPerChunk = 15; decorator.reedsPerChunk = 2; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 4)); spawnableCreatureList.add(new SpawnListEntry(EntityDonkey.class, 1, 1, 2)); this.flowers.clear(); for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10); } }
Example #8
Source File: BiomeWoodlands.java From CommunityMod with GNU Lesser General Public License v2.1 | 6 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.8D) { int j = rand.nextInt(4); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } }
Example #9
Source File: BiomeLushHills.java From Traverse-Legacy-1-12-2 with MIT License | 5 votes |
public BiomeLushHills() { super(properties); decorator.treesPerChunk = 2; decorator.flowersPerChunk = 10; decorator.grassPerChunk = 3; this.flowers.clear(); for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10); } }
Example #10
Source File: BiomeWoodlands.java From Traverse-Legacy-1-12-2 with MIT License | 5 votes |
public BiomeWoodlands() { super(properties); decorator.treesPerChunk = 4; decorator.flowersPerChunk = 6; decorator.grassPerChunk = 16; this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 2, 4, 4)); this.flowers.clear(); for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10); } }
Example #11
Source File: BiomeWoodlands.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
public BiomeWoodlands() { super(properties); decorator.treesPerChunk = 4; decorator.flowersPerChunk = 6; decorator.grassPerChunk = 16; this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 2, 4, 4)); this.flowers.clear(); for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10); } }
Example #12
Source File: BiomeLushHills.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
public BiomeLushHills() { super(properties); decorator.treesPerChunk = 2; decorator.flowersPerChunk = 10; decorator.grassPerChunk = 3; this.flowers.clear(); for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) { if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; addFlower(net.minecraft.init.Blocks.RED_FLOWER.getDefaultState().withProperty(net.minecraft.init.Blocks.RED_FLOWER.getTypeProperty(), type), 10); } }
Example #13
Source File: BiomeLushSwamp.java From CommunityMod with GNU Lesser General Public License v2.1 | 4 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { return BlockFlower.EnumFlowerType.BLUE_ORCHID; }
Example #14
Source File: BiomeLushSwamp.java From CommunityMod with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void addDefaultFlowers() { addFlower(Blocks.RED_FLOWER.getDefaultState().withProperty(Blocks.RED_FLOWER.getTypeProperty(), BlockFlower.EnumFlowerType.BLUE_ORCHID), 10); }
Example #15
Source File: BiomeLushSwamp.java From Traverse-Legacy-1-12-2 with MIT License | 4 votes |
public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { return BlockFlower.EnumFlowerType.BLUE_ORCHID; }
Example #16
Source File: BiomeLushSwamp.java From Traverse-Legacy-1-12-2 with MIT License | 4 votes |
@Override public void addDefaultFlowers() { addFlower(Blocks.RED_FLOWER.getDefaultState().withProperty(Blocks.RED_FLOWER.getTypeProperty(), BlockFlower.EnumFlowerType.BLUE_ORCHID), 10); }
Example #17
Source File: OilGeneratorFix.java From NewHorizonsCoreMod with GNU General Public License v3.0 | 4 votes |
private int getTopBlock( World pWorld, int pLocX, int pLocZ ) { Chunk tChunk = pWorld.getChunkFromBlockCoords( pLocX, pLocZ ); int y = tChunk.getTopFilledSegment() + 15; int trimmedX = pLocX & 0xF; int trimmedZ = pLocZ & 0xF; for( ; y > 0; y-- ) { Block tBlock = tChunk.getBlock( trimmedX, y, trimmedZ ); if( !tBlock.isAir( pWorld, pLocX, y, pLocZ ) ) { if(tBlock instanceof BlockStaticLiquid) { return y; } if(tBlock instanceof BlockFluidBase) { return y; } if(tBlock instanceof IFluidBlock) { return y; } if( tBlock.getMaterial().blocksMovement() ) { if( !( tBlock instanceof BlockFlower ) ) { return y - 1; } } } } return -1; }
Example #18
Source File: MoCBlock.java From mocreaturesdev with GNU General Public License v3.0 | 4 votes |
@Override public boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant) { int plantID = plant.getPlantID(world, x, y + 1, z); EnumPlantType plantType = plant.getPlantType(world, x, y + 1, z); if (plantID == cactus.blockID && blockID == cactus.blockID) { return true; } if (plantID == reed.blockID && blockID == reed.blockID) { return true; } if (plant instanceof BlockFlower) { return true; } switch (plantType) { case Desert: return blockID == sand.blockID; case Nether: return blockID == slowSand.blockID; case Crop: return blockID == tilledField.blockID; case Cave: return isBlockSolidOnSide(world, x, y, z, UP); case Plains: return blockID == grass.blockID || blockID == dirt.blockID; case Water: return world.getBlockMaterial(x, y, z) == Material.water && world.getBlockMetadata(x, y, z) == 0; case Beach: boolean isBeach = (blockID == Block.grass.blockID || blockID == Block.dirt.blockID || blockID == Block.sand.blockID); boolean hasWater = (world.getBlockMaterial(x - 1, y, z ) == Material.water || world.getBlockMaterial(x + 1, y, z ) == Material.water || world.getBlockMaterial(x, y, z - 1) == Material.water || world.getBlockMaterial(x, y, z + 1) == Material.water); return isBeach && hasWater; } return false; }