diff options
author | Raven Szewczyk <git@eigenraven.me> | 2023-04-10 17:49:16 +0100 |
---|---|---|
committer | Raven Szewczyk <git@eigenraven.me> | 2023-04-10 17:49:16 +0100 |
commit | 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 (patch) | |
tree | 0a8c7b737f1f2607fa6875309f4c6a5c2b8b3331 /src/main/java/gregtech/common/GT_Worldgen_Stone.java | |
parent | d795cf740c3b48b602d3bfb708ed9e6c492ad37d (diff) | |
download | GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.gz GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.tar.bz2 GT5-Unofficial-8ac58626bd4caa9e49f58acc6b97ac031f6c2107.zip |
Update spotless config to 0.2.2
Diffstat (limited to 'src/main/java/gregtech/common/GT_Worldgen_Stone.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Worldgen_Stone.java | 224 |
1 files changed, 93 insertions, 131 deletions
diff --git a/src/main/java/gregtech/common/GT_Worldgen_Stone.java b/src/main/java/gregtech/common/GT_Worldgen_Stone.java index 94b529c1e5..1996b77349 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_Stone.java +++ b/src/main/java/gregtech/common/GT_Worldgen_Stone.java @@ -59,26 +59,26 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { } public GT_Worldgen_Stone(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, - int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, - boolean aAllowToGenerateinVoid) { + int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, + boolean aAllowToGenerateinVoid) { super( - aName, - aDefault, - aBlock, - aBlockMeta, - aDimensionType, - aAmount, - aSize, - aProbability, - aMinY, - aMaxY, - aBiomeList, - aAllowToGenerateinVoid); + aName, + aDefault, + aBlock, + aBlockMeta, + aDimensionType, + aAmount, + aSize, + aProbability, + aMinY, + aMaxY, + aBiomeList, + aAllowToGenerateinVoid); } @Override public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, - int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { XSTR stoneRNG = new XSTR(); ArrayList<ValidSeeds> stones = new ArrayList<>(); @@ -97,24 +97,24 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { for (int x = aChunkX / 16 - windowWidth; x < (aChunkX / 16 + windowWidth + 1); x++) { for (int z = aChunkZ / 16 - windowWidth; z < (aChunkZ / 16 + windowWidth + 1); z++) { long hash = (((aWorld.provider.dimensionId & 0xffL) << 56) | (((long) x & 0x000000000fffffffL) << 28) - | ((long) z & 0x000000000fffffffL)); + | ((long) z & 0x000000000fffffffL)); if (!validStoneSeeds.containsKey(hash)) { // Determine if RNG says to add stone at this chunk stoneRNG.setSeed( - aWorld.getSeed() ^ hash + Math.abs(mBlockMeta) - + Math.abs(mSize) - + ((GregTech_API.sBlockGranites == mBlock) ? (32768) : (0))); // Don't judge me. - // Want different - // values for - // different block - // types + aWorld.getSeed() ^ hash + Math.abs(mBlockMeta) + + Math.abs(mSize) + + ((GregTech_API.sBlockGranites == mBlock) ? (32768) : (0))); // Don't judge me. + // Want different + // values for + // different block + // types if ((this.mProbability <= 1) || (stoneRNG.nextInt(this.mProbability) == 0)) { // Add stone at this chunk validStoneSeeds.put(hash, new StoneSeeds(true)); // Add to generation list stones.add(new ValidSeeds(x, z)); if (debugStones) GT_Log.out.println( - "New stoneseed=" + mWorldGenName + " x=" + x + " z=" + z + " realSize=" + realSize); + "New stoneseed=" + mWorldGenName + " x=" + x + " z=" + z + " realSize=" + realSize); } else { validStoneSeeds.put(hash, new StoneSeeds(false)); } @@ -138,11 +138,11 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { int z = stones.get(0).mZ * 16; stoneRNG.setSeed( - aWorld.getSeed() - ^ (((aWorld.provider.dimensionId & 0xffL) << 56) | (((long) x & 0x000000000fffffffL) << 28) - | ((long) z & 0x000000000fffffffL)) + Math.abs(mBlockMeta) - + Math.abs(mSize) - + ((GregTech_API.sBlockGranites == mBlock) ? (32768) : (0))); // Don't judge me + aWorld.getSeed() + ^ (((aWorld.provider.dimensionId & 0xffL) << 56) | (((long) x & 0x000000000fffffffL) << 28) + | ((long) z & 0x000000000fffffffL)) + Math.abs(mBlockMeta) + + Math.abs(mSize) + + ((GregTech_API.sBlockGranites == mBlock) ? (32768) : (0))); // Don't judge me for (int i = 0; i < this.mAmount; i++) { // Not sure why you would want more than one in a chunk! Left alone // though. // Locate the stoneseed XYZ. Original code would request an isAir at the seed location, causing a chunk @@ -176,30 +176,30 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { // If the (tY-ySize) of the stoneseed is air in the current chunk, mark the seed empty and move on. if (aWorld.getBlock(aChunkX + 8, tMinY, aChunkZ + 8) - .isAir(aWorld, aChunkX + 8, tMinY, aChunkZ + 8)) { + .isAir(aWorld, aChunkX + 8, tMinY, aChunkZ + 8)) { if (debugStones) GT_Log.out.println( - mWorldGenName + " tX=" - + tX - + " tY=" - + tY - + " tZ=" - + tZ - + " realSize=" - + realSize - + " xSize=" - + realSize / xSize - + " ySize=" - + realSize / ySize - + " zSize=" - + realSize / zSize - + " tMinY=" - + tMinY - + " tMaxY=" - + tMaxY - + " - Skipped because first requesting chunk would not contain this stone"); + mWorldGenName + " tX=" + + tX + + " tY=" + + tY + + " tZ=" + + tZ + + " realSize=" + + realSize + + " xSize=" + + realSize / xSize + + " ySize=" + + realSize / ySize + + " zSize=" + + realSize / zSize + + " tMinY=" + + tMinY + + " tMaxY=" + + tMaxY + + " - Skipped because first requesting chunk would not contain this stone"); long hash = (((aWorld.provider.dimensionId & 0xffL) << 56) - | (((long) x & 0x000000000fffffffL) << 28) - | ((long) z & 0x000000000fffffffL)); + | (((long) x & 0x000000000fffffffL) << 28) + | ((long) z & 0x000000000fffffffL)); validStoneSeeds.remove(hash); validStoneSeeds.put(hash, new StoneSeeds(false)); } @@ -212,32 +212,32 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { int nZ = Math.min(tMaxZ, aChunkZ + 8 + 16); if (debugStones) GT_Log.out.println( - mWorldGenName + " tX=" - + tX - + " tY=" - + tY - + " tZ=" - + tZ - + " realSize=" - + realSize - + " xSize=" - + realSize / xSize - + " ySize=" - + realSize / ySize - + " zSize=" - + realSize / zSize - + " wX=" - + wX - + " eX=" - + eX - + " tMinY=" - + tMinY - + " tMaxY=" - + tMaxY - + " sZ=" - + sZ - + " nZ=" - + nZ); + mWorldGenName + " tX=" + + tX + + " tY=" + + tY + + " tZ=" + + tZ + + " realSize=" + + realSize + + " xSize=" + + realSize / xSize + + " ySize=" + + realSize / ySize + + " zSize=" + + realSize / zSize + + " wX=" + + wX + + " eX=" + + eX + + " tMinY=" + + tMinY + + " tMaxY=" + + tMaxY + + " sZ=" + + sZ + + " nZ=" + + nZ); double rightHandSide = realSize * realSize + 1; // Precalc the right hand side for (int iY = tMinY; iY < tMaxY; iY++) { // Do placement from the bottom up layer up. Maybe better on @@ -271,62 +271,24 @@ public class GT_Worldgen_Stone extends GT_Worldgen_Ore { if (tTargetedBlock != GregTech_API.sBlockOres1) { ((GT_TileEntity_Ores) tTileEntity).convertOreBlock(aWorld, iX, iY, iZ); } - ((GT_TileEntity_Ores) tTileEntity).overrideOreBlockMaterial( - this.mBlock, - (byte) this.mBlockMeta); + ((GT_TileEntity_Ores) tTileEntity) + .overrideOreBlockMaterial(this.mBlock, (byte) this.mBlockMeta); } } else if (((this.mAllowToGenerateinVoid) && (aWorld.getBlock(iX, iY, iZ) - .isAir(aWorld, iX, iY, iZ))) - || ((tTargetedBlock != null) && ((tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - Blocks.stone)) - || (tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - Blocks.stained_hardened_clay)) - || (tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - Blocks.cobblestone)) - || (tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - Blocks.end_stone)) - || (tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - Blocks.netherrack)) - || (tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - GregTech_API.sBlockGranites)) - || (tTargetedBlock.isReplaceableOreGen( - aWorld, - iX, - iY, - iZ, - GregTech_API.sBlockStones))))) { - aWorld.setBlock( - iX, - iY, - iZ, - this.mBlock, - this.mBlockMeta, - 0); - } + .isAir(aWorld, iX, iY, iZ))) + || ((tTargetedBlock != null) && ((tTargetedBlock + .isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.stone)) + || (tTargetedBlock + .isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.stained_hardened_clay)) + || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.cobblestone)) + || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.end_stone)) + || (tTargetedBlock.isReplaceableOreGen(aWorld, iX, iY, iZ, Blocks.netherrack)) + || (tTargetedBlock + .isReplaceableOreGen(aWorld, iX, iY, iZ, GregTech_API.sBlockGranites)) + || (tTargetedBlock + .isReplaceableOreGen(aWorld, iX, iY, iZ, GregTech_API.sBlockStones))))) { + aWorld.setBlock(iX, iY, iZ, this.mBlock, this.mBlockMeta, 0); + } } } } |