diff options
Diffstat (limited to 'src/main/java/bwcrossmod/galacticraft')
11 files changed, 1025 insertions, 0 deletions
diff --git a/src/main/java/bwcrossmod/galacticraft/GalacticraftProxy.java b/src/main/java/bwcrossmod/galacticraft/GalacticraftProxy.java new file mode 100644 index 0000000000..d6ee41c48b --- /dev/null +++ b/src/main/java/bwcrossmod/galacticraft/GalacticraftProxy.java @@ -0,0 +1,82 @@ +/* + * 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; + +import net.minecraftforge.common.MinecraftForge; + +import bartworks.API.SideReference; +import bartworks.common.configs.ConfigHandler; +import bartworks.system.oregen.BWWorldGenRoss128b; +import bartworks.system.oregen.BWWorldGenRoss128ba; +import bwcrossmod.galacticraft.atmosphere.BWAtmosphereManager; +import bwcrossmod.galacticraft.solarsystems.Ross128SolarSystem; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class GalacticraftProxy { + + private GalacticraftProxy() {} + + public static void postInit(FMLPostInitializationEvent e) { + if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { + GalacticraftProxy.serverPostInit(e); + } else { + GalacticraftProxy.clientPostInit(e); + } + GalacticraftProxy.commonPostInit(e); + } + + public static void preInit(FMLPreInitializationEvent e) { + if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { + GalacticraftProxy.serverpreInit(e); + } else { + GalacticraftProxy.clientpreInit(e); + } + GalacticraftProxy.commonpreInit(e); + } + + private static void serverpreInit(FMLPreInitializationEvent e) {} + + private static void clientpreInit(FMLPreInitializationEvent e) {} + + private static void commonpreInit(FMLPreInitializationEvent e) { + BWWorldGenRoss128b.initOres(); + BWWorldGenRoss128ba.init_Ores(); + MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE); + } + + public static void init(FMLInitializationEvent e) { + if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { + GalacticraftProxy.serverInit(e); + } else { + GalacticraftProxy.clientInit(e); + } + GalacticraftProxy.commonInit(e); + } + + private static void serverInit(FMLInitializationEvent e) {} + + private static void clientInit(FMLInitializationEvent e) {} + + private static void commonInit(FMLInitializationEvent e) { + if (ConfigHandler.Ross128Enabled) Ross128SolarSystem.init(); + } + + private static void serverPostInit(FMLPostInitializationEvent e) {} + + private static void clientPostInit(FMLPostInitializationEvent e) {} + + private static void commonPostInit(FMLPostInitializationEvent e) {} +} diff --git a/src/main/java/bwcrossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/bwcrossmod/galacticraft/PlanetsHelperClass.java new file mode 100644 index 0000000000..eecd5bd8fe --- /dev/null +++ b/src/main/java/bwcrossmod/galacticraft/PlanetsHelperClass.java @@ -0,0 +1,33 @@ +/* + * 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; + +import net.minecraft.entity.player.EntityPlayerMP; + +import bartworks.common.configs.ConfigHandler; +import micdoodle8.mods.galacticraft.core.entities.EntityLander; +import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; +import micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod; +import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons; + +public class PlanetsHelperClass { + + public static EntityLanderBase getLanderType(EntityPlayerMP player) { + return switch (ConfigHandler.landerType) { + case 1 -> new EntityLander(player); + case 2 -> new EntityLandingBalloons(player); + default -> new EntityEntryPod(player); + }; + } +} diff --git a/src/main/java/bwcrossmod/galacticraft/UniversalTeleportType.java b/src/main/java/bwcrossmod/galacticraft/UniversalTeleportType.java new file mode 100644 index 0000000000..4507cadca2 --- /dev/null +++ b/src/main/java/bwcrossmod/galacticraft/UniversalTeleportType.java @@ -0,0 +1,78 @@ +/* + * 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; + +import static gregtech.api.enums.Mods.GalacticraftMars; + +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.api.world.ITeleportType; +import micdoodle8.mods.galacticraft.core.entities.EntityLander; +import micdoodle8.mods.galacticraft.core.entities.EntityLanderBase; +import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats; + +public class UniversalTeleportType implements ITeleportType { + + @Override + public boolean useParachute() { + return false; + } + + @Override + public Vector3 getPlayerSpawnLocation(WorldServer world, EntityPlayerMP player) { + return this.getEntitySpawnLocation(world, player); + } + + @Override + public Vector3 getEntitySpawnLocation(WorldServer world, Entity entity) { + if (entity instanceof EntityPlayerMP) { + GCPlayerStats stats = GCPlayerStats.get((EntityPlayerMP) entity); + return new Vector3(stats.coordsTeleportedFromX, 500D, stats.coordsTeleportedFromZ); + } + return new Vector3(entity.posX, 500D, entity.posZ); + } + + @Override + public Vector3 getParaChestSpawnLocation(WorldServer world, EntityPlayerMP player, Random rand) { + return null; + } + + @Override + public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { + if (ridingAutoRocket) return; + if (player != null && GCPlayerStats.get(player).teleportCooldown <= 0) { + if (player.capabilities.isFlying) { + player.capabilities.isFlying = false; + } + + EntityLanderBase elb; + if (GalacticraftMars.isModLoaded()) elb = PlanetsHelperClass.getLanderType(player); + else elb = new EntityLander(player); + + if (!newWorld.isRemote) { + newWorld.spawnEntityInWorld(elb); + } + GCPlayerStats.get(player).teleportCooldown = 10; + } + } + + @Override + public void setupAdventureSpawn(EntityPlayerMP player) {} +} diff --git a/src/main/java/bwcrossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/bwcrossmod/galacticraft/atmosphere/BWAtmosphereManager.java new file mode 100644 index 0000000000..0bae6f4546 --- /dev/null +++ b/src/main/java/bwcrossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -0,0 +1,121 @@ +/* + * 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.atmosphere; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import com.google.common.collect.ArrayListMultimap; + +import bartworks.system.material.Werkstoff; +import bartworks.system.material.WerkstoffLoader; +import bartworks.util.Pair; +import bwcrossmod.BartWorksCrossmod; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ISubTagContainer; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; + +public final class BWAtmosphereManager { + + private static final Map<Integer, Integer[]> COEFFICIENT_MAP = new HashMap<>(); + + private BWAtmosphereManager() { + BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[] { 100 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(2, new Integer[] { 70, 30 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(3, new Integer[] { 60, 25, 15 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(4, new Integer[] { 50, 25, 15, 10 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(5, new Integer[] { 45, 25, 15, 10, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(6, new Integer[] { 45, 20, 15, 10, 5, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(7, new Integer[] { 40, 20, 15, 10, 5, 5, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(8, new Integer[] { 35, 20, 15, 10, 5, 5, 5, 5 }); + BWAtmosphereManager.COEFFICIENT_MAP.put(9, new Integer[] { 35, 15, 15, 10, 5, 5, 5, 5, 5 }); + } + + public static final BWAtmosphereManager INSTANCE = new BWAtmosphereManager(); + + private static final ArrayListMultimap<Integer, Pair<ISubTagContainer, Integer>> gasConcentration = ArrayListMultimap + .create(); + + public static List<Pair<ISubTagContainer, Integer>> getGasFromWorldID(int worldID) { + return BWAtmosphereManager.gasConcentration.get(worldID); + } + + public static void removeGasFromWorld(int worldID, ISubTagContainer gas) { + for (Pair<ISubTagContainer, Integer> pair : BWAtmosphereManager.gasConcentration.get(worldID)) { + if (pair.getKey() + .equals(gas)) { + BWAtmosphereManager.gasConcentration.get(worldID) + .remove(pair); + return; + } + } + } + + public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount) { + Pair<ISubTagContainer, Integer> toadd = new Pair<>(gas, amount); + BWAtmosphereManager.gasConcentration.put(worldID, toadd); + } + + public static void addGasToWorld(int worldID, Pair<ISubTagContainer, Integer> toPut) { + BWAtmosphereManager.gasConcentration.put(worldID, toPut); + } + + @SafeVarargs + public static void addGasToWorld(int worldID, Pair<ISubTagContainer, Integer>... toPut) { + Arrays.stream(toPut) + .forEach(toadd -> BWAtmosphereManager.gasConcentration.put(worldID, toadd)); + } + + private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber) { + if (IAtmosphericGas.CO2.equals(gas)) { + BWAtmosphereManager.addGasToWorld( + worldID, + Materials.CarbonDioxide, + BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + return true; + } + String name = gas.toString(); + name = name.charAt(0) + name.substring(1) + .toLowerCase(Locale.US); + ISubTagContainer mat = Materials.get(name); + if (mat == Materials._NULL) { + mat = WerkstoffLoader.getWerkstoff(name); + } + if (mat == Werkstoff.default_null_Werkstoff) { + return false; + } + BWAtmosphereManager.addGasToWorld(worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + return true; + } + + @SubscribeEvent + public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event) { + CelestialBody planet = GalaxyRegistry.getRegisteredPlanets() + .get(event.planetName); + for (int i = 0; i < planet.atmosphere.size(); i++) { + if (!BWAtmosphereManager + .addGCGasToWorld(planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) + BartWorksCrossmod.LOGGER.warn( + "Unidentified Fluid (" + planet.atmosphere.get(i) + + ") in the Atmosphere of: " + + planet.getLocalizedName()); + } + } +} 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; + } +} diff --git a/src/main/java/bwcrossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/bwcrossmod/galacticraft/solarsystems/Ross128SolarSystem.java new file mode 100644 index 0000000000..050c26b087 --- /dev/null +++ b/src/main/java/bwcrossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -0,0 +1,91 @@ +/* + * 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.solarsystems; + +import static gregtech.api.enums.Mods.GalaxySpace; + +import java.util.Arrays; + +import net.minecraft.util.ResourceLocation; + +import bartworks.common.configs.ConfigHandler; +import bwcrossmod.BartWorksCrossmod; +import bwcrossmod.galacticraft.UniversalTeleportType; +import bwcrossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; +import bwcrossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; +import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; +import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; +import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; +import micdoodle8.mods.galacticraft.api.galaxies.Moon; +import micdoodle8.mods.galacticraft.api.galaxies.Planet; +import micdoodle8.mods.galacticraft.api.galaxies.SolarSystem; +import micdoodle8.mods.galacticraft.api.galaxies.Star; +import micdoodle8.mods.galacticraft.api.vector.Vector3; +import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; +import micdoodle8.mods.galacticraft.core.GalacticraftCore; + +public class Ross128SolarSystem { + + public static SolarSystem Ross128System; + public static Star Ross128; + public static Planet Ross128b; + public static Moon Ross128ba; + + private Ross128SolarSystem() {} + + public static void init() { + + Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay") + .setMapPosition(new Vector3(-0.5D, 0.65D, 0.0D)); + Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System) + .setTierRequired(-1); + Ross128SolarSystem.Ross128.setUnreachable(); + Ross128SolarSystem.Ross128 + .setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128); + + Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System); + Ross128SolarSystem.Ross128b.setRingColorRGB(0x9F / 255f, 0x8A / 255f, 0x79 / 255f); + Ross128SolarSystem.Ross128b.setPhaseShift(1.25F); + Ross128SolarSystem.Ross128b.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); + Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); + Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); + Ross128SolarSystem.Ross128b.atmosphere + .addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); + Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); + Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier); + + Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); + Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)) + .setRelativeOrbitTime(1 / 0.01F); + Ross128SolarSystem.Ross128ba.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); + Ross128SolarSystem.Ross128ba + .setTierRequired(GalaxySpace.isModLoaded() ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + + GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); + GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); + GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); + GalacticraftRegistry.registerRocketGui( + WorldProviderRoss128b.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); + GalacticraftRegistry.registerRocketGui( + WorldProviderRoss128ba.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); + GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); + } +} |