diff options
| author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-09-02 23:17:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-02 23:17:17 +0200 |
| commit | 1b820de08a05070909a267e17f033fcf58ac8710 (patch) | |
| tree | 02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/bartworks/system/oregen | |
| parent | afd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff) | |
| download | GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2 GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip | |
The Great Renaming (#3014)
* move kekztech to a single root dir
* move detrav to a single root dir
* move gtnh-lanthanides to a single root dir
* move tectech and delete some gross reflection in gt++
* remove more reflection inside gt5u
* delete more reflection in gt++
* fix imports
* move bartworks and bwcrossmod
* fix proxies
* move galactigreg and ggfab
* move gtneioreplugin
* try to fix gt++ bee loader
* apply the rename rules to BW
* apply rename rules to bwcrossmod
* apply rename rules to detrav scanner mod
* apply rename rules to galacticgreg
* apply rename rules to ggfab
* apply rename rules to goodgenerator
* apply rename rules to gtnh-lanthanides
* apply rename rules to gt++
* apply rename rules to kekztech
* apply rename rules to kubatech
* apply rename rules to tectech
* apply rename rules to gt
apply the rename rules to gt
* fix tt import
* fix mui hopefully
* fix coremod except intergalactic
* rename assline recipe class
* fix a class name i stumbled on
* rename StructureUtility to GTStructureUtility to prevent conflict with structurelib
* temporary rename of GTTooltipDataCache to old name
* fix gt client/server proxy names
Diffstat (limited to 'src/main/java/bartworks/system/oregen')
4 files changed, 749 insertions, 0 deletions
diff --git a/src/main/java/bartworks/system/oregen/BWOreLayer.java b/src/main/java/bartworks/system/oregen/BWOreLayer.java new file mode 100644 index 0000000000..5f9688e68c --- /dev/null +++ b/src/main/java/bartworks/system/oregen/BWOreLayer.java @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package bartworks.system.oregen; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +import com.google.common.collect.ArrayListMultimap; + +import bartworks.MainMod; +import bartworks.system.material.BWMetaGeneratedOres; +import bartworks.system.material.BWMetaGeneratedSmallOres; +import bartworks.system.material.BWTileEntityMetaGeneratedOre; +import bartworks.system.material.Werkstoff; +import bartworks.system.material.WerkstoffLoader; +import bartworks.util.MurmurHash3; +import bartworks.util.Pair; +import gregtech.api.GregTechAPI; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import gregtech.api.world.GTWorldgen; +import gregtech.common.blocks.TileEntityOres; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public abstract class BWOreLayer extends GTWorldgen { + + public static final List<BWOreLayer> sList = new ArrayList<>(); + public static final ArrayListMultimap<Short, BWOreLayer> NEIMAP = ArrayListMultimap.create(); + private static final boolean logOregenRoss128 = false; + public static int sWeight; + public byte bwOres; + public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; + + public abstract Block getDefaultBlockToReplace(); + + public abstract int[] getDefaultDamageToReplace(); + + public abstract String getDimName(); + + public BWOreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, + ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + super(aName, BWOreLayer.sList, aDefault); + this.mMinY = (short) aMinY; + this.mMaxY = (short) aMaxY; + this.mWeight = (short) aWeight; + this.mDensity = (short) aDensity; + this.mSize = (short) Math.max(1, aSize); + + if (this.mEnabled) BWOreLayer.sWeight += this.mWeight; + + if (top instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b1000); + if (bottom instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0100); + if (between instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0010); + if (sprinkled instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0001); + + short aPrimary = top instanceof Materials ? (short) ((Materials) top).mMetaItemSubID + : top instanceof Werkstoff ? ((Werkstoff) top).getmID() : 0; + short aSecondary = bottom instanceof Materials ? (short) ((Materials) bottom).mMetaItemSubID + : bottom instanceof Werkstoff ? ((Werkstoff) bottom).getmID() : 0; + short aBetween = between instanceof Materials ? (short) ((Materials) between).mMetaItemSubID + : between instanceof Werkstoff ? ((Werkstoff) between).getmID() : 0; + short aSporadic = sprinkled instanceof Materials ? (short) ((Materials) sprinkled).mMetaItemSubID + : sprinkled instanceof Werkstoff ? ((Werkstoff) sprinkled).getmID() : 0; + this.mPrimaryMeta = aPrimary; + this.mSecondaryMeta = aSecondary; + this.mBetweenMeta = aBetween; + this.mSporadicMeta = aSporadic; + NEIMAP.put((short) this.mPrimaryMeta, this); + NEIMAP.put((short) this.mSecondaryMeta, this); + NEIMAP.put((short) this.mBetweenMeta, this); + NEIMAP.put((short) this.mSporadicMeta, this); + } + + public List<ItemStack> getStacks() { + ArrayList<ItemStack> ret = new ArrayList<>(); + ret.add( + (this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) + : new ItemStack(GregTechAPI.sBlockOres1, 1, this.mPrimaryMeta)); + ret.add( + (this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) + : new ItemStack(GregTechAPI.sBlockOres1, 1, this.mSecondaryMeta)); + ret.add( + (this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) + : new ItemStack(GregTechAPI.sBlockOres1, 1, this.mBetweenMeta)); + ret.add( + (this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) + : new ItemStack(GregTechAPI.sBlockOres1, 1, this.mSporadicMeta)); + return ret; + } + + public List<Pair<Integer, Boolean>> getStacksRawData() { + ArrayList<Pair<Integer, Boolean>> ret = new ArrayList<>(); + ret.add(new Pair<>(this.mPrimaryMeta, (this.bwOres & 0b1000) != 0)); + ret.add(new Pair<>(this.mSecondaryMeta, (this.bwOres & 0b0100) != 0)); + ret.add(new Pair<>(this.mBetweenMeta, (this.bwOres & 0b0010) != 0)); + ret.add(new Pair<>(this.mSporadicMeta, (this.bwOres & 0b0001) != 0)); + return ret; + } + + @Override + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + { + int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); + int cX = aChunkX - aRandom.nextInt(this.mSize); + int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); + + boolean wasPlaced = false; + + for (int tX = cX; tX <= eX; ++tX) { + int cZ = aChunkZ - aRandom.nextInt(this.mSize); + int eZ = aChunkZ + 16 + aRandom.nextInt(this.mSize); + + for (int tZ = cZ; tZ <= eZ; ++tZ) { + int i; + if (this.mSecondaryMeta > 0) { + for (i = tMinY - 1; i < tMinY + 2; ++i) { + if (this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mSecondaryMeta, false); + } + } + } + + if (this.mBetweenMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + wasPlaced = this + .setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + } + + if (this.mPrimaryMeta > 0) { + for (i = tMinY + 3; i < tMinY + 6; ++i) { + if (this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + wasPlaced = this.setOreBlock(aWorld, tX, i, tZ, this.mPrimaryMeta, false); + } + } + } + + if (this.mSporadicMeta > 0 && this.shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { + wasPlaced = this + .setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + } + } + } + + if (BWOreLayer.logOregenRoss128) { + MainMod.LOGGER.info("Generated Orevein: " + this.mWorldGenName + " " + aChunkX + " " + aChunkZ); + } + + return wasPlaced; + } + } + + private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { + if (aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0 + || aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) + return true; + return false; + } + + public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { + // security stuff to prevent crashes with 2 TileEntites on the same Spot + TileEntity te = aWorld.getTileEntity(aX, aY, aZ); + if (te instanceof BWTileEntityMetaGeneratedOre || te instanceof TileEntityOres) return true; + + if (aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0 + || aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0 + || aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0 + || aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0) { + return isSmallOre + ? BWMetaGeneratedSmallOres.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()) + : BWMetaGeneratedOres.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()); + } + + return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); + } + + public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block) { + if (TileEntityOres.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) return true; + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + Block tBlock = aWorld.getBlock(aX, aY, aZ); + Block tOreBlock = GregTechAPI.sBlockOres1; + if (aMetaData < 0 || tBlock == Blocks.air) { + return false; + } else { + if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, block)) { + return false; + } + aMetaData += 5000; + aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof TileEntityOres ore) { + ore.mMetaData = (short) aMetaData; + } + return true; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof BWOreLayer that)) return false; + + if (this.bwOres != that.bwOres || this.mMinY != that.mMinY + || this.mWeight != that.mWeight + || this.mDensity != that.mDensity) return false; + if (this.mSize != that.mSize) return false; + if (this.mMaxY != that.mMaxY) return false; + if (this.mPrimaryMeta != that.mPrimaryMeta) return false; + if (this.mSecondaryMeta != that.mSecondaryMeta) return false; + if (this.mBetweenMeta != that.mBetweenMeta) return false; + return this.mSporadicMeta == that.mSporadicMeta; + } + + @Override + public int hashCode() { + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(37) + .put(this.bwOres) + .putInt(this.mMinY) + .putInt(this.mWeight) + .putInt(this.mDensity) + .putInt(this.mSize) + .putInt(this.mMaxY) + .putInt(this.mPrimaryMeta) + .putInt(this.mSecondaryMeta) + .putInt(this.mBetweenMeta) + .putInt(this.mSporadicMeta) + .array(), + 0, + 37, + 31); + } +} diff --git a/src/main/java/bartworks/system/oregen/BWWordGenerator.java b/src/main/java/bartworks/system/oregen/BWWordGenerator.java new file mode 100644 index 0000000000..10a3c862af --- /dev/null +++ b/src/main/java/bartworks/system/oregen/BWWordGenerator.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package bartworks.system.oregen; + +import java.util.HashSet; +import java.util.Random; + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +import cpw.mods.fml.common.IWorldGenerator; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GTLog; + +/** + * Original GT File Stripped and adjusted to work with this mod + */ +public class BWWordGenerator implements IWorldGenerator { + + public BWWordGenerator() { + // GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider + // GameRegistry.registerWorldGenerator(this, 1073741823); + } + + public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + new BWWordGenerator.WorldGenContainer( + aX * 16, + aZ * 16, + aWorld.provider, + aWorld, + aChunkGenerator, + aChunkProvider).run(); + } + + public static class WorldGenContainer implements Runnable { + + public static HashSet<ChunkCoordIntPair> mGenerated = new HashSet<>(2000); + public final WorldProvider mWorldProvider; + public final World mWorld; + public final IChunkProvider mChunkGenerator; + public final IChunkProvider mChunkProvider; + public int mX; + public int mZ; + + public WorldGenContainer(int aX, int aZ, WorldProvider aWorldProvider, World aWorld, + IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + this.mX = aX; + this.mZ = aZ; + this.mWorldProvider = aWorldProvider; + this.mWorld = aWorld; + this.mChunkGenerator = aChunkGenerator; + this.mChunkProvider = aChunkProvider; + } + + // returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square + public int getVeinCenterCoordinate(int c) { + c += c < 0 ? 1 : 3; + return c - c % 3 - 2; + } + + public boolean surroundingChunksLoaded(int xCenter, int zCenter) { + return this.mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); + } + + public XSTR getRandom(int xChunk, int zChunk) { + long worldSeed = this.mWorld.getSeed(); + XSTR fmlRandom = new XSTR(worldSeed); + long xSeed = fmlRandom.nextLong() >> 2 + 1L; + long zSeed = fmlRandom.nextLong() >> 2 + 1L; + long chunkSeed = xSeed * xChunk + zSeed * zChunk ^ worldSeed; + fmlRandom.setSeed(chunkSeed); + return new XSTR(fmlRandom.nextInt()); + } + + public void run() { + int xCenter = this.getVeinCenterCoordinate(this.mX >> 4); + int zCenter = this.getVeinCenterCoordinate(this.mZ >> 4); + Random random = this.getRandom(xCenter, zCenter); + xCenter <<= 4; + zCenter <<= 4; + ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); + if (!BWWordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) + && this.surroundingChunksLoaded(xCenter, zCenter)) { + BWWordGenerator.WorldGenContainer.mGenerated.add(centerChunk); + if (BWOreLayer.sWeight > 0 && BWOreLayer.sList.size() > 0) { + boolean temp = true; + int tRandomWeight; + for (int i = 0; i < 256 && temp; i++) { + tRandomWeight = random.nextInt(BWOreLayer.sWeight); + for (BWOreLayer tWorldGen : BWOreLayer.sList) { + if (!tWorldGen.isGenerationAllowed(this.mWorld, mWorldProvider.getClass())) continue; + tRandomWeight -= tWorldGen.mWeight; + if (tRandomWeight <= 0) { + try { + boolean placed; + int attempts = 0; + do { + placed = tWorldGen.executeWorldgen( + this.mWorld, + random, + "", + this.mWorldProvider.dimensionId, + xCenter, + zCenter, + this.mChunkGenerator, + this.mChunkProvider); + ++attempts; + } while (!placed && attempts < 25); + temp = false; + break; + } catch (Throwable e) { + e.printStackTrace(GTLog.err); + } + } + } + } + } + } + Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); + if (tChunk != null) { + tChunk.isModified = true; + } + } + } +} diff --git a/src/main/java/bartworks/system/oregen/BWWorldGenRoss128b.java b/src/main/java/bartworks/system/oregen/BWWorldGenRoss128b.java new file mode 100644 index 0000000000..0af1a4a993 --- /dev/null +++ b/src/main/java/bartworks/system/oregen/BWWorldGenRoss128b.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package bartworks.system.oregen; + +import static gregtech.api.enums.Materials.Bismuth; +import static gregtech.api.enums.Materials.Coal; +import static gregtech.api.enums.Materials.Diamond; +import static gregtech.api.enums.Materials.Graphite; +import static gregtech.api.enums.Materials.Lepidolite; +import static gregtech.api.enums.Materials.Scheelite; +import static gregtech.api.enums.Materials.Spodumene; +import static gregtech.api.enums.Materials.Stibnite; +import static gregtech.api.enums.Materials.Tetrahedrite; +import static gregtech.api.enums.Materials.Uraninite; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.StatCollector; + +import bartworks.common.configs.ConfigHandler; +import bartworks.system.material.WerkstoffLoader; +import gregtech.api.interfaces.ISubTagContainer; + +public class BWWorldGenRoss128b extends BWOreLayer { + + @Override + public Block getDefaultBlockToReplace() { + return Blocks.stone; + } + + @Override + public int[] getDefaultDamageToReplace() { + return new int[] { 0 }; + } + + @Override + public String getDimName() { + return StatCollector.translateToLocal("planet.Ross128b"); + } + + public BWWorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, + ISubTagContainer sprinkled) { + super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); + } + + public static void initOres() { + new BWWorldGenRoss128b( + "ore.mix.ross128.Thorianit", + true, + 30, + 60, + 17, + 1, + 16, + WerkstoffLoader.Thorianit, + Uraninite, + Lepidolite, + Spodumene); + new BWWorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); + new BWWorldGenRoss128b( + "ore.mix.ross128.bismuth", + true, + 5, + 80, + 30, + 1, + 16, + WerkstoffLoader.Bismuthinit, + Stibnite, + Bismuth, + WerkstoffLoader.Bismutite); + new BWWorldGenRoss128b( + "ore.mix.ross128.TurmalinAlkali", + true, + 5, + 80, + 15, + 4, + 48, + WerkstoffLoader.Olenit, + WerkstoffLoader.FluorBuergerit, + WerkstoffLoader.ChromoAluminoPovondrait, + WerkstoffLoader.VanadioOxyDravit); + new BWWorldGenRoss128b( + "ore.mix.ross128.Roquesit", + true, + 30, + 50, + 3, + 1, + 12, + WerkstoffLoader.Arsenopyrite, + WerkstoffLoader.Ferberite, + WerkstoffLoader.Loellingit, + WerkstoffLoader.Roquesit); + new BWWorldGenRoss128b( + "ore.mix.ross128.Tungstate", + true, + 5, + 40, + 10, + 4, + 14, + WerkstoffLoader.Ferberite, + WerkstoffLoader.Huebnerit, + WerkstoffLoader.Loellingit, + Scheelite); + new BWWorldGenRoss128b( + "ore.mix.ross128.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + WerkstoffLoader.Djurleit, + WerkstoffLoader.Bornite, + WerkstoffLoader.Wittichenit, + Tetrahedrite); + new BWWorldGenRoss128b( + "ore.mix.ross128.Forsterit", + true, + 20, + 90, + 50, + 2, + 32, + WerkstoffLoader.Forsterit, + WerkstoffLoader.Fayalit, + WerkstoffLoader.DescloiziteCUVO4, + WerkstoffLoader.DescloiziteZNVO4); + new BWWorldGenRoss128b( + "ore.mix.ross128.Hedenbergit", + true, + 20, + 90, + 50, + 2, + 32, + WerkstoffLoader.Hedenbergit, + WerkstoffLoader.Fayalit, + WerkstoffLoader.DescloiziteCUVO4, + WerkstoffLoader.DescloiziteZNVO4); + new BWWorldGenRoss128b( + "ore.mix.ross128.RedZircon", + true, + 10, + 80, + 40, + 3, + 24, + WerkstoffLoader.Fayalit, + WerkstoffLoader.FuchsitAL, + WerkstoffLoader.RedZircon, + WerkstoffLoader.FuchsitCR); + } + + @Override + public boolean isGenerationAllowed(String aDimName, int aDimensionType, int aAllowedDimensionType) { + return aDimensionType == ConfigHandler.ross128BID; + } +} diff --git a/src/main/java/bartworks/system/oregen/BWWorldGenRoss128ba.java b/src/main/java/bartworks/system/oregen/BWWorldGenRoss128ba.java new file mode 100644 index 0000000000..3a032af822 --- /dev/null +++ b/src/main/java/bartworks/system/oregen/BWWorldGenRoss128ba.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package bartworks.system.oregen; + +import static gregtech.api.enums.Materials.Amethyst; +import static gregtech.api.enums.Materials.Barite; +import static gregtech.api.enums.Materials.Galena; +import static gregtech.api.enums.Materials.NaquadahEnriched; +import static gregtech.api.enums.Materials.Olivine; +import static gregtech.api.enums.Materials.Scheelite; +import static gregtech.api.enums.Materials.Sphalerite; +import static gregtech.api.enums.Materials.Tetrahedrite; + +import net.minecraft.block.Block; +import net.minecraft.util.StatCollector; + +import bartworks.common.configs.ConfigHandler; +import bartworks.system.material.WerkstoffLoader; +import gregtech.api.interfaces.ISubTagContainer; + +public class BWWorldGenRoss128ba extends BWOreLayer { + + public BWWorldGenRoss128ba(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, + ISubTagContainer sprinkled) { + super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); + } + + @Override + public Block getDefaultBlockToReplace() { + return Block.getBlockFromName("GalacticraftCore:tile.moonBlock"); + } + + @Override + public int[] getDefaultDamageToReplace() { + int[] ret = new int[12]; + for (int i = 0; i < 12; i++) { + if (i != 5 && i != 3) ret[i] = i; + } + return ret; + } + + @Override + public String getDimName() { + return StatCollector.translateToLocal("moon.Ross128ba"); + } + + public static void init_Ores() { + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.tib", + true, + 30, + 60, + 6, + 1, + 16, + WerkstoffLoader.Tiberium, + WerkstoffLoader.Tiberium, + NaquadahEnriched, + NaquadahEnriched); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.Tungstate", + true, + 5, + 40, + 60, + 4, + 14, + WerkstoffLoader.Ferberite, + WerkstoffLoader.Huebnerit, + WerkstoffLoader.Loellingit, + Scheelite); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.bart", + true, + 30, + 60, + 1, + 1, + 1, + WerkstoffLoader.BArTiMaEuSNeK, + WerkstoffLoader.BArTiMaEuSNeK, + WerkstoffLoader.BArTiMaEuSNeK, + WerkstoffLoader.BArTiMaEuSNeK); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.TurmalinAlkali", + true, + 5, + 80, + 60, + 4, + 48, + WerkstoffLoader.Olenit, + WerkstoffLoader.FluorBuergerit, + WerkstoffLoader.ChromoAluminoPovondrait, + WerkstoffLoader.VanadioOxyDravit); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.Amethyst", + true, + 5, + 80, + 35, + 2, + 8, + Amethyst, + Olivine, + WerkstoffLoader.Prasiolite, + WerkstoffLoader.Hedenbergit); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + WerkstoffLoader.Djurleit, + WerkstoffLoader.Bornite, + WerkstoffLoader.Wittichenit, + Tetrahedrite); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.RedZircon", + true, + 10, + 80, + 40, + 3, + 24, + WerkstoffLoader.Fayalit, + WerkstoffLoader.FuchsitAL, + WerkstoffLoader.RedZircon, + WerkstoffLoader.FuchsitCR); + new BWWorldGenRoss128ba( + "ore.mix.ross128ba.Fluorspar", + true, + 10, + 80, + 35, + 4, + 8, + Galena, + Sphalerite, + WerkstoffLoader.Fluorspar, + Barite); + } + + @Override + public boolean isGenerationAllowed(String aDimName, int aDimensionType, int aAllowedDimensionType) { + return aDimensionType == ConfigHandler.ross128BAID; + } +} |
