Skip to content

Commit

Permalink
Cherry tree rarity increased, also configurable
Browse files Browse the repository at this point in the history
Fix bamboo mosaic being enabled under the wrong conditions
  • Loading branch information
Roadhog360 committed Nov 20, 2023
1 parent e51d8e4 commit f3e77de
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/ganymedes01/etfuturum/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ public enum ModBlocks {
BAMBOO_STAIRS(ConfigBlocksItems.enableBambooBlocks, new BaseStairs(WOOD_PLANKS.get(), 4).setBlockSound(ModSounds.soundBambooWood).setUnlocalizedNameWithPrefix("bamboo")),

//Not plank, but like plank
BAMBOO_MOSAIC(ConfigBlocksItems.woodVariants, new BlockBambooMosaic()),
BAMBOO_MOSAIC_SLAB(ConfigBlocksItems.woodVariants, new BaseSlab(false, Material.wood, "bamboo_mosaic").setNames("bamboo_mosaic_slab")
BAMBOO_MOSAIC(ConfigBlocksItems.enableBambooBlocks, new BlockBambooMosaic()),
BAMBOO_MOSAIC_SLAB(ConfigBlocksItems.enableBambooBlocks, new BaseSlab(false, Material.wood, "bamboo_mosaic").setNames("bamboo_mosaic_slab")
.setBlockSound(ModSounds.soundBambooWood).setHardness(2).setResistance(3)),
DOUBLE_BAMBOO_MOSAIC_SLAB(ConfigBlocksItems.woodVariants, new BaseSlab(true, Material.wood, "bamboo_mosaic").setNames("bamboo_mosaic_slab")
DOUBLE_BAMBOO_MOSAIC_SLAB(ConfigBlocksItems.enableBambooBlocks, new BaseSlab(true, Material.wood, "bamboo_mosaic").setNames("bamboo_mosaic_slab")
.setBlockSound(ModSounds.soundBambooWood).setHardness(2).setResistance(3)),
BAMBOO_MOSAIC_STAIRS(ConfigBlocksItems.enableBambooBlocks, new BaseStairs(BAMBOO_MOSAIC.get(), 0).setBlockSound(ModSounds.soundBambooWood).setUnlocalizedNameWithPrefix("bamboo_mosaic")),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.ModBlocks;
import ganymedes01.etfuturum.client.particle.CustomParticles;
import ganymedes01.etfuturum.configuration.configs.ConfigBlocksItems;
Expand All @@ -20,6 +21,7 @@ public class BlockModernLeaves extends BaseLeaves {

public BlockModernLeaves() {
super("mangrove", "cherry");
setCreativeTab(EtFuturum.creativeTabBlocks);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.configuration.configs.ConfigBlocksItems;
import ganymedes01.etfuturum.world.generate.decorate.WorldGenCherryTrees;
import net.minecraft.block.Block;
Expand All @@ -24,6 +25,7 @@ public class BlockModernSapling extends BlockSapling implements ISubBlocksBlock

public BlockModernSapling() {
setStepSound(Block.soundTypeGrass);
setCreativeTab(EtFuturum.creativeTabBlocks);
}

@SideOnly(Side.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class ConfigWorld extends ConfigBase {
public static int amethystMaxY;
public static int[] amethystDimensionBlacklist;
public static boolean amethystDimensionBlacklistAsWhitelist;
public static int cherryTreeForestRarity;
public static int cherryTreePlainsRarity;

public static int crimsonForestID;
public static int warpedForestID;
Expand Down Expand Up @@ -169,6 +171,8 @@ protected void syncConfigOptions() {
amethystDimensionBlacklistAsWhitelist = getBoolean("amethystDimensionBlacklistAsWhitelist", catGeneration, false, "Treat the amethyst dimension blacklist as a whitelist instead, so geodes will ONLY generate in those dimensions, instead of excluding those dimensions from generation.");
amethystRarity = getInt("amethystRarity", catGeneration, 53, 1, 128, "How rare should amethyst geodes be? 1/x chance per chunk, 1 means a geode attempts to appear every chunk");
amethystMaxY = getInt("amethystMaxY", catGeneration, 46, 6, 245, "Max Y level amethyst geodes should attempt to generate at");
cherryTreeForestRarity = getInt("cherryTreeForestRarity", catGeneration, 72, 1, 128, "How rare should cherry trees be in certain forest biomes? 1/x chance per chunk, 1 means a tree attempts to appear every chunk. 0 = no cherry trees in forest biomes.");
cherryTreePlainsRarity = getInt("cherryTreePlainsRarity", catGeneration, 124, 1, 128, "How rare should cherry trees be in certain plains biomes? 1/x chance per chunk, 1 means a tree attempts to appear every chunk. 0 = no cherry trees in plains biomes.");

crimsonForestID = getInt("crimsonForestID", catBiomes, 200, -1, 65536, "Set to -1 to disable the generation of Crimson Forests. To use an ID above 255, EndlessIDs is required.");
warpedForestID = getInt("warpedForestID", catBiomes, 201, -1, 65536, "Set to -1 to disable the generation of Warped Forests. To use an ID above 255, EndlessIDs is required.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkPro
Block block = world.getBlock(x, y - 1, z);
if (y > 0 && block.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (IPlantable) ModBlocks.SAPLING.get())) {
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
int rng = cherryForestBiomes.contains(biome) ? 64 : cherryPlainsBiomes.contains(biome) ? 80 : 0;
int rng = cherryForestBiomes.contains(biome) ? ConfigWorld.cherryTreeForestRarity : cherryPlainsBiomes.contains(biome) ? ConfigWorld.cherryTreePlainsRarity : 0;
if (rng > 0 && rand.nextInt(rng) == 0) {
if (cherryTreeGen.generate(world, rand, x, y, z)) {
cherryTreeGen.func_150524_b(world, rand, x, y, z);
Expand Down

0 comments on commit f3e77de

Please sign in to comment.