Merge pull request #2473 from MellowArpeggiation/master

common worldgen cascade fixes (improved worldgen performance)
This commit is contained in:
HbmMods 2025-10-06 07:52:22 +02:00 committed by GitHub
commit ab7c852d61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 24 deletions

View File

@ -576,8 +576,8 @@ public class HbmWorldGen implements IWorldGenerator {
}
if(WorldConfig.meteoriteSpawn > 0 && rand.nextInt(WorldConfig.meteoriteSpawn) == 0) {
int x = i + rand.nextInt(16);
int z = j + rand.nextInt(16);
int x = i + rand.nextInt(16) + 8;
int z = j + rand.nextInt(16) + 8;
int y = world.getHeightValue(x, z) - rand.nextInt(10);
if(y > 1) (new Meteorite()).generate(world, rand, x, y, z, false, false, false);
}

View File

@ -130,7 +130,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe
IBatteryItem battery = (IBatteryItem) stack.getItem();
long toCharge = Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate());
toCharge = Math.min(toCharge, power / 5);
toCharge = Math.min(toCharge, Math.max(power / 5, 1));
battery.chargeBattery(stack, toCharge);
power -= toCharge;

View File

@ -88,8 +88,8 @@ public class DungeonToolbox {
private static WorldGenFlowers genFlowers = new WorldGenFlowers(null);
public static void generateFlowers(World world, Random rand, int chunkX, int chunkZ, Block flower, int meta) {
int x = chunkX + rand.nextInt(16);
int z = chunkZ + rand.nextInt(16);
int x = chunkX + rand.nextInt(16) + 8;
int z = chunkZ + rand.nextInt(16) + 8;
int y = world.getHeightValue(x, z);
genFlowers.func_150550_a(flower, meta);
genFlowers.generate(world, rand, x, y, z);