Skip to content

Commit

Permalink
Merge remote-tracking branch 'Minepolz320/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Feb 4, 2024
2 parents 68fff55 + 967a0eb commit b74b58a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
5 changes: 4 additions & 1 deletion src/main/java/twilightforest/TFFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ public static TFFeature generateFeatureFor1Point7(int chunkX, int chunkZ, World
// get random value
Random hillRNG = new Random(world.getSeed() + chunkX * 25117L + chunkZ * 151121L);

// Balance major features chance
// Modify major features (Bosses) generation rate
// 100% = default
// 50% = only 50% generation chance from default chance

if (!getRandom(hillRNG, TwilightForestMod.majorFeatureGenChance)) {
return nothing;
}
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/twilightforest/TwilightForestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;

import baubles.api.BaubleType;
import cpw.mods.fml.common.FMLCommonHandler;
Expand Down Expand Up @@ -125,7 +126,7 @@ public class TwilightForestMod {

// Major feature spawn chance
public static double majorFeatureGenChance = 100;
public static double minorFeatureGenChance = 100;
public static double minorFeatureGenChance = 14;

public static int idMobWildBoar;
public static int idMobBighornSheep;
Expand Down Expand Up @@ -1017,8 +1018,12 @@ private void loadConfiguration(Configuration configFile) {
}

// Gen chance
majorFeatureGenChance = configFile.get("WorldGen", "Major Feature Generation Chance", 100).getDouble(100);
minorFeatureGenChance = configFile.get("WorldGen", "Minor Feature Generation Chance", 100).getDouble(100);
Property majorGenChance = configFile.get("WorldGen", "Major Feature Generation Chance", 100);
majorGenChance.comment = "IT IS NOT RECOMMENDED TO CHANGE ON AN ALREADY CREATED WORLD! Since old dungeons can change/don't showing the icon on the magic map or will not be generated completely";
majorFeatureGenChance = majorGenChance.getDouble();

minorFeatureGenChance = configFile.get("WorldGen", "Minor Feature Generation Chance", 14).getDouble(14);

stalactiteOrePopulationDensity = configFile.get("WorldGen", "Ore density in stalactites", 100).getDouble(100);

// fixed values, don't even read the config
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/twilightforest/biomes/TFBiomeDecorator.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,14 @@ protected void genDecorations(BiomeGenBase biome) {
// random features!
// now with chance
if (TFFeature.getRandom(randomGenerator, TwilightForestMod.minorFeatureGenChance)) {
if (randomGenerator.nextInt(6) == 0) {
int rx = chunk_X + randomGenerator.nextInt(16) + 8;
int rz = chunk_Z + randomGenerator.nextInt(16) + 8;
int ry = currentWorld.getHeightValue(rx, rz);
if (ry < 75) {
TFGenerator rf = randomFeature(randomGenerator);
rf.generate(currentWorld, randomGenerator, rx, ry, rz);
}
int rx = chunk_X + randomGenerator.nextInt(16) + 8;
int rz = chunk_Z + randomGenerator.nextInt(16) + 8;
int ry = currentWorld.getHeightValue(rx, rz);
if (ry < 75) {
TFGenerator rf = randomFeature(randomGenerator);
rf.generate(currentWorld, randomGenerator, rx, ry, rz);
}

}

// add canopy trees
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class GT_Integration_Utils {

static GT_OrePlacer orePlacer;
private static GT_OrePlacer orePlacer;

public static void init() {
// Create worker obj
Expand All @@ -24,8 +24,4 @@ public static boolean doPlaceGTOre(World aWorld, int aX, int aY, int aZ, Block m
return orePlacer.placeGTOre(aWorld, aX, aY, aZ, mcOreBlock);
}

public static GT_OrePlacer getOrePlacer() {
return orePlacer;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class TFGenCaveStalactite extends TFGenerator {
public int maxLength;
public int minHeight;

// Greg?
public boolean doOreGen;

/**
Expand Down

0 comments on commit b74b58a

Please sign in to comment.