Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
Alomst Done!
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahJelen committed Jun 7, 2018
1 parent d13c91d commit 520037d
Show file tree
Hide file tree
Showing 13 changed files with 389 additions and 68 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@
Improved world generation in the Deep Underground
1.1.1:
Fixed a bug with diamond crystal generating in the deep void and deep underground

1.2:
Added biomes to Deep Underground
For performance reasons, most of the gravel generation has been removed from the deep underground dimension.
Liquid Redstone now generate underground in lakes
Added Glowing Ice
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.NetherNoah.ParadiseMod.blocks.misc;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class glowingIce extends Block {
public glowingIce() {
super(Material.ICE);
setUnlocalizedName("glowingIce");
setRegistryName("glowing_ice");
setHardness(.2F);
setResistance(2F);
setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
setHarvestLevel("pickaxe",0);
setLightLevel(.46666667F);
setSoundType(SoundType.GLASS);
setDefaultSlipperiness(1F);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.NetherNoah.ParadiseMod.blocks.misc.VoidFurnaceLit;
import com.NetherNoah.ParadiseMod.blocks.misc.VoidStone;
import com.NetherNoah.ParadiseMod.blocks.misc.emeraldRail;
import com.NetherNoah.ParadiseMod.blocks.misc.glowingIce;
import com.NetherNoah.ParadiseMod.blocks.misc.glowingObsidian;
import com.NetherNoah.ParadiseMod.blocks.misc.soulGlass;
import com.NetherNoah.ParadiseMod.blocks.misc.soulGlassPane;
Expand Down Expand Up @@ -80,6 +81,7 @@ public class Misc {
public static MossyFurnaceCode MossyFurnaceLit;
public static VoidFurnaceCode VoidFurnace;
public static VoidFurnaceCode VoidFurnaceLit;
public static Block glowingIce;

public static void initAndRegister() {
Utils.regBlock(RegenerationStone=new RegenerationStone());
Expand Down Expand Up @@ -111,11 +113,13 @@ public static void initAndRegister() {
Utils.regBlock(GoldHopper = new GoldHopper());
Utils.regBlock(MossyFurnace = new MossyFurnace());
Utils.regBlock(VoidFurnace=new VoidFurnace());
Utils.regBlock(glowingIce=new glowingIce());
ForgeRegistries.BLOCKS.register(MossyFurnaceLit = new MossyFurnaceLit());
ForgeRegistries.BLOCKS.register(VoidFurnaceLit=new VoidFurnaceLit());

}
public static void regRenders() {
Utils.regRender(glowingIce);
Utils.regRender(RegenerationStone);
Utils.regRender(VoidBricks);
Utils.regRender(PolishedVoidStone);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import java.util.List;
import java.util.Random;

import com.NetherNoah.ParadiseMod.init.LiquidRedstone;
import com.NetherNoah.ParadiseMod.init.ModBlocks.Crystals;
import com.NetherNoah.ParadiseMod.world.MapGenDuCaves;
import com.NetherNoah.ParadiseMod.init.ModBlocks.Misc;
import com.NetherNoah.ParadiseMod.world.mapgen.MapGenDUCaves;
import com.NetherNoah.ParadiseMod.world.mapgen.MapGenDURavines;

import net.minecraft.block.Block;
import net.minecraft.block.BlockStone;
Expand All @@ -23,7 +26,6 @@
import net.minecraft.world.chunk.ChunkPrimer;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.MapGenRavine;
import net.minecraft.world.gen.NoiseGeneratorOctaves;
import net.minecraft.world.gen.feature.WorldGenBush;
import net.minecraft.world.gen.feature.WorldGenMinable;
Expand Down Expand Up @@ -51,6 +53,9 @@ public class DUChunkGenerator implements IChunkGenerator {
protected static final IBlockState SANDSTONE = Blocks.SANDSTONE.getDefaultState();
protected static final IBlockState PRISMARINE=Blocks.PRISMARINE.getDefaultState();
protected static final IBlockState COBBLESTONE = Blocks.COBBLESTONE.getDefaultState();
protected static final IBlockState MYCELIUM=Blocks.MYCELIUM.getDefaultState();
protected static final IBlockState LIQUID_REDSTONE=LiquidRedstone.BlockLiquidRedstone.instance.getDefaultState();
protected static final IBlockState GLOWING_ICE=Misc.glowingIce.getDefaultState();


private final World world;
Expand Down Expand Up @@ -78,6 +83,9 @@ public class DUChunkGenerator implements IChunkGenerator {
//volcanic
private final WorldGenMinable Magma= new WorldGenMinable(Blocks.MAGMA.getDefaultState(), 33,BlockMatcher.forBlock(Blocks.COBBLESTONE));

//icy
private final WorldGenMinable glowingIce= new WorldGenMinable(GLOWING_ICE, 33,BlockMatcher.forBlock(Blocks.PACKED_ICE));

//crystals
private final WorldGenBush quartzGen = new WorldGenBush(Crystals.quartzCrystal);
private final WorldGenBush diamondGen = new WorldGenBush(Crystals.diamondCrystal);
Expand All @@ -100,8 +108,8 @@ public class DUChunkGenerator implements IChunkGenerator {
private final WorldGenBush redMushroomFeature = new WorldGenBush(Blocks.RED_MUSHROOM);

//natural structures
private MapGenBase genDUCaves = new MapGenDuCaves();
private MapGenBase genDURavines = new MapGenRavine();
private MapGenBase genDUCaves = new MapGenDUCaves();
private MapGenBase genDURavines = new MapGenDURavines();
private MapGenBase genDUMineshafts=new MapGenMineshaft();

double[] pnr;
Expand Down Expand Up @@ -266,6 +274,7 @@ public Chunk generateChunk(int x, int z) {
boolean desert=blockBiome==Biomes.DESERT||blockBiome==Biomes.DESERT_HILLS||blockBiome==Biomes.MUTATED_DESERT;
boolean volcanic=blockBiome==Biomes.EXTREME_HILLS||blockBiome==Biomes.EXTREME_HILLS_EDGE||blockBiome==Biomes.EXTREME_HILLS_WITH_TREES||blockBiome==Biomes.MUTATED_EXTREME_HILLS||blockBiome==Biomes.MUTATED_EXTREME_HILLS_WITH_TREES;
boolean oceanic=blockBiome==Biomes.OCEAN||blockBiome==Biomes.DEEP_OCEAN;
boolean mushroom=blockBiome==Biomes.MUSHROOM_ISLAND||blockBiome==Biomes.MUSHROOM_ISLAND_SHORE;

//block to replace
Block blockToReplace=chunk.getBlockState(cx, cy, cz).getBlock();
Expand All @@ -277,8 +286,15 @@ public Chunk generateChunk(int x, int z) {
if (blockToReplace==Blocks.GRAVEL)
chunk.setBlockState(new BlockPos(cx,cy,cz), STONE);

if (cy<=9&&blockToReplace==Blocks.WATER)
chunk.setBlockState(new BlockPos(cx,cy,cz), LIQUID_REDSTONE);
if (cy==10&&blockToReplace==Blocks.WATER)
chunk.setBlockState(new BlockPos(cx,cy,cz), Misc.glowingObsidian.getDefaultState());

//replace grass and dirt
if (blockToReplace==Blocks.GRASS||blockToReplace==Blocks.DIRT) {
if (mushroom)
chunk.setBlockState(new BlockPos(cx,cy,cz), MYCELIUM);

if (icy)
chunk.setBlockState(new BlockPos(cx, cy, cz),COMPICE);
Expand All @@ -300,7 +316,7 @@ public Chunk generateChunk(int x, int z) {

//replace exposed stone
if (blockToReplace==Blocks.STONE) {
if (chunk.getBlockState(cx+1,cy, cz).getBlock()==Blocks.AIR||chunk.getBlockState(cx,cy+1, cz).getBlock()==Blocks.AIR||chunk.getBlockState(cx,cy, cz+1).getBlock()==Blocks.AIR||chunk.getBlockState(cx-1,cy, cz).getBlock()==Blocks.AIR||chunk.getBlockState(cx,cy-1, cz).getBlock()==Blocks.AIR|| chunk.getBlockState(cx,cy, cz-1).getBlock()==Blocks.AIR) {
if (chunk.getBlockState(cx+1,cy, cz).getBlock()==Blocks.AIR||chunk.getBlockState(cx,cy+1, cz).getBlock()==Blocks.AIR||chunk.getBlockState(cx,cy, cz+1).getBlock()==Blocks.AIR||chunk.getBlockState(cx-1,cy, cz).getBlock()==Blocks.AIR||chunk.getBlockState(cx,cy-1, cz).getBlock()==Blocks.AIR|| chunk.getBlockState(cx,cy, cz-1).getBlock()==Blocks.AIR||chunk.getBlockState(cx+1,cy, cz).getBlock()==Blocks.WATER||chunk.getBlockState(cx,cy+1, cz).getBlock()==Blocks.WATER||chunk.getBlockState(cx,cy, cz+1).getBlock()==Blocks.WATER||chunk.getBlockState(cx-1,cy, cz).getBlock()==Blocks.WATER||chunk.getBlockState(cx,cy-1, cz).getBlock()==Blocks.WATER|| chunk.getBlockState(cx,cy, cz-1).getBlock()==Blocks.WATER) {

if (icy)
chunk.setBlockState(new BlockPos(cx, cy, cz), COMPICE);
Expand Down Expand Up @@ -452,6 +468,9 @@ public void populate(int x, int z) {

//oceanic
Lantern.generate(world, rand, blockpos.add(rand.nextInt(16), rand.nextInt(216) + 20, rand.nextInt(16)));

//icy
glowingIce.generate(world, rand, blockpos.add(rand.nextInt(16), rand.nextInt(216) + 20, rand.nextInt(16)));
}
biome.decorate(world, rand, new BlockPos(i, 0, j));
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(world, rand, blockpos));
Expand Down
Loading

0 comments on commit 520037d

Please sign in to comment.