aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/bwcrossmod/galacticraft/planets
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/bwcrossmod/galacticraft/planets')
-rw-r--r--src/main/java/bwcrossmod/galacticraft/planets/AbstractWorldProviderSpace.java37
-rw-r--r--src/main/java/bwcrossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java185
-rw-r--r--src/main/java/bwcrossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java25
-rw-r--r--src/main/java/bwcrossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java154
-rw-r--r--src/main/java/bwcrossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java107
-rw-r--r--src/main/java/bwcrossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java112
6 files changed, 620 insertions, 0 deletions
diff --git a/src/main/java/bwcrossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/bwcrossmod/galacticraft/planets/AbstractWorldProviderSpace.java
new file mode 100644
index 0000000000..7f69e87cfb
--- /dev/null
+++ b/src/main/java/bwcrossmod/galacticraft/planets/AbstractWorldProviderSpace.java
@@ -0,0 +1,37 @@
+/*
+ * 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 bwcrossmod.galacticraft.planets;
+
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldProviderSpace;
+import micdoodle8.mods.galacticraft.api.world.IExitHeight;
+import micdoodle8.mods.galacticraft.api.world.ISolarLevel;
+
+public abstract class AbstractWorldProviderSpace extends WorldProviderSpace implements IExitHeight, ISolarLevel {
+
+ @Override
+ public boolean canRainOrSnow() {
+ return false;
+ }
+
+ @Override
+ public String getDimensionName() {
+ return this.getCelestialBody()
+ .getLocalizedName();
+ }
+
+ @Override
+ public boolean hasSunset() {
+ return true;
+ }
+}
diff --git a/src/main/java/bwcrossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/bwcrossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java
new file mode 100644
index 0000000000..7682e61d09
--- /dev/null
+++ b/src/main/java/bwcrossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java
@@ -0,0 +1,185 @@
+/*
+ * 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 bwcrossmod.galacticraft.planets.ross128b;
+
+import static gregtech.api.enums.Mods.Thaumcraft;
+import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE;
+import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFalling;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.IChunkProvider;
+import net.minecraft.world.gen.ChunkProviderGenerate;
+import net.minecraft.world.gen.MapGenBase;
+import net.minecraft.world.gen.MapGenCaves;
+import net.minecraft.world.gen.MapGenRavine;
+import net.minecraft.world.gen.feature.WorldGenLakes;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.terraingen.PopulateChunkEvent;
+import net.minecraftforge.event.terraingen.TerrainGen;
+
+import bartworks.common.configs.ConfigHandler;
+import bartworks.system.oregen.BWWordGenerator;
+import bartworks.system.worldgen.MapGenRuins;
+import bwcrossmod.thaumcraft.util.ThaumcraftHandler;
+import gregtech.api.objects.XSTR;
+
+public class ChunkProviderRoss128b extends ChunkProviderGenerate {
+
+ XSTR rand = new XSTR();
+ private BiomeGenBase[] biomesForGeneration;
+ public static final BWWordGenerator BWOreGen = new BWWordGenerator();
+ private final World worldObj;
+ private final MapGenBase caveGenerator = new MapGenCaves();
+ private final MapGenBase ravineGenerator = new MapGenRavine();
+ private final MapGenRuins.RuinsBase ruinsBase = new MapGenRuins.RuinsBase();
+
+ public ChunkProviderRoss128b(World par1World, long seed, boolean mapFeaturesEnabled) {
+ super(par1World, seed, mapFeaturesEnabled);
+ this.worldObj = par1World;
+ }
+
+ @Override
+ public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_,
+ int p_73155_4_) {
+ return null;
+ }
+
+ @Override
+ public Chunk provideChunk(int p_73154_1_, int p_73154_2_) {
+ this.rand.setSeed(p_73154_1_ * 341873128712L + p_73154_2_ * 132897987541L);
+ Block[] ablock = new Block[65536];
+ byte[] abyte = new byte[65536];
+ this.func_147424_a(p_73154_1_, p_73154_2_, ablock);
+ this.biomesForGeneration = this.worldObj.getWorldChunkManager()
+ .loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16);
+ for (int i = 0; i < this.biomesForGeneration.length; i++) {
+ BiomeGenBase biomeGenBase = this.biomesForGeneration[i];
+ if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) {
+ this.biomesForGeneration[i] = BiomeGenBase.taiga;
+ } else if (biomeGenBase.biomeID == BiomeGenBase.mushroomIslandShore.biomeID) {
+ this.biomesForGeneration[i] = BiomeGenBase.stoneBeach;
+ }
+ if (Thaumcraft.isModLoaded()) {
+ if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID))
+ this.biomesForGeneration[i] = BiomeGenBase.taiga;
+ else if (ConfigHandler.disableMagicalForest
+ && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID))
+ this.biomesForGeneration[i] = BiomeGenBase.birchForest;
+ }
+ }
+ this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration);
+ this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock);
+ this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock);
+
+ Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_);
+ byte[] abyte1 = chunk.getBiomeArray();
+
+ for (int k = 0; k < abyte1.length; ++k) {
+ abyte1[k] = (byte) this.biomesForGeneration[k].biomeID;
+ }
+
+ chunk.generateSkylightMap();
+ return chunk;
+ }
+
+ @Override
+ public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {
+ BlockFalling.fallInstantly = true;
+ int k = p_73153_2_ * 16;
+ int l = p_73153_3_ * 16;
+ BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
+ this.rand.setSeed(this.worldObj.getSeed());
+ if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) {
+ long i1 = this.rand.nextLong() / 2L * 2L + 1L;
+ long j1 = this.rand.nextLong() / 2L * 2L + 1L;
+ this.rand.setSeed(p_73153_2_ * i1 + p_73153_3_ * j1 ^ this.worldObj.getSeed());
+ }
+
+ MinecraftForge.EVENT_BUS
+ .post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false));
+
+ int x1;
+ int y1;
+ int z1;
+ if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills
+ && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) {
+ x1 = k + this.rand.nextInt(16) + 8;
+ y1 = this.rand.nextInt(256);
+ z1 = l + this.rand.nextInt(16) + 8;
+ int rni = this.rand.nextInt(8);
+ if (rni == 0) new WorldGenLakes(Blocks.ice).generate(this.worldObj, this.rand, x1, y1, z1);
+ else if (rni == 4) new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, x1, y1, z1);
+ }
+ if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean
+ && biomegenbase != BiomeGenBase.river
+ && biomegenbase != BiomeGenBase.frozenOcean
+ && biomegenbase != BiomeGenBase.frozenRiver
+ && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) {
+ x1 = k + this.rand.nextInt(16) + 3;
+ y1 = this.rand.nextInt(256);
+ z1 = l + this.rand.nextInt(16) + 3;
+ this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1);
+ }
+
+ biomegenbase.decorate(this.worldObj, this.rand, k, l);
+
+ k += 8;
+ l += 8;
+
+ boolean doGen = TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, ICE);
+ for (x1 = 0; doGen && x1 < 16; ++x1) {
+ for (y1 = 0; y1 < 16; ++y1) {
+ z1 = this.worldObj.getPrecipitationHeight(k + x1, l + y1);
+
+ if (this.worldObj.isBlockFreezable(x1 + k, z1 - 1, y1 + l)) {
+ this.worldObj.setBlock(x1 + k, z1 - 1, y1 + l, Blocks.ice, 0, 2);
+ }
+
+ if (this.worldObj.func_147478_e(x1 + k, z1, y1 + l, true)) {
+ this.worldObj.setBlock(x1 + k, z1, y1 + l, Blocks.snow_layer, 0, 2);
+ }
+ }
+ }
+
+ BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this);
+ MinecraftForge.EVENT_BUS
+ .post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false));
+
+ BlockFalling.fallInstantly = false;
+ }
+
+ @Override
+ public void recreateStructures(int p_82695_1_, int p_82695_2_) {}
+
+ @Override
+ public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas,
+ BiomeGenBase[] p_147422_5_) {
+ super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_);
+ for (int i = 0; i < blocks.length; i++) {
+ if (blocks[i] == Blocks.grass) {
+ blocks[i] = Blocks.dirt;
+ metas[i] = 2;
+ }
+ }
+ }
+}
diff --git a/src/main/java/bwcrossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/bwcrossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java
new file mode 100644
index 0000000000..9a4fe472b3
--- /dev/null
+++ b/src/main/java/bwcrossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java
@@ -0,0 +1,25 @@
+/*
+ * 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 bwcrossmod.galacticraft.planets.ross128b;
+
+import net.minecraft.util.ResourceLocation;
+
+import bwcrossmod.BartWorksCrossmod;
+
+public class SkyProviderRoss128b {
+
+ // ASM enables this texture
+ public static final ResourceLocation sunTex = new ResourceLocation(
+ BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png");
+}
diff --git a/src/main/java/bwcrossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/bwcrossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java
new file mode 100644
index 0000000000..a21cbd0cbf
--- /dev/null
+++ b/src/main/java/bwcrossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java
@@ -0,0 +1,154 @@
+/*
+ * 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 bwcrossmod.galacticraft.planets.ross128b;
+
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.Vec3;
+import net.minecraft.world.biome.WorldChunkManager;
+import net.minecraft.world.chunk.IChunkProvider;
+
+import bwcrossmod.galacticraft.planets.AbstractWorldProviderSpace;
+import bwcrossmod.galacticraft.solarsystems.Ross128SolarSystem;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody;
+import micdoodle8.mods.galacticraft.api.vector.Vector3;
+
+public class WorldProviderRoss128b extends AbstractWorldProviderSpace {
+
+ @Override
+ public boolean canRespawnHere() {
+ return true;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Vec3 getFogColor(float cy, float noidea) {
+ float angle = MathHelper.cos(cy * (float) Math.PI * 2.0F) * 2.0F + 0.5F;
+
+ if (angle < 0.0F) {
+ angle = 0.0F;
+ }
+
+ if (angle > 1.0F) {
+ angle = 1.0F;
+ }
+
+ float red = 200 / 255f;
+ float green = 80 / 255f;
+ float blue = 0.0F;
+ red *= angle * 0.94F + 0.06F;
+ green *= angle * 0.94F + 0.06F;
+ return Vec3.createVectorHelper(red, green, blue);
+ }
+
+ @Override
+ public Vector3 getFogColor() {
+ // unused
+ return null;
+ }
+
+ @Override
+ public float getSunBrightness(float par1) {
+ return super.getSunBrightness(par1) * 0.975f;
+ }
+
+ @Override
+ public float calculateCelestialAngle(long par1, float par3) {
+ return super.calculateCelestialAngle(par1, par3);
+ }
+
+ @Override
+ public Vector3 getSkyColor() {
+ float red = 200 / 255f;
+ float green = 120 / 255f;
+ float blue = 0.0F;
+ return new Vector3(red, green, blue);
+ }
+
+ @Override
+ public long getDayLength() {
+ return (long) (24000 * 9.9f);
+ }
+
+ @Override
+ public Class<? extends IChunkProvider> getChunkProviderClass() {
+ return ChunkProviderRoss128b.class;
+ }
+
+ @Override
+ public Class<? extends WorldChunkManager> getWorldChunkManagerClass() {
+ return WorldChunkManager.class;
+ }
+
+ @Override
+ public float getGravity() {
+ return -0.0035F;
+ }
+
+ @Override
+ public double getMeteorFrequency() {
+ return 0D;
+ }
+
+ @Override
+ public double getFuelUsageMultiplier() {
+ return 1.35D;
+ }
+
+ @Override
+ public boolean canSpaceshipTierPass(int tier) {
+ return Ross128SolarSystem.Ross128b.getTierRequirement() <= tier;
+ }
+
+ @Override
+ public float getFallDamageModifier() {
+ return 1.35F;
+ }
+
+ @Override
+ public float getSoundVolReductionAmount() {
+ return 1F;
+ }
+
+ @Override
+ public float getThermalLevelModifier() {
+ return 0.01f;
+ }
+
+ @Override
+ public float getWindLevel() {
+ return 1.35f;
+ }
+
+ @Override
+ public CelestialBody getCelestialBody() {
+ return Ross128SolarSystem.Ross128b;
+ }
+
+ @Override
+ public double getYCoordinateToTeleport() {
+ return 500D;
+ }
+
+ @Override
+ public double getSolarEnergyMultiplier() {
+ return 1.38D;
+ }
+
+ @Override
+ public boolean hasBreathableAtmosphere() {
+ return true;
+ }
+}
diff --git a/src/main/java/bwcrossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/bwcrossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java
new file mode 100644
index 0000000000..67b776f473
--- /dev/null
+++ b/src/main/java/bwcrossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java
@@ -0,0 +1,107 @@
+/*
+ * 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 bwcrossmod.galacticraft.planets.ross128ba;
+
+import java.util.Arrays;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFalling;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.IChunkProvider;
+
+import bartworks.util.NoiseUtil.BartsNoise;
+import bwcrossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b;
+import gregtech.api.objects.XSTR;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta;
+import micdoodle8.mods.galacticraft.core.blocks.GCBlocks;
+import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon;
+import micdoodle8.mods.galacticraft.core.world.gen.ChunkProviderMoon;
+import micdoodle8.mods.galacticraft.core.world.gen.MapGenCavesMoon;
+
+public class ChunkProviderRoss128ba extends ChunkProviderMoon {
+
+ private final XSTR rand = new XSTR();
+ private final World worldObj;
+ private BiomeGenBase[] biomesForGeneration;
+ private final MapGenBaseMeta caveGenerator;
+
+ public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) {
+ super(world, seed, mapFeaturesEnabled);
+ this.biomesForGeneration = new BiomeGenBase[] { BiomeGenBaseMoon.moonFlat };
+ this.caveGenerator = new MapGenCavesMoon();
+ this.worldObj = world;
+ }
+
+ @Override
+ public Chunk provideChunk(int cx, int cz) {
+ this.rand.setSeed(cx * 341873128712L + cz * 132897987541L);
+ Block[] ids = new Block[65536];
+ byte[] meta = new byte[65536];
+ Arrays.fill(ids, Blocks.air);
+ this.generateTerrain(cx, cz, ids, meta);
+ this.biomesForGeneration = this.worldObj.getWorldChunkManager()
+ .loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16);
+ this.createCraters(cx, cz, ids, meta);
+ this.replaceBlocksForBiome(cx, cz, ids, meta, this.biomesForGeneration);
+ this.caveGenerator.generate(this, this.worldObj, cx, cz, ids, meta);
+ Chunk Chunk = new Chunk(this.worldObj, ids, meta, cx, cz);
+ Chunk.generateSkylightMap();
+ return Chunk;
+ }
+
+ @Override
+ public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) {}
+
+ @Override
+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
+ super.populate(par1IChunkProvider, par2, par3);
+ BlockFalling.fallInstantly = true;
+ ChunkProviderRoss128b.BWOreGen.generate(this.rand, par2, par3, this.worldObj, this, this);
+ BlockFalling.fallInstantly = false;
+ }
+
+ private int getIndex(int x, int y, int z) {
+ return (x * 16 + z) * 256 + y;
+ }
+
+ final Block lowerBlockID = GCBlocks.blockMoon;
+ final BartsNoise noiseGen = new BartsNoise(2, 0.008F, 1D, System.nanoTime());
+ final BartsNoise noiseGen2 = new BartsNoise(2, 0.01F, 1D, System.nanoTime());
+ final BartsNoise noiseGen3 = new BartsNoise(2, 0.002F, 1D, System.nanoTime());
+
+ @Override
+ public void generateTerrain(int chunkX, int chunkZ, Block[] idArray, byte[] metaArray) {
+ for (int x = 0; x < 16; ++x) {
+ for (int z = 0; z < 16; ++z) {
+ double d = this.noiseGen.getNoise(x + chunkX * 16, z + chunkZ * 16);
+ double d2 = this.noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16);
+ double d3 = this.noiseGen3.getCosNoise(x + chunkX * 16, z + chunkZ * 16);
+
+ double yDev = d * 4 + d2 * 2 + d3;
+
+ for (int y = 0; y < 128; ++y) {
+ if (y < 60.0D + yDev) {
+ idArray[this.getIndex(x, y, z)] = this.lowerBlockID;
+ int var10001 = this.getIndex(x, y, z);
+ metaArray[var10001] = 4;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/bwcrossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java b/src/main/java/bwcrossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java
new file mode 100644
index 0000000000..8acb289c85
--- /dev/null
+++ b/src/main/java/bwcrossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java
@@ -0,0 +1,112 @@
+/*
+ * 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 bwcrossmod.galacticraft.planets.ross128ba;
+
+import net.minecraft.world.biome.WorldChunkManager;
+import net.minecraft.world.chunk.IChunkProvider;
+
+import bartworks.util.MathUtils;
+import bwcrossmod.galacticraft.planets.AbstractWorldProviderSpace;
+import bwcrossmod.galacticraft.solarsystems.Ross128SolarSystem;
+import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody;
+import micdoodle8.mods.galacticraft.api.vector.Vector3;
+import micdoodle8.mods.galacticraft.core.world.gen.WorldChunkManagerMoon;
+
+public class WorldProviderRoss128ba extends AbstractWorldProviderSpace {
+
+ @Override
+ public Vector3 getFogColor() {
+ return new Vector3(0, 0, 0);
+ }
+
+ @Override
+ public Vector3 getSkyColor() {
+ return new Vector3(0, 0, 0);
+ }
+
+ @Override
+ public long getDayLength() {
+ return MathUtils.floorLong(24000f * 9.9f / 100f);
+ }
+
+ @Override
+ public boolean hasSunset() {
+ return false;
+ }
+
+ @Override
+ public Class<? extends IChunkProvider> getChunkProviderClass() {
+ return ChunkProviderRoss128ba.class;
+ }
+
+ @Override
+ public Class<? extends WorldChunkManager> getWorldChunkManagerClass() {
+ return WorldChunkManagerMoon.class;
+ }
+
+ @Override
+ public double getYCoordinateToTeleport() {
+ return 500;
+ }
+
+ @Override
+ public float getGravity() {
+ return 0.060f;
+ }
+
+ @Override
+ public double getMeteorFrequency() {
+ return 9D;
+ }
+
+ @Override
+ public double getFuelUsageMultiplier() {
+ return 0.7D;
+ }
+
+ @Override
+ public boolean canSpaceshipTierPass(int i) {
+ return i >= Ross128SolarSystem.Ross128ba.getTierRequirement();
+ }
+
+ @Override
+ public float getFallDamageModifier() {
+ return 0.2f;
+ }
+
+ @Override
+ public float getSoundVolReductionAmount() {
+ return 20f;
+ }
+
+ @Override
+ public float getThermalLevelModifier() {
+ return 0;
+ }
+
+ @Override
+ public float getWindLevel() {
+ return 0;
+ }
+
+ @Override
+ public CelestialBody getCelestialBody() {
+ return Ross128SolarSystem.Ross128ba;
+ }
+
+ @Override
+ public double getSolarEnergyMultiplier() {
+ return 1.9D;
+ }
+}