Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.02 KB | None | 0 0
  1. package com.halestormxv.worldALT.biomes.decorators;
  2.  
  3. import java.util.Random;
  4.  
  5. import com.halestormxv.biome.features.WorldGenCelestialTree;
  6. import com.halestormxv.blocks.CelestialCraft_blocks;
  7. import com.halestormxv.worldALT.gen.WorldGenEffectTree;
  8. import com.halestormxv.worldALT.gen.WorldGenForestBigTree;
  9. import com.halestormxv.worldALT.gen.WorldGenForestTrees;
  10.  
  11. import net.minecraft.block.Block;
  12. import net.minecraft.init.Blocks;
  13. import net.minecraft.world.World;
  14. import net.minecraft.world.biome.BiomeDecorator;
  15. import net.minecraft.world.biome.BiomeGenBase;
  16. import net.minecraft.world.gen.feature.WorldGenMinable;
  17. import net.minecraft.world.gen.feature.WorldGenerator;
  18.  
  19. public class BiomeDecoratorMod extends BiomeDecorator
  20. {
  21.     /** The world the BiomeDecorator is currently decorating */
  22.     public static World currentWorld;
  23.     /** The Biome Decorator's random number generator. */
  24.     public static Random randomGenerator;
  25.     /** The X-coordinate of the chunk currently being decorated */
  26.     public static int chunk_X;
  27.     /** The Z-coordinate of the chunk currently being decorated */
  28.     public static int chunk_Z;
  29.     /** True if decorator should generate surface lava & water */
  30.     public static boolean generateLakes;
  31.     /** How meny trees per chunk, set in each biome class **/
  32.     public static int howMenyTrees;
  33.  
  34.     /** Dimension Trees **/
  35.     public static WorldGenForestTrees smallTree;
  36.     public static WorldGenForestBigTree bigTree;
  37.     public static WorldGenEffectTree effectTree;
  38.     public static WorldGenCelestialTree celestialTree;
  39.    
  40.     @SuppressWarnings("unused")
  41.     private static final String __OBFID = "CL_00000164";
  42.  
  43.     public BiomeDecoratorMod() {
  44.         coalGen = new WorldGenMinable(Blocks.coal_ore, 16, Blocks.coal_ore);
  45.         ironGen = new WorldGenMinable(Blocks.iron_ore, 8, Blocks.iron_ore);
  46.         goldGen = new WorldGenMinable(Blocks.gold_ore, 8, Blocks.gold_ore);
  47.         redstoneGen = new WorldGenMinable(Blocks.redstone_ore, 7, Blocks.redstone_ore);
  48.         diamondGen = new WorldGenMinable(Blocks.diamond_ore, 7, Blocks.diamond_ore);
  49.         lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6, Blocks.lapis_ore);
  50.  
  51.         // TREES
  52.         smallTree = new WorldGenForestTrees(true);
  53.         bigTree = new WorldGenForestBigTree(true, 10, 1, 5);
  54.         effectTree = new WorldGenEffectTree(true);
  55.         celestialTree = new WorldGenCelestialTree(CelestialCraft_blocks.blockLog, CelestialCraft_blocks.blockLeaf, 1, 1, false, 4, 6, false);
  56.         // generates lakes and lava lakes in dimension.
  57.         generateLakes = true;
  58.     }
  59.  
  60.     public void decorateChunk(World world, Random random, BiomeGenBase biomeGenBase, int chunkX, int chunkZ) {
  61.         if (currentWorld != null) {
  62.             throw new RuntimeException("Already decorating!!");
  63.         } else {
  64.             currentWorld = world;
  65.             randomGenerator = random;
  66.             chunk_X = chunkX;
  67.             chunk_Z = chunkZ;
  68.             genDecorationsForBiome(biomeGenBase);
  69.             currentWorld = null;
  70.             randomGenerator = null;
  71.         }
  72.     }
  73.  
  74.     /**
  75.      * Decorate's biome.
  76.      *
  77.      * @param biome
  78.      */
  79.     protected void genDecorationsForBiome(BiomeGenBase biome) {
  80.         BiomeDecoratorHelper.decorateBiome(biome);
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement