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

Commit

Permalink
Optimizing world gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Jelen committed Sep 10, 2018
1 parent b2255c6 commit e8aefd2
Show file tree
Hide file tree
Showing 43 changed files with 1,106 additions and 476 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,8 @@
Added 2 easter eggs
Added underground villages
Optimized ore generation

1.3.1:
Attempted to optimize cave generation
Ore cystals no longer generate in ocean biomes
Optimized structure generation
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public diamondCrystal() {
setResistance(1F);
setLightLevel(1F);
setSoundType(SoundType.GLASS);
setTickRandomly(false);
}
@Override
protected boolean canSustainBush(IBlockState state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public emeraldCrystal() {
setResistance(1F);
setLightLevel(1F);
setSoundType(SoundType.GLASS);
setTickRandomly(false);
}
@Override
protected boolean canSustainBush(IBlockState state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public quartzCrystal() {
setResistance(1F);
setLightLevel(1F);
setSoundType(SoundType.GLASS);
setTickRandomly(false);
}
@Override
protected boolean canSustainBush(IBlockState state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public redstoneCrystal() {
setResistance(1F);
setLightLevel(1F);
setSoundType(SoundType.GLASS);
setTickRandomly(false);
}
@Override
protected boolean canSustainBush(IBlockState state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public rubyCrystal() {
setResistance(1F);
setLightLevel(1F);
setSoundType(SoundType.GLASS);
setTickRandomly(false);
}
@Override
protected boolean canSustainBush(IBlockState state)
Expand Down
100 changes: 100 additions & 0 deletions src/main/java/com/NetherNoah/ParadiseMod/blocks/formations/icicle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.NetherNoah.ParadiseMod.blocks.formations;

import net.minecraft.block.BlockDirectional;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class icicle extends BlockDirectional {
protected static final AxisAlignedBB END_ROD_VERTICAL_AABB = new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D);
protected static final AxisAlignedBB END_ROD_NS_AABB = new AxisAlignedBB(0.375D, 0.375D, 0.0D, 0.625D, 0.625D, 1.0D);
protected static final AxisAlignedBB END_ROD_EW_AABB = new AxisAlignedBB(0.0D, 0.375D, 0.375D, 1.0D, 0.625D, 0.625D);

public icicle()
{
super(Material.CIRCUITS);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP));
setCreativeTab(CreativeTabs.DECORATIONS);
setUnlocalizedName("Icicle");
setRegistryName("icicle");
}

@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}

@Override
public boolean isFullCube(IBlockState state) {
return false;
}

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
switch (((EnumFacing)state.getValue(FACING)).getAxis())
{
case X:
default:
return END_ROD_EW_AABB;
case Z:
return END_ROD_NS_AABB;
case Y:
return END_ROD_VERTICAL_AABB;
}
}
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.TRANSLUCENT;
}

@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
iblockstate = iblockstate.withProperty(FACING, EnumFacing.getFront(meta));
return iblockstate;
}

@Override
public int getMetaFromState(IBlockState state)
{
return ((EnumFacing)state.getValue(FACING)).getIndex();
}

@Override
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
IBlockState iblockstate = worldIn.getBlockState(pos.offset(facing.getOpposite()));

if (iblockstate.getBlock() == Blocks.END_ROD)
{
EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING);

if (enumfacing == facing)
{
return this.getDefaultState().withProperty(FACING, facing.getOpposite());
}
}

return this.getDefaultState().withProperty(FACING, facing);
}

@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer(this, new IProperty[] {FACING});
}

}
Loading

0 comments on commit e8aefd2

Please sign in to comment.