diff options
| author | Martin Robertz <dream-master@gmx.net> | 2021-12-15 16:11:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-15 16:11:54 +0100 |
| commit | 128c74faa99dfef8d056c1d82c6e4388b9d470e8 (patch) | |
| tree | 2c84162154ba681232f86dffd4106db530236814 /src/Java/gtPlusPlus/australia/gen | |
| parent | 47ce336f288a45aa3244c8ae1177499fa5080942 (diff) | |
| parent | ff4b8c7068c2ea7d654e9beda00646d23e62b314 (diff) | |
| download | GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.gz GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.bz2 GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.zip | |
Merge pull request #65 from GTNewHorizons/unified-build-script2
Move sources and resources
Diffstat (limited to 'src/Java/gtPlusPlus/australia/gen')
13 files changed, 0 insertions, 3287 deletions
diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java deleted file mode 100644 index 18f9e6684f..0000000000 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java +++ /dev/null @@ -1,294 +0,0 @@ -package gtPlusPlus.australia.gen.gt; - -import java.util.Hashtable; - -import gregtech.api.enums.Materials; - -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.MaterialUtils; -import gtPlusPlus.everglades.object.BoxedQuad; - -public class WorldGen_Australia_Ores { - - /** - * Set Ore Types on by one. - */ - - private static final Material PYRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Pyrite); - private static final Material PYROPE = MaterialUtils.generateMaterialFromGtENUM(Materials.Pyrope); - private static final Material ALMANDINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Almandine); - private static final Material RUBY = MaterialUtils.generateMaterialFromGtENUM(Materials.Ruby); - private static final Material CHALCOPYRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chalcopyrite); - private static final Material TOPAZ = MaterialUtils.generateMaterialFromGtENUM(Materials.Topaz); - private static final Material SAPPHIRE_GREEN = MaterialUtils.generateMaterialFromGtENUM(Materials.GreenSapphire); - private static final Material SAPPHIRE_BLUE = MaterialUtils.generateMaterialFromGtENUM(Materials.Sapphire); - - - private static final Material EMERALD = MaterialUtils.generateMaterialFromGtENUM(Materials.Emerald); - private static final Material DIAMOND = MaterialUtils.generateMaterialFromGtENUM(Materials.Diamond); - private static final Material BANDED_IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.BandedIron); - private static final Material LIM_YELLOW = MaterialUtils.generateMaterialFromGtENUM(Materials.YellowLimonite); - private static final Material LIM_BROWN = MaterialUtils.generateMaterialFromGtENUM(Materials.BrownLimonite); - private static final Material TETRAHEDRITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Tetrahedrite); - private static final Material COAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Coal); - private static final Material SHIT_COAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Lignite); - private static final Material GRAPHITE = MaterialUtils.generateMaterialFromGtENUM(Materials.Graphite); - - - - public static WorldGen_GT_Australia_Ore_Layer BaseVein = new WorldGen_GT_Australia_Ore_Layer( - "veinA", - 0, 128, - 5, - 8, - 32, - ELEMENT.getInstance().IRON, - BANDED_IRON, - LIM_YELLOW, - TETRAHEDRITE); - - - - /** - * Custom ore Veins - */ - - public static WorldGen_GT_Australia_Ore_Layer Vein1 = new WorldGen_GT_Australia_Ore_Layer( - "vein1", - 0, 10, - 1, - 8, - 16, - EMERALD, - SHIT_COAL, - TOPAZ, - DIAMOND); - - public static WorldGen_GT_Australia_Ore_Layer Vein2 = new WorldGen_GT_Australia_Ore_Layer( - "vein2", - 0, 128, - 20, - 16, - 64, - COAL, - COAL, - SHIT_COAL, - SHIT_COAL); - - public static WorldGen_GT_Australia_Ore_Layer Vein3 = new WorldGen_GT_Australia_Ore_Layer( - "vein3", - 0, 128, - 5, - 8, - 32, - ELEMENT.getInstance().IRON, - ELEMENT.getInstance().TIN, - ELEMENT.getInstance().GOLD, - ELEMENT.getInstance().LEAD); - - public static WorldGen_GT_Australia_Ore_Layer Vein4 = new WorldGen_GT_Australia_Ore_Layer( - "vein4", - 0, 128, - 5, - 8, - 32, - ELEMENT.getInstance().GOLD, - ELEMENT.getInstance().COPPER, - ELEMENT.getInstance().COBALT, - ALMANDINE); - - - - public static WorldGen_GT_Australia_Ore_Layer Vein5 = new WorldGen_GT_Australia_Ore_Layer( - "vein5", - 0, 128, - 15, - 8, - 16, - PYRITE, - PYROPE, - LIM_YELLOW, - CHALCOPYRITE); - - public static WorldGen_GT_Australia_Ore_Layer Vein6 = new WorldGen_GT_Australia_Ore_Layer( - "vein6", - 0, 128, - 5, - 8, - 32, - LIM_BROWN, - SAPPHIRE_GREEN, - ELEMENT.getInstance().IRON, - ELEMENT.getInstance().COPPER); - - public static WorldGen_GT_Australia_Ore_Layer Vein7 = new WorldGen_GT_Australia_Ore_Layer( - "vein7", - 0, 128, - 5, - 8, - 32, - GRAPHITE, - RUBY, - LIM_YELLOW, - ELEMENT.getInstance().NICKEL); - - public static WorldGen_GT_Australia_Ore_Layer Vein8 = new WorldGen_GT_Australia_Ore_Layer( - "vein8", - 0, 128, - 5, - 8, - 32, - ELEMENT.getInstance().IRON, - SAPPHIRE_BLUE, - LIM_YELLOW, - GRAPHITE); - - - - - /*public static WorldGen_GT_Australia_Ore_Layer Vein9 = new WorldGen_GT_Australia_Ore_Layer( - "vein9", - 10, 30, - 20, - 4, - 64, - ORES.LANTHANITE_CE, - FLUORIDES.FLUORITE, - PLATINUM, - ORES.FLORENCITE); - public static WorldGen_GT_Australia_Ore_Layer Vein10 = new WorldGen_GT_Australia_Ore_Layer( - "vein10", - 20, 50, - 20, - 8, - 32, - ORES.GEIKIELITE, - ORES.YTTROCERITE, - ORES.LANTHANITE_LA, - BAUXITE); - public static WorldGen_GT_Australia_Ore_Layer Vein11 = new WorldGen_GT_Australia_Ore_Layer( - "vein11", - 30, 70, - 20, - 5, - 64, - FLUORIDES.FLUORITE, - SAPPHIRE_BLUE, - ORES.ZIRCON, - ORES.CRYOLITE); - public static WorldGen_GT_Australia_Ore_Layer Vein12 = new WorldGen_GT_Australia_Ore_Layer( - "vein12", - 40, 80, - 20, - 8, - 32, - ORES.CERITE, - SAPPHIRE_GREEN, - CHALCOPYRITE, - ORES.HIBONITE); - - *//** - * Best Rarest Veins 2017 - *//* - - public static WorldGen_GT_Australia_Ore_Layer Vein13 = new WorldGen_GT_Australia_Ore_Layer( - "vein13", - 5, 15, - 5, - 5, - 16, - ORES.CRYOLITE, - NAQPLUS, - NAQUADRIA, - ORES.FLORENCITE); - - public static WorldGen_GT_Australia_Ore_Layer Vein14 = new WorldGen_GT_Australia_Ore_Layer( - "vein14", - 10, 20, - 8, - 3, - 16, - URNAIUM235, - PLUTONIUM, - OSMIUM, - AMETHYST); - - public static WorldGen_GT_Australia_Ore_Layer Vein15 = new WorldGen_GT_Australia_Ore_Layer( - "vein15", - 5, 25, - 5, - 6, - 24, - ORES.FLUORCAPHITE, - BISMUTH, - ORES.GADOLINITE_CE, - ORES.GADOLINITE_Y); - - public static WorldGen_GT_Australia_Ore_Layer Vein16 = new WorldGen_GT_Australia_Ore_Layer( - "vein16", - 0, 25, - 4, - 6, - 32, - ORES.YTTROCERITE, - ORES.LEPERSONNITE, - INFUSEDGOLD, - FLUORIDES.FLUORITE); - - public static WorldGen_GT_Australia_Ore_Layer Vein17 = new WorldGen_GT_Australia_Ore_Layer( - "vein17", - 10, 35, - 4, - 5, - 32, - ORES.FLORENCITE, - URNAIUM235, - ORES.SAMARSKITE_YB, - ORES.POLYCRASE); - public static WorldGen_GT_Australia_Ore_Layer Vein18 = new WorldGen_GT_Australia_Ore_Layer( - "vein18", - 15, 40, - 4, - 4, - 64, - ORES.GADOLINITE_CE, - ORES.GADOLINITE_Y, - ORES.AGARDITE_LA, - ORES.AGARDITE_CD);*/ - - - - - public static Hashtable<Long, WorldGen_GT_Australia_Ore_Layer> validOreveins = new Hashtable<Long, WorldGen_GT_Australia_Ore_Layer>( - 1024); - - - public static volatile BoxedQuad<Integer, Integer, Integer, Integer> OreVein1 = new BoxedQuad<Integer, Integer, Integer, Integer>(null, null, null, null); - - static long ID = 0; - public static void generateValidOreVeins(){ - validOreveins.put(ID++, BaseVein); - - validOreveins.put(ID++, Vein1); - validOreveins.put(ID++, Vein2); - validOreveins.put(ID++, Vein3); - validOreveins.put(ID++, Vein4); - validOreveins.put(ID++, Vein5); - validOreveins.put(ID++, Vein6); - validOreveins.put(ID++, Vein7); - validOreveins.put(ID++, Vein8); - - /*validOreveins.put(ID++, Vein9); - validOreveins.put(ID++, Vein10); - validOreveins.put(ID++, Vein11); - validOreveins.put(ID++, Vein12); - validOreveins.put(ID++, Vein13); - validOreveins.put(ID++, Vein14); - validOreveins.put(ID++, Vein15); - validOreveins.put(ID++, Vein16); - validOreveins.put(ID++, Vein17); - validOreveins.put(ID++, Vein18);*/ - } - -} diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java deleted file mode 100644 index 93d5524a66..0000000000 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java +++ /dev/null @@ -1,48 +0,0 @@ -package gtPlusPlus.australia.gen.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.australia.GTplusplus_Australia; - -public abstract class WorldGen_GT_Australia { - public final String mWorldGenName; - public final boolean mEnabled; - private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>(); - - public WorldGen_GT_Australia(String aName, List aList, boolean aDefault) { - this.mWorldGenName = aName; - this.mEnabled = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault); - if (this.mEnabled) { - aList.add(this); - } - - } - - 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) { - return false; - } - - public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { - String aDimName = aWorld.provider.getDimensionName(); - Boolean tAllowed = (Boolean) this.mDimensionMap.get(aDimName); - if (tAllowed == null) { - boolean tValue = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen.dimensions." + this.mWorldGenName, aDimName, - aDimensionType == aAllowedDimensionType); - this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue)); - return tValue; - } else { - return tAllowed.booleanValue(); - } - } -}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java deleted file mode 100644 index 917c1eb746..0000000000 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java +++ /dev/null @@ -1,471 +0,0 @@ -package gtPlusPlus.australia.gen.gt; - -import java.util.*; - -import cpw.mods.fml.common.IWorldGenerator; - -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 gregtech.api.util.GT_Log; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.australia.dimension.Dimension_Australia; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; - -public class WorldGen_GT_Australia_Base implements IWorldGenerator { - - /** - * Class Variables - */ - - /** - * 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 - */ - 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. - */ - public static int oreveinMaxPlacementAttempts; - /** - * 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. - */ - - public static List<Runnable> mList = new ArrayList<Runnable>(); - public static HashSet<Long> ProcChunks = new HashSet<Long>(); - // This is probably not going to work. Trying to create a fake orevein to - // put into hashtable when there will be no ores in a vein. - public static WorldGen_GT_Australia_Ore_Layer noOresInVein = new WorldGen_GT_Australia_Ore_Layer("vein0", 0, 255, 0, 0, - 0, ELEMENT.getInstance().IRON, ELEMENT.getInstance().GOLD, ELEMENT.getInstance().LEAD, ELEMENT.getInstance().TIN); - - public static Hashtable<Long, WorldGen_GT_Australia_Ore_Layer> validOreveins = new Hashtable<Long, WorldGen_GT_Australia_Ore_Layer>( - 1024); - - public boolean mIsGenerating = false; - public static final Object listLock = new Object(); - // private static boolean gcAsteroids = true; - - public WorldGen_GT_Australia_Base() { - if (debugWorldGen) { - GT_Log.out.println("GTPP_Worldgenerator created"); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - if (world.provider.dimensionId == Dimension_Australia.DIMID) { - generateSafely(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); - } - } - - public synchronized void generateSafely(Random random, int chunkX, int chunkZ, World world, - IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - int xDim = Dimension_Australia.DIMID; - switch (world.provider.dimensionId) { - case -1: // Nether - // generateNether(world, random, chunkX * 16, chunkZ * 16); - break; - case 0: // Overworld - // generateSurface(world, random, chunkX * 16, chunkZ * 16); - break; - case 1: // End - // generateEnd(world, random, chunkX * 16, chunkZ * 16); - break; - default: // Any other dimension - if (world.provider.dimensionId != xDim) { - break; - } - else { - generateEverglades(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); - break; - } - } - } - - private synchronized void generateEverglades(Random aRandom, int aX, int aZ, World aWorld, - IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - Logger.WARNING("Trying to Generate Dimension."); - synchronized (listLock) { - Logger.WARNING("Locked List addition."); - if (WorldGen_GT_Australia_Base.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) + 1), aX, aZ, - Dimension_Australia.DIMID, - aWorld, aChunkGenerator, aChunkProvider, - aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))){ - Logger.WARNING("Locked List addition. Success."); - } - else { - Logger.WARNING("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_Australia_Base.mList.size()); - } - - if (!this.mIsGenerating) { - Logger.WARNING("Is not generating."); - this.mIsGenerating = true; - Logger.WARNING("Setting Generation to true."); - int mList_sS = WorldGen_GT_Australia_Base.mList.size(); - mList_sS = Math.min(mList_sS, 3); // Run a maximum of 3 chunks at a - // time through worldgen. Extra - // chunks get done later. - for (int i = 0; i < mList_sS; i++) { - WorldGenContainer toRun = (WorldGenContainer) WorldGen_GT_Australia_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_Australia_Base.mList.size() - + " i: " + i); - synchronized (listLock) { - Logger.WARNING("Locked List Removal."); - WorldGen_GT_Australia_Base.mList.remove(0); - } - toRun.run(); - } - this.mIsGenerating = false; - Logger.WARNING("Is Generating now set to false.."); - } - } - - 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) { - int xrand = random.nextInt(16); - int yrand = random.nextInt(heightRange) + minY; - int zrand = random.nextInt(16); - worldgenminable.generate(world, random, chunk_x + xrand, yrand, chunk_z + zrand); - } - } - - public static class WorldGenContainer implements Runnable { - public final Random mRandom; - public final int mX; - public final int mZ; - public final int mDimensionType; - public final World mWorld; - public final IChunkProvider mChunkGenerator; - public final IChunkProvider mChunkProvider; - public final String mBiome; - - // Local class to track which orevein seeds must be checked when doing - // chunkified worldgen - class NearbySeeds { - public int mX; - public int mZ; - - NearbySeeds(int x, int z) { - this.mX = x; - this.mZ = z; - } - }; - - public static ArrayList<NearbySeeds> seedList = new ArrayList<NearbySeeds>(); - - // 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) { - this.mRandom = aRandom; - this.mX = aX; - this.mZ = aZ; - this.mDimensionType = aDimensionType; - this.mWorld = aWorld; - this.mChunkGenerator = aChunkGenerator; - this.mChunkProvider = aChunkProvider; - this.mBiome = aBiome; - } - - public void worldGenFindVein(int oreseedX, int oreseedZ) { - // Explanation of oreveinseed implementation. - // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen - // passes, one with getSeed set to +1 the original world seed. This - // pushes that +1 off the low bits of oreseedZ, so that the hashes - // are far apart for the two passes. - // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the - // dimension in the top bits of the hash, to make sure to get unique - // hashes per dimension - // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in - // the bits 29-55. Cuts off the top few bits of the chunk so we have - // bits for dimension. - // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the - // 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) | (oreseedZ & 0x000000000fffffffL)); // Use - // an - // RNG - // that - // is - // identical - // every - // time - // it - // is - // called - // for - // this - // oreseed. - XSTR oreveinRNG = new XSTR(oreveinSeed); - int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the - // dice, see - // if we get - // an - // orevein - // here at - // all - int noOrePlacedCount = 0; - String tDimensionName = ""; - if (debugWorldGen) { - tDimensionName = this.mWorld.provider.getDimensionName(); - } - - 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()); - } - - Logger.WARNING("[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: "+oreveinSeed); - // Search for a valid orevein for this dimension - if (!validOreveins.containsKey(oreveinSeed)) { - - - Logger.WARNING("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "+((oreveinPercentageRoll < oreveinPercentage))); - Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "+(WorldGen_GT_Australia_Ore_Layer.sWeight > 0)); - Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "+(WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)); - if ((oreveinPercentageRoll < oreveinPercentage) && (WorldGen_GT_Australia_Ore_Layer.sWeight > 0) - && (WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)) { - int placementAttempts = 0; - boolean oreveinFound = false; - int i; - for (i = 0; (i < oreveinAttempts) && (!oreveinFound) - && (placementAttempts < oreveinMaxPlacementAttempts); i++) { - Logger.WARNING("[World Generation Debug] i: "+i); - Logger.WARNING("[World Generation Debug] placementAttempts: "+placementAttempts); - Logger.WARNING("[World Generation Debug] oreveinAttempts: "+oreveinAttempts); - Logger.WARNING("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "+(placementAttempts < oreveinMaxPlacementAttempts)); - Logger.WARNING("[World Generation Debug] oreveinFound: "+oreveinFound); - int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Australia_Ore_Layer.sWeight); - for (WorldGen_GT_Australia_Ore_Layer tWorldGen : WorldGen_GT_Australia_Ore_Layer.sList) { - Logger.WARNING("[World Generation Debug] Iterating sList - Size: "+WorldGen_GT_Australia_Ore_Layer.sList.size()); - tRandomWeight -= (tWorldGen).mWeight; - if (tRandomWeight <= 0) { - try { - // Adjust the seed so that this layer has a - // series of unique random numbers. - // Otherwise multiple attempts at this same - // oreseed will get the same offset and X/Z - // values. If an orevein failed, any orevein - // with the - // same minimum heights would fail as well. - // This prevents that, giving each orevein a - // unique height each pass through here. - int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, - new XSTR(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))), this.mBiome, - this.mDimensionType, this.mX * 16, this.mZ * 16, oreseedX * 16, - oreseedZ * 16, this.mChunkGenerator, this.mChunkProvider); - switch (placementResult) { - case WorldGen_GT_Australia_Ore_Layer.ORE_PLACED: - if (debugWorldGen) - GT_Log.out.println(" Added oreveinSeed=" + oreveinSeed - + " tries at oremix=" + i + " placementAttempts=" - + placementAttempts + " dimensionName=" + tDimensionName); - validOreveins.put(oreveinSeed, tWorldGen); - oreveinFound = true; - Logger.WARNING("[World Generation Debug] ORE_PLACED"); - break; - case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: - placementAttempts++; - Logger.WARNING("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "+placementAttempts); - // SHould do retry in this case - // until out of chances - break; - case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP: - // Orevein didn't reach this chunk, - // can't add it yet to the hash - Logger.WARNING("[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 - ); - validOreveins.put(oreveinSeed, tWorldGen); - oreveinFound = true; - break; - case WorldGen_GT_Australia_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 - ); - // SHould do retry in this case until out of chances - Logger.WARNING("[World Generation Debug] NO_OVERLAP_AIR_BLOCK"); - placementAttempts++; - break; - } - 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); - e.printStackTrace(GT_Log.err); - } - } - } - } - // 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); - 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); - 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() + " "); - WorldGen_GT_Australia_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed); - oreveinRNG.setSeed(oreveinSeed ^ (Block.getIdFromBlock(tWorldGen.mPrimaryMeta))); // Reset - // RNG - // to - // only - // be - // based - // on - // oreseed - // X/Z - // and - // type - // of - // vein - int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, oreveinRNG, this.mBiome, - this.mDimensionType, this.mX * 16, this.mZ * 16, oreseedX * 16, oreseedZ * 16, - this.mChunkGenerator, this.mChunkProvider); - switch (placementResult) { - case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: - if (debugWorldGen) - GT_Log.out.println(" No ore in bottom layer"); - break; - case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP: - if (debugWorldGen) - GT_Log.out.println(" No overlap"); - break; - } - } - } - - @Override - public void run() { - long startTime = System.nanoTime(); - int oreveinMaxSize; - - // Determine bounding box on how far out to check for oreveins - // affecting this chunk - // For now, manually reducing oreveinMaxSize when not in the - // Underdark for performance - if (this.mWorld.provider.getDimensionName().equals("Underdark")) { - oreveinMaxSize = 24; // Leave Deep Dark/Underdark max oregen at - // 32, instead of 64 - } - else { - oreveinMaxSize = 48; - } - - int wXbox = this.mX - (oreveinMaxSize / 16); - int eXbox = this.mX + (oreveinMaxSize / 16 + 1); // Need to add 1 - // since it is - // compared - // using a < - int nZbox = this.mZ - (oreveinMaxSize / 16); - int sZbox = this.mZ + (oreveinMaxSize / 16 + 1); - - // Search for orevein seeds and add to the list; - for (int x = wXbox; x < eXbox; x++) { - for (int z = nZbox; z < sZbox; z++) { - // Determine if this X/Z is an orevein seed - if (((Math.abs(x) % 3) == 1) && ((Math.abs(z) % 3) == 1)) { - if (debugWorldGen) - GT_Log.out.println("Adding seed x=" + x + " z=" + z); - seedList.add(new NearbySeeds(x, z)); - } - } - } - - // Now process each oreseed vs this requested chunk - for (; seedList.size() != 0; seedList.remove(0)) { - if (debugWorldGen) - GT_Log.out.println("Processing seed x=" + seedList.get(0).mX + " z=" + seedList.get(0).mZ); - worldGenFindVein(seedList.get(0).mX, seedList.get(0).mZ); - } - - long oregenTime = System.nanoTime(); - - // Do leftover worldgen for this chunk (GT_Stones and GT_small_ores) - try { - for (WorldGen_GT_Australia tWorldGen : HANDLER_GT.sWorldgenListAustralia) { - /* - * if (debugWorldGen) GT_Log.out.println( - * "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName ); - */ - tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX * 16, - this.mZ * 16, this.mChunkGenerator, this.mChunkProvider); - } - } - catch (Throwable e) { - e.printStackTrace(GT_Log.err); - } - - long leftOverTime = System.nanoTime(); - - Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); - if (tChunk != null) { - tChunk.isModified = true; - } - 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"); - } - } - } - -} diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java deleted file mode 100644 index a5e5f8b245..0000000000 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java +++ /dev/null @@ -1,511 +0,0 @@ -package gtPlusPlus.australia.gen.gt; - -import static gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia_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; -import gregtech.common.blocks.GT_Block_Ores; -import gregtech.common.blocks.GT_TileEntity_Ores; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.australia.GTplusplus_Australia; -import gtPlusPlus.australia.dimension.Dimension_Australia; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class WorldGen_GT_Australia_Ore_Layer -extends WorldGen_GT_Australia { - public static ArrayList<WorldGen_GT_Australia_Ore_Layer> sList = new ArrayList<WorldGen_GT_Australia_Ore_Layer>(); - public static int sWeight = 0; - public final short mMinY; - public final short mMaxY; - public final short mWeight; - public final short mDensity; - public final short mSize; - public Block mPrimaryMeta; - public Block mSecondaryMeta; - public Block mBetweenMeta; - public Block mSporadicMeta; - publi |
