diff options
Diffstat (limited to 'src/main/java')
23 files changed, 642 insertions, 609 deletions
diff --git a/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java b/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java index 93900c3efe..dfa1307bce 100644 --- a/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java +++ b/src/main/java/bloodasp/galacticgreg/GT_TileEntity_Ores_Space.java @@ -16,12 +16,12 @@ public class GT_TileEntity_Ores_Space { // Renamed function to prevent function shadowing with base GT-code public static boolean setOuterSpaceOreBlock(ModDimensionDef pDimensionDef, World pWorld, int pX, int pY, int pZ, - int pMetaData) { + int pMetaData) { return setOuterSpaceOreBlock(pDimensionDef, pWorld, pX, pY, pZ, pMetaData, false, -1); } public static boolean setOuterSpaceOreBlock(ModDimensionDef pDimensionDef, World pWorld, int pX, int pY, int pZ, - int pMetaData, boolean pAir) { + int pMetaData, boolean pAir) { return setOuterSpaceOreBlock(pDimensionDef, pWorld, pX, pY, pZ, pMetaData, pAir, -1); } @@ -35,7 +35,7 @@ public class GT_TileEntity_Ores_Space { * @return */ private static ReplaceState CheckForReplaceableBlock(World pWorld, int pX, int pY, int pZ, - ModDimensionDef pDimDef) { + ModDimensionDef pDimDef) { try { ReplaceState tFlag = ReplaceState.Unknown; @@ -65,12 +65,12 @@ public class GT_TileEntity_Ores_Space { * @return */ public static boolean setOuterSpaceOreBlock(ModDimensionDef pDimensionDef, World pWorld, int pX, int pY, int pZ, - int pMetaData, boolean pAir, int pCustomGTOreOffset) { + int pMetaData, boolean pAir, int pCustomGTOreOffset) { if (!pAir) pY = Math.min(pWorld.getActualHeight(), Math.max(pY, 1)); if (pDimensionDef == null) { GalacticGreg.Logger - .warn("Unknown DimensionID: %d. Will not set anything here", pWorld.provider.dimensionId); + .warn("Unknown DimensionID: %d. Will not set anything here", pWorld.provider.dimensionId); return false; } try { @@ -96,20 +96,21 @@ public class GT_TileEntity_Ores_Space { return false; } - if (pCustomGTOreOffset == -1) pMetaData += pDimensionDef.getStoneType().getOffset(); + if (pCustomGTOreOffset == -1) pMetaData += pDimensionDef.getStoneType() + .getOffset(); else pMetaData += pCustomGTOreOffset; // This fix seems like cargo cult coding...The Abstract class just returns 0 for the harvest level. // But it aligns with the GT5U method, so yay? pWorld.setBlock( - pX, - pY, - pZ, - GregTech_API.sBlockOres1, - GT_TileEntity_Ores.getHarvestData( - (short) pMetaData, - ((GT_Block_Ores_Abstract) GregTech_API.sBlockOres1) - .getBaseBlockHarvestLevel(pMetaData % 16000 / 1000)), - 0); + pX, + pY, + pZ, + GregTech_API.sBlockOres1, + GT_TileEntity_Ores.getHarvestData( + (short) pMetaData, + ((GT_Block_Ores_Abstract) GregTech_API.sBlockOres1) + .getBaseBlockHarvestLevel(pMetaData % 16000 / 1000)), + 0); TileEntity tTileEntity = pWorld.getTileEntity(pX, pY, pZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { ((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) pMetaData); @@ -120,20 +121,20 @@ public class GT_TileEntity_Ores_Space { // That's why I put this behind a debug config option. If you ever find the reason for it, // please tell me what caused this if (GalacticGreg.GalacticConfig.ReportOreGenFailures) GalacticGreg.Logger.warn( - "Something went wrong while placing GT OreTileEntity. Meta: %d X [%d] Y [%d] Z [%d]", - pMetaData, - pX, - pY, - pZ); + "Something went wrong while placing GT OreTileEntity. Meta: %d X [%d] Y [%d] Z [%d]", + pMetaData, + pX, + pY, + pZ); } return true; } else GalacticGreg.Logger.warn( - "Not replacing block at pos %d %d %d due unexpected metaData for OreBlock: %d", - pX, - pY, - pZ, - pMetaData); + "Not replacing block at pos %d %d %d due unexpected metaData for OreBlock: %d", + pX, + pY, + pZ, + pMetaData); } } catch (Exception e) { if (GalacticGreg.GalacticConfig.ReportOreGenFailures) e.printStackTrace(); diff --git a/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_Layer_Space.java b/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_Layer_Space.java index 67bbb492f8..44fa0bf5a4 100644 --- a/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_Layer_Space.java +++ b/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_Layer_Space.java @@ -42,24 +42,22 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { private DynamicOreMixWorldConfig _mDynWorldConfig; public GT_Worldgen_GT_Ore_Layer_Space(String pName, boolean pDefault, int pMinY, int pMaxY, int pWeight, - int pDensity, int pSize, Materials pPrimary, Materials pSecondary, Materials pBetween, - Materials pSporadic) { + int pDensity, int pSize, Materials pPrimary, Materials pSecondary, Materials pBetween, Materials pSporadic) { super(pName, GalacticGreg.oreVeinWorldgenList, pDefault); mMinY = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", pMinY)); - mMaxY = ((short) Math.max( - this.mMinY + 5, - GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); + mMaxY = ((short) Math + .max(this.mMinY + 5, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); mWeight = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "RandomWeight", pWeight)); mDensity = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Density", pDensity)); mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Size", pSize))); mPrimaryMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OrePrimaryLayer", pPrimary.mMetaItemSubID)); + .get("worldgen." + this.mWorldGenName, "OrePrimaryLayer", pPrimary.mMetaItemSubID)); mSecondaryMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", pSecondary.mMetaItemSubID)); + .get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", pSecondary.mMetaItemSubID)); mBetweenMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", pBetween.mMetaItemSubID)); + .get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", pBetween.mMetaItemSubID)); mSporadicMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", pSporadic.mMetaItemSubID)); + .get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", pSporadic.mMetaItemSubID)); _mDynWorldConfig = new DynamicOreMixWorldConfig(mWorldGenName); _mDynWorldConfig.InitDynamicConfig(); @@ -71,23 +69,22 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { } public GT_Worldgen_GT_Ore_Layer_Space(String pName, boolean pDefault, int pMinY, int pMaxY, int pWeight, - int pDensity, int pSize, short pPrimary, short pSecondary, short pBetween, short pSporadic) { + int pDensity, int pSize, short pPrimary, short pSecondary, short pBetween, short pSporadic) { super(pName, GalacticGreg.oreVeinWorldgenList, pDefault); mMinY = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", pMinY)); - mMaxY = ((short) Math.max( - this.mMinY + 5, - GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); + mMaxY = ((short) Math + .max(this.mMinY + 5, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); mWeight = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "RandomWeight", pWeight)); mDensity = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Density", pDensity)); mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Size", pSize))); mPrimaryMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OrePrimaryLayer", pPrimary)); + .get("worldgen." + this.mWorldGenName, "OrePrimaryLayer", pPrimary)); mSecondaryMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", pSecondary)); + .get("worldgen." + this.mWorldGenName, "OreSecondaryLayer", pSecondary)); mBetweenMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", pBetween)); + .get("worldgen." + this.mWorldGenName, "OreSporadiclyInbetween", pBetween)); mSporadicMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", pSporadic)); + .get("worldgen." + this.mWorldGenName, "OreSporaticlyAround", pSporadic)); _mDynWorldConfig = new DynamicOreMixWorldConfig(mWorldGenName); _mDynWorldConfig.InitDynamicConfig(); @@ -124,8 +121,7 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { else { for (GT_Worldgen tWorldGen : GalacticGreg.oreVeinWorldgenList) if (tWorldGen instanceof GT_Worldgen_GT_Ore_Layer_Space - && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef)) - tVal++; + && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef)) tVal++; _mBufferedVeinCountList.put(pDimensionDef.getDimIdentifier(), tVal); } @@ -150,10 +146,10 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { tReturn = new ArrayList<>(); for (GT_Worldgen tWorldGen : GalacticGreg.oreVeinWorldgenList) if (tWorldGen instanceof GT_Worldgen_GT_Ore_Layer_Space - && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef)) + && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef)) tReturn.add(tWorldGen.mWorldGenName); else if (tWorldGen instanceof BW_Worldgen_Ore_Layer_Space - && ((BW_Worldgen_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef)) + && ((BW_Worldgen_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef)) tReturn.add(tWorldGen.mWorldGenName); _mBufferedVeinList.put(pDimensionDef.getDimIdentifier(), tReturn); @@ -166,8 +162,8 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { short tVal = 0; for (GT_Worldgen tWorldGen : GalacticGreg.oreVeinWorldgenList) if (tWorldGen instanceof GT_Worldgen_GT_Ore_Layer_Space - && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef) - && tVal < ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).mWeight) + && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).isEnabledForDim(pDimensionDef) + && tVal < ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).mWeight) tVal = ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).mWeight; return tVal; @@ -200,8 +196,7 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { GT_Worldgen tGen = null; for (GT_Worldgen tWorldGen : GalacticGreg.oreVeinWorldgenList) if (tWorldGen instanceof GT_Worldgen_GT_Ore_Layer_Space - && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).mWorldGenName.equals(tVeinName)) - tGen = tWorldGen; + && ((GT_Worldgen_GT_Ore_Layer_Space) tWorldGen).mWorldGenName.equals(tVeinName)) tGen = tWorldGen; if (tGen != null) { // GT_Worldgen_GT_Ore_Layer_Space tGen = GalacticGreg.oreVeinWorldgenList.get(tRndMix); @@ -249,21 +244,18 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { @Override public boolean executeWorldgen(World pWorld, Random pRandom, String pBiome, int pDimensionType, int pChunkX, - int pChunkZ, IChunkProvider pChunkGenerator, IChunkProvider pChunkProvider) { + int pChunkZ, IChunkProvider pChunkGenerator, IChunkProvider pChunkProvider) { GalacticGreg.Logger.trace("Entering executeWorldgen for [%s]", mWorldGenName); ModDimensionDef tMDD = GalacticGregRegistry.getDimensionTypeByChunkGenerator(pChunkGenerator); if (tMDD == null) { - GalacticGreg.Logger.trace( - "Can't find dimension definition for ChunkProvider %s, skipping", - pChunkGenerator.toString()); + GalacticGreg.Logger + .trace("Can't find dimension definition for ChunkProvider %s, skipping", pChunkGenerator.toString()); return false; } if (!_mDynWorldConfig.isEnabledInDim(tMDD)) { - GalacticGreg.Logger.trace( - "OreGen for %s is disallowed in dimension %s, skipping", - mWorldGenName, - tMDD.getDimensionName()); + GalacticGreg.Logger + .trace("OreGen for %s is disallowed in dimension %s, skipping", mWorldGenName, tMDD.getDimensionName()); return false; } @@ -280,31 +272,31 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { if (this.mSecondaryMeta > 0) { for (int i = tMinY - 1; i < tMinY + 3; i++) { int placeX = Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); int placeZ = Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); if ((pRandom.nextInt(placeZ) == 0) || (pRandom.nextInt(placeX) == 0)) { GT_TileEntity_Ores_Space - .setOuterSpaceOreBlock(tMDD, pWorld, tX, i, tZ, this.mSecondaryMeta); + .setOuterSpaceOreBlock(tMDD, pWorld, tX, i, tZ, this.mSecondaryMeta); } } } if (this.mBetweenMeta > 0) { for (int i = tMinY + 2; i < tMinY + 6; i++) { int placeX = Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); int placeZ = Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); if (((pRandom.nextInt(placeZ) == 0) || (pRandom.nextInt(placeX) == 0)) - && (pRandom.nextInt(2) == 0)) { + && (pRandom.nextInt(2) == 0)) { GT_TileEntity_Ores_Space.setOuterSpaceOreBlock(tMDD, pWorld, tX, i, tZ, this.mBetweenMeta); } } @@ -313,13 +305,13 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { if (this.mPrimaryMeta > 0) { for (int i = tMinY + 4; i < tMinY + 8; i++) { int placeX = Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); int placeZ = Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); if ((pRandom.nextInt(placeZ) == 0) || (pRandom.nextInt(placeX) == 0)) { GT_TileEntity_Ores_Space.setOuterSpaceOreBlock(tMDD, pWorld, tX, i, tZ, this.mPrimaryMeta); } @@ -328,15 +320,15 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { if (this.mSporadicMeta > 0) { for (int i = tMinY - 1; i < tMinY + 8; i++) { int placeX = Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); int placeZ = Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); + 1, + Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) + / getDensityFromPos(tX, tZ, pChunkX, pChunkZ)); if (((pRandom.nextInt(placeX) == 0) || (pRandom.nextInt(placeZ) == 0)) - && (pRandom.nextInt(7) == 0)) { + && (pRandom.nextInt(7) == 0)) { GT_TileEntity_Ores_Space.setOuterSpaceOreBlock(tMDD, pWorld, tX, i, tZ, this.mSporadicMeta); } } @@ -356,7 +348,7 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { tZ = pRandom.nextInt(16) + pChunkZ + 2; tY = pRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. if (this.mSecondaryMeta > 0) GT_TileEntity_Ores_Space - .setOuterSpaceOreBlock(tMDD, pWorld, tX, tY, tZ, this.mSecondaryMeta + 16000); + .setOuterSpaceOreBlock(tMDD, pWorld, tX, tY, tZ, this.mSecondaryMeta + 16000); tX = pRandom.nextInt(16) + pChunkX + 2; tZ = pRandom.nextInt(16) + pChunkZ + 2; tY = pRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. @@ -366,7 +358,7 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { tZ = pRandom.nextInt(16) + pChunkZ + 2; tY = pRandom.nextInt(190) + 10; // Y height can vary from 10 to 200 for small ores. if (this.mSporadicMeta > 0) GT_TileEntity_Ores_Space - .setOuterSpaceOreBlock(tMDD, pWorld, tX, tY, tZ, this.mSporadicMeta + 16000); + .setOuterSpaceOreBlock(tMDD, pWorld, tX, tY, tZ, this.mSporadicMeta + 16000); } } @@ -377,9 +369,9 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { long tTotalTime = mProfilingEnd - mProfilingStart; GalacticGreg.Profiler.AddTimeToList(tMDD, tTotalTime); GalacticGreg.Logger.debug( - "Done with OreLayer-Worldgen in DimensionType %s. Generation took %d ms", - tMDD.getDimensionName(), - tTotalTime); + "Done with OreLayer-Worldgen in DimensionType %s. Generation took %d ms", + tMDD.getDimensionName(), + tTotalTime); } catch (Exception ignored) {} // Silently ignore errors } @@ -391,8 +383,8 @@ public class GT_Worldgen_GT_Ore_Layer_Space extends GT_Worldgen { if (aX < 0) aX -= 16; if (aZ < 0) aZ -= 16; return Math.max( - 1, - this.mDensity / ((int) Math - .sqrt(2 + Math.pow(aX / 16 - aSeedX / 16, 2) + Math.pow(aZ / 16 - aSeedZ / 16, 2)))); + 1, + this.mDensity + / ((int) Math.sqrt(2 + Math.pow(aX / 16 - aSeedX / 16, 2) + Math.pow(aZ / 16 - aSeedZ / 16, 2)))); } } diff --git a/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_SmallPieces_Space.java b/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_SmallPieces_Space.java index 38f7a94d37..11e264b4fb 100644 --- a/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_SmallPieces_Space.java +++ b/src/main/java/bloodasp/galacticgreg/GT_Worldgen_GT_Ore_SmallPieces_Space.java @@ -24,17 +24,16 @@ public class GT_Worldgen_GT_Ore_SmallPieces_Space extends GT_Worldgen { private DynamicOreMixWorldConfig _mDynWorldConfig; public GT_Worldgen_GT_Ore_SmallPieces_Space(String pName, boolean pDefault, int pMinY, int pMaxY, int pAmount, - Materials pPrimary) { + Materials pPrimary) { super(pName, GalacticGreg.smallOreWorldgenList, pDefault); mMinY = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", pMinY)); - mMaxY = ((short) Math.max( - this.mMinY + 1, - GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); + mMaxY = ((short) Math + .max(this.mMinY + 1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); mAmount = ((short) Math - .max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", pAmount))); + .max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", pAmount))); mMeta = ((short) GregTech_API.sWorldgenFile - .get("worldgen." + this.mWorldGenName, "Ore", pPrimary.mMetaItemSubID)); + .get("worldgen." + this.mWorldGenName, "Ore", pPrimary.mMetaItemSubID)); _mDynWorldConfig = new DynamicOreMixWorldConfig(mWorldGenName); _mDynWorldConfig.InitDynamicConfig(); @@ -43,15 +42,14 @@ public class GT_Worldgen_GT_Ore_SmallPieces_Space extends GT_Worldgen { } public GT_Worldgen_GT_Ore_SmallPieces_Space(String pName, boolean pDefault, int pMinY, int pMaxY, int pAmount, - short pPrimary) { + short pPrimary) { super(pName, GalacticGreg.smallOreWorldgenList, pDefault); mMinY = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", pMinY)); - mMaxY = ((short) Math.max( - this.mMinY + 1, - GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); + mMaxY = ((short) Math + .max(this.mMinY + 1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", pMaxY))); mAmount = ((short) Math - .max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", pAmount))); + .max(1, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Amount", pAmount))); mMeta = ((short) GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Ore", pPrimary)); _mDynWorldConfig = new DynamicOreMixWorldConfig(mWorldGenName); @@ -72,21 +70,18 @@ public class GT_Worldgen_GT_Ore_SmallPieces_Space extends GT_Worldgen { @Override public boolean executeWorldgen(World pWorld, Random pRandom, String pBiome, int pDimensionType, int pChunkX, - int pChunkZ, IChunkProvider pChunkGenerator, IChunkProvider pChunkProvider) { + int pChunkZ, IChunkProvider pChunkGenerator, IChunkProvider pChunkProvider) { GalacticGreg.Logger.trace("Entering executeWorldgen for [%s]", mWorldGenName); ModDimensionDef tMDD = GalacticGregRegistry.getDimensionTypeByChunkGenerator(pChunkGenerator); if (tMDD == null) { - GalacticGreg.Logger.trace( - "Can't find dimension definition for ChunkProvider %s, skipping", - pChunkGenerator.toString()); + GalacticGreg.Logger + .trace("Can't find dimension definition for ChunkProvider %s, skipping", pChunkGenerator.toString()); return false; } if (!_mDynWorldConfig.isEnabledInDim(tMDD)) { - GalacticGreg.Logger.trace( - "OreGen for %s is disallowed in dimension %s, skipping", - mWorldGenName, - tMDD.getDimensionName()); + GalacticGreg.Logger + .trace("OreGen for %s is disallowed in dimension %s, skipping", mWorldGenName, tMDD.getDimensionName()); return false; } @@ -97,12 +92,12 @@ public class GT_Worldgen_GT_Ore_SmallPieces_Space extends GT_Worldgen { int i = 0; for (int j = Math.max(1, this.mAmount / 2 + pRandom.nextInt(this.mAmount) / 2); i < j; i++) { GT_TileEntity_Ores_Space.setOuterSpaceOreBlock( - tMDD, - pWorld, - pChunkX + pRandom.nextInt(16), - this.mMinY + pRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), - pChunkZ + pRandom.nextInt(16), - this.mMeta + 16000); + tMDD, + pWorld, + pChunkX + pRandom.nextInt(16), + this.mMinY + pRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), + pChunkZ + pRandom.nextInt(16), + this.mMeta + 16000); } } // --------------------------- @@ -112,9 +107,9 @@ public class GT_Worldgen_GT_Ore_SmallPieces_Space extends GT_Worldgen { long tTotalTime = mProfilingEnd - mProfilingStart; GalacticGreg.Profiler.AddTimeToList(tMDD, tTotalTime); GalacticGreg.Logger.debug( - "Done with SmallOre-Worldgen in DimensionType %s. Generation took %d ms", - tMDD.getDimensionName(), - tTotalTime); + "Done with SmallOre-Worldgen in DimensionType %s. Generation took %d ms", + tMDD.getDimensionName(), + tTotalTime); } catch (Exception ignored) {} // Silently ignore errors } diff --git a/src/main/java/bloodasp/galacticgreg/GT_Worldgenerator_Space.java b/src/main/java/bloodasp/galacticgreg/GT_Worldgenerator_Space.java index 2a8a7bafd5..d2060ca71e 100644 --- a/src/main/java/bloodasp/galacticgreg/GT_Worldgenerator_Space.java +++ b/src/main/java/bloodasp/galacticgreg/GT_Worldgenerator_Space.java @@ -53,7 +53,7 @@ public class GT_Worldgenerator_Space implements IWorldGenerator { } public void generate(Random pRandom, int pX, int pZ, World pWorld, IChunkProvider pChunkGenerator, - IChunkProvider pChunkProvider) { + IChunkProvider pChunkProvider) { pX *= 16; pZ *= 16; @@ -63,14 +63,14 @@ public class GT_Worldgenerator_Space implements IWorldGenerator { tBiome = BiomeGenBase.plains.biomeName; } GalacticGreg.Logger - .trace("Triggered generate: [ChunkGenerator %s] [Biome %s]", pChunkGenerator.toString(), tBiome); + .trace("Triggered generate: [ChunkGenerator %s] [Biome %s]", pChunkGenerator.toString(), tBiome); ModDimensionDef tDimDef = GalacticGregRegistry.getDimensionTypeByChunkGenerator(pChunkGenerator); if (tDimDef == null) { GalacticGreg.Logger.trace( - "Ignoring ChunkGenerator type %s as there is no definition for it in the registry", - pChunkGenerator.toString()); + "Ignoring ChunkGenerator type %s as there is no definition for it in the registry", + pChunkGenerator.toString()); return; } else { GalacticGreg.Logger.trace("Selected DimDef: [%s]", tDimDef.getDimIdentifier()); @@ -84,8 +84,8 @@ public class GT_Worldgenerator_Space implements IWorldGenerator { if (tDimDef.getDimensionType() != DimensionType.Planet) { if (tDimDef.getRandomAsteroidMaterial() == null) GalacticGreg.Logger.error( - "Dimension [%s] is set to Asteroids, but no asteroid material is specified! Nothing will generate", - tDimDef.getDimensionName()); + "Dimension [%s] is set to Asteroids, but no asteroid material is specified! Nothing will generate", + tDimDef.getDimensionName()); else Generate_Asteroids(tDimDef, pRandom, pWorld, pX, pZ); } else if (tDimDef.getDimensionType() != DimensionType.Asteroid) { Generate_OreVeins(tDimDef, pRandom, pWorld, pX, pZ, "", pChunkGenerator, pChunkProvider); @@ -103,8 +103,8 @@ public class GT_Worldgenerator_Space implements IWorldGenerator { AsteroidConfig tAConf = DynamicDimensionConfig.getAsteroidConfig(pDimensionDef); if (tAConf == null) { GalacticGreg.Logger.error( - "Dimension %s is set to asteroid, but no config object can be found. Skipping!", - pDimensionDef.getDimIdentifier()); + "Dimension %s is set to asteroid, but no config object can be found. Skipping!", + pDimensionDef.getDimIdentifier()); return; } else { GalacticGreg.Logger.trace("Asteroid probability: %d", tAConf.Probability); @@ -122,7 +122,8 @@ public class GT_Worldgenerator_Space implements IWorldGenerator { int tZ = pZ + pRandom.nextInt(16); // Check if position is free - if ((pWorld.getBlock(tX, tY, tZ).isAir(pWorld, tX, tY, tZ))) { + if ((pWorld.getBlock(tX, tY, tZ) + .isAir(pWorld, tX, tY, tZ))) { int tCustomAsteroidOffset = -1; int tGraniteMeta = 0; @@ -135,20 +136,23 @@ public class GT_Worldgenerator_Space implements IWorldGenerator { // Fill Vars for random Asteroid Block tFinalAsteroidBlock = tABComb.getBlock(); int tFinalAsteroidBlockMeta = tABComb.getMeta(); - int tFinalOreOffset = tABComb.getOreMaterial().getOffset(); - int tFinalUpd |
