Some clean-up on the new tree stuff

This commit is contained in:
Emmanuel BENOîT 2016-07-10 00:58:56 +02:00
parent e24b927f1d
commit 81148c7c0a
7 changed files with 74 additions and 50 deletions

View file

@ -5,15 +5,13 @@ deco No Copper pots
deco No Copper plates deco No Copper plates
deco No Lanterns deco No Lanterns
deco No Light plates deco No Light plates
deco No Limestone... deco No Stone - Smooth + stairs + slabs
...stairs Limestone
...slabs Slate
deco No Slate... Basalt
...stairs deco No Wood - Stairs + slabs + doors + fences + chairs + tables + thrones
...slabs Hevea
deco No Basalt... Bamboo
...stairs
...slabs
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
plants No? Tomatoes plants No? Tomatoes
plants No? Turnips plants No? Turnips
@ -43,20 +41,17 @@ materials No Alloys
Alnico Alnico
materials No Metal from slag materials No Metal from slag
-> in metal recycler -> in metal recycler
materials No Black sand materials No Black sand URGENT
materials No Quicksand / quagmire materials No Quicksand / quagmire URGENT
materials No Metals materials No Metals
Lead Lead
Aluminium Aluminium
Silver Silver
materials No Liquids materials No Liquids
Mercury Mercury
------------------------------------------------------------------------------------------------------- materials No Missing bamboo plank textures BF
materials.rock No Smooth limestone materials No Make bamboo behave like bamboo BF
materials.rock No Smooth slate materials No Olivine
materials.rock No Smooth basalt
-------------------------------------------------------------------------------------------------------
materials.ore No Olivine
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
tech.base No Alloy furnace tech.base No Alloy furnace
-> fix item pickup in creative mode BF -> fix item pickup in creative mode BF
@ -67,15 +62,19 @@ tech.base No Metal recycler
tech.tools No Pan (for e.g. panning gold) tech.tools No Pan (for e.g. panning gold)
-> limit it per chunk -> limit it per chunk
-> depend on chunk minerals -> depend on chunk minerals
tech.tools No Boats
Hevea
Bamboo
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
tech.blackboard ??? AUGUSTIN WANTS IT! tech.blackboard ??? AUGUSTIN WANTS IT!
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
animals ??? Goats animals ??? Goats
animals ??? Alligators
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
world ??? Improved system to handle neighbouring biomes BF world ??? Improved system to handle neighbouring biomes BF
world.gen ??? Make basalt gen behave correctly at chunk boundaries BF world.gen ??? Make basalt gen behave correctly at chunk boundaries BF
world.gen ??? Improve saltpeter gen so it generates in caves only BF world.gen ??? Improve saltpeter gen so it generates in caves only BF
world ??? Volcanos world ??? Volcanos URGENT
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
??? ??? Sub-blocks ??? ??? Sub-blocks
??? Yes Improved pistons ??? Yes Improved pistons

View file

@ -172,7 +172,7 @@ public class MTree
{ {
this.genNormal = generator; this.genNormal = generator;
if ( generator != null ) { if ( generator != null ) {
generator.setWood( this ); generator.setTreeMaterials( this );
} }
return this; return this;
} }
@ -189,7 +189,7 @@ public class MTree
this.genBig = generator; this.genBig = generator;
this.genBigChance = chance; this.genBigChance = chance;
if ( generator != null ) { if ( generator != null ) {
generator.setWood( this ); generator.setTreeMaterials( this );
} }
return this; return this;
} }
@ -199,7 +199,7 @@ public class MTree
{ {
this.genMega = generator; this.genMega = generator;
if ( generator != null ) { if ( generator != null ) {
generator.setWood( this ); generator.setTreeMaterials( this );
} }
return this; return this;
} }

View file

@ -2,8 +2,8 @@ package mmm.materials;
import mmm.utils.UMaths; import mmm.utils.UMaths;
import mmm.world.trees.WTHeveaGenerator;
import mmm.world.trees.WTBambooGenerator; import mmm.world.trees.WTBambooGenerator;
import mmm.world.trees.WTHeveaGenerator;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
@ -17,19 +17,18 @@ public class MTrees
MTrees( ) MTrees( )
{ {
HEVEA = new MTree( "hevea" ) // this.HEVEA = new MTree( "hevea" ) //
.setBarkColor( MapColor.GRAY ) // .setBarkColor( MapColor.GRAY ) //
.setBaseFireInfo( 5 , 8 ) // .setBaseFireInfo( 5 , 8 ) //
.setTreeGenerator( new WTHeveaGenerator( true ) ) // .setTreeGenerator( WTHeveaGenerator.createSaplingGen( ) ) //
.register( ); .register( );
BAMBOO = new MTree( "bamboo" ) // this.BAMBOO = new MTree( "bamboo" ) //
.setBarkColor( MapColor.FOLIAGE ) // .setBarkColor( MapColor.FOLIAGE ) //
.setLogBoundingBox( UMaths.makeBlockAABB( 4 , 0 , 4 , 12 , 16 , 12 ) ) // .setLogBoundingBox( UMaths.makeBlockAABB( 4 , 0 , 4 , 12 , 16 , 12 ) ) //
.setGrowthChance( .3f ) // .setGrowthChance( .3f ) //
.setSaplingGrowthStages( 1 ) // .setTreeGenerator( WTBambooGenerator.createSaplingGen( false ) ) //
.setTreeGenerator( new WTBambooGenerator( false , true ) ) // .setBigTreeGenerator( WTBambooGenerator.createSaplingGen( true ) , .15f ) //
.setBigTreeGenerator( new WTBambooGenerator( true , true ) , .15f ) //
.register( ); .register( );
} }
} }

View file

@ -46,14 +46,12 @@ public class WBTropicalSwamp
private static final IBlockState WATER_LILY = Blocks.WATERLILY.getDefaultState( ); private static final IBlockState WATER_LILY = Blocks.WATERLILY.getDefaultState( );
private static final A_WTTreeGenerator TG_BAMBOO_BIG = new WTBambooGenerator( true , false ) // private static final A_WTTreeGenerator TG_BAMBOO_BIG = new WTBambooGenerator( true , false );
.setWood( Materials.TREE.BAMBOO ); private static final A_WTTreeGenerator TG_BAMBOO = new WTBambooGenerator( false , false );
private static final A_WTTreeGenerator TG_BAMBOO = new WTBambooGenerator( false , false ) // private static final A_WTTreeGenerator TG_HEVEA = new WTHeveaGenerator( false );
.setWood( Materials.TREE.BAMBOO );
private static final A_WTTreeGenerator TG_HEVEA = new WTHeveaGenerator( false ) // private static final WorldGenShrub TG_SHRUB = new WorldGenShrub( //
.setWood( Materials.TREE.HEVEA ); WBTropicalSwamp.OAK_LOG , WBTropicalSwamp.OAK_LEAF );
private static final WorldGenShrub TG_SHRUB = new WorldGenShrub( WBTropicalSwamp.OAK_LOG ,
WBTropicalSwamp.OAK_LEAF );
public WBTropicalSwamp( final WBiomeHelper helper ) public WBTropicalSwamp( final WBiomeHelper helper )

View file

@ -160,24 +160,25 @@ public abstract class A_WTTreeGenerator
} }
private MTree wood; private MTree materials;
public A_WTTreeGenerator( final boolean notify ) public A_WTTreeGenerator( final boolean notify , MTree materials )
{ {
super( notify ); super( notify );
this.materials = materials;
} }
public MTree getWood( ) public MTree getTreeMaterials( )
{ {
return this.wood; return this.materials;
} }
public A_WTTreeGenerator setWood( final MTree wood ) public A_WTTreeGenerator setTreeMaterials( final MTree materials )
{ {
this.wood = wood; this.materials = materials;
return this; return this;
} }
@ -185,7 +186,7 @@ public abstract class A_WTTreeGenerator
@Override @Override
public boolean generate( final World worldIn , final Random rand , final BlockPos position ) public boolean generate( final World worldIn , final Random rand , final BlockPos position )
{ {
if ( position.getY( ) < 1 || !this.wood.canSaplingStay( worldIn , position ) ) { if ( position.getY( ) < 1 || !this.materials.canSaplingStay( worldIn , position ) ) {
return false; return false;
} }

View file

@ -3,6 +3,8 @@ package mmm.world.trees;
import java.util.Random; import java.util.Random;
import mmm.materials.MTree;
import mmm.materials.Materials;
import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockLeaves;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -12,6 +14,10 @@ import net.minecraft.util.math.BlockPos;
public class WTBambooGenerator public class WTBambooGenerator
extends A_WTTreeGenerator extends A_WTTreeGenerator
{ {
public static WTBambooGenerator createSaplingGen( final boolean big )
{
return new WTBambooGenerator( big , true , null );
}
private final int minHeight; private final int minHeight;
private final int randomHeight; private final int randomHeight;
@ -20,7 +26,13 @@ public class WTBambooGenerator
public WTBambooGenerator( final boolean big , final boolean notify ) public WTBambooGenerator( final boolean big , final boolean notify )
{ {
super( notify ); this( big , notify , Materials.TREE.BAMBOO );
}
private WTBambooGenerator( final boolean big , final boolean notify , MTree materials )
{
super( notify , materials );
this.minHeight = big ? 13 : 5; this.minHeight = big ? 13 : 5;
this.randomHeight = big ? 15 : 8; this.randomHeight = big ? 15 : 8;
this.maxRingRadius = big ? 2 : 1; this.maxRingRadius = big ? 2 : 1;
@ -39,7 +51,7 @@ public class WTBambooGenerator
{ {
// Trunk // Trunk
for ( int y = 0 ; y < rtd.height ; y++ ) { for ( int y = 0 ; y < rtd.height ; y++ ) {
rtd.setBlock( 2 , y , 2 , this.getWood( ).LOG , E_BlockRequirement.VANILLA ); rtd.setBlock( 2 , y , 2 , this.getTreeMaterials( ).LOG , E_BlockRequirement.VANILLA );
rtd.setRequirement( 2 , y , 2 , E_BlockRequirement.VANILLA ); rtd.setRequirement( 2 , y , 2 , E_BlockRequirement.VANILLA );
} }
@ -51,8 +63,8 @@ public class WTBambooGenerator
} }
// Leaves // Leaves
final IBlockState leaves = this.getWood( ).LEAVES.getDefaultState( ).withProperty( BlockLeaves.CHECK_DECAY , final IBlockState leaves = this.getTreeMaterials( ).LEAVES.getDefaultState( ) //
false ); .withProperty( BlockLeaves.CHECK_DECAY , false );
int ringY = 1 + rand.nextInt( 3 ); int ringY = 1 + rand.nextInt( 3 );
while ( ringY < rtd.height ) { while ( ringY < rtd.height ) {
final int radius = 1 + rand.nextInt( this.maxRingRadius ); final int radius = 1 + rand.nextInt( this.maxRingRadius );

View file

@ -4,6 +4,7 @@ package mmm.world.trees;
import java.util.Random; import java.util.Random;
import mmm.materials.MLeaves; import mmm.materials.MLeaves;
import mmm.materials.Materials;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -13,9 +14,22 @@ public class WTHeveaGenerator
extends A_WTTreeGenerator extends A_WTTreeGenerator
{ {
public static WTHeveaGenerator createSaplingGen( )
{
return new WTHeveaGenerator( );
}
public WTHeveaGenerator( final boolean notify ) public WTHeveaGenerator( final boolean notify )
{ {
super( notify ); super( notify , Materials.TREE.HEVEA );
}
// Used for sapling gen
private WTHeveaGenerator( )
{
super( true , null );
} }
@ -39,7 +53,8 @@ public class WTHeveaGenerator
final int trunkHeight = Math.max( trunkBottom + 1 , rtd.height - ( 1 + rand.nextInt( leavesHeight ) ) ); final int trunkHeight = Math.max( trunkBottom + 1 , rtd.height - ( 1 + rand.nextInt( leavesHeight ) ) );
// Lower part of the leaves // Lower part of the leaves
IBlockState leaves = this.getWood( ).LEAVES.getDefaultState( ).withProperty( MLeaves.CHECK_DECAY , false ); IBlockState leaves = this.getTreeMaterials( ).LEAVES.getDefaultState( )//
.withProperty( MLeaves.CHECK_DECAY , false );
for ( int y = trunkBottom , i = 0 ; y < lowerPart ; y++ , i++ ) { for ( int y = trunkBottom , i = 0 ; y < lowerPart ; y++ , i++ ) {
final int radius = ( i >> 1 ) + 1; final int radius = ( i >> 1 ) + 1;
final int rSquare = radius * radius + ( i & 1 ); final int rSquare = radius * radius + ( i & 1 );
@ -72,7 +87,7 @@ public class WTHeveaGenerator
// Trunk // Trunk
for ( int y = 0 ; y < trunkHeight ; y++ ) { for ( int y = 0 ; y < trunkHeight ; y++ ) {
rtd.setBlock( centre , y , centre , this.getWood( ).LOG , E_BlockRequirement.VANILLA ); rtd.setBlock( centre , y , centre , this.getTreeMaterials( ).LOG , E_BlockRequirement.VANILLA );
rtd.setRequirement( centre , y , centre , E_BlockRequirement.VANILLA ); rtd.setRequirement( centre , y , centre , E_BlockRequirement.VANILLA );
} }
} }