Everything should now generate properly.
This commit is contained in:
parent
f581bdc38b
commit
dcdd216e63
12 changed files with 71 additions and 16 deletions
|
@ -56,7 +56,7 @@ public class BlockBOPAppleLeaves extends BlockLeavesBase implements IShearable
|
|||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int meta)
|
||||
{
|
||||
return textures[(!isOpaqueCube() ? 0 : 1)][meta & 7];
|
||||
return textures[(!isOpaqueCube() ? 0 : 1)][meta & 3];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,7 +67,6 @@ public class BlockBOPColorizedLeaves extends BlockLeavesBase implements IShearab
|
|||
switch (par1)
|
||||
{
|
||||
case 0:
|
||||
case 4:
|
||||
return ColorizerFoliage.getFoliageColorBirch();
|
||||
|
||||
case 3:
|
||||
|
|
|
@ -106,6 +106,11 @@ public class BlockBOPFlower extends BlockFlower
|
|||
list.add(new ItemStack(blockID, 1, i));
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int id)
|
||||
{
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID || id == Block.sand.blockID;
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int id, int meta)
|
||||
{
|
||||
switch (meta)
|
||||
|
@ -146,6 +151,10 @@ public class BlockBOPFlower extends BlockFlower
|
|||
@Override
|
||||
public boolean canBlockStay(World world, int x, int y, int z)
|
||||
{
|
||||
if (world.getBlockId(x, y, z) != this.blockID)
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
|
||||
else
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
|
|
@ -93,6 +93,11 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
|
|||
return this.canPlaceBlockOnSide(world, x, y, z, side);
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int id)
|
||||
{
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID;
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int blockID, int metadata)
|
||||
{
|
||||
if (metadata == GRASSTOP)
|
||||
|
@ -106,6 +111,10 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
|
|||
@Override
|
||||
public boolean canBlockStay(World world, int x, int y, int z)
|
||||
{
|
||||
if (world.getBlockId(x, y, z) != this.blockID)
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
|
||||
else
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
|
|
@ -119,6 +119,12 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
|||
}
|
||||
}
|
||||
|
||||
protected boolean canThisPlantGrowOnThisBlockID(int id)
|
||||
{
|
||||
return id == Blocks.driedDirt.get().blockID || id == Block.sand.blockID || id == Blocks.redRock.get().blockID || id == Blocks.holyGrass.get().blockID
|
||||
|| id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side, ItemStack itemStack)
|
||||
{
|
||||
|
@ -157,7 +163,11 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
|||
@Override
|
||||
public boolean canBlockStay(World world, int x, int y, int z)
|
||||
{
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
if (world.getBlockId(x, y, z) != this.blockID)
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
|
||||
else
|
||||
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z))
|
||||
&& this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
||||
|
@ -179,7 +189,27 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
|
|||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return -1;
|
||||
if (par1 > 5)
|
||||
return this.blockID;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random random)
|
||||
{
|
||||
if (meta == 6)
|
||||
return random.nextInt(5) == 0 ? 1 : 0;
|
||||
else if (meta == 7)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -143,4 +143,11 @@ public class BlockBamboo extends Block
|
|||
{
|
||||
return BOPItems.bambooItem.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves(World world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ public class BlockWillow extends Block implements IShearable
|
|||
*/
|
||||
public int getRenderColor(int par1)
|
||||
{
|
||||
return ColorizerFoliage.getFoliageColorBasic();
|
||||
return ColorizerFoliage.getFoliageColorBirch();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Random;
|
|||
import biomesoplenty.api.Blocks;
|
||||
import biomesoplenty.configuration.BOPBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
|
@ -18,7 +19,7 @@ public class WorldGenAlgae extends WorldGenerator
|
|||
int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
|
||||
int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
|
||||
if (par1World.isAirBlock(var7, var8, var9) && Blocks.foliage.get().canPlaceBlockAt(par1World, var7, var8, var9))
|
||||
if (par1World.isAirBlock(var7, var8, var9) && par1World.getBlockId(var7, var8 - 1, var9) == Block.waterStill.blockID)
|
||||
{
|
||||
par1World.setBlock(var7, var8, var9, Blocks.foliage.get().blockID, 0, 2);
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ public class WorldGenCherry1 extends WorldGenerator
|
|||
}
|
||||
else
|
||||
{
|
||||
this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 0);
|
||||
this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 1);
|
||||
++var13;
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ public class WorldGenCherry1 extends WorldGenerator
|
|||
var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D);
|
||||
var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D);
|
||||
var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D);
|
||||
byte var17 = 0;
|
||||
byte var17 = 1;
|
||||
int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]);
|
||||
int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]);
|
||||
int var20 = Math.max(var18, var19);
|
||||
|
@ -288,11 +288,11 @@ public class WorldGenCherry1 extends WorldGenerator
|
|||
{
|
||||
if (var18 == var20)
|
||||
{
|
||||
var17 = 4;
|
||||
var17 = 5;
|
||||
}
|
||||
else if (var19 == var20)
|
||||
{
|
||||
var17 = 8;
|
||||
var17 = 9;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ public class WorldGenCherry2 extends WorldGenerator
|
|||
}
|
||||
else
|
||||
{
|
||||
this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 0);
|
||||
this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 3);
|
||||
++var13;
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ public class WorldGenCherry2 extends WorldGenerator
|
|||
var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D);
|
||||
var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D);
|
||||
var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D);
|
||||
byte var17 = 0;
|
||||
byte var17 = 1;
|
||||
int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]);
|
||||
int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]);
|
||||
int var20 = Math.max(var18, var19);
|
||||
|
@ -288,11 +288,11 @@ public class WorldGenCherry2 extends WorldGenerator
|
|||
{
|
||||
if (var18 == var20)
|
||||
{
|
||||
var17 = 4;
|
||||
var17 = 5;
|
||||
}
|
||||
else if (var19 == var20)
|
||||
{
|
||||
var17 = 8;
|
||||
var17 = 9;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ public class WorldGenDeadTree extends WorldGenerator
|
|||
var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D);
|
||||
var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D);
|
||||
var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D);
|
||||
byte var17 = 0;
|
||||
byte var17 = 2;
|
||||
int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]);
|
||||
int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]);
|
||||
int var20 = Math.max(var18, var19);
|
||||
|
|
|
@ -280,7 +280,7 @@ public class WorldGenDeadTree3 extends WorldGenerator
|
|||
var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D);
|
||||
var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D);
|
||||
var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D);
|
||||
byte var17 = 0;
|
||||
byte var17 = 2;
|
||||
int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]);
|
||||
int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]);
|
||||
int var20 = Math.max(var18, var19);
|
||||
|
|
Loading…
Reference in a new issue