From 25209a4bcb9b79647a77bc0c63515f1192154098 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Fri, 29 Jul 2016 18:54:45 +0100 Subject: Merge GG into GT --- .../gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 16 ++++++---- .../common/GT_Worldgen_GT_Ore_SmallPieces.java | 18 +++++++---- .../java/gregtech/common/GT_Worldgenerator.java | 35 +++++++++++++++------- 3 files changed, 48 insertions(+), 21 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index 9ed6c1dc48..cff1da7192 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -25,18 +25,24 @@ public class GT_Worldgen_GT_Ore_Layer public final short mSecondaryMeta; public final short mBetweenMeta; public final short mSporadicMeta; - public final String mBiome; + public final String mRestrictBiome; public final boolean mOverworld; public final boolean mNether; public final boolean mEnd; public final boolean mEndAsteroid; + public final boolean mMoon; + public final boolean mMars; + public final boolean mAsteroid; - public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { + public GT_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 aMoon, boolean aMars, boolean aAsteroid, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { super(aName, sList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Overworld", aOverworld); this.mNether = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Nether", aNether); this.mEnd = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "TheEnd", aEnd); this.mEndAsteroid = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "EndAsteroid", aEnd); + this.mMoon = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Moon", aMoon); + this.mMars = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Mars", aMars); + this.mAsteroid = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Asteroid", aAsteroid); this.mMinY = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", aMinY)); this.mMaxY = ((short) Math.max(this.mMinY + 5, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", aMaxY))); this.mWeight = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "RandomWeight", aWeight)); @@ -46,7 +52,7 @@ public class GT_Worldgen_GT_Ore_Layer this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - this.mBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "BiomeName", "None"); + this.mRestrictBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "mRestrictToBiomeName", "None"); if (this.mEnabled) { GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); @@ -57,10 +63,10 @@ public class GT_Worldgen_GT_Ore_Layer } public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (!this.mBiome.equals("None") && !(this.mBiome.equals(aBiome))) { + if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return false; //Not the correct biome for ore mix } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) || ((aDimensionType == -30) && (this.mAsteroid)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 5365eb82df..71fc349b4b 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -18,25 +18,31 @@ public class GT_Worldgen_GT_Ore_SmallPieces public final boolean mOverworld; public final boolean mNether; public final boolean mEnd; - public final String mBiome; + public final boolean mMoon; + public final boolean mMars; + public final boolean mAsteroid; + public final String mRestrictBiome; - public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary) { + public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, boolean aMoon, boolean aMars, boolean aAsteroid, Materials aPrimary) { super(aName, GregTech_API.sWorldgenList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Overworld", aOverworld); this.mNether = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Nether", aNether); this.mEnd = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "TheEnd", aEnd); + this.mMoon = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Moon", aMoon); + this.mMars = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Mars", aMars); + this.mAsteroid = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Asteroid", aAsteroid); this.mMinY = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", aMinY)); this.mMaxY = ((short) Math.max(this.mMinY + 1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", aMaxY))); this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); - this.mBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "BiomeName", "None"); + this.mRestrictBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "mRestrictToBiomeName", "None"); } public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - if (!this.mBiome.equals("None") && !(this.mBiome.equals(aBiome))) { - return false; //Not the correct biome for ore mix + if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { + return false; //Not the correct biome for small ore } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) || ((aDimensionType == -30) && (this.mAsteroid)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } if (this.mMeta > 0) { diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index de0606b62f..f05143b0d1 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -21,12 +21,15 @@ import java.util.Random; public class GT_Worldgenerator implements IWorldGenerator { - public static boolean sAsteroids = true; - private static int mEndAsteroidProbability = 300; + private static int mEndAsteroidProbability = 50; + private static int mGCAsteroidProbability = 300; private static int mSize = 100; private static int endMinSize = 50; private static int endMaxSize = 200; + private static int gcMinSize = 100; + private static int gcMaxSize = 400; private static boolean endAsteroids = true; + private static boolean gcAsteroids = true; public List mList = new ArrayList(); public boolean mIsGenerating = false; @@ -36,6 +39,10 @@ public class GT_Worldgenerator endMinSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMinSize", 50); endMaxSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMaxSize", 200); mEndAsteroidProbability = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidProbability", 300); + gcAsteroids = GregTech_API.sWorldgenFile.get("gcasteroids", "GenerateGCAsteroids", true); + gcMinSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMinSize", 100); + gcMaxSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMaxSize", 400); + mGCAsteroidProbability = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidProbability", 300); GameRegistry.registerWorldGenerator(this, 1073741823); } @@ -118,8 +125,9 @@ public class GT_Worldgenerator //Asteroid Worldgen int tDimensionType = this.mWorld.provider.dimensionId; Random aRandom = new Random(); - if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) { - short primaryMeta = 0; + if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionType == -30) && gcAsteroids && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) { + + short primaryMeta = 0; short secondaryMeta = 0; short betweenMeta = 0; short sporadicMeta = 0; @@ -132,7 +140,7 @@ public class GT_Worldgenerator tRandomWeight -= ((GT_Worldgen_GT_Ore_Layer) tWorldGen).mWeight; if (tRandomWeight <= 0) { try { - if (tWorldGen.mEndAsteroid && tDimensionType == 1) { + if ((tWorldGen.mEndAsteroid && tDimensionType == 1) || (tWorldGen.mAsteroid && tDimensionType == -30)) { primaryMeta = tWorldGen.mPrimaryMeta; secondaryMeta = tWorldGen.mSecondaryMeta; betweenMeta = tWorldGen.mBetweenMeta; @@ -152,6 +160,8 @@ public class GT_Worldgenerator int tZ = mZ + aRandom.nextInt(16); if (tDimensionType == 1) { mSize = aRandom.nextInt((int) (endMaxSize - endMinSize)); + } else if (tDimensionType == -30) { + mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize)); } if ((mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) { float var6 = aRandom.nextFloat() * 3.141593F; @@ -185,14 +195,19 @@ public class GT_Worldgenerator if ((var39 * var39 + var42 * var42 + var45 * var45 < 1.0D) && (mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) { int ranOre = aRandom.nextInt(50); if (ranOre < 3) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, primaryMeta , true); + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, primaryMeta, false); } else if (ranOre < 6) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, secondaryMeta , true); + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, secondaryMeta, false); } else if (ranOre < 8) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, betweenMeta , true); + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, betweenMeta, false); } else if (ranOre < 10) { - GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta , true); - } else {mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false); + } else { + if (tDimensionType == -1) { + mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); + } else if (tDimensionType == -30) { + mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); + } } } } -- cgit From b5b8ea974ff79201a9dd12d77917d3b28d07579c Mon Sep 17 00:00:00 2001 From: Muramasa Date: Fri, 29 Jul 2016 20:13:02 +0100 Subject: Bugs & Removal of GG's TileEntityOres --- .../galacticgreg/GT_TileEntity_Ores_Space.java | 79 ---------------------- .../gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 2 +- .../common/GT_Worldgen_GT_Ore_SmallPieces.java | 2 +- .../java/gregtech/common/GT_Worldgenerator.java | 4 +- 4 files changed, 4 insertions(+), 83 deletions(-) delete mode 100644 src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java b/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java deleted file mode 100644 index 7b88384287..0000000000 --- a/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java +++ /dev/null @@ -1,79 +0,0 @@ -package bloodasp.galacticgreg; - -import gregtech.api.GregTech_API; -import gregtech.common.blocks.GT_TileEntity_Ores; -import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; -import micdoodle8.mods.galacticraft.planets.mars.blocks.MarsBlocks; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class GT_TileEntity_Ores_Space extends GT_TileEntity_Ores { - - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData) { - return setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); - } - - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air) { - // GalacticGreg.tmp1++; - // System.out.println("start gen ore"+aMetaData); - if (!air) { - aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); - } - Block tBlock = aWorld.getBlock(aX, aY, aZ); - int tMeta=0; - tMeta = aWorld.getBlockMetadata(aX, aY, aZ); - if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) { - if (aMetaData < 1000) { - if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) { - aMetaData += 1000; - } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) { - aMetaData += 2000; - } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) { - if (tBlock == GregTech_API.sBlockGranites) { - if (tMeta < 8) { - aMetaData += 3000; - } else { - aMetaData += 4000; - } - } else { - aMetaData += 3000; - } - } - else - if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GCBlocks.blockMoon)) { - if (tMeta != 4) { - return false; - } - } else if (tBlock == MarsBlocks.marsBlock) { - aMetaData += 4000; - if (tMeta != 9) { - // GalacticGreg.tmp3++; - return false; - } else { - } - } else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { - if (!air) { - return false; - } - } - } -// System.out.println("test "+aMetaData); -// System.out.println("block: "+tBlock.getUnlocalizedName()+" meta: "+aWorld.getBlockMetadata(aX, aY, aZ)); - // GalacticGreg.tmp2++; - // System.out.println("set ore block"); - if(tMeta==4||tMeta==9||tBlock==Blocks.end_stone||tBlock== GregTech_API.sBlockGranites){ - //if(aMetaData>1000&&aMetaData<5000){System.out.println("aMeta: "+aMetaData);} - aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1, getHarvestData((short) aMetaData), 0); - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - // GalacticGreg.tmp4++; - ((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) aMetaData); - ((GT_TileEntity_Ores) tTileEntity).mNatural = true; - } - return true;} - } - return false; - } -} diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index cff1da7192..d8a165a8af 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -52,7 +52,7 @@ public class GT_Worldgen_GT_Ore_Layer this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - this.mRestrictBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "mRestrictToBiomeName", "None"); + this.mRestrictBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "RestrictToBiomeName", "None"); if (this.mEnabled) { GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 71fc349b4b..c5c6481344 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -35,7 +35,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces this.mMaxY = ((short) Math.max(this.mMinY + 1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", aMaxY))); this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); - this.mRestrictBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "mRestrictToBiomeName", "None"); + this.mRestrictBiome = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "RestrictToBiomeName", "None"); } public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index f05143b0d1..1dbd77a6da 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -21,8 +21,8 @@ import java.util.Random; public class GT_Worldgenerator implements IWorldGenerator { - private static int mEndAsteroidProbability = 50; - private static int mGCAsteroidProbability = 300; + private static int mEndAsteroidProbability = 300; + private static int mGCAsteroidProbability = 50; private static int mSize = 100; private static int endMinSize = 50; private static int endMaxSize = 200; -- cgit From ed89ccbc4f2cd1f6e2c13287f6c0b07ac7a246da Mon Sep 17 00:00:00 2001 From: Muramasa Date: Mon, 1 Aug 2016 15:08:11 +0100 Subject: Remove asteroids from isGenerationAllowed --- src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 2 +- src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java | 2 +- src/main/java/gregtech/common/GT_Worldgenerator.java | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index d8a165a8af..cde5b2600b 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -66,7 +66,7 @@ public class GT_Worldgen_GT_Ore_Layer if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return false; //Not the correct biome for ore mix } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) || ((aDimensionType == -30) && (this.mAsteroid)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index c5c6481344..305f03d52b 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -42,7 +42,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return false; //Not the correct biome for small ore } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) || ((aDimensionType == -30) && (this.mAsteroid)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } if (this.mMeta > 0) { diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 1dbd77a6da..2d421097fc 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -206,7 +206,12 @@ public class GT_Worldgenerator if (tDimensionType == -1) { mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); } else if (tDimensionType == -30) { - mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); + //int asteroidType = aRandom.nextInt(20); + //if (asteroidType == 19) { //Rare Asteroid? + //mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); + //} else { + mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); + //} } } } -- cgit From a1a65ef0f665b67088f06915e52b33c1f09c192d Mon Sep 17 00:00:00 2001 From: Muramasa Date: Tue, 2 Aug 2016 09:33:22 +0100 Subject: Use dim name for GC worlds. --- src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 2 +- src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index cde5b2600b..45afe9c81a 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -66,7 +66,7 @@ public class GT_Worldgen_GT_Ore_Layer if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return false; //Not the correct biome for ore mix } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aWorld.provider.getDimensionName().equals("Moon")) && (this.mMoon)) || ((aWorld.provider.getDimensionName().equals("Mars")) && (this.mMars)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 305f03d52b..0e1656f572 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -42,7 +42,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return false; //Not the correct biome for small ore } - if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aDimensionType == -28) && (this.mMoon)) || ((aDimensionType == -29) && (this.mMars)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) || ((aWorld.provider.getDimensionName().equals("Moon")) && (this.mMoon)) || ((aWorld.provider.getDimensionName().equals("Mars")) && (this.mMars)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { return false; } if (this.mMeta > 0) { -- cgit