net.minecraftforge.event.terraingen.DecorateBiomeEvent Java Examples

The following examples show how to use net.minecraftforge.event.terraingen.DecorateBiomeEvent. 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: NeatNetherGen.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
@SubscribeEvent
public static void onDecorate(DecorateBiomeEvent.Pre event)
{
	if(event.getWorld().provider.getDimension() == -1)  //Only gen in nether
	{
		for(int i = 0; i < 4; i++)
		{
			if(event.getWorld().rand.nextInt(25) == 0)
			{
				WorldGenSmoulderingAsh ashGen = new WorldGenSmoulderingAsh(2 + event.getRand().nextInt(5));

				int x = event.getChunkPos().getXStart() + event.getRand().nextInt(16) + 8;
				int z = event.getChunkPos().getZStart() + event.getRand().nextInt(16) + 8;

				int y = event.getRand().nextInt((100 - 40) + 1) + 40;
				ashGen.generate(event.getWorld(), event.getRand(), new BlockPos(x, y, z));
			}
		}
	}
}
 
Example #2
Source File: TofuEventLoader.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@SubscribeEvent
  public void decorateBiome(DecorateBiomeEvent.Post event)
  {
      World worldObj = event.getWorld();
      Random rand = event.getRand();
      @SuppressWarnings("deprecation")
BlockPos pos = event.getPos();
      // Hellsoybeans
      if (rand.nextInt(600) < Math.min((Math.abs(pos.getX()) + Math.abs(pos.getZ())) / 2, 400) - 100)
      {
          if (Biome.getIdForBiome(worldObj.getBiome(pos)) == Biome.getIdForBiome(Biomes.HELL))
          {
              int k = pos.getX();
              int l = pos.getZ();
              BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos();
              
              for (int i = 0; i < 10; ++i)
              {
                  int j1 = k + rand.nextInt(16) + 8;
                  int k1 = rand.nextInt(128);
                  int l1 = l + rand.nextInt(16) + 8;
                  mutable.setPos(j1, k1, l1);
                  
                  (new WorldGenCrops((BlockBush)BlockLoader.SOYBEAN_NETHER)
                  		{ 
                  			@Override
						protected IBlockState getStateToPlace() {
                  				return this.plantBlock.getDefaultState().withProperty(BlockSoybeanNether.AGE, 7);
                  			}
                  		})
                  		.generate(worldObj, rand, mutable);           
              }
          }
      }
  }
 
Example #3
Source File: BiomeCliffs.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void decorate(World worldIn, Random rand, BlockPos pos) {
    if (!TraverseConfig.disallowBoulders && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, DecorateBiomeEvent.Decorate.EventType.ROCK)) {
        int genChance = rand.nextInt(9);
        if (genChance == 0) {
            int k6 = rand.nextInt(16) + 8;
            int l = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(k6, 0, l));
            COBBLESTONE_BOULDER_FEATURE.generate(worldIn, rand, blockpos);
        }
    }
    super.decorate(worldIn, rand, pos);
}
 
Example #4
Source File: BiomeAridHighland.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void decorate(World worldIn, Random rand, BlockPos pos) {
	if (net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, DecorateBiomeEvent.Decorate.EventType.TREE)) {
		if (rand.nextInt(5) == 0) {
			int k6 = rand.nextInt(16) + 8;
			int l = rand.nextInt(16) + 8;
			BlockPos blockpos = worldIn.getHeight(pos.add(k6, 0, l));
			OAK_SHRUB_FEATURE.generate(worldIn, rand, blockpos);
		}
	}

	super.decorate(worldIn, rand, pos);
}
 
Example #5
Source File: BiomeCragCliffs.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void decorate(World worldIn, Random rand, BlockPos pos) {
	if (!TraverseConfig.disallowBoulders && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, DecorateBiomeEvent.Decorate.EventType.ROCK)) {
		int genChance = rand.nextInt(9);
		if (genChance == 0) {
			int k6 = rand.nextInt(16) + 8;
			int l = rand.nextInt(16) + 8;
			BlockPos blockpos = worldIn.getHeight(pos.add(k6, 0, l));
			BOULDER_FEATURE.generate(worldIn, rand, blockpos);
		}
	}
	super.decorate(worldIn, rand, pos);
}
 
Example #6
Source File: GTEventDecorateBiome.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public void onEvent(DecorateBiomeEvent.Decorate event) {
	if (GTConfig.general.reduceGrassOnWorldGen && event.getType() == DecorateBiomeEvent.Decorate.EventType.GRASS
			&& event.getRand().nextInt(11) != 0) {
		event.setResult(Event.Result.DENY);
	}
}
 
Example #7
Source File: BiomeCliffs.java    From Traverse-Legacy-1-12-2 with MIT License 5 votes vote down vote up
@Override
public void decorate(World worldIn, Random rand, BlockPos pos) {
    if (!TraverseConfig.disallowBoulders && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, DecorateBiomeEvent.Decorate.EventType.ROCK)) {
        int genChance = rand.nextInt(9);
        if (genChance == 0) {
            int k6 = rand.nextInt(16) + 8;
            int l = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(k6, 0, l));
            COBBLESTONE_BOULDER_FEATURE.generate(worldIn, rand, blockpos);
        }
    }
    super.decorate(worldIn, rand, pos);
}
 
Example #8
Source File: BiomeAridHighland.java    From Traverse-Legacy-1-12-2 with MIT License 5 votes vote down vote up
@Override
public void decorate(World worldIn, Random rand, BlockPos pos) {
	if (net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, DecorateBiomeEvent.Decorate.EventType.TREE)) {
		if (rand.nextInt(5) == 0) {
			int k6 = rand.nextInt(16) + 8;
			int l = rand.nextInt(16) + 8;
			BlockPos blockpos = worldIn.getHeight(pos.add(k6, 0, l));
			OAK_SHRUB_FEATURE.generate(worldIn, rand, blockpos);
		}
	}

	super.decorate(worldIn, rand, pos);
}
 
Example #9
Source File: BiomeCragCliffs.java    From Traverse-Legacy-1-12-2 with MIT License 5 votes vote down vote up
@Override
public void decorate(World worldIn, Random rand, BlockPos pos) {
	if (!TraverseConfig.disallowBoulders && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, DecorateBiomeEvent.Decorate.EventType.ROCK)) {
		int genChance = rand.nextInt(9);
		if (genChance == 0) {
			int k6 = rand.nextInt(16) + 8;
			int l = rand.nextInt(16) + 8;
			BlockPos blockpos = worldIn.getHeight(pos.add(k6, 0, l));
			BOULDER_FEATURE.generate(worldIn, rand, blockpos);
		}
	}
	super.decorate(worldIn, rand, pos);
}
 
Example #10
Source File: GenHandler.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void gen(DecorateBiomeEvent.Pre event) {
	if (ConfigValues.manaPoolRarity > 0)
		if (ConfigValues.isDimBlacklist ^ Ints.contains(ConfigValues.manaPoolDimWhitelist, event.getWorld().provider.getDimension()))
			generateMana(event.getWorld(), event.getRand(), event.getChunkPos().x, event.getChunkPos().z);
}