Fixed the light values for glowshrooms, glow flowers, enderlotus and burning blossoms and fixed an issue with incorrect/untextured log drops

This commit is contained in:
Adubbz 2014-12-01 19:21:52 +11:00
parent f6816e4110
commit f6ab4fe08c
7 changed files with 64 additions and 9 deletions

View File

@ -36,6 +36,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import biomesoplenty.api.block.BOPPlant;
import biomesoplenty.api.block.IBOPVariant;
import biomesoplenty.common.block.BlockBOPMushroom.MushroomType;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
public class BlockBOPFlower extends BOPPlant
@ -47,7 +48,27 @@ public class BlockBOPFlower extends BOPPlant
super(VARIANT_PROP);
}
//TODO: Add light for glowflowers, enderlotus and the burning blossom (Requires Forge)
@Override
public int getLightValue(IBlockAccess world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
FlowerType type = (FlowerType)state.getValue(VARIANT_PROP);
switch (type)
{
case GLOWFLOWER:
return 9;
case ENDERLOTUS:
return 5;
case BURNING_BLOSSOM:
return 9;
default:
return super.getLightValue();
}
}
//TODO: Make enderlotus require spectral moss
//TODO: Make bromeliads require hard dirt, hardened clay or sand

View File

@ -24,7 +24,13 @@ public class BlockBOPLog extends BlockBOPLogBase
{
super(VARIANT_PROP);
}
@Override
public int damageDropped(IBlockState state)
{
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
}
@Override
public IBlockState getStateFromMeta(int meta)
{
@ -77,7 +83,7 @@ public class BlockBOPLog extends BlockBOPLogBase
@Override
public int getDefaultMetadata()
{
return this.ordinal() * 3;
return this.ordinal() * 3 + 1;
}
}
}

View File

@ -24,6 +24,12 @@ public class BlockBOPLog2 extends BlockBOPLogBase
super(VARIANT_PROP);
}
@Override
public int damageDropped(IBlockState state)
{
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
}
@Override
public IBlockState getStateFromMeta(int meta)
{
@ -76,7 +82,7 @@ public class BlockBOPLog2 extends BlockBOPLogBase
@Override
public int getDefaultMetadata()
{
return this.ordinal() * 3;
return this.ordinal() * 3 + 1;
}
}
}

View File

@ -24,6 +24,12 @@ public class BlockBOPLog3 extends BlockBOPLogBase
super(VARIANT_PROP);
}
@Override
public int damageDropped(IBlockState state)
{
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
}
@Override
public IBlockState getStateFromMeta(int meta)
{
@ -76,7 +82,7 @@ public class BlockBOPLog3 extends BlockBOPLogBase
@Override
public int getDefaultMetadata()
{
return this.ordinal() * 3;
return this.ordinal() * 3 + 1;
}
}
}

View File

@ -23,6 +23,12 @@ public class BlockBOPLog4 extends BlockBOPLogBase
{
super(VARIANT_PROP);
}
@Override
public int damageDropped(IBlockState state)
{
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
}
@Override
public IBlockState getStateFromMeta(int meta)
@ -72,7 +78,7 @@ public class BlockBOPLog4 extends BlockBOPLogBase
@Override
public int getDefaultMetadata()
{
return this.ordinal() * 3;
return this.ordinal() * 3 + 1;
}
}
}

View File

@ -19,7 +19,6 @@ import net.minecraft.world.World;
import biomesoplenty.api.block.BOPBlock;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
//TODO: Commented methods and calls
public abstract class BlockBOPLogBase extends BOPBlock
{
public static final PropertyEnum AXIS_PROP = PropertyEnum.create("axis", EnumFacing.Axis.class);
@ -30,7 +29,7 @@ public abstract class BlockBOPLogBase extends BOPBlock
this.setDefaultState(this.getDefaultState().withProperty(AXIS_PROP, EnumFacing.Axis.Y));
//this.setHarvestLevel("axe", 0);
this.setHarvestLevel("axe", 0);
this.setHardness(2.0F);
this.setResistance(5.0F);

View File

@ -29,7 +29,18 @@ public class BlockBOPMushroom extends BOPPlant
super(VARIANT_PROP);
}
//TODO: Add light for glowshrooms (Requires Forge)
@Override
public int getLightValue(IBlockAccess world, BlockPos pos)
{
IBlockState blockState = world.getBlockState(pos);
if ((MushroomType)blockState.getValue(VARIANT_PROP) == MushroomType.GLOWSHROOM)
{
return 6;
}
return super.getLightValue();
}
@Override
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)