From 55f64675b42ac8d3c557cc850f78664bee006f6f Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 28 Jan 2023 19:32:44 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../everglades/gen/WorldGenDeadLilly.java | 1 + .../everglades/gen/WorldGenMinable_Custom.java | 20 +- .../gtPlusPlus/everglades/gen/gt/WorldGen_GT.java | 31 +- .../everglades/gen/gt/WorldGen_GT_Base.java | 317 +++++++++------- .../everglades/gen/gt/WorldGen_GT_Ore_Layer.java | 401 +++++++++++---------- .../everglades/gen/gt/WorldGen_Ores.java | 205 +++++++++-- 6 files changed, 599 insertions(+), 376 deletions(-) (limited to 'src/main/java/gtPlusPlus/everglades/gen') diff --git a/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java b/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java index ded79aec6a..37947452c5 100644 --- a/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java +++ b/src/main/java/gtPlusPlus/everglades/gen/WorldGenDeadLilly.java @@ -1,6 +1,7 @@ package gtPlusPlus.everglades.gen; import java.util.Random; + import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenWaterlily; diff --git a/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java b/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java index 1480c8651a..2e9d62d99f 100644 --- a/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java +++ b/src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java @@ -2,15 +2,18 @@ package gtPlusPlus.everglades.gen; import static gtPlusPlus.core.lib.CORE.PI; -import gtPlusPlus.api.objects.Logger; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenMinable; +import gtPlusPlus.api.objects.Logger; + public class WorldGenMinable_Custom extends WorldGenMinable { + /** The block to generate. */ private Block oreToGenerate; /** The number of blocks to generate. */ @@ -68,12 +71,17 @@ public class WorldGenMinable_Custom extends WorldGenMinable { if (((d12 * d12) + (d13 * d13)) < 1.0D) { for (int i3 = k1; i3 <= j2; ++i3) { final double d14 = ((i3 + 0.5D) - d8) / (d10 / 2.0D); - if ((((d12 * d12) + (d13 * d13) + (d14 * d14)) < 1.0D) - && world.getBlock(k2, l2, i3) - .isReplaceableOreGen(world, k2, l2, i3, this.blockToReplace)) { + if ((((d12 * d12) + (d13 * d13) + (d14 * d14)) < 1.0D) && world.getBlock(k2, l2, i3) + .isReplaceableOreGen(world, k2, l2, i3, this.blockToReplace)) { world.setBlock(k2, l2, i3, this.oreToGenerate, this.mineableBlockMeta, 3); - Logger.INFO("Generated a " + this.oreToGenerate.getLocalizedName() + " at x: " + k2 - + " | y: " + l2 + " | z: " + i3); + Logger.INFO( + "Generated a " + this.oreToGenerate.getLocalizedName() + + " at x: " + + k2 + + " | y: " + + l2 + + " | z: " + + i3); } } } diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java index ae60ca1b4e..70dfd2b35a 100644 --- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java +++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT.java @@ -1,14 +1,17 @@ package gtPlusPlus.everglades.gen.gt; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; import java.util.List; import java.util.Map; import java.util.Random; import java.util.concurrent.ConcurrentHashMap; + import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import gtPlusPlus.xmod.gregtech.HANDLER_GT; + public abstract class WorldGen_GT { + public final String mWorldGenName; public final boolean mEnabled; private final Map mDimensionMap = new ConcurrentHashMap(); @@ -21,27 +24,13 @@ public abstract class WorldGen_GT { } } - public boolean executeWorldgen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return false; } - public boolean executeCavegen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return false; } @@ -50,7 +39,9 @@ public abstract class WorldGen_GT { Boolean tAllowed = (Boolean) this.mDimensionMap.get(aDimName); if (tAllowed == null) { boolean tValue = HANDLER_GT.sCustomWorldgenFile.get( - "worldgen.dimensions." + this.mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); + "worldgen.dimensions." + this.mWorldGenName, + aDimName, + aDimensionType == aAllowedDimensionType); this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue)); return tValue; } else { diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java index cbf07372fc..eeb45cee22 100644 --- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java +++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Base.java @@ -1,5 +1,13 @@ package gtPlusPlus.everglades.gen.gt; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenMinable; + import cpw.mods.fml.common.IWorldGenerator; import gregtech.api.util.GT_Log; import gtPlusPlus.api.objects.Logger; @@ -7,12 +15,6 @@ import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.everglades.dimension.Dimension_Everglades; import gtPlusPlus.xmod.gregtech.HANDLER_GT; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.feature.WorldGenMinable; public class WorldGen_GT_Base implements IWorldGenerator { @@ -21,29 +23,25 @@ public class WorldGen_GT_Base implements IWorldGenerator { */ /** - * Control percentage of filled 3x3 chunks. Lower number means less oreveins - * spawn + * Control percentage of filled 3x3 chunks. Lower number means less oreveins spawn */ public static int oreveinPercentage; /** - * Control number of attempts to find a valid orevein. Generally this - * maximum limit isn't hit, selecting a vein is cheap + * Control number of attempts to find a valid orevein. Generally this maximum limit isn't hit, selecting a vein is + * cheap */ public static int oreveinAttempts; /** - * Control number of attempts to place a valid orevein. If a vein wasn't - * placed due to height restrictions, completely in the water, etc, another - * attempt is tried. + * Control number of attempts to place a valid orevein. If a vein wasn't placed due to height restrictions, + * completely in the water, etc, another attempt is tried. */ public static int oreveinMaxPlacementAttempts; /** - * Debug parameter for world generation. Tracks chunks added/removed from - * run queue. + * Debug parameter for world generation. Tracks chunks added/removed from run queue. */ public static boolean debugWorldGen = false; /** - * Try re-implement Richard Hendrick's Chunk by Chunk Ore Generation from - * his GT5u fork. + * Try re-implement Richard Hendrick's Chunk by Chunk Ore Generation from his GT5u fork. */ public static List mList = new ArrayList(); @@ -62,8 +60,8 @@ public class WorldGen_GT_Base implements IWorldGenerator { ELEMENT.getInstance().IRON, ELEMENT.getInstance().IRON); - public static Hashtable validOreveins = - new Hashtable(1024); + public static Hashtable validOreveins = new Hashtable( + 1024); public boolean mIsGenerating = false; public static final Object listLock = new Object(); @@ -76,25 +74,15 @@ public class WorldGen_GT_Base implements IWorldGenerator { } @Override - public void generate( - Random random, - int chunkX, - int chunkZ, - World world, - IChunkProvider chunkGenerator, + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if (world.provider.dimensionId == Dimension_Everglades.DIMID) { generateSafely(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } } - public synchronized void generateSafely( - Random random, - int chunkX, - int chunkZ, - World world, - IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { + public synchronized void generateSafely(Random random, int chunkX, int chunkZ, World world, + IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { int xDim = Dimension_Everglades.DIMID; switch (world.provider.dimensionId) { case -1: // Nether @@ -116,32 +104,35 @@ public class WorldGen_GT_Base implements IWorldGenerator { } } - private synchronized void generateEverglades( - Random aRandom, - int aX, - int aZ, - World aWorld, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + private synchronized void generateEverglades(Random aRandom, int aX, int aZ, World aWorld, + IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { Logger.WORLD("Trying to Generate Dimension."); synchronized (listLock) { Logger.WORLD("Locked List addition."); - if (WorldGen_GT_Base.mList.add(new WorldGenContainer( - new XSTR(Math.abs(aRandom.nextInt()) + 1), - aX, - aZ, - Dimension_Everglades.DIMID, - aWorld, - aChunkGenerator, - aChunkProvider, - aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))) { + if (WorldGen_GT_Base.mList.add( + new WorldGenContainer( + new XSTR(Math.abs(aRandom.nextInt()) + 1), + aX, + aZ, + Dimension_Everglades.DIMID, + aWorld, + aChunkGenerator, + aChunkProvider, + aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))) { Logger.WORLD("Locked List addition. Success."); } else { Logger.WORLD("Locked List addition. Fail."); } - if (debugWorldGen) - GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId - + " chunk x:" + aX + " z:" + aZ + " SIZE: " + WorldGen_GT_Base.mList.size()); + if (debugWorldGen) GT_Log.out.println( + "ADD WorldSeed:" + aWorld.getSeed() + + " DimId" + + aWorld.provider.dimensionId + + " chunk x:" + + aX + + " z:" + + aZ + + " SIZE: " + + WorldGen_GT_Base.mList.size()); } if (!this.mIsGenerating) { @@ -154,10 +145,18 @@ public class WorldGen_GT_Base implements IWorldGenerator { // chunks get done later. for (int i = 0; i < mList_sS; i++) { WorldGenContainer toRun = (WorldGenContainer) WorldGen_GT_Base.mList.get(0); - if (debugWorldGen) - GT_Log.out.println("RUN WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId - + " chunk x:" + toRun.mX + " z:" + toRun.mZ + " SIZE: " + WorldGen_GT_Base.mList.size() - + " i: " + i); + if (debugWorldGen) GT_Log.out.println( + "RUN WorldSeed:" + aWorld.getSeed() + + " DimId" + + aWorld.provider.dimensionId + + " chunk x:" + + toRun.mX + + " z:" + + toRun.mZ + + " SIZE: " + + WorldGen_GT_Base.mList.size() + + " i: " + + i); synchronized (listLock) { Logger.WORLD("Locked List Removal."); WorldGen_GT_Base.mList.remove(0); @@ -169,19 +168,8 @@ public class WorldGen_GT_Base implements IWorldGenerator { } } - public void generateOre( - Block block, - World world, - Random random, - int chunk_x, - int chunk_z, - int maxX, - int maxZ, - int maxVeinSize, - int chancesToSpawn, - int minY, - int maxY, - Block generateIn) { + public void generateOre(Block block, World world, Random random, int chunk_x, int chunk_z, int maxX, int maxZ, + int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block generateIn) { int heightRange = maxY - minY; WorldGenMinable worldgenminable = new WorldGenMinable(block, maxVeinSize, generateIn); for (int k1 = 0; k1 < chancesToSpawn; ++k1) { @@ -193,6 +181,7 @@ public class WorldGen_GT_Base implements IWorldGenerator { } public static class WorldGenContainer implements Runnable { + public final Random mRandom; public final int mX; public final int mZ; @@ -205,6 +194,7 @@ public class WorldGen_GT_Base implements IWorldGenerator { // Local class to track which orevein seeds must be checked when doing // chunkified worldgen class NearbySeeds { + public int mX; public int mZ; @@ -212,21 +202,13 @@ public class WorldGen_GT_Base implements IWorldGenerator { this.mX = x; this.mZ = z; } - } - ; + }; public static ArrayList seedList = new ArrayList(); // aX and aZ are now the by-chunk X and Z for the chunk of interest - public WorldGenContainer( - Random aRandom, - int aX, - int aZ, - int aDimensionType, - World aWorld, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider, - String aBiome) { + public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld, + IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) { this.mRandom = aRandom; this.mX = aX; this.mZ = aZ; @@ -253,8 +235,7 @@ public class WorldGen_GT_Base implements IWorldGenerator { // bits 0-27. Cuts off the top few bits of the chunk so we have bits // for dimension. long oreveinSeed = (this.mWorld.getSeed() << 16) - ^ ((this.mWorld.provider.dimensionId & 0xffL) << 56 - | ((oreseedX & 0x000000000fffffffL) << 28) + ^ ((this.mWorld.provider.dimensionId & 0xffL) << 56 | ((oreseedX & 0x000000000fffffffL) << 28) | (oreseedZ & 0x000000000fffffffL)); // Use // an // RNG @@ -284,9 +265,18 @@ public class WorldGen_GT_Base implements IWorldGenerator { } if (debugWorldGen) { - GT_Log.out.println(" Finding oreveins for oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" - + this.mZ + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " worldSeed=" - + this.mWorld.getSeed()); + GT_Log.out.println( + " Finding oreveins for oreveinSeed=" + oreveinSeed + + " mX=" + + this.mX + + " mZ=" + + this.mZ + + " oreseedX=" + + oreseedX + + " oreseedZ=" + + oreseedZ + + " worldSeed=" + + this.mWorld.getSeed()); } Logger.INFO( @@ -294,33 +284,34 @@ public class WorldGen_GT_Base implements IWorldGenerator { // Search for a valid orevein for this dimension if (!validOreveins.containsKey(oreveinSeed)) { - Logger.INFO("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? " - + ((oreveinPercentageRoll < oreveinPercentage))); - Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? " - + (WorldGen_GT_Ore_Layer.sWeight > 0)); - Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? " - + (WorldGen_GT_Ore_Layer.sList.size() > 0)); - if ((oreveinPercentageRoll < oreveinPercentage) - && (WorldGen_GT_Ore_Layer.sWeight > 0) + Logger.INFO( + "[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? " + + ((oreveinPercentageRoll < oreveinPercentage))); + Logger.INFO( + "[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? " + + (WorldGen_GT_Ore_Layer.sWeight > 0)); + Logger.INFO( + "[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? " + + (WorldGen_GT_Ore_Layer.sList.size() > 0)); + if ((oreveinPercentageRoll < oreveinPercentage) && (WorldGen_GT_Ore_Layer.sWeight > 0) && (WorldGen_GT_Ore_Layer.sList.size() > 0)) { int placementAttempts = 0; boolean oreveinFound = false; int i; - for (i = 0; - (i < oreveinAttempts) - && (!oreveinFound) - && (placementAttempts < oreveinMaxPlacementAttempts); - i++) { + for (i = 0; (i < oreveinAttempts) && (!oreveinFound) + && (placementAttempts < oreveinMaxPlacementAttempts); i++) { Logger.INFO("[World Generation Debug] i: " + i); Logger.INFO("[World Generation Debug] placementAttempts: " + placementAttempts); Logger.INFO("[World Generation Debug] oreveinAttempts: " + oreveinAttempts); - Logger.INFO("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): " - + (placementAttempts < oreveinMaxPlacementAttempts)); + Logger.INFO( + "[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): " + + (placementAttempts < oreveinMaxPlacementAttempts)); Logger.INFO("[World Generation Debug] oreveinFound: " + oreveinFound); int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Ore_Layer.sWeight); for (WorldGen_GT_Ore_Layer tWorldGen : WorldGen_GT_Ore_Layer.sList) { - Logger.INFO("[World Generation Debug] Iterating sList - Size: " - + WorldGen_GT_Ore_Layer.sList.size()); + Logger.INFO( + "[World Generation Debug] Iterating sList - Size: " + + WorldGen_GT_Ore_Layer.sList.size()); tRandomWeight -= (tWorldGen).mWeight; if (tRandomWeight <= 0) { try { @@ -346,18 +337,23 @@ public class WorldGen_GT_Base implements IWorldGenerator { this.mChunkProvider); switch (placementResult) { case WorldGen_GT_Ore_Layer.ORE_PLACED: - if (debugWorldGen) - GT_Log.out.println(" Added oreveinSeed=" + oreveinSeed - + " tries at oremix=" + i + " placementAttempts=" - + placementAttempts + " dimensionName=" + tDimensionName); + if (debugWorldGen) GT_Log.out.println( + " Added oreveinSeed=" + oreveinSeed + + " tries at oremix=" + + i + + " placementAttempts=" + + placementAttempts + + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, tWorldGen); oreveinFound = true; Logger.INFO("[World Generation Debug] ORE_PLACED"); break; case WorldGen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: placementAttempts++; - Logger.INFO("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: " - + placementAttempts); + Logger.INFO( + "[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: " + + placementAttempts); // SHould do retry in this case // until out of chances break; @@ -365,24 +361,30 @@ public class WorldGen_GT_Base implements IWorldGenerator { // Orevein didn't reach this chunk, // can't add it yet to the hash Logger.INFO("[World Generation Debug] NO_OVERLAP"); - if (debugWorldGen) - GT_Log.out.println(" Added far oreveinSeed=" + oreveinSeed + " " - + (tWorldGen).mWorldGenName - + " tries at oremix=" - + i + " placementAttempts=" - + placementAttempts + " dimensionName=" - + tDimensionName); + if (debugWorldGen) GT_Log.out.println( + " Added far oreveinSeed=" + oreveinSeed + + " " + + (tWorldGen).mWorldGenName + + " tries at oremix=" + + i + + " placementAttempts=" + + placementAttempts + + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, tWorldGen); oreveinFound = true; break; case WorldGen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK: - if (debugWorldGen) - GT_Log.out.println(" No overlap and air block in test spot=" - + oreveinSeed + " " + (tWorldGen).mWorldGenName - + " tries at oremix=" - + i + " placementAttempts=" - + placementAttempts + " dimensionName=" - + tDimensionName); + if (debugWorldGen) GT_Log.out.println( + " No overlap and air block in test spot=" + oreveinSeed + + " " + + (tWorldGen).mWorldGenName + + " tries at oremix=" + + i + + " placementAttempts=" + + placementAttempts + + " dimensionName=" + + tDimensionName); // SHould do retry in this case until out of chances Logger.INFO("[World Generation Debug] NO_OVERLAP_AIR_BLOCK"); placementAttempts++; @@ -390,10 +392,18 @@ public class WorldGen_GT_Base implements IWorldGenerator { } break; // Try the next orevein } catch (Throwable e) { - if (debugWorldGen) - GT_Log.out.println("Exception occurred on oreVein" + tWorldGen + " oreveinSeed=" - + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ + " oreseedX=" - + oreseedX + " oreseedZ=" + oreseedZ); + if (debugWorldGen) GT_Log.out.println( + "Exception occurred on oreVein" + tWorldGen + + " oreveinSeed=" + + oreveinSeed + + " mX=" + + this.mX + + " mZ=" + + this.mZ + + " oreseedX=" + + oreseedX + + " oreseedZ=" + + oreseedZ); e.printStackTrace(GT_Log.err); } } @@ -402,24 +412,47 @@ public class WorldGen_GT_Base implements IWorldGenerator { // Only add an empty orevein if are unable to place a vein // at the oreseed chunk. if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)) { - if (debugWorldGen) - GT_Log.out.println(" Empty oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ - + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " tries at oremix=" + i - + " placementAttempts=" + placementAttempts + " dimensionName=" + tDimensionName); + if (debugWorldGen) GT_Log.out.println( + " Empty oreveinSeed=" + oreveinSeed + + " mX=" + + this.mX + + " mZ=" + + this.mZ + + " oreseedX=" + + oreseedX + + " oreseedZ=" + + oreseedZ + + " tries at oremix=" + + i + + " placementAttempts=" + + placementAttempts + + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, noOresInVein); } } else if (oreveinPercentageRoll >= oreveinPercentage) { - if (debugWorldGen) - GT_Log.out.println(" Skipped oreveinSeed=" + oreveinSeed + " mX=" + this.mX + " mZ=" + this.mZ - + " oreseedX=" + oreseedX + " oreseedZ=" + oreseedZ + " RNG=" + oreveinPercentageRoll - + " %=" + oreveinPercentage + " dimensionName=" + tDimensionName); + if (debugWorldGen) GT_Log.out.println( + " Skipped oreveinSeed=" + oreveinSeed + + " mX=" + + this.mX + + " mZ=" + + this.mZ + + " oreseedX=" + + oreseedX + + " oreseedZ=" + + oreseedZ + + " RNG=" + + oreveinPercentageRoll + + " %=" + + oreveinPercentage + + " dimensionName=" + + tDimensionName); validOreveins.put(oreveinSeed, noOresInVein); } } else { // oreseed is located in the previously processed table - if (debugWorldGen) - GT_Log.out.print(" Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()=" - + validOreveins.size() + " "); + if (debugWorldGen) GT_Log.out.print( + " Valid oreveinSeed=" + oreveinSeed + " validOreveins.size()=" + validOreveins.size() + " "); WorldGen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed); oreveinRNG.setSeed(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))); // Reset // RNG @@ -504,8 +537,7 @@ public class WorldGen_GT_Base implements IWorldGenerator { try { for (WorldGen_GT tWorldGen : HANDLER_GT.sWorldgenListEverglades) { /* - * if (debugWorldGen) GT_Log.out.println( - * "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName ); + * if (debugWorldGen) GT_Log.out.println( "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName ); */ tWorldGen.executeWorldgen( this.mWorld, @@ -530,8 +562,13 @@ public class WorldGen_GT_Base implements IWorldGenerator { long endTime = System.nanoTime(); long duration = (endTime - startTime); if (debugWorldGen) { - GT_Log.out.println(" Oregen took " + (oregenTime - startTime) + " Leftover gen took " - + (leftOverTime - oregenTime) + " Worldgen took " + duration + " nanoseconds"); + GT_Log.out.println( + " Oregen took " + (oregenTime - startTime) + + " Leftover gen took " + + (leftOverTime - oregenTime) + + " Worldgen took " + + duration + + " nanoseconds"); } } } diff --git a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java index ee4dc51461..76948631c1 100644 --- a/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java +++ b/src/main/java/gtPlusPlus/everglades/gen/gt/WorldGen_GT_Ore_Layer.java @@ -2,6 +2,17 @@ package gtPlusPlus.everglades.gen.gt; import static gtPlusPlus.everglades.gen.gt.WorldGen_GT_Base.debugWorldGen; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Log; @@ -14,17 +25,9 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.dimension.Dimension_Everglades; import gtPlusPlus.xmod.gregtech.HANDLER_GT; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; public class WorldGen_GT_Ore_Layer extends WorldGen_GT { + public static ArrayList sList = new ArrayList(); public static int sWeight = 0; public final short mMinY; @@ -67,25 +70,15 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { try { Field temp = ReflectionUtils.getField(GregTech_API.class, "sBlockStones"); tempBlock = temp.get(null); - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} mStoneTypes = (Block) tempBlock; } else { mStoneTypes = null; } } - public WorldGen_GT_Ore_Layer( - String aName, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - Material aPrimary, - Material aSecondary, - Material aBetween, - Material aSporadic) { + public WorldGen_GT_Ore_Layer(String aName, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, + Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { this( aName, true, @@ -106,28 +99,13 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { aSporadic); } - public WorldGen_GT_Ore_Layer( - String aName, - boolean aDefault, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - boolean aOverworld, - boolean aNether, - boolean aEnd, - boolean GC_UNUSED1, - boolean GC_UNUSED2, - boolean GC_UNUSED3, - Material aPrimary, - Material aSecondary, - Material aBetween, - Material aSporadic) { + public WorldGen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, + boolean GC_UNUSED3, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { super(aName, sList, aDefault); Logger.WORLD("Creating Ore Layer Object"); - this.mOverworld = - HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); + this.mOverworld = HANDLER_GT.sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); this.mNether = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); this.mEnd = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); // this.mMoon = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); @@ -141,12 +119,12 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { mMaxY = (short) (this.mMinY + 7); } this.mMaxY = mMaxY; - this.mWeight = ((short) - HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = - ((short) HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) - Math.max(1, HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); + this.mWeight = ((short) HANDLER_GT.sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); + this.mDensity = ((short) HANDLER_GT.sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); + this.mSize = ((short) Math + .max(1, HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); this.mPrimary = aPrimary; this.mSecondary = aSecondary; this.mBetween = aBetween; @@ -155,8 +133,8 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { this.mSecondaryMeta = aSecondary.getOreBlock(1); this.mBetweenMeta = aBetween.getOreBlock(1); this.mSporadicMeta = aSporadic.getOreBlock(1); - this.mRestrictBiome = - HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + this.mRestrictBiome = HANDLER_GT.sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); // if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new // IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does @@ -184,24 +162,14 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { } } - public int executeWorldgenChunkified( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - int aSeedX, - int aSeedZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { // Debug Handler /** * This handles Variables that are null during Init */ - if (this.mPrimaryMeta == Blocks.stone - || this.mSecondaryMeta == Blocks.stone + if (this.mPrimaryMeta == Blocks.stone || this.mSecondaryMeta == Blocks.stone || this.mBetweenMeta == Blocks.stone || this.mSporadicMeta == Blocks.stone) { this.mPrimaryMeta = this.mPrimary.getOreBlock(1); @@ -219,13 +187,9 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { return ORE_PLACED; } if (aDimensionType != Dimension_Everglades.DIMID) { - /* // Debug code, but spams log - if (debugWorldGen) { - GT_Log.out.println( - "Wrong dimension" - ); - } - */ + /* + * // Debug code, but spams log if (debugWorldGen) { GT_Log.out.println( "Wrong dimension" ); } + */ Logger.WORLD("[World Generation Debug] Wrong dimension."); return WRONG_DIMENSION; } @@ -243,13 +207,20 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { int eX = Math.min(eXVein, aChunkX + 2 + 16); if (wX >= eX) { // No overlap between orevein and this chunk exists in X Block tBlock = aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8); - if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.stone) - || tBlock.isReplaceableOreGen( - aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondLayer) + if (tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.stone) || tBlock + .isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondLayer) || tBlock.isReplaceableOreGen( - aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockMainFiller) + aWorld, + aChunkX + 8, + tMinY, + aChunkZ + 8, + Dimension_Everglades.blockMainFiller) || tBlock.isReplaceableOreGen( - aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Dimension_Everglades.blockSecondaryFiller) + aWorld, + aChunkX + 8, + tMinY, + aChunkZ + 8, + Dimension_Everglades.blockSecondaryFiller) || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.netherrack) || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, Blocks.end_stone) || tBlock.isReplaceableOreGen(aWorld, aChunkX + 8, tMinY, aChunkZ + 8, GregTech_API.sBlockGranites) @@ -284,58 +255,64 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { if (debugWorldGen) { String tDimensionName = aWorld.provider.getDimensionName(); - GT_Log.out.print("Trying Orevein:" + this.mWorldGenName + " Dimension=" - + tDimensionName + " mX=" - + aChunkX / 16 + " mZ=" - + aChunkZ / 16 + " oreseedX=" - + aSeedX / 16 + " oreseedZ=" - + aSeedZ / 16 + " cY=" - + tMinY); + GT_Log.out.print( + "Trying Orevein:" + this.mWorldGenName + + " Dimension=" + + tDimensionName + + " mX=" + + aChunkX / 16 + + " mZ=" + + aChunkZ / 16 + + " oreseedX=" + + aSeedX / 16 + + " oreseedZ=" + + aSeedZ / 16 + + " cY=" + + tMinY); } - // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed + // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed // should always be max density due to truncation of Math.sqrt(). int localDensity = (Math.max( 1, - this.mDensity - / ((int) Math.sqrt(2 - + Math.pow(aChunkX / 16 - aSeedX / 16, 2) - + Math.pow(aChunkZ / 16 - aSeedZ / 16, 2))))); + this.mDensity / ((int) Math + .sqrt(2 + Math.pow(aChunkX / 16 - aSeedX / 16, 2) + Math.pow(aChunkZ / 16 - aSeedZ / 16, 2))))); // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll // 1 pass through the loop // Now we do bottom-level-first oregen, and work our way upwards. - int level = tMinY - 1; // Dunno why, but the first layer is actually played one below tMinY. Go figure. + int level = tMinY - 1; // Dunno why, but the first layer is actually played one below tMinY. Go figure. for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max( - 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + int placeX = Math + .max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); for (int tZ = nZ; tZ < sZ; tZ++) { int placeZ = Math.max( - 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + 1, + Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta != null)) { if (setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) { placeCount[1]++; } - } else if ((aRandom.nextInt(7) == 0) - && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mSporadicMeta - != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to - // compensate - if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++; - } + } else + if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta != null)) { // Sporadics are only 1 per vertical column normally, + // reduce by 1/7 to + // compensate + if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) + placeCount[3]++; + } } } - /*if ((placeCount[1]+placeCount[3])==0) { - if (debugWorldGen) GT_Log.out.println( - " No ore in bottom layer" - ); - return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer - }*/ + /* + * if ((placeCount[1]+placeCount[3])==0) { if (debugWorldGen) GT_Log.out.println( " No ore in bottom layer" ); + * return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer } + */ Logger.WORLD("[World Generation Debug] Trying to set Ores?"); for (level = tMinY; level < (tMinY - 1 + 3); level++) { for (int tX = wX; tX < eX; tX++) { int placeX = Math.max( - 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + 1, + Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); for (int tZ = nZ; tZ < sZ; tZ++) { int placeZ = Math.max( 1, @@ -347,65 +324,68 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { } } else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mSporadicMeta - != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to - // compensate - if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++; - } + && (this.mSporadicMeta != null)) { // Sporadics are only 1 per vertical column normally, + // reduce by 1/7 to + // compensate + if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) + placeCount[3]++; + } } } } // Low Middle layer is between + sporadic // level should be = tMinY-1+3 from end of for loop for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max( - 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + int placeX = Math + .max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); for (int tZ = nZ; tZ < sZ; tZ++) { int placeZ = Math.max( - 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); - if ((aRandom.nextInt(2) == 0) - && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mBetweenMeta - != null)) { // Between are only 1 per vertical column, reduce by 1/2 to compensate + 1, + Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mBetweenMeta != null)) { // Between are only 1 per vertical column, reduce by 1/2 to + // compensate if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) { placeCount[2]++; } - } else if ((aRandom.nextInt(7) == 0) - && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mSporadicMeta - != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to - // compensate - if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++; - } + } else + if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta != null)) { // Sporadics are only 1 per vertical column normally, + // reduce by 1/7 to + // compensate + if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) + placeCount[3]++; + } } } // High Middle layer is between + primary + sporadic level++; // Increment level to next layer for (int tX = wX; tX < eX; tX++) { - int placeX = Math.max( - 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + int placeX = Math + .max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); for (int tZ = nZ; tZ < sZ; tZ++) { int placeZ = Math.max( - 1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); - if ((aRandom.nextInt(2) == 0) - && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mBetweenMeta - != null)) { // Between are only 1 per vertical column, reduce by 1/2 to compensate + 1, + Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ)) / localDensity); + if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mBetweenMeta != null)) { // Between are only 1 per vertical column, reduce by 1/2 to + // compensate if (setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) { placeCount[2]++; } } else if (((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta != null)) { - if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) { - placeCount[0]++; - } - } else if ((aRandom.nextInt(7) == 0) - && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mSporadicMeta - != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to - // compensate - if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++; - } + if (setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) { + placeCount[0]++; + } + } else + if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) + && (this.mSporadicMeta != null)) { // Sporadics are only 1 per vertical column normally, + // reduce by 1/7 to + // compensate + if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) + placeCount[3]++; + } } } // Top two layers are primary + sporadic @@ -413,7 +393,8 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { for (; level < (tMinY + 6); level++) { // should do two layers for (int tX = wX; tX < eX; tX++) { int placeX = Math.max( - 1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); + 1, + Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX)) / localDensity); for (int tZ = nZ; tZ < sZ; tZ++) { int placeZ = Math.max( 1, @@ -425,42 +406,57 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { } } else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) - && (this.mSporadicMeta - != null)) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to - // compensate - if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) placeCount[3]++; - } + && (this.mSporadicMeta != null)) { // Sporadics are only 1 per vertical column normally, + // reduce by 1/7 to + // compensate + if (setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false)) + placeCount[3]++; + } } } } if (debugWorldGen) { String tDimensionName = aWorld.provider.getDimensionName(); - GT_Log.out.println("Generated Orevein:" + this.mWorldGenName + " Dimension=" - + tDimensionName + " mX=" - + aChunkX / 16 + " mZ=" - + aChunkZ / 16 + " oreseedX=" - + aSeedX / 16 + " oreseedZ=" - + aSeedZ / 16 + " cY=" - + tMinY + " wXVein" - + wXVein + " eXVein" - + eXVein + " nZVein" - + nZVein + " sZVein" - + sZVein + " locDen=" - + localDensity + " Den=" - + this.mDensity + " Sec=" - + placeCount[1] + " Spo=" - + placeCount[3] + " Bet=" - + placeCount[2] + " Pri=" - + placeCount[0]); + GT_Log.out.println( + "Generated Orevein:" + this.mWorldGenName + + " Dimension=" + + tDimensionName + + " mX=" + + aChunkX / 16 + + " mZ=" + + aChunkZ / 16 + + " oreseedX=" + + aSeedX / 16 + + " oreseedZ=" + + aSeedZ / 16 + + " cY=" + + tMinY + + " wXVein" + + wXVein + + " eXVein" + + eXVein + + " nZVein" + + nZVein + + " sZVein" + + sZVein + + " locDen=" + + localDensity + + " Den=" + + this.mDensity + + " Sec=" + + placeCount[1] + + " Spo=" + + placeCount[3] + + " Bet=" + + placeCount[2] + + " Pri=" + + placeCount[0]); } // Something (at least the bottom layer must have 1 block) must have been placed, return true return ORE_PLACED; } - private String fString = "unset", - ore1String = "unset", - ore2String = "unset", - ore3String = "unset", + private String fString = "unset", ore1String = "unset", ore2String = "unset", ore3String = "unset", ore4String = "unset"; Map gtOreMap = new HashMap(); @@ -473,20 +469,16 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { // Set GT ORE if (aMetaData instanceof GT_Block_Ores) { if (ore1String.equals("unset")) { - ore1String = - Utils.sanitizeString(this.mPrimary.getLocalizedName().toLowerCase()); + ore1String = Utils.sanitizeString(this.mPrimary.getLocalizedName().toLowerCase()); } if (ore2String.equals("unset")) { - ore2String = Utils.sanitizeString( - this.mSecondaryMeta.getLocalizedName().toLowerCase()); + ore2String = Utils.sanitizeString(this.mSecondaryMeta.getLocalizedName().toLowerCase()); } if (ore3String.equals("unset")) { - ore3String = Utils.sanitizeString( - this.mBetweenMeta.getLocalizedName().toLowerCase()); + ore3String = Utils.sanitizeString(this.mBetweenMeta.getLocalizedName().toLowerCase()); } if (ore4String.equals("unset")) { - ore4String = Utils.sanitizeString( - this.mSporadicMeta.getLocalizedName().toLowerCase()); + ore4String = Utils.sanitizeString(this.mSporadicMeta.getLocalizedName().toLowerCase()); } if (this.mPrimaryMeta == aMetaData) { @@ -498,8 +490,14 @@ public class WorldGen_GT_Ore_Layer extends WorldGen_GT { if (fString.contains(ore1String)) { int r = f.mMetaItemSubID; if (setOreBlock(aWorld, aX, aY, aZ, r, false)) { - Logger.WORLD("[World Generation Debug] Set " + f.mDefaultLocalName + " Ore at X: " + aX - + " | Y: " + aY + " | Z: " + aZ); + Logger.WORLD( + "[World Generation Debug] Set " + f.mDefaultLocalName + + " Ore at X: " + + aX +