aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/galacticraft/system
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-10-24 02:38:23 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-10-24 02:38:23 +0100
commit5856a6623641697349a112ff75b74296358361a0 (patch)
tree3474ab5f0b2d51550259b2a2cce1562a15bcb158 /src/Java/gtPlusPlus/xmod/galacticraft/system
parent53408770c7a4dd6fa4c997d4601b7aba215bc9ab (diff)
downloadGT5-Unofficial-5856a6623641697349a112ff75b74296358361a0.tar.gz
GT5-Unofficial-5856a6623641697349a112ff75b74296358361a0.tar.bz2
GT5-Unofficial-5856a6623641697349a112ff75b74296358361a0.zip
+ Added Base framework for custom GC systems.
% Tweaked Automatic doors, they will not open if mobs are within 2m or if open, they will close.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/galacticraft/system')
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/BaseGalacticDimension.java304
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/BaseSolarSystem.java95
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BaseWorldProviderGalactic.java123
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BasicChunkProviderGalactic.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java111
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalaxyLakes.java529
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticBiomeGenBase.java39
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticMapGenCavesBase.java191
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/biome/BiomeGenGalaxy.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/SystemHD10180.java40
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/planets/b/dim/WorldProviderHD10180B.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/objects/BiomeSettings.java29
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/objects/DimensionSettings.java77
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/objects/IPlanetBlockRegister.java29
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/objects/PlanetGenerator.java50
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/system/objects/WorldProviderSettings.java30
16 files changed, 1698 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/BaseGalacticDimension.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/BaseGalacticDimension.java
new file mode 100644
index 0000000000..cb02fa0e31
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/BaseGalacticDimension.java
@@ -0,0 +1,304 @@
+package gtPlusPlus.xmod.galacticraft.system;
+
+import java.util.Random;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.xmod.galacticraft.system.objects.DimensionSettings;
+import gtPlusPlus.xmod.galacticraft.system.objects.PlanetGenerator;
+import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldChunkManagerSpace;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldProviderSpace;
+import micdoodle8.mods.galacticraft.api.vector.Vector3;
+import micdoodle8.mods.galacticraft.api.world.IExitHeight;
+import micdoodle8.mods.galacticraft.api.world.ISolarLevel;
+import micdoodle8.mods.galacticraft.api.world.ITeleportType;
+import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats;
+import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
+import micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraft.world.WorldServer;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.chunk.IChunkProvider;
+
+public class BaseGalacticDimension {
+
+ private final WorldChunkManagerGalactic mGlobalChunkManager;
+ private final WorldProviderGalactic mWorldProvider;
+ private final Class<? extends IChunkProvider> mChunkProvider;
+ private final PlanetGenerator mPlanet;
+
+ public BaseGalacticDimension(PlanetGenerator aPlanet, BiomeGenBase aBiomeForDim, Class<? extends IChunkProvider> aChunkProvider, DimensionSettings aSettings) {
+ mPlanet = aPlanet;
+ mGlobalChunkManager = new WorldChunkManagerGalactic(aBiomeForDim);
+ mChunkProvider = aChunkProvider;
+ mWorldProvider = new WorldProviderGalactic(aSettings);
+ }
+
+ public class WorldChunkManagerGalactic extends WorldChunkManagerSpace {
+ private final BiomeGenBase mBiome;
+
+ public WorldChunkManagerGalactic(BiomeGenBase aDimBiome) {
+ mBiome = aDimBiome;
+ }
+
+ public BiomeGenBase getBiome() {
+ return mBiome;
+ }
+ }
+
+ public class WorldProviderGalactic extends WorldProviderSpace implements IExitHeight, ISolarLevel, ITeleportType {
+
+ private final int mTierRequirement;
+ private final PlanetGenerator mPlanet;
+ private final boolean mAtmosphere;
+ private final int mPressure;
+ private final boolean mSolarRadiation;
+ private final float mCloudHeight;
+ private final float mGravity;
+ private final float mMeteorFreq;
+ private final boolean mCanRainOrSnow;
+ private final long mDayLength;
+ private final Class<? extends IChunkProvider> mChunkProvider;
+
+ public WorldProviderGalactic(DimensionSettings aSettings) {
+ mPlanet = aSettings.getPlanet();
+ mTierRequirement = aSettings.getTierRequirement();
+ mAtmosphere = aSettings.hasAtmosphere();
+ mPressure = aSettings.getPressure();
+ mSolarRadiation = aSettings.hasSolarRadiation();
+ mCloudHeight = aSettings.getCloudHeight();
+ mGravity = aSettings.getGravity();
+ mMeteorFreq = aSettings.getMeteorFreq();
+ mCanRainOrSnow = aSettings.hasRainOrSnow();
+ mDayLength = aSettings.getDayLength();
+ mChunkProvider = aSettings.getChunkProvider();
+ }
+
+ public WorldProviderGalactic(PlanetGenerator aPlanet, Class<? extends IChunkProvider> aChunkProvider, int aTierRequirement, boolean aHasBreathableAtmo,
+ int aPressure, boolean aSolarRadiation, float aCloudHeight, float aGravity, float aMeteorFreq, boolean aCanRainOrSnow, long aDayLength) {
+ mPlanet = aPlanet;
+ mTierRequirement = aTierRequirement;
+ mAtmosphere = aHasBreathableAtmo;
+ mPressure = aPressure;
+ mSolarRadiation = aSolarRadiation;
+ mCloudHeight = aCloudHeight;
+ mGravity = aGravity;
+ mMeteorFreq = aMeteorFreq;
+ mCanRainOrSnow = aCanRainOrSnow;
+ mDayLength = aDayLength;
+ mChunkProvider = aChunkProvider;
+ }
+
+ public boolean canSpaceshipTierPass(int tier) {
+ return tier >= mTierRequirement;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public float getCloudHeight() {
+ return mCloudHeight;
+ }
+
+ public double getHorizon() {
+ return 44.0D;
+ }
+
+ public float getFallDamageModifier() {
+ return 0.16F;
+ }
+
+ public double getFuelUsageMultiplier() {
+ return 0.8D;
+ }
+
+ public float getGravity() {
+ return mGravity;
+ }
+
+ public double getMeteorFrequency() {
+ return mMeteorFreq;
+ }
+
+ public float getSoundVolReductionAmount() {
+ return Float.MAX_VALUE;
+ }
+
+ public float getThermalLevelModifier() {
+ return 0.0F;
+ }
+
+ public float getWindLevel() {
+ return 0.6F;
+ }
+
+ public boolean canRainOrSnow() {
+ return mCanRainOrSnow;
+ }
+
+ public boolean canBlockFreeze(int x, int y, int z, boolean byWater) {
+ return false;
+ }
+
+ public CelestialBody getCelestialBody() {
+ return mPlanet.getPlanet();
+ }
+
+ public Class<? extends IChunkProvider> getChunkProviderClass() {
+ return mChunkProvider;
+ }
+
+ public long getDayLength() {
+ return mDayLength;
+ }
+
+ public boolean hasBreathableAtmosphere() {
+ return mAtmosphere;
+ }
+
+ public Vector3 getFogColor() {
+ float f = 1.0F - this.getStarBrightness(1.0F);
+ return new Vector3((double) (0.65882355F * f), (double) (0.84705883F * f), (double) (1.0F * f));
+ }
+
+ public Vector3 getSkyColor() {
+ float f = 1.0F - this.getStarBrightness(1.0F);
+ return new Vector3((double) (0.25882354F * f), (double) (0.6666667F * f), (double) (1.0F * f));
+ }
+
+ public boolean isSkyColored() {
+ return true;
+ }
+
+ public Class<? extends WorldChunkManagerGalactic> getWorldChunkManagerClass() {
+ return WorldChunkManagerGalactic.class;
+ }
+
+ public boolean hasSunset() {
+ return false;
+ }
+
+ public boolean shouldForceRespawn() {
+ return !ConfigManagerCore.forceOverworldRespawn;
+ }
+
+ public double getSolarEnergyMultiplier() {
+ return 0.8D;
+ }
+
+ public double getYCoordinateToTeleport() {
+ return 800.0D;
+ }
+
+ public Vector3 getEntitySpawnLocation(WorldServer arg0, Entity arg1) {
+ return new Vector3(arg1.posX, ConfigManagerCore.disableLander ? 250.0D : 900.0D, arg1.posZ);
+ }
+
+ public Vector3 getParaChestSpawnLocation(WorldServer arg0, EntityPlayerMP arg1, Random arg2) {
+ if (ConfigManagerCore.disableLander) {
+ double x = (arg2.nextDouble() * 2.0D - 1.0D) * 5.0D;
+ double z = (arg2.nextDouble() * 2.0D - 1.0D) * 5.0D;
+ return new Vector3(x, 220.0D, z);
+ } else {
+ return null;
+ }
+ }
+
+ public Vector3 getPlayerSpawnLocation(WorldServer arg0, EntityPlayerMP arg1) {
+ if (arg1 != null) {
+ GCPlayerStats stats = GCPlayerStats.get(arg1);
+ return new Vector3(stats.coordsTeleportedFromX, ConfigManagerCore.disableLander ? 250.0D : 900.0D,
+ stats.coordsTeleportedFromZ);
+ } else {
+ return null;
+ }
+ }
+
+ public void onSpaceDimensionChanged(World arg0, EntityPlayerMP player, boolean arg2) {
+ if (player != null && GCPlayerStats.get(player).teleportCooldown <= 0) {
+ if (player.capabilities.isFlying) {
+ player.capabilities.isFlying = false;
+ }
+
+ EntityLandingBalloons lander = new EntityLandingBalloons(player);
+ if (!arg0.isRemote) {
+ arg0.spawnEntityInWorld(lander);
+ }
+
+ GCPlayerStats.get(player).teleportCooldown = 10;
+ }
+
+ }
+
+ public boolean useParachute() {
+ return ConfigManagerCore.disableLander;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public float getStarBrightness(float par1) {
+ float var2 = this.worldObj.getCelestialAngle(par1);
+ float var3 = 1.0F - (MathHelper.cos(var2 * 3.1415927F * 2.0F) * 2.0F + 0.25F);
+ if (var3 < 0.0F) {
+ var3 = 0.0F;
+ }
+
+ if (var3 > 1.0F) {
+ var3 = 1.0F;
+ }
+
+ return var3 * var3 * 0.5F + 0.3F;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public float getSunBrightness(float par1) {
+ float f1 = this.worldObj.getCelestialAngle(1.0F);
+ float f2 = 1.25F - (MathHelper.cos(f1 * 3.1415927F * 2.0F) * 2.0F + 0.2F);
+ if (f2 < 0.0F) {
+ f2 = 0.0F;
+ }
+
+ if (f2 > 1.0F) {
+ f2 = 1.0F;
+ }
+
+ f2 = 1.2F - f2;
+ return f2 * 0.2F;
+ }
+
+ public void setupAdventureSpawn(EntityPlayerMP player) {
+ }
+
+ public int AtmosphericPressure() {
+ return mPressure;
+ }
+
+ public boolean SolarRadiation() {
+ return mSolarRadiation;
+ }
+ }
+
+ public synchronized final WorldChunkManagerGalactic getGlobalChunkManager() {
+ return mGlobalChunkManager;
+ }
+
+ public synchronized final WorldProviderGalactic getWorldProvider() {
+ return mWorldProvider;
+ }
+
+ public synchronized final Class<? extends WorldProviderSpace> getWorldProviderClass() {
+ return mWorldProvider.getClass();
+ }
+
+ public synchronized final Class<? extends IChunkProvider> getChunkProvider() {
+ return mChunkProvider;
+ }
+
+ public synchronized final PlanetGenerator getPlanet() {
+ return mPlanet;
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/BaseSolarSystem.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/BaseSolarSystem.java
new file mode 100644
index 0000000000..96148c0cdb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/BaseSolarSystem.java
@@ -0,0 +1,95 @@
+package gtPlusPlus.xmod.galacticraft.system;
+
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.galacticraft.system.objects.IPlanetBlockRegister;
+import gtPlusPlus.xmod.galacticraft.system.objects.PlanetGenerator;
+import micdoodle8.mods.galacticraft.api.GalacticraftRegistry;
+import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry;
+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.prefab.world.gen.WorldProviderSpace;
+import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody.ScalableDistance;
+import micdoodle8.mods.galacticraft.api.vector.Vector3;
+import micdoodle8.mods.galacticraft.api.world.ITeleportType;
+import net.minecraft.util.ResourceLocation;
+
+public abstract class BaseSolarSystem {
+ private SolarSystem mSolarSystem;
+ private Star mStar;
+ private AutoMap<Planet> mPlanetMap = new AutoMap<Planet>();
+
+ public SolarSystem getSystem() {
+ return mSolarSystem;
+ }
+
+ public Star getStar() {
+ return mStar;
+ }
+
+ public AutoMap<Planet> getPlanets(){
+ return mPlanetMap;
+ }
+
+ public abstract void preInit();
+
+ public final void init() {
+ initSolarSystem();
+ }
+
+ public abstract void initSolarSystem();
+
+ public static void registryteleport(Class<? extends WorldProviderSpace> aWorldProvider, ITeleportType aWorldProviderInstance) {
+ GalacticraftRegistry.registerTeleportType(aWorldProvider, aWorldProviderInstance);
+ }
+
+ public boolean registerSolarSystem(SolarSystem aSystem) {
+ this.mSolarSystem = aSystem;
+ return GalaxyRegistry.registerSolarSystem(aSystem);
+ }
+
+ public boolean registerPlanet(BaseGalacticDimension aDimension) {
+ return registerPlanet(aDimension.getPlanet().getPlanet(), aDimension.getWorldProviderClass(), aDimension.getWorldProvider());
+ }
+ public boolean registerPlanet(Planet aPlanet, Class<? extends WorldProviderSpace> aWorldProvider, ITeleportType aWorldProviderInstance) {
+ try {
+ mPlanetMap.put(aPlanet);
+ GalaxyRegistry.registerPlanet(aPlanet);
+ registryteleport(aWorldProvider, aWorldProviderInstance);
+ return true;
+ }
+ catch(Throwable t) {
+ return false;
+ }
+ }
+
+ public SolarSystem createSolarSystem(String aSystemName, String aParentGalaxyName, Vector3 aMapPosition) {
+ SolarSystem aSolarSystem = (new SolarSystem(aSystemName, aParentGalaxyName)).setMapPosition(aMapPosition);
+ return aSolarSystem;
+ }
+
+ public Star createStar(String aStarName, int aTierRequired) {
+ Star aStar = (Star) (new Star(aStarName)).setParentSolarSystem(getSystem()).setTierRequired(aTierRequired);
+ aStar.setBodyIcon(new ResourceLocation(CORE.MODID, "textures/space/planets/"+aStarName.toLowerCase()+"/"+aStarName+".png"));
+ return aStar;
+ }
+
+ public PlanetGenerator createPlanet(String aPlanetName, float[] aRingRGB, float aPhaseShift, float aRelativeDistanceFromCentMin, float aRelativeDistanceFromCentMax, float aRelativeOrbitTime, IPlanetBlockRegister aPlanetBlocks) {
+ Planet aNewPlanet = (new Planet(aPlanetName)).setParentSolarSystem(getSystem());
+ aNewPlanet.setRingColorRGB(aRingRGB[0], aRingRGB[1], aRingRGB[2]);
+ aNewPlanet.setPhaseShift(aPhaseShift);
+ aNewPlanet.setBodyIcon(new ResourceLocation(CORE.MODID, "textures/space/planets/"+aPlanetName.toLowerCase()+"/"+aPlanetName+".png"));
+ aNewPlanet.setRelativeDistanceFromCenter(new ScalableDistance(aRelativeDistanceFromCentMin, aRelativeDistanceFromCentMax));
+ aNewPlanet.setRelativeOrbitTime(aRelativeOrbitTime);
+ PlanetGenerator aPlanet = new PlanetGenerator(aNewPlanet, aPlanetBlocks);
+ return aPlanet;
+ }
+
+ public void setMainStarForSolarSystem(Star aStar) {
+ this.mStar = aStar;
+ getSystem().setMainStar(aStar);
+ }
+
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BaseWorldProviderGalactic.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BaseWorldProviderGalactic.java
new file mode 100644
index 0000000000..01180f913c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BaseWorldProviderGalactic.java
@@ -0,0 +1,123 @@
+package gtPlusPlus.xmod.galacticraft.system.core.dim;
+
+import java.util.Random;
+
+import gtPlusPlus.api.objects.random.XSTR;
+import gtPlusPlus.xmod.galacticraft.system.BaseGalacticDimension;
+import gtPlusPlus.xmod.galacticraft.system.core.world.gen.GalacticBiomeGenBase;
+import gtPlusPlus.xmod.galacticraft.system.objects.BiomeSettings;
+import gtPlusPlus.xmod.galacticraft.system.objects.DimensionSettings;
+import gtPlusPlus.xmod.galacticraft.system.objects.PlanetGenerator;
+import gtPlusPlus.xmod.galacticraft.system.objects.WorldProviderSettings;
+import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeDecorator;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.chunk.IChunkProvider;
+import net.minecraftforge.common.BiomeDictionary;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.common.BiomeDictionary.Type;
+import net.minecraftforge.event.terraingen.TerrainGen;
+import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post;
+import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre;
+import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
+
+public class BaseWorldProviderGalactic {
+
+ private final PlanetGenerator mThisPlanet;
+ private final BaseGalacticDimension mDim;
+ public final BiomeGenBase mBiome;
+
+ //new DimensionSettings(b, aCP, 5, true, 1, false, 240f, 0.1f, 0.2f, false, 48000L)
+
+ public BaseWorldProviderGalactic(WorldProviderSettings b) {
+ this(b.getPlanet(), b.getDimSettings(), b.getBiomeSettings());
+ }
+
+ private BaseWorldProviderGalactic(PlanetGenerator b, DimensionSettings aDimSettings, BiomeSettings aBiomeSettings) {
+ mThisPlanet = b;
+ Class<? extends IChunkProvider> aCP = aDimSettings.getChunkProvider();
+ mBiome = tryCreateBiome(aBiomeSettings);
+ mDim = new BaseGalacticDimension(b, mBiome, aCP, aDimSettings);
+ }
+
+ public synchronized final BaseGalacticDimension getDim() {
+ return mDim;
+ }
+
+ public BiomeGenBase tryCreateBiome(BiomeSettings aSettings) {
+ BiomeGenBase x = (new BiomeGenMain(aSettings.getID())).setBiomeName(aSettings.getName()).setHeight(aSettings.getHeight());
+ return x;
+ }
+
+ public class BiomeGenBasePlanetSurface extends GalacticBiomeGenBase {
+ public BiomeGenBase aBiome;
+
+ public BiomeGenBasePlanetSurface(int id) {
+ super(id);
+ this.enableRain = true;
+ this.enableSnow = true;
+ this.topBlock = Blocks.stone;
+ this.fillerBlock = Blocks.stone;
+ }
+
+ public BiomeDecorator createBiomeDecorator() {
+ return new BiomeDecoratorGalactic();
+ }
+
+ protected BiomeDecoratorGalactic getBiomeDecorator() {
+ return (BiomeDecoratorGalactic) this.theBiomeDecorator;
+ }
+
+ }
+
+ public class BiomeGenMain extends BiomeGenBasePlanetSurface {
+ public BiomeGenMain(int aID) {
+ super(aID);
+ this.enableRain = false;
+ this.enableSnow = false;
+ this.topBlock = mThisPlanet.getTask().getTopLayer();
+ this.topMeta = 0;
+ this.fillerBlock = mThisPlanet.getTask().getSoil();
+ this.fillerMeta = 0;
+ this.stoneBlock = mThisPlanet.getTask().getStone();
+ this.stoneMeta = 0;
+ this.spawnableCaveCreatureList.clear();
+ this.spawnableCreatureList.clear();
+ this.spawnableMonsterList.clear();
+ this.spawnableWaterCreatureList.clear();
+ if (!ConfigManagerCore.disableBiomeTypeRegistrations) {
+ BiomeDictionary.registerBiomeType(this, new Type[]{Type.COLD, Type.DRY, Type.DEAD, Type.SPOOKY});
+ }
+
+ }
+ }
+
+ public class BiomeDecoratorGalactic extends BiomeDecorator {
+
+ public void decorateChunk(World world, Random rand, BiomeGenBase biome, int x, int z) {
+ if (this.currentWorld != null) {
+ throw new RuntimeException("Already decorating!!");
+ } else {
+ this.currentWorld = world;
+ this.randomGenerator = new XSTR(rand.nextLong());
+ this.chunk_X = x;
+ this.chunk_Z = z;
+ this.genDecorations(biome);
+ this.currentWorld = null;
+ this.randomGenerator = null;
+ }
+ }
+
+ protected void genDecorations(BiomeGenBase biome) {
+ MinecraftForge.EVENT_BUS.post(new Pre(this.currentWorld, this.randomGenerator, this.chunk_X, this.chunk_Z));
+ MinecraftForge.EVENT_BUS.post(new Post(this.currentWorld, this.randomGenerator, this.chunk_X, this.chunk_Z));
+ }
+
+ protected boolean getGen(EventType event) {
+ return TerrainGen.decorate(this.currentWorld, this.randomGenerator, this.chunk_X, this.chunk_Z, event);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BasicChunkProviderGalactic.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BasicChunkProviderGalactic.java
new file mode 100644
index 0000000000..9a912fdfc0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/dim/BasicChunkProviderGalactic.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.xmod.galacticraft.system.core.dim;
+
+import gtPlusPlus.xmod.galacticraft.system.core.world.gen.ChunkProviderGalactic;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.BiomeDecoratorSpace;
+import net.minecraft.world.World;
+
+public class BasicChunkProviderGalactic extends ChunkProviderGalactic {
+
+ public BasicChunkProviderGalactic(World par1World, long seed, boolean mapFeaturesEnabled) {
+ super(par1World, seed, mapFeaturesEnabled);
+ }
+
+ @Override
+ public BiomeDecoratorSpace getBiomeGenerator() {
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java
new file mode 100644
index 0000000000..3b9633b21d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java
@@ -0,0 +1,111 @@
+package gtPlusPlus.xmod.galacticraft.system.core.world.gen;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.BiomeDecoratorSpace;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta;
+import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedCreeper;
+import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSkeleton;
+import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSpider;
+import net.minecraft.block.Block;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
+import net.minecraft.world.chunk.IChunkProvider;
+
+public abstract class ChunkProviderGalactic extends ChunkProviderGalaxyLakes {
+
+ private List<MapGenBaseMeta> worldGenerators;
+ private BiomeGenBase[] biomesForGeneration = this.getBiomesForGeneration();
+ private final GalacticMapGenCavesBase caveGenerator = new GalacticMapGenCavesBase();
+
+ protected List<MapGenBaseMeta> getWorldGenerators() {
+ List<MapGenBaseMeta> generators = Lists.newArrayList();
+ return generators;
+ }
+
+ public ChunkProviderGalactic(World par1World, long seed, boolean mapFeaturesEnabled) {
+ super(par1World, seed, mapFeaturesEnabled);
+ }
+
+ public abstract BiomeDecoratorSpace getBiomeGenerator();
+
+ protected BiomeGenBase[] getBiomesForGeneration() {
+ return new BiomeGenBase[] { GalacticBiomeGenBase.mGalaxy };
+ }
+
+ protected SpawnListEntry[] getCreatures() {
+ return new SpawnListEntry[0];
+ }
+
+ public double getHeightModifier() {
+ return 24.0D;
+ }
+
+ protected SpawnListEntry[] getMonsters() {
+ SpawnListEntry skele = new SpawnListEntry(EntityEvolvedSkeleton.class, 100, 4, 4);
+ SpawnListEntry creeper = new SpawnListEntry(EntityEvolvedCreeper.class, 100, 4, 4);
+ SpawnListEntry spider = new SpawnListEntry(EntityEvolvedSpider.class, 100, 4, 4);
+
+ Class<?> aEnderman;
+ try {
+ aEnderman = Class.forName("galaxyspace.SolarSystem.planets.pluto.entities.EntityEvolvedEnderman");
+ if (aEnderman != null) {
+ SpawnListEntry enderman = new SpawnListEntry(aEnderman, 100, 4, 4);
+ return new SpawnListEntry[] { skele, creeper, spider, enderman };
+ }
+ } catch (ClassNotFoundException e) {}
+
+ return new SpawnListEntry[] { skele, creeper, spider };
+ }
+
+ public void onPopulate(IChunkProvider arg0, int arg1, int arg2) {
+ }
+
+ public boolean chunkExists(int x, int y) {
+ return false;
+ }
+
+ protected SpawnListEntry[] getWaterCreatures() {
+ return new SpawnListEntry[0];
+ }
+
+ public BlockMetaPair getGrassBlock() {
+ return new BlockMetaPair(null, (byte) 0);
+ }
+
+ public BlockMetaPair getDirtBlock() {
+ return new BlockMetaPair(null, (byte) 0);
+ }
+
+ public BlockMetaPair getStoneBlock() {
+ return new BlockMetaPair(null, (byte) 0);
+ }
+
+ protected boolean enableBiomeGenBaseBlock() {
+ return false;
+ }
+
+ public void onChunkProvider(int cX, int cZ, Block[] blocks, byte[] metadata) {
+ }
+
+ public int getWaterLevel() {
+ return 110;
+ }
+
+ public boolean canGenerateWaterBlock() {
+ return true;
+ }
+
+ protected BlockMetaPair getWaterBlock() {
+ return new BlockMetaPair(null, (byte) 0);
+ }
+
+ public boolean canGenerateIceBlock() {
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalaxyLakes.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalaxyLakes.java
new file mode 100644
index 0000000000..a3d696d7c5
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalaxyLakes.java
@@ -0,0 +1,529 @@
+package gtPlusPlus.xmod.galacticraft.system.core.world.gen;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+
+import gtPlusPlus.api.objects.random.XSTR;
+import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.BiomeDecoratorSpace;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta;
+import micdoodle8.mods.galacticraft.core.perlin.generator.Gradient;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFalling;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.IProgressUpdate;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.SpawnerAnimals;
+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.NoiseGeneratorOctaves;
+import net.minecraft.world.gen.NoiseGeneratorPerlin;
+
+public abstract class ChunkProviderGalaxyLakes extends ChunkProviderGenerate {
+ protected Random rand;
+ private NoiseGeneratorOctaves noiseGen4;
+ public NoiseGeneratorOctaves noiseGen5;
+ public NoiseGeneratorOctaves noiseGen6;
+ public NoiseGeneratorOctaves mobSpawnerNoise;
+ protected World worldObj;
+ private BiomeGenBase[] biomesForGeneration = this.getBiomesForGeneration();
+ double[] noise3;
+ double[] noise1;
+ double[] noise2;
+ double[] noise5;
+ double[] noise6;
+ float[] squareTable;
+ private NoiseGeneratorOctaves field_147431_j;
+ private NoiseGeneratorOctaves field_147432_k;
+ private NoiseGeneratorOctaves field_147429_l;
+ private NoiseGeneratorPerlin field_147430_m;
+ private double[] terrainCalcs;
+ private float[] parabolicField;
+ double[] field_147427_d;
+ double[] field_147428_e;
+ double[] field_147425_f;
+ double[] field_147426_g;
+ int[][] field_73219_j = new int[32][32];
+ private final Gradient noiseGen8;
+ private List<MapGenBaseMeta> worldGenerators;
+
+ public ChunkProviderGalaxyLakes(World world, long seed, boolean flag) {
+ super(world, seed, flag);
+ this.worldObj = world;
+ this.rand = new XSTR(seed);
+ this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
+ this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
+ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
+ this.noiseGen8 = new Gradient(this.rand.nextLong(), 2, 0.25F);
+ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
+ this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16);
+ this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16);
+ this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8);
+ this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4);
+ this.terrainCalcs = new double[825];
+ this.parabolicField = new float[25];
+
+ for (int j = -2; j <= 2; ++j) {
+ for (int k = -2; k <= 2; ++k) {
+ float f = 10.0F / MathHelper.sqrt_float((float) (j * j + k * k) + 0.2F);
+ this.parabolicField[j + 2 + (k + 2) * 5] = f;
+ }
+ }
+
+ }
+
+ public Chunk provideChunk(int x, int z) {
+ this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
+ Block[] blockStorage = new Block[65536];
+ byte[] metaStorage = new byte[65536];
+ this.generateTerrain(x, z, blockStorage, metaStorage);
+ this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration,
+ x * 16, z * 16, 16, 16);
+ this.replaceBlocksForBiome(x, z, blockStorage, metaStorage, this.biomesForGeneration);
+ this.onChunkProvider(x, z, blockStorage, metaStorage);
+ Chunk chunk = new Chunk(this.worldObj, blockStorage, metaStorage, x, z);
+ byte[] chunkBiomes = chunk.getBiomeArray();
+ if (this.worldGenerators == null) {
+ this.worldGenerators = this.getWorldGenerators();
+ }
+
+ Iterator<MapGenBaseMeta> i$ = this.worldGenerators.iterator();
+
+ while (i$.hasNext()) {
+ MapGenBaseMeta generator = (MapGenBaseMeta) i$.next();
+ generator.generate(this, this.worldObj, x, z, blockStorage, metaStorage);
+ }
+
+ for (int i = 0; i < chunkBiomes.length; ++i) {
+ chunkBiomes[i] = (byte) this.biomesForGeneration[i].biomeID;
+ }
+
+ chunk.generateSkylightMap();
+ return chunk;
+ }
+
+ public void generateTerrain(int chunkX, int chunkZ, Block[] blockStorage, byte[] metaStorage) {
+ int seaLevel = this.getWaterLevel();
+ metaStorage = new byte[65536];
+ this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration,
+ chunkX * 4 - 2, chunkZ * 4 - 2, 10, 10);
+ this.makeLandPerBiome2(chunkX * 4, 0, chunkZ * 4);
+
+ for (int k = 0; k < 4; ++k) {
+ int l = k * 5;
+ int i1 = (k + 1) * 5;
+
+ for (int j1 = 0; j1 < 4; ++j1) {
+ int k1 = (l + j1) * 33;
+ int l1 = (l + j1 + 1) * 33;
+ int i2 = (i1 + j1) * 33;
+ int j2 = (i1 + j1 + 1) * 33;
+
+ for (int k2 = 0; k2 < 32; ++k2) {
+ double d0 = 0.125D;
+ double d1 = this.terrainCalcs[k1 + k2];
+ double d2 = this.terrainCalcs[l1 + k2];
+ double d3 = this.terrainCalcs[i2 + k2];
+ double d4 = this.terrainCalcs[j2 + k2];
+ double d5 = (this.terrainCalcs[k1 + k2 + 1] - d1) * d0;
+ double d6 = (this.terrainCalcs[l1 + k2 + 1] - d2) * d0;
+ double d7 = (this.terrainCalcs[i2 + k2 + 1] - d3) * d0;
+ double d8 = (this.terrainCalcs[j2 + k2 + 1] - d4) * d0;
+
+ for (int l2 = 0; l2 < 8; ++l2) {
+ double d9 = 0.25D;
+ double d10 = d1;
+ double d11 = d2;
+ double d12 = (d3 - d1) * d9;
+ double d13 = (d4 - d2) * d9;
+
+ for (int i3 = 0; i3 < 4; ++i3) {
+ int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2;
+ short short1 = 256;
+ j3 -= short1;
+ double d14 = 0.25D;
+ double d16 = (d11 - d10) * d14;
+ double d15 = d10 - d16;
+
+ for (int k3 = 0; k3 < 4; ++k3) {
+ if ((d15 += d16) > 0.0D) {
+ blockStorage[j3 += short1] = this.getStoneBlock().getBlock();
+ } else if (k2 * 8 + l2 < seaLevel && this.canGenerateWaterBlock()) {
+ blockStorage[j3 += short1] = this.getWaterBlock().getBlock();
+ } else {
+ blockStorage[j3 += short1] = null;
+ }
+ }
+
+ d10 += d12;
+ d11 += d13;
+ }
+
+ d1 += d5;
+ d2 += d6;
+ d3 += d7;
+ d4 += d8;
+ }
+ }
+ }
+ }
+
+ }
+
+ private void makeLandPerBiome2(int x, int zero, int z) {
+ this.field_147426_g = this.noiseGen6.generateNoiseOctaves(this.field_147426_g, x, z, 5, 5, 200.0D, 200.0D,
+ 0.5D);
+ this.field_147427_d = this.field_147429_l.generateNoiseOctaves(this.field_147427_d, x, zero, z, 5, 33, 5,
+ 8.555150000000001D, 4.277575000000001D, 8.555150000000001D);
+ this.field_147428_e = this.field_147431_j.generateNoiseOctaves(this.field_147428_e, x, zero, z, 5, 33, 5,
+ 684.412D, 684.412D, 684.412D);
+ this.field_147425_f = this.field_147432_k.generateNoiseOctaves(this.field_147425_f, x, zero, z, 5, 33, 5,
+ 684.412D, 684.412D, 684.412D);
+ int terrainIndex = 0;
+ int noiseIndex = 0;
+
+ for (int ax = 0; ax < 5; ++ax) {
+ for (int az = 0; az < 5; ++az) {
+ float totalVariation = 0.0F;
+ float totalHeight = 0.0F;
+ float totalFactor = 0.0F;
+ byte two = 2;
+ BiomeGenBase biomegenbase = this.biomesForGeneration[ax + 2 + (az + 2) * 10];
+
+ for (int ox = -two; ox <= two; ++ox) {
+ for (int oz = -two; oz <= two; ++oz) {
+ BiomeGenBase biomegenbase1 = this.biomesForGeneration[ax + ox + 2 + (az + oz + 2) * 10];
+ float rootHeight = biomegenbase1.rootHeight;
+ float heightVariation = biomegenbase1.heightVariation;
+ float heightFactor = this.parabolicField[ox + 2 + (oz + 2) * 5] / (rootHeight + 2.0F);
+ if (biomegenbase1.rootHeight > biomegenbase.rootHeight) {
+ heightFactor /= 2.0F;
+ }
+
+ totalVariation += heightVariation * heightFactor;
+ totalHeight += rootHeight * heightFactor;
+ totalFactor += heightFactor;
+ }
+ }
+
+ totalVariation /= totalFactor;
+ totalHeight /= totalFactor;
+ totalVariation = totalVariation * 0.9F + 0.1F;
+ totalHeight = (totalHeight * 4.0F - 1.0F) / 8.0F;
+ double terrainNoise = this.field_147426_g[noiseIndex] / 8000.0D;
+ if (terrainNoise < 0.0D) {
+ terrainNoise = -terrainNoise * 0.3D;
+ }
+
+ terrainNoise = terrainNoise * 3.0D - 2.0D;
+ if (terrainNoise < 0.0D) {
+ terrainNoise /= 2.0D;
+ if (terrainNoise < -1.0D) {
+ terrainNoise = -1.0D;
+ }
+
+ terrainNoise /= 1.4D;
+ terrainNoise /= 2.0D;
+ } else {
+ if (terrainNoise > 1.0D) {
+ terrainNoise = 1.0D;
+ }
+
+ terrainNoise /= 8.0D;
+ }
+
+ ++noiseIndex;
+ double heightCalc = (double) totalHeight;
+ double variationCalc = (double) totalVariation * this.getHeightModifier() / 10.0D;
+ heightCalc += terrainNoise * 0.2D;
+ heightCalc = heightCalc * 8.5D / 8.0D;
+ double d5 = 8.5D + heightCalc * 4.0D;
+
+ for (int ay = 0; ay < 33; ++ay) {
+ double d6 = ((double) ay - d5) * 12.0D * 128.0D / 256.0D / variationCalc;
+ if (d6 < 0.0D) {
+ d6 *= 4.0D;
+ }
+
+ double d7 = this.field_147428_e[terrainIndex] / 512.0D;
+ double d8 = this.field_147425_f[terrainIndex] / 512.0D;
+ double d9 = (this.field_147427_d[terrainIndex] / 10.0D + 1.0D) / 2.0D;
+ double terrainCalc = MathHelper.denormalizeClamp(d7, d8, d9) - d6;
+ if (ay > 29) {
+ double d11 = (double) ((float) (ay - 29) / 3.0F);
+ terrainCalc = terrainCalc * (1.0D - d11) + -10.0D * d11;
+ }
+
+ this.terrainCalcs[terrainIndex] = terrainCalc;
+ ++terrainIndex;
+ }
+ }
+ }
+
+ }
+
+ public void replaceBlocksForBiome(int par1, int par2, Block[] arrayOfIDs, byte[] arrayOfMeta,
+ BiomeGenBase[] par4ArrayOfBiomeGenBase) {
+ this.noiseGen8.setFrequency(0.0625F);
+
+ for (int var8 = 0; var8 < 16; ++var8) {
+ for (int var9 = 0; var9 < 16; ++var9) {
+ GalacticBiomeGenBase biomegenbase = (GalacticBiomeGenBase) par4ArrayOfBiomeGenBase[var8 + var9 * 16];
+ int var12 = (int) ((double) this.noiseGen8.getNoise((float) (par1 * 16 + var8),
+ (float) (par2 * 16 + var9)) / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
+ int var13 = -1;
+ Block var14 = this.enableBiomeGenBaseBlock() ? biomegenbase.topBlock : this.getGrassBlock().getBlock();
+ byte var14m = this.enableBiomeGenBaseBlock()
+ ? biomegenbase.topMeta
+ : this.getGrassBlock().getMetadata();
+ Block var15 = this.enableBiomeGenBaseBlock()
+ ? biomegenbase.fillerBlock
+ : this.getDirtBlock().getBlock();
+ byte var15m = this.enableBiomeGenBaseBlock()
+ ? biomegenbase.fillerMeta
+ : this.getDirtBlock().getMetadata();
+
+ for (int var16 = 255; var16 >= 0; --var16) {
+ int index = this.getIndex(var8, var16, var9);
+ if (var16 <= 0 + this.rand.nextInt(5)) {
+ arrayOfIDs[index] = Blocks.bedrock;
+ }
+
+ if (var16 != 5 && var16 != 6 + this.rand.nextInt(3)) {
+ Block var18 = arrayOfIDs[index];
+ if (Blocks.air == var18) {
+ var13 = -1;
+ } else if (var18 == this.getStoneBlock().getBlock() && !this.enableBiomeGenBaseBlock()) {
+ arrayOfMeta[index] = this.getStoneBlock().getMetadata();
+ if (var13 == -1) {
+ if (var12 <= 0) {
+ var14 = Blocks.air;
+ var14m = 0;
+ var15 = this.getStoneBlock().getBlock();
+ var15m = this.getStoneBlock().getMetadata();
+ } else if (var16 >= 36 && var16 <= 21) {
+ if (this.enableBiomeGenBaseBlock()) {
+ var14 = biomegenbase.topBlock;
+ var14m = biomegenbase.topMeta;
+ var14 = biomegenbase.fillerBlock;
+ var14m = biomegenbase.fillerMeta;
+ } else {
+ var14 = this.getGrassBlock().getBlock();
+ var14m = this.getGrassBlock().getMetadata();
+ var14 = this.getDirtBlock().getBlock();
+ var14m = this.getDirtBlock().getMetadata();
+ }
+ }
+
+ var13 = var12;
+ if (var16 >= 19) {
+ arrayOfIDs[index] = var14;
+ arrayOfMeta[index] = var14m;
+ } else {
+ arrayOfIDs[index] = var15;
+ arrayOfMeta[index] = var15m;
+ }
+ } else if (var13 > 0) {
+ --var13;
+ arrayOfIDs[index] = var15;
+ arrayOfMeta[index] = var15m;
+ }
+ } else if (var18 == biomegenbase.stoneBlock) {
+ arrayOfMeta[index] = biomegenbase.stoneMeta;
+ if (var13 == -1) {
+ if (var12 <= 0) {
+ var14 = Blocks.air;
+ var14m = 0;
+ if (this.enableBiomeGenBaseBlock()) {
+ var15 = biomegenbase.stoneBlock;
+ var15m = biomegenbase.stoneMeta;
+ } else {
+ var15 = this.getStoneBlock().getBlock();
+ var15m = this.getStoneBlock().getMetadata();
+ }
+ } else if (var16 >= 36 && var16 <= 21) {
+ if (this.enableBiomeGenBaseBlock()) {
+ var14 = biomegenbase.topBlock;
+ var14m = biomegenbase.topMeta;
+ var14 = biomegenbase.fillerBlock;
+ var14m = biomegenbase.fillerMeta;
+ } else {
+ var14 = this.getGrassBlock().getBlock();
+ var14m = this.getGrassBlock().getMetadata();
+ var14 = this.getDirtBlock().getBlock();
+ var14m = this.getDirtBlock().getMetadata();
+ }
+ }
+
+ var13 = var12;
+ if (var16 >= 19) {
+ arrayOfIDs[index] = var14;
+ arrayOfMeta[index] = var14m;
+ } else {
+ arrayOfIDs[index] = var15;
+ arrayOfMeta[index] = var15m;
+ }
+ } else if (var13 > 0) {
+ --var13;
+ arrayOfIDs[index] = var15;
+ arrayOfMeta[index] = var15m;
+ }
+ }
+ } else {
+ arrayOfIDs[index] = this.canGenerateIceBlock() ? Blocks.packed_ice : Blocks.bedrock;
+ }
+ }
+ }
+ }
+
+ }
+
+ private int getIndex(int x, int y, int z) {
+ return (x * 16 + z) * 256 + y;
+ }
+
+ public Chunk loadChunk(int x, int z) {
+ return this.provideChunk(x, z);
+ }
+
+ public boolean chunkExists(int x, int z) {
+ return true;
+ }
+
+ public void populate(IChunkProvider chunk, int x, int z) {
+ BlockFalling.fallInstantly = true;
+ int var4 = x * 16;
+ int var5 = z * 16;
+ BiomeGenBase biomeGen = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
+ this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
+ this.rand.setSeed(this.worldObj.getSeed());
+ long var7 = this.rand.nextLong() / 2L * 2L + 1L;
+ long var9 = this.rand.nextLong() / 2L * 2L + 1L;
+ this.rand.setSeed((long) x * var7 + (long) z * var9 ^ this.worldObj.getSeed());
+ biomeGen.decorate(this.worldObj, this.rand, var4, var5);
+ this.decoratePlanet(this.worldObj, this.rand, var4, var5);
+ SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomeGen, var4 + 8, var5 + 8, 16, 16, this.rand);
+ this.onPopulate(chunk, x, z);
+ BlockFalling.fallInstantly = false;
+ }
+
+ public void decoratePlanet(World world, Random rand, int x, int z) {
+ this.getBiomeGenerator().decorate(world, rand, x, z);
+ }
+
+ public boolean saveChunks(boolean flag, IProgressUpdate progress) {
+ return true;
+ }
+
+ public boolean canSave() {
+ return true;
+ }
+
+ public String makeString() {
+ return "RandomLevelSource";
+ }
+
+ public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int i, int j, int k) {
+ ArrayList<SpawnListEntry> watercreatures;
+ SpawnListEntry[] arr$;
+ int len$;
+ int i$;
+ SpawnListEntry watercreature;
+ if (par1EnumCreatureType == EnumCreatureType.monster) {
+ watercreatures = new ArrayList<SpawnListEntry>();
+ arr$ = this.getMonsters();
+ len$ = arr$.length;
+
+ for (i$ = 0; i$ < len$; ++i$) {
+ watercreature = arr$[i$];
+ watercreatures.add(watercreature);
+ }
+
+ return watercreatures;
+ } else if (par1EnumCreatureType == EnumCreatureType.creature) {
+ watercreatures = new ArrayList<SpawnListEntry>();
+ arr$ = this.getCreatures();
+ len$ = arr$.length;
+
+ for (i$ = 0; i$ < len$; ++i$) {
+ watercreature = arr$[i$];
+ watercreatures.add(watercreature);
+ }
+
+ return watercreatures;
+ } else if (par1EnumCreatureType != EnumCreatureType.waterCreature) {
+ return null;
+ } else {
+ watercreatures = new ArrayList<SpawnListEntry>();
+ arr$ = this.getWaterCreatures();
+ len$ = arr$.length;
+
+ for (i$ = 0; i$ < len$; ++i$) {
+ watercreature = arr$[i$];
+ watercreatures.add(watercreature);
+ }
+
+ return watercreatures;
+ }
+ }
+
+ public int getLoadedChunkCount() {
+ return 0;
+ }
+
+ public void recreateStructures(int x, int z) {
+ }
+
+ public boolean unloadQueuedChunks() {
+ return false;
+ }
+
+ public void saveExtraData() {
+ }
+
+ public ChunkPosition func_147416_a(World world, String string, int x, int y, int z) {
+ return null;
+ }
+
+ protected abstract BiomeDecoratorSpace getBiomeGenerator();
+
+ protected abstract BiomeGenBase[] getBiomesForGeneration();
+
+ public abstract void onChunkProvider(int var1, int var2, Block[] var3, byte[] var4);
+
+ public abstract void onPopulate(IChunkProvider var1, int var2, int var3);
+
+ protected abstract SpawnListEntry[] getMonsters();
+
+ protected abstract SpawnListEntry[] getCreatures();
+
+ protected abstract SpawnListEntry[] getWaterCreatures();
+
+ protected abstract List<MapGenBaseMeta> getWorldGenerators();
+
+ public abstract double getHeightModifier();
+
+ public abstract int getWaterLevel();
+
+ public abstract boolean canGenerateWaterBlock();
+
+ public abstract boolean canGenerateIceBlock();
+
+ protected abstract BlockMetaPair getWaterBlock();
+
+ protected abstract BlockMetaPair getGrassBlock();
+
+ protected abstract BlockMetaPair getDirtBlock();
+
+ protected abstract BlockMetaPair getStoneBlock();
+
+ protected abstract boolean enableBiomeGenBaseBlock();
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticBiomeGenBase.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticBiomeGenBase.java
new file mode 100644
index 0000000000..9ebb7d3908
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticBiomeGenBase.java
@@ -0,0 +1,39 @@
+package gtPlusPlus.xmod.galacticraft.system.core.world.gen;
+
+import gtPlusPlus.xmod.galacticraft.system.core.world.gen.biome.BiomeGenGalaxy;
+import net.minecraft.block.Block;
+import net.minecraft.world.biome.BiomeGenBase;
+
+public abstract class GalacticBiomeGenBase extends BiomeGenBase {
+
+ public static BiomeGenBase mGalaxy;
+ public Block stoneBlock;
+ public byte topMeta;
+ public byte fillerMeta;
+ public byte stoneMeta;
+
+ public int mBiomeID;
+
+ public GalacticBiomeGenBase(int id) {
+ super(id);
+ this.spawnableMonsterList.clear();
+ this.spawnableWaterCreatureList.clear();
+ this.spawnableCreatureList.clear();
+ this.spawnableCaveCreatureList.clear();
+ this.rainfall = 0.0F;
+ this.setColor(-16744448);
+ mBiomeID = id;
+ }
+
+ public GalacticBiomeGenBase setColor(int var1) {
+ return (GalacticBiomeGenBase) super.setColor(var1);
+ }
+
+ public float getSpawningChance() {
+ return 0.1F;
+ }
+
+ static {
+ mGalaxy = (new BiomeGenGalaxy(177)).setBiomeName("Galaxy");
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticMapGenCavesBase.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticMapGenCavesBase.java
new file mode 100644
index 0000000000..713682b921
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/GalacticMapGenCavesBase.java
@@ -0,0 +1,191 @@
+package gtPlusPlus.xmod.galacticraft.system.core.world.gen;
+
+import galaxyspace.SolarSystem.core.registers.blocks.GSBlocks;
+import java.util.Random;
+import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+
+public class GalacticMapGenCavesBase extends MapGenBaseMeta {
+ public static final int BREAK_THROUGH_CHANCE = 25;
+
+ protected void generateLargeCaveNode(long par1, int par3, int par4, Block[] blockIdArray, byte[] metaArray,
+ double par6, double par8, double par10) {
+ this.generateCaveNode(par1, par3, par4, blockIdArray, metaArray, par6, par8, par10,
+ 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
+ }
+
+ protected void generateCaveNode(long par1, int par3, int par4, Block[] blockIdArray, byte[] metaArray, double par6,
+ double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) {
+ double d4 = (double) (par3 * 16 + 8);
+ double d5 = (double) (par4 * 16 + 8);
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+ Random random = new Random(par1);
+ if (par16 <= 0) {
+ int j1 = this.range * 16 - 16;
+ par16 = j1 - random.nextInt(j1 / 4);
+ }
+
+ boolean flag = false;
+ if (par15 == -1) {
+ par15 = par16 / 2;
+ flag = true;
+ }
+
+ int k1 = random.nextInt(par16 / 2) + par16 / 4;
+
+ for (boolean flag1 = random.nextInt(6) == 0; par15 < par16; ++par15) {
+ double d6 = 1.5D + (double) (MathHelper.sin((float) par15 * 3.1415927F / (float) par16) * par12 * 1.0F);
+ double d7 = d6 * par17;
+ float f5 = MathHelper.cos(par14);
+ float f6 = MathHelper.sin(par14);
+ par6 += (double) (MathHelper.cos(par13) * f5);
+ par8 += (double) f6;
+ par10 += (double) (MathHelper.sin(par13) * f5);
+ if (flag1) {
+ par14 *= 0.92F;
+ } else {
+ par14 *= 0.7F;
+ }
+
+ par14 += f4 * 0.1F;
+ par13 += f3 * 0.1F;
+ f4 *= 0.9F;
+ f3 *= 0.75F;
+ f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
+ f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F;
+ if (!flag && par15 == k1 && par12 > 1.0F && par16 > 0) {
+ this.generateCaveNode(random.nextLong(), par3, par4, blockIdArray, metaArray, par6, par8, par10,
+ random.nextFloat() * 0.5F + 0.5F, par13 - 1.5707964F, par14 / 3.0F, par15, par16, 1.0D);
+ this.generateCaveNode(random.nextLong(), par3, par4, blockIdArray, metaArray, par6, par8, par10,
+ random.nextFloat() * 0.5F + 0.5F, par13 + 1.5707964F, par14 / 3.0F, par15, par16, 1.0D);
+ return;
+ }
+
+ if (flag || random.nextInt(4) != 0) {
+ double d8 = par6 - d4;
+ double d9 = par10 - d5;
+ double d10 = (double) (par16 - par15);
+ double d11 = (double) (par12 + 2.0F + 16.0F);
+ if (d8 * d8 + d9 * d9 - d10 * d10 > d11 * d11) {
+ return;
+ }
+
+ if (par6 >= d4 - 16.0D - d6 * 2.0D && par10 >= d5 - 16.0D - d6 * 2.0D && par6 <= d4 + 16.0D + d6 * 2.0D
+ && par10 <= d5 + 16.0D + d6 * 2.0D) {
+ int l1 = MathHelper.floor_double(par6 - d6) - par3 * 16 - 1;
+ int i2 = MathHelper.floor_double(par6 + d6) - par3 * 16 + 1;
+ int j2 = MathHelper.floor_double(par8 - d7) - 1;
+ int k2 = MathHelper.floor_double(par8 + d7) + 1;
+ int l2 = MathHelper.floor_double(par10 - d6) - par4 * 16 - 1;
+ int i3 = MathHelper.floor_double(par10 + d6) - par4 * 16 + 1;
+ if (l1 < 0) {
+ l1 = 0;
+ }
+
+ if (i2 > 16) {
+ i2 = 16;
+ }
+
+ if (j2 < 1) {
+ j2 = 1;
+ }
+
+ if (k2 > 120) {
+ k2 = 120;
+ }
+
+ if (l2 < 0) {
+ l2 = 0;
+ }
+
+ if (i3 > 16) {
+ i3 = 16;
+ }
+
+ boolean flag2 = false;
+
+ int localY;
+ for (int j3 = l1; j3 < i2; ++j3) {
+ for (localY = l2; localY < i3; ++localY) {
+ for (int i4 = k2 + 1; i4 >= j2 - 1; --i4) {
+ if (i4 >= 0 && i4 < 128 && i4 != j2 - 1 && j3 != l1 && j3 != i2 - 1 && localY != l2
+ && localY != i3 - 1) {
+ i4 = j2;
+ }
+ }
+ }
+ }
+
+ for (localY = j2; localY < k2; ++localY) {
+ double yfactor = ((double) localY + 0.5D - par8) / d7;
+ double yfactorSq = yfactor * yfactor;
+
+ for (int localX = l1; localX < i2; ++localX) {
+ double zfactor = ((double) (localX + par3 * 16) + 0.5D - par6) / d6;
+ double zfactorSq = zfactor * zfactor;
+
+ for (int localZ = l2; localZ < i3; ++localZ) {
+ double xfactor = ((double) (localZ + par4 * 16) + 0.5D - par10) / d6;
+ double xfactorSq = xfactor * xfactor;
+ if (xfactorSq + zfactorSq < 1.0D) {
+ int coords = (localX * 16 + localZ) * 256 + localY;
+ if (yfactor > -0.7D && xfactorSq + yfactorSq + zfactorSq < 1.0D) {
+ if (blockIdArray[coords] == GSBlocks.HaumeaBlocks && metaArray[coords] == 0
+ && random.nextInt(25) == 0) {
+ blockIdArray[coords] = Blocks.air;
+ } else if (blockIdArray[coords] == GSBlocks.HaumeaBlocks
+ && metaArray[coords] == 0) {
+ blockIdArray[coords] = Blocks.air;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (flag) {
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, Block[] blockIdArray,
+ byte[] metaArray) {
+ int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);
+ if (this.rand.nextInt(15) != 0) {
+ var7 = 0;
+ }
+
+ for (int var8 = 0; var8 < var7; ++var8) {
+ double var9 = (double) (par2 * 16 + this.rand.nextInt(16));
+ double var11 = (double) this.rand.nextInt(this.rand.nextInt(120) + 8);
+ double var13 = (double) (par3 * 16 + this.rand.nextInt(16));
+ int var15 = 1;
+ if (this.rand.nextInt(4) == 0) {
+ this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, blockIdArray, metaArray, var9, var11,
+ var13);
+ var15 += this.rand.nextInt(4);
+ }
+
+ for (int var16 = 0; var16 < var15; ++var16) {
+ float var17 = this.rand.nextFloat() * 3.1415927F * 2.0F;
+ float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F;
+ float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat();
+ if (this.rand.nextInt(10) == 0) {
+ var19 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F;
+ }
+
+ this.generateCaveNode(this.rand.nextLong(), par4, par5, blockIdArray, metaArray, var9, var11, var13,
+ var19, var17, var18, 0, 0, 1.0D);
+ }
+ }
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/biome/BiomeGenGalaxy.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/biome/BiomeGenGalaxy.java
new file mode 100644
index 0000000000..56d34831b8
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/biome/BiomeGenGalaxy.java
@@ -0,0 +1,20 @@
+package gtPlusPlus.xmod.galacticraft.system.core.world.gen.biome;
+
+import gtPlusPlus.xmod.galacticraft.system.core.world.gen.GalacticBiomeGenBase;
+import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
+import net.minecraftforge.common.BiomeDictionary;
+import net.minecraftforge.common.BiomeDictionary.Type;
+
+public class BiomeGenGalaxy extends GalacticBiomeGenBase {
+ public BiomeGenGalaxy(int var1) {
+ super(var1);
+ this.spawnableCaveCreatureList.clear();
+ this.spawnableCreatureList.clear();
+ this.spawnableMonsterList.clear();
+ this.spawnableWaterCreatureList.clear();
+ if (!ConfigManagerCore.disableBiomeTypeRegistrations) {
+ BiomeDictionary.registerBiomeType(this, new Type[]{Type.COLD, Type.DRY, Type.DEAD, Type.SPOOKY});
+ }
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/SystemHD10180.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/SystemHD10180.java
new file mode 100644
index 0000000000..6a1bb52204
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/SystemHD10180.java
@@ -0,0 +1,40 @@
+package gtPlusPlus.xmod.galacticraft.system.hd10180;
+
+import gtPlusPlus.xmod.galacticraft.system.BaseSolarSystem;
+import gtPlusPlus.xmod.galacticraft.system.core.dim.BasicChunkProviderGalactic;
+import gtPlusPlus.xmod.galacticraft.system.hd10180.planets.b.dim.WorldProviderHD10180B;
+import gtPlusPlus.xmod.galacticraft.system.objects.BiomeSettings;
+import gtPlusPlus.xmod.galacticraft.system.objects.DimensionSettings;
+import gtPlusPlus.xmod.galacticraft.system.objects.PlanetGenerator;
+import gtPlusPlus.xmod.galacticraft.system.objects.WorldProviderSettings;
+import micdoodle8.mods.galacticraft.api.galaxies.SolarSystem;
+import micdoodle8.mods.galacticraft.api.galaxies.Star;
+import micdoodle8.mods.galacticraft.api.vector.Vector3;
+
+public class SystemHD10180 extends BaseSolarSystem {
+
+ public void preInit() {
+ //TCBlocks.initialize();
+ }
+
+ public void registrycelestial() {
+
+ }
+
+ @Override
+ public void initSolarSystem() {
+
+ SolarSystem aSystemHD10180 = createSolarSystem("HD10180", "hydrus", new Vector3(2.0D, -1.0D, 2.0D));
+ this.registerSolarSystem(aSystemHD10180);
+
+ Star aMainStar = this.createStar("HD10180-A", -1);
+ this.setMainStarForSolarSystem(aMainStar);
+
+ //Planet B
+ PlanetGenerator B = this.createPlanet("HD10180-B", new float[] {0.2f, 0.2f, 0.2f}, 3.1415927F, 1f, 2f, 11.861994F, null);
+ DimensionSettings Planet_B_Settings = new DimensionSettings(B, BasicChunkProviderGalactic.class, 5, true, 1, false, 240f, 0.1f, 0.2f, false, 48000L);
+ BiomeSettings Planet_B_Biome = new BiomeSettings("HD10180-B", 255, 0.1f, 0.2f);
+ this.registerPlanet(new WorldProviderHD10180B(new WorldProviderSettings(Planet_B_Settings, Planet_B_Biome)).getDim());
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/planets/b/dim/WorldProviderHD10180B.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/planets/b/dim/WorldProviderHD10180B.java
new file mode 100644
index 0000000000..2566ef6280
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/hd10180/planets/b/dim/WorldProviderHD10180B.java
@@ -0,0 +1,13 @@
+package gtPlusPlus.xmod.galacticraft.system.hd10180.planets.b.dim;
+
+import gtPlusPlus.xmod.galacticraft.system.core.dim.BaseWorldProviderGalactic;
+import gtPlusPlus.xmod.galacticraft.system.objects.WorldProviderSettings;
+
+public class WorldProviderHD10180B extends BaseWorldProviderGalactic {
+
+ public WorldProviderHD10180B(WorldProviderSettings b) {
+ super(b);
+ }
+
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/BiomeSettings.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/BiomeSettings.java
new file mode 100644
index 0000000000..33873f3f9e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/BiomeSettings.java
@@ -0,0 +1,29 @@
+package gtPlusPlus.xmod.galacticraft.system.objects;
+
+import net.minecraft.world.biome.BiomeGenBase.Height;
+
+public class BiomeSettings {
+
+ private final String mBiomeName;
+ private final int mBiomeID;
+ private final Height mHeight;
+
+ public BiomeSettings(String aName, int aID, float aHeightMin, float aHeightMax) {
+ mBiomeName = aName;
+ mBiomeID = aID;
+ mHeight = new Height(aHeightMin, aHeightMax);
+
+ }
+
+ public synchronized final String getName() {
+ return mBiomeName;
+ }
+
+ public synchronized final int getID() {
+ return mBiomeID;
+ }
+
+ public synchronized final Height getHeight() {
+ return mHeight;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/DimensionSettings.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/DimensionSettings.java
new file mode 100644
index 0000000000..5e444805e0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/DimensionSettings.java
@@ -0,0 +1,77 @@
+package gtPlusPlus.xmod.galacticraft.system.objects;
+
+import net.minecraft.world.chunk.IChunkProvider;
+
+public class DimensionSettings {
+
+ private final int TierRequirement;
+ private final PlanetGenerator Planet;
+ private final boolean Atmosphere;
+ private final int Pressure;
+ private final boolean SolarRadiation;
+ private final float CloudHeight;
+ private final float Gravity;
+ private final float MeteorFreq;
+ private final boolean CanRainOrSnow;
+ private final long DayLength;
+ private final Class<? extends IChunkProvider> ChunkProvider;
+
+ public DimensionSettings(PlanetGenerator aPlanet, Class<? extends IChunkProvider> aChunkProvider, int aTierRequirement, boolean aHasBreathableAtmo,
+ int aPressure, boolean aSolarRadiation, float aCloudHeight, float aGravity, float aMeteorFreq, boolean aCanRainOrSnow, long aDayLength) {
+ Planet = aPlanet;
+ TierRequirement = aTierRequirement;
+ Atmosphere = aHasBreathableAtmo;
+ Pressure = aPressure;
+ SolarRadiation = aSolarRadiation;
+ CloudHeight = aCloudHeight;
+ Gravity = aGravity;
+ MeteorFreq = aMeteorFreq;
+ CanRainOrSnow = aCanRainOrSnow;
+ DayLength = aDayLength;
+ ChunkProvider = aChunkProvider;
+ }
+
+ public synchronized final int getTierRequirement() {
+ return TierRequirement;
+ }
+
+ public synchronized final PlanetGenerator getPlanet() {
+ return Planet;
+ }
+
+ public synchronized final boolean hasAtmosphere() {
+ return Atmosphere;
+ }
+
+ public synchronized final int getPressure() {
+ return Pressure;
+ }
+
+ public synchronized final boolean hasSolarRadiation() {
+ return SolarRadiation;
+ }
+
+ public synchronized final float getCloudHeight() {
+ return CloudHeight;
+ }
+
+ public synchronized final float getGravity() {
+ return Gravity;
+ }
+
+ public synchronized final float getMeteorFreq() {
+ return MeteorFreq;
+ }
+
+ public synchronized final boolean hasRainOrSnow() {
+ return CanRainOrSnow;
+ }
+
+ public synchronized final long getDayLength() {
+ return DayLength;
+ }
+
+ public synchronized final Class<? extends IChunkProvider> getChunkProvider() {
+ return ChunkProvider;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/IPlanetBlockRegister.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/IPlanetBlockRegister.java
new file mode 100644
index 0000000000..e8349d8553
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/IPlanetBlockRegister.java
@@ -0,0 +1,29 @@
+package gtPlusPlus.xmod.galacticraft.system.objects;
+
+import gtPlusPlus.api.objects.data.AutoMap;
+import net.minecraft.block.Block;
+
+public interface IPlanetBlockRegister extends Runnable {
+
+ public abstract AutoMap<Block> getBlocksToRegister();
+
+ public abstract Block getWaterBlock();
+
+ public abstract Block getTopLayer();
+
+ public abstract Block getSoil();
+
+ public abstract Block getSoil2();
+
+ public abstract Block getStone();
+
+ public abstract void register();
+
+ @Override
+ default void run() {
+ register();
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/PlanetGenerator.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/PlanetGenerator.java
new file mode 100644
index 0000000000..7f59baa47a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/PlanetGenerator.java
@@ -0,0 +1,50 @@
+package gtPlusPlus.xmod.galacticraft.system.objects;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import micdoodle8.mods.galacticraft.api.galaxies.Planet;
+import net.minecraft.block.Block;
+
+public class PlanetGenerator {
+
+ private final Planet mPlanet;
+ private final IPlanetBlockRegister mTask;
+ private final Map<String, Block> mPlanetBlocks;
+ private final Thread mTaskThread;
+
+ public static final Map<String, PlanetGenerator> mGlobalPlanetCache = new HashMap<String, PlanetGenerator>();
+
+ public PlanetGenerator(Planet aPlanet, IPlanetBlockRegister aBlockRegistrationTask) {
+ mPlanet = aPlanet;
+ mTask = aBlockRegistrationTask;
+ mPlanetBlocks = new HashMap<String, Block>();
+ for (Block b : aBlockRegistrationTask.getBlocksToRegister()) {
+ mPlanetBlocks.put(b.getUnlocalizedName(), b);
+ }
+ if (mGlobalPlanetCache.get(mPlanet.getName().toUpperCase()) == null) {
+ mGlobalPlanetCache.put(mPlanet.getName().toUpperCase(), this);
+ }
+ else {
+ try {
+ this.finalize();
+ } catch (Throwable e) {
+ }
+ }
+ mTaskThread = new Thread(aBlockRegistrationTask);
+ mTaskThread.start();
+ }
+
+ public synchronized final Planet getPlanet() {
+ return mPlanet;
+ }
+
+ public synchronized final IPlanetBlockRegister getTask() {
+ return mTask;
+ }
+
+ public synchronized final Map<String, Block> getPlanetBlocks() {
+ return mPlanetBlocks;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/WorldProviderSettings.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/WorldProviderSettings.java
new file mode 100644
index 0000000000..e5ef3b43d9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/objects/WorldProviderSettings.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.xmod.galacticraft.system.objects;
+
+public class WorldProviderSettings {
+
+ private PlanetGenerator mPlanet;
+ private final DimensionSettings mDimSettings;
+ private final BiomeSettings mBiomeSettings;
+
+ public WorldProviderSettings(DimensionSettings d, BiomeSettings b) {
+ mPlanet = d.getPlanet();
+ mDimSettings = d;
+ mBiomeSettings = b;
+ }
+
+ public synchronized final PlanetGenerator getPlanet() {
+ return mPlanet;
+ }
+
+ public synchronized final void setPlanet(PlanetGenerator aPlanet) {
+ mPlanet = aPlanet;
+ }
+
+ public synchronized final DimensionSettings getDimSettings() {
+ return mDimSettings;
+ }
+
+ public synchronized final BiomeSettings getBiomeSettings() {
+ return mBiomeSettings;
+ }
+}