Guest User

TutorialWorldProvider

a guest
Aug 11th, 2014
420
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package tutorial.dimension;
  2.  
  3. import tutorial.TutorialMoon;
  4. import java.util.Random;
  5.  
  6. import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody;
  7. import micdoodle8.mods.galacticraft.api.prefab.world.gen.WorldProviderSpace;
  8. import micdoodle8.mods.galacticraft.api.vector.Vector3;
  9. import micdoodle8.mods.galacticraft.api.world.IExitHeight;
  10. import micdoodle8.mods.galacticraft.api.world.ISolarLevel;
  11. import micdoodle8.mods.galacticraft.api.world.ITeleportType;
  12. import micdoodle8.mods.galacticraft.core.client.CloudRenderer;
  13. import net.minecraft.entity.Entity;
  14. import net.minecraft.entity.player.EntityPlayerMP;
  15. import net.minecraft.world.World;
  16. import net.minecraft.world.WorldServer;
  17. import net.minecraft.world.biome.WorldChunkManager;
  18. import net.minecraft.world.chunk.IChunkProvider;
  19. import net.minecraftforge.client.IRenderHandler;
  20.  
  21. public class TutorialWorldProvider extends WorldProviderSpace implements IExitHeight, ISolarLevel, ITeleportType{
  22.  
  23.     @Override
  24.     public boolean canSpaceshipTierPass(int tier) {
  25.         return tier >= 1;
  26.     }
  27.  
  28.     @Override
  29.     public float getFallDamageModifier() {
  30.         return 0.75;
  31.     }
  32.  
  33.     @Override
  34.     public double getFuelUsageMultiplier() {
  35.         return 0.8;
  36.     }
  37.  
  38.     //Gravity is tricky. The only working values I have found are between 0.04 and 0.075 exclusive.
  39.     //Anything else tends to be a bit wonky. Feel free to experiment.
  40.     //Also a higher value means less gravity
  41.     @Override
  42.     public float getGravity() {
  43.         return 0.07F;
  44.     }
  45.  
  46.     //The moon is 7.0, 0 is none, lower numbers mean more
  47.     @Override
  48.     public double getMeteorFrequency() {
  49.         return 4.0;
  50.     }
  51.  
  52.     @Override
  53.     public float getSoundVolReductionAmount() {
  54.         return Float.MAX_VALUE;
  55.     }
  56.  
  57.     @Override
  58.     public float getThermalLevelModifier() {
  59.         return -2;
  60.     }
  61.  
  62.     @Override
  63.     public float getWindLevel() {
  64.         return 0;
  65.     }
  66.  
  67.     @Override
  68.     public boolean canRainOrSnow() {
  69.         return false;
  70.     }
  71.  
  72.     @Override
  73.     public CelestialBody getCelestialBody() {
  74.         return ;
  75.     }
  76.  
  77.      //Created later
  78.     @Override
  79.     public Class<? extends IChunkProvider> getChunkProviderClass() {
  80.         return TutorialChunkProvider.class;
  81.     }
  82.  
  83.     @Override
  84.     public long getDayLength() {
  85.         return 24000L;
  86.     }
  87.  
  88.     @Override
  89.     public Vector3 getFogColor() {
  90.         return new Vector3(0, 0, 0);
  91.     }
  92.  
  93.     @Override
  94.     public Vector3 getSkyColor() {
  95.         return new Vector3(0, 0, 0);
  96.     }
  97.  
  98.      //Created Later
  99.     @Override
  100.     public Class<? extends WorldChunkManager> getWorldChunkManagerClass() {
  101.         return WorldChunkManagerTutorial.class;
  102.     }
  103.  
  104.     @Override
  105.     public boolean hasSunset() {
  106.         return false;
  107.     }
  108.  
  109.     //Can players respawn here?
  110.     @Override
  111.     public boolean shouldForceRespawn() {
  112.         return true;
  113.     }
  114.  
  115.     @Override
  116.     public double getSolarEnergyMultiplier() {
  117.         return 0.85;
  118.     }
  119.  
  120.     @Override
  121.     public double getYCoordinateToTeleport() {
  122.         return 800;
  123.     }
  124.  
  125.     @Override
  126.     public Vector3 getEntitySpawnLocation(WorldServer arg0, Entity arg1) {
  127.         return new Vector3(arg1.posX, 140, arg1.posZ);
  128.     }
  129.  
  130.     @Override
  131.     public Vector3 getParaChestSpawnLocation(WorldServer arg0,
  132.             EntityPlayerMP arg1, Random arg2) {
  133.         //Randomize parachest spawn location
  134.         return new Vector3(arg1.posX - 5 + arg2.nextInt(10), 150, arg1.posZ - 5 + arg2.nextInt(10));
  135.     }
  136.  
  137.     @Override
  138.     public Vector3 getPlayerSpawnLocation(WorldServer arg0, EntityPlayerMP arg1) {
  139.         return getEntitySpawnLocation(arg0, arg1);
  140.     }
  141.  
  142.     @Override
  143.     public void onSpaceDimensionChanged(World arg0, EntityPlayerMP arg1,
  144.             boolean arg2) {}
  145.  
  146.     @Override
  147.     public boolean useParachute() {
  148.         return true;
  149.     }
  150.  
  151.     @Override
  152.     public IRenderHandler getCloudRenderer(){
  153.         //Removes clouds from dimension
  154.         return new CloudRenderer();
  155.     }
  156. }
RAW Paste Data