diff options
author | Jason Mitchell <mitchej@gmail.com> | 2021-01-17 20:21:01 -0800 |
---|---|---|
committer | Jason Mitchell <mitchej@gmail.com> | 2021-01-17 20:21:01 -0800 |
commit | db1a9e4a7fc67a1650ca08e5d6cfd1921d354b5d (patch) | |
tree | 7ccdf9c54d28ed0c6114e2f06add39bd347a1fc6 /src | |
parent | 3e0e372608347cd9e6979e1644a0f716f7001be9 (diff) | |
download | GT5-Unofficial-db1a9e4a7fc67a1650ca08e5d6cfd1921d354b5d.tar.gz GT5-Unofficial-db1a9e4a7fc67a1650ca08e5d6cfd1921d354b5d.tar.bz2 GT5-Unofficial-db1a9e4a7fc67a1650ca08e5d6cfd1921d354b5d.zip |
Remove a bunch of commented out code, small formatting adjustments
Diffstat (limited to 'src')
13 files changed, 41 insertions, 152 deletions
diff --git a/src/main/java/gregtech/common/GT_DummyWorld.java b/src/main/java/gregtech/common/GT_DummyWorld.java index b2c15c6a0d..914600b590 100644 --- a/src/main/java/gregtech/common/GT_DummyWorld.java +++ b/src/main/java/gregtech/common/GT_DummyWorld.java @@ -18,8 +18,7 @@ import net.minecraft.world.storage.WorldInfo; import java.io.File; -public class GT_DummyWorld - extends World { +public class GT_DummyWorld extends World { public GT_IteratorRandom mRandom = new GT_IteratorRandom(); public ItemStack mLastSetBlock = null; @@ -66,17 +65,7 @@ public class GT_DummyWorld return null; } }, "DUMMY_DIMENSION", null, -// new WorldProvider(), -// -// -// -// new WorldSettings(new WorldInfo(new NBTTagCompound())) -// { -// public String getDimensionName() -// { -// return "DUMMY_DIMENSION"; -// } -// } + new WorldSettings(new WorldInfo(new NBTTagCompound())), new Profiler()); } diff --git a/src/main/java/gregtech/common/GT_IteratorRandom.java b/src/main/java/gregtech/common/GT_IteratorRandom.java index 79b8c2ae37..d93aca3e02 100644 --- a/src/main/java/gregtech/common/GT_IteratorRandom.java +++ b/src/main/java/gregtech/common/GT_IteratorRandom.java @@ -2,8 +2,7 @@ package gregtech.common; import java.util.Random; -public class GT_IteratorRandom - extends Random { +public class GT_IteratorRandom extends Random { private static final long serialVersionUID = 1L; public int mIterationStep = 2147483647; diff --git a/src/main/java/gregtech/common/GT_MinableOreGenerator.java b/src/main/java/gregtech/common/GT_MinableOreGenerator.java index c5249f1f25..7d368184c6 100644 --- a/src/main/java/gregtech/common/GT_MinableOreGenerator.java +++ b/src/main/java/gregtech/common/GT_MinableOreGenerator.java @@ -8,8 +8,7 @@ import net.minecraft.world.gen.feature.WorldGenerator; import java.util.Random; -public class GT_MinableOreGenerator - extends WorldGenerator { +public class GT_MinableOreGenerator extends WorldGenerator { private Block minableBlockId; private Block mBlock; private int minableBlockMeta = 0; diff --git a/src/main/java/gregtech/common/GT_Network.java b/src/main/java/gregtech/common/GT_Network.java index 5fd315b7ce..fcd81ed988 100644 --- a/src/main/java/gregtech/common/GT_Network.java +++ b/src/main/java/gregtech/common/GT_Network.java @@ -27,9 +27,7 @@ import java.util.List; import static gregtech.GT_Mod.GT_FML_LOGGER; @ChannelHandler.Sharable -public class GT_Network - extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> - implements IGT_NetworkHandler { +public class GT_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler { private final EnumMap<Side, FMLEmbeddedChannel> mChannel; private final GT_Packet[] mSubChannels; diff --git a/src/main/java/gregtech/common/GT_PlayerActivityLogger.java b/src/main/java/gregtech/common/GT_PlayerActivityLogger.java index 7c275e76df..cbba87c7d9 100644 --- a/src/main/java/gregtech/common/GT_PlayerActivityLogger.java +++ b/src/main/java/gregtech/common/GT_PlayerActivityLogger.java @@ -5,8 +5,7 @@ import gregtech.api.util.GT_Log; import java.util.ArrayList; -public class GT_PlayerActivityLogger - implements Runnable { +public class GT_PlayerActivityLogger implements Runnable { public void run() { try { for (; ; ) { diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index be49e57e4a..65c9ce5054 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -11,7 +11,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; @@ -29,9 +28,11 @@ import java.util.HashMap; import java.util.List; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -import static gregtech.common.GT_Proxy.*; +import static gregtech.common.GT_Proxy.GTPOLLUTION; +import static gregtech.common.GT_Proxy.dimensionWiseChunkData; +import static gregtech.common.GT_Proxy.dimensionWisePollution; +import static gregtech.common.GT_Proxy.getDefaultChunkDataOnCreation; -//import net.minecraft.entity.EntityLiving; public class GT_Pollution { /** @@ -62,7 +63,9 @@ public class GT_Pollution { * * Machine Explosion(100,000) * - * Muffler Hatch Pollution reduction: + * Other Random Shit: lots and lots + * + * Muffler Hatch Pollution reduction: ** inaccurate ** * LV (0%), MV (30%), HV (52%), EV (66%), IV (76%), LuV (84%), ZPM (89%), UV (92%), MAX (95%) */ private List<ChunkCoordIntPair> pollutionList = new ArrayList<>();//chunks left to process diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 7d1a2d0900..d313cb613f 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -379,15 +379,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { - /*if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); - return true; - */ return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, null,aOutput1, aDuration, aEUt, false); } @@ -396,17 +387,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { - /*if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { - return false; - } - if (aOutput1 == null) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); - */ return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false); } @@ -584,14 +564,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { @Deprecated public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { -// if ((aInput1 == null) || (aOutput1 == null)) { -// return false; -// } -// if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput1, aDuration)) <= 0) { -// return false; -// } -// new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt); -// return true; return false; } @@ -889,10 +861,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) { int aDuration= aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62; - if ((aInput != null) && (aOutput != null)) { - if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { - } - } else { + if (aInput == null || aOutput == null) { return false; } if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { @@ -906,10 +875,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { } public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { - if ((aInput != null) && (aOutput != null)) { - if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { - } - } else { + if (aInput == null || aOutput == null) { return false; } if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { @@ -1208,16 +1174,6 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { @Override @Deprecated public boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { - //if ((aInput == null) || (aOutput == null)) { - // return false; - // } - // if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) { - // return false; - // } - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, GT_ModHandler.getSteam(aInput.amount)}, new FluidStack[]{aOutput, Materials.Hydrogen.getGas(aInput.amount)}, aDuration, aEUt, 0); - // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, Materials.Hydrogen.getGas(aInput.amount)}, new FluidStack[]{new FluidStack(aOutput.getFluid(), (int) (aOutput.amount * 1.3))}, aDuration, aEUt, 0); - // return true; return false; } diff --git a/src/main/java/gregtech/common/GT_Server.java b/src/main/java/gregtech/common/GT_Server.java index 831ec4666a..4f9aa383ba 100644 --- a/src/main/java/gregtech/common/GT_Server.java +++ b/src/main/java/gregtech/common/GT_Server.java @@ -4,8 +4,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class GT_Server - extends GT_Proxy { +public class GT_Server extends GT_Proxy { public boolean isServerSide() { return true; } diff --git a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java index aa3d120357..cac12fa5c3 100644 --- a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java +++ b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java @@ -27,8 +27,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -public class GT_ThaumcraftCompat - implements IThaumcraftCompat { +public class GT_ThaumcraftCompat implements IThaumcraftCompat { public GT_ThaumcraftCompat() { TC_Aspects.AER.mAspect = Aspect.AIR; TC_Aspects.ALIENIS.mAspect = Aspect.ELDRITCH; 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 995984158f..635fc46b49 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 @@ -18,8 +18,7 @@ import static gregtech.api.enums.GT_Values.debugOrevein; import static gregtech.api.enums.GT_Values.oreveinPlacerOres; import static gregtech.api.enums.GT_Values.oreveinPlacerOresMultiplier; -public class GT_Worldgen_GT_Ore_Layer - extends GT_Worldgen { +public class GT_Worldgen_GT_Ore_Layer extends GT_Worldgen { public static ArrayList<GT_Worldgen_GT_Ore_Layer> sList = new ArrayList(); public static int sWeight = 0; public final short mMinY; @@ -77,21 +76,8 @@ public class GT_Worldgen_GT_Ore_Layer this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic)); this.mRestrictBiome = GregTech_API.sWorldgenFile.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 not exist"); - //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); - //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist"); - //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist"); - 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); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); sWeight += this.mWeight; - //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){ - // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f}); - //} - } } @@ -106,9 +92,6 @@ public class GT_Worldgen_GT_Ore_Layer this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); - //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); - //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); - //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); if (mMaxY < (this.mMinY + 9)) { @@ -128,21 +111,8 @@ public class GT_Worldgen_GT_Ore_Layer this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); this.mRestrictBiome = GregTech_API.sWorldgenFile.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 not exist"); - //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); - //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist"); - //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist"); - 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); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); - //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); sWeight += this.mWeight; - //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){ - // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f}); - //} - } } @@ -234,7 +204,7 @@ public class GT_Worldgen_GT_Ore_Layer // 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))) ); - // 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 + // 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. // Layer -1 Secondary and Sporadic int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure. 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 85c0eb2d07..c5d60838a9 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 @@ -27,7 +27,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces public final String aTextWorldgen = "worldgen."; public static ArrayList<GT_Worldgen_GT_Ore_SmallPieces> sList = new ArrayList<GT_Worldgen_GT_Ore_SmallPieces>(); - //TODO CHECk IF INSTANTIATION IS CORRECT + //TODO CHECK IF INSTANTIATION IS CORRECT public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary) { super(aName, GregTech_API.sWorldgenList, aDefault); this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); @@ -38,7 +38,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - this.sList.add(this); + sList.add(this); } public GT_Worldgen_GT_Ore_SmallPieces(String aName, boolean aDefault, int aMinY, int aMaxY, int aAmount, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Materials aPrimary) { @@ -51,7 +51,7 @@ public class GT_Worldgen_GT_Ore_SmallPieces this.mAmount = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Amount", aAmount))); this.mMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Ore", aPrimary.mMetaItemSubID)); this.mBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "BiomeName", "None"); - this.sList.add(this); + sList.add(this); } diff --git a/src/main/java/gregtech/common/GT_Worldgen_Stone.java b/src/main/java/gregtech/common/GT_Worldgen_Stone.java index a354a813fe..392d9ea705 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_Stone.java +++ b/src/main/java/gregtech/common/GT_Worldgen_Stone.java @@ -19,8 +19,7 @@ import java.util.Random; import static gregtech.api.enums.GT_Values.debugStones; -public class GT_Worldgen_Stone - extends GT_Worldgen_Ore { +public class GT_Worldgen_Stone extends GT_Worldgen_Ore { static final double sizeConversion[] = { 1, 1, 1.333333, 1.333333, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; // Bias the sizes towards skinnier boulders, ie more "shafts" than dikes or sills. diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 00bdb0d879..aa6f63cf95 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -1,17 +1,5 @@ package gregtech.common; -import static gregtech.api.enums.GT_Values.debugOrevein; -import static gregtech.api.enums.GT_Values.debugWorldGen; -import static gregtech.api.enums.GT_Values.oreveinAttempts; -import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; -import static gregtech.api.enums.GT_Values.oreveinPercentage; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Random; - import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; @@ -26,18 +14,23 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -// Disabled for hardcoded value. import static gregtech.api.enums.GT_Values.oreveinMaxSize; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Random; + +import static gregtech.api.enums.GT_Values.debugOrevein; +import static gregtech.api.enums.GT_Values.debugWorldGen; +import static gregtech.api.enums.GT_Values.oreveinAttempts; +import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; +import static gregtech.api.enums.GT_Values.oreveinPercentage; -public class GT_Worldgenerator -implements IWorldGenerator { - //public static boolean sAsteroids = true; +public class GT_Worldgenerator implements IWorldGenerator { 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; - //private static int gcMinSize = 100; - //private static int gcMaxSize = 400; private static boolean endAsteroids = true; public static List<Runnable> mList = new ArrayList(); public static HashSet<Long> ProcChunks = new HashSet<Long>(); @@ -46,7 +39,6 @@ implements IWorldGenerator { public static Hashtable<Long, GT_Worldgen_GT_Ore_Layer> validOreveins = new Hashtable(1024); public boolean mIsGenerating = false; public static final Object listLock = new Object(); - //private static boolean gcAsteroids = true; public GT_Worldgenerator() { @@ -54,10 +46,6 @@ implements IWorldGenerator { 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); if (debugWorldGen) { GT_Log.out.println( @@ -69,33 +57,33 @@ implements IWorldGenerator { public void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { synchronized (listLock) { - this.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); + mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); if (debugWorldGen) GT_Log.out.println( "ADD WorldSeed:"+aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId + " chunk x:" + aX + " z:" + aZ + - " SIZE: " + this.mList.size() + " SIZE: " + mList.size() ); } if (!this.mIsGenerating) { this.mIsGenerating = true; - int mList_sS=this.mList.size(); + int mList_sS= mList.size(); mList_sS = Math.min(mList_sS, 5); // Run a maximum of 5 chunks at a time through worldgen. Extra chunks get done later. for (int i = 0; i < mList_sS; i++) { - WorldGenContainer toRun = (WorldGenContainer) this.mList.get(0); + WorldGenContainer toRun = (WorldGenContainer) 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: " + this.mList.size() + + " SIZE: " + mList.size() + " i: " + i ); synchronized (listLock) { - this.mList.remove(0); + mList.remove(0); } toRun.run(); } @@ -480,16 +468,7 @@ implements IWorldGenerator { } else if (ranOre < 10) { GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false); } else { - //if (tDimensionType == 1) {//TODO CHECK mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); - //} else if (tDimensionName.equals("Asteroids")) { - ////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); - ////} - //} } } } |