Guest User

TutorialChunkProvider.java

a guest
Aug 11th, 2014
319
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package tutorial.dimension;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair;
  7. import micdoodle8.mods.galacticraft.api.prefab.world.gen.BiomeDecoratorSpace;
  8. import micdoodle8.mods.galacticraft.api.prefab.world.gen.ChunkProviderSpace;
  9. import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta;
  10. import micdoodle8.mods.galacticraft.core.blocks.GCBlocks;
  11. import micdoodle8.mods.galacticraft.core.entities.EntityAlienVillager;
  12. import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedCreeper;
  13. import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSkeleton;
  14. import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedZombie;
  15. import net.minecraft.block.Block;
  16. import net.minecraft.world.World;
  17. import net.minecraft.world.biome.BiomeGenBase;
  18. import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry;
  19. import net.minecraft.world.chunk.IChunkProvider;
  20.  
  21. public class TutorialChunkProvider extends ChunkProviderSpace {
  22.  
  23.     public TutorialChunkProvider(World par1World, long seed, boolean mapFeaturesEnabled) {
  24.         super(par1World, seed, mapFeaturesEnabled);
  25.     }
  26.  
  27.     @Override
  28.     protected BiomeDecoratorSpace getBiomeGenerator() {
  29.         // TODO Auto-generated method stub
  30.         return new BiomeDecoratorTutorial();
  31.     }
  32.  
  33.      //This should be a custom biome for your mod, but I'm opting to go desert instead out of quickness
  34.     //and the fact that biomes are outside the scope of this tutorial
  35.     @Override
  36.     protected BiomeGenBase[] getBiomesForGeneration() {
  37.         // TODO make phobos biome
  38.         return new BiomeGenBase[]{BiomeGenBase.desert};
  39.     }
  40.  
  41.     @Override
  42.     public int getCraterProbability() {
  43.         return 64;
  44.     }
  45.  
  46.     @Override
  47.     protected SpawnListEntry[] getCreatures() {
  48.         SpawnListEntry villager = new SpawnListEntry(EntityAlienVillager.class, 10, 2, 2);
  49.         return new SpawnListEntry[]{villager};
  50.     }
  51.  
  52.     @Override
  53.     protected BlockMetaPair getDirtBlock() {
  54.         // TODO Auto-generated method stub
  55.         return new BlockMetaPair(GCBlocks.blockMoon, (byte) 3);
  56.     }
  57.  
  58.     @Override
  59.     protected BlockMetaPair getGrassBlock() {
  60.         // TODO Auto-generated method stub
  61.         return new BlockMetaPair(GCBlocks.blockMoon, (byte) 5);
  62.     }
  63.  
  64.     @Override
  65.     public double getHeightModifier() {
  66.         // TODO Auto-generated method stub
  67.         return 10;
  68.     }
  69.  
  70.     @Override
  71.     protected SpawnListEntry[] getMonsters() {
  72.         SpawnListEntry skele = new SpawnListEntry(EntityEvolvedSkeleton.class, 100, 4, 4);
  73.         SpawnListEntry creeper = new SpawnListEntry(EntityEvolvedCreeper.class, 100, 4, 4);
  74.         SpawnListEntry zombie = new SpawnListEntry(EntityEvolvedZombie.class, 100, 4, 4);
  75.      
  76.         return new SpawnListEntry[]{skele, creeper, zombie};
  77.     }
  78.  
  79.     @Override
  80.     public double getMountainHeightModifier() {
  81.         return 0;
  82.     }
  83.  
  84.     @Override
  85.     protected int getSeaLevel() {
  86.         return 56;
  87.     }
  88.  
  89.     @Override
  90.     public double getSmallFeatureHeightModifier() {
  91.         return 0;
  92.     }
  93.  
  94.     @Override
  95.     protected BlockMetaPair getStoneBlock() {
  96.         // TODO Auto-generated method stub
  97.         return new BlockMetaPair(GCBlocks.blockMoon, (byte) 4);
  98.     }
  99.  
  100.     @Override
  101.     public double getValleyHeightModifier() {
  102.         return 0;
  103.     }
  104.  
  105.     @Override
  106.     protected List<MapGenBaseMeta> getWorldGenerators() {
  107.         // TODO fill in with caves and villages
  108.         return new ArrayList<MapGenBaseMeta>();
  109.     }
  110.  
  111.     @Override
  112.     public void onChunkProvide(int arg0, int arg1, Block[] arg2, byte[] arg3) {
  113.     }
  114.  
  115.     @Override
  116.     public void onPopulate(IChunkProvider arg0, int arg1, int arg2){
  117.     }
  118.  
  119.     @Override
  120.     public boolean chunkExists(int x, int y){
  121.         return false;
  122.     }
  123.  
  124. }
RAW Paste Data