Some tweaks and clean-up on trees
This commit is contained in:
parent
f7b5e3df23
commit
c929569cd4
3 changed files with 26 additions and 36 deletions
|
@ -112,7 +112,7 @@ public class MSapling
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.wood.getMegaGenerator( ) != null ) {
|
if ( this.wood.canGenerateMega( ) ) {
|
||||||
for ( int x = -1 ; x < 1 ; x++ ) {
|
for ( int x = -1 ; x < 1 ; x++ ) {
|
||||||
for ( int z = -1 ; z < 1 ; z++ ) {
|
for ( int z = -1 ; z < 1 ; z++ ) {
|
||||||
final BlockPos basePos = pos.add( x , 0 , z );
|
final BlockPos basePos = pos.add( x , 0 , z );
|
||||||
|
@ -233,7 +233,7 @@ public class MSapling
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public Block.EnumOffsetType getOffsetType( )
|
public Block.EnumOffsetType getOffsetType( )
|
||||||
{
|
{
|
||||||
return Block.EnumOffsetType.XZ;
|
return this.wood.mustOffsetSapling( ) ? Block.EnumOffsetType.XZ : Block.EnumOffsetType.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ public class MTree
|
||||||
private int fruitDropChance = 0;
|
private int fruitDropChance = 0;
|
||||||
private Item fruit = null;
|
private Item fruit = null;
|
||||||
|
|
||||||
|
private boolean mustOffsetSapling = false;
|
||||||
private int saplingGrowthStages = 2;
|
private int saplingGrowthStages = 2;
|
||||||
private float bonemealChance = .45f;
|
private float bonemealChance = .45f;
|
||||||
private float growthChance = .142f;
|
private float growthChance = .142f;
|
||||||
|
@ -132,7 +133,14 @@ public class MTree
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public MTree setSaplingGrowthStages( final int stages )
|
public MTree offsetSapling( )
|
||||||
|
{
|
||||||
|
this.mustOffsetSapling = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MTree setGrowthStages( final int stages )
|
||||||
{
|
{
|
||||||
this.saplingGrowthStages = stages;
|
this.saplingGrowthStages = stages;
|
||||||
return this;
|
return this;
|
||||||
|
@ -286,6 +294,12 @@ public class MTree
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean mustOffsetSapling( )
|
||||||
|
{
|
||||||
|
return this.mustOffsetSapling;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getSaplingGrowthStages( )
|
public int getSaplingGrowthStages( )
|
||||||
{
|
{
|
||||||
return this.saplingGrowthStages;
|
return this.saplingGrowthStages;
|
||||||
|
@ -325,6 +339,12 @@ public class MTree
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean canGenerateMega( )
|
||||||
|
{
|
||||||
|
return this.genMega != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean generateNormalOrBig( final World worldIn , final BlockPos pos , final Random rand )
|
public boolean generateNormalOrBig( final World worldIn , final BlockPos pos , final Random rand )
|
||||||
{
|
{
|
||||||
if ( this.genBig != null
|
if ( this.genBig != null
|
||||||
|
@ -333,12 +353,7 @@ public class MTree
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.generateNormal( worldIn , pos , rand );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean generateNormal( final World worldIn , final BlockPos pos , final Random rand )
|
|
||||||
{
|
|
||||||
if ( this.genNormal == null ) {
|
if ( this.genNormal == null ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -346,15 +361,6 @@ public class MTree
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean generateBig( final World worldIn , final BlockPos pos , final Random rand )
|
|
||||||
{
|
|
||||||
if ( this.genBig == null ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.genBig.generate( worldIn , rand , pos );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean generateMega( final World worldIn , final BlockPos pos , final Random rand )
|
public boolean generateMega( final World worldIn , final BlockPos pos , final Random rand )
|
||||||
{
|
{
|
||||||
if ( this.genMega == null ) {
|
if ( this.genMega == null ) {
|
||||||
|
@ -364,24 +370,6 @@ public class MTree
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public WorldGenAbstractTree getNormalGenerator( )
|
|
||||||
{
|
|
||||||
return this.genNormal;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public WorldGenAbstractTree getBigGenerator( )
|
|
||||||
{
|
|
||||||
return this.genBig;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public WorldGenAbstractTree getMegaGenerator( )
|
|
||||||
{
|
|
||||||
return this.genMega;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerRecipes( )
|
public void registerRecipes( )
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,9 @@ public class MTrees
|
||||||
this.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 ) //
|
.setGrowthStages( 8 ) //
|
||||||
|
.setGrowthChance( .8f ) //
|
||||||
|
.offsetSapling( ) //
|
||||||
.setTreeGenerator( WTBamboo.createSaplingGen( false ) ) //
|
.setTreeGenerator( WTBamboo.createSaplingGen( false ) ) //
|
||||||
.setBigTreeGenerator( WTBamboo.createSaplingGen( true ) , .15f ) //
|
.setBigTreeGenerator( WTBamboo.createSaplingGen( true ) , .15f ) //
|
||||||
.register( );
|
.register( );
|
||||||
|
|
Reference in a new issue