diff options
Diffstat (limited to 'src/main/java/bwcrossmod/galacticraft/planets/ross128ba')
| -rw-r--r-- | src/main/java/bwcrossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java | 107 | ||||
| -rw-r--r-- | src/main/java/bwcrossmod/galacticraft/planets/ross128ba/WorldProviderRoss128ba.java | 112 |
2 files changed, 219 insertions, 0 deletions
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; + } +} |
