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:
parent
f6816e4110
commit
f6ab4fe08c
7 changed files with 64 additions and 9 deletions
|
@ -36,6 +36,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import biomesoplenty.api.block.BOPPlant;
|
import biomesoplenty.api.block.BOPPlant;
|
||||||
import biomesoplenty.api.block.IBOPVariant;
|
import biomesoplenty.api.block.IBOPVariant;
|
||||||
|
import biomesoplenty.common.block.BlockBOPMushroom.MushroomType;
|
||||||
import biomesoplenty.common.util.inventory.CreativeTabBOP;
|
import biomesoplenty.common.util.inventory.CreativeTabBOP;
|
||||||
|
|
||||||
public class BlockBOPFlower extends BOPPlant
|
public class BlockBOPFlower extends BOPPlant
|
||||||
|
@ -47,7 +48,27 @@ public class BlockBOPFlower extends BOPPlant
|
||||||
super(VARIANT_PROP);
|
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 enderlotus require spectral moss
|
||||||
//TODO: Make bromeliads require hard dirt, hardened clay or sand
|
//TODO: Make bromeliads require hard dirt, hardened clay or sand
|
||||||
|
|
|
@ -25,6 +25,12 @@ public class BlockBOPLog extends BlockBOPLogBase
|
||||||
super(VARIANT_PROP);
|
super(VARIANT_PROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(IBlockState state)
|
||||||
|
{
|
||||||
|
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +83,7 @@ public class BlockBOPLog extends BlockBOPLogBase
|
||||||
@Override
|
@Override
|
||||||
public int getDefaultMetadata()
|
public int getDefaultMetadata()
|
||||||
{
|
{
|
||||||
return this.ordinal() * 3;
|
return this.ordinal() * 3 + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,12 @@ public class BlockBOPLog2 extends BlockBOPLogBase
|
||||||
super(VARIANT_PROP);
|
super(VARIANT_PROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(IBlockState state)
|
||||||
|
{
|
||||||
|
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
|
@ -76,7 +82,7 @@ public class BlockBOPLog2 extends BlockBOPLogBase
|
||||||
@Override
|
@Override
|
||||||
public int getDefaultMetadata()
|
public int getDefaultMetadata()
|
||||||
{
|
{
|
||||||
return this.ordinal() * 3;
|
return this.ordinal() * 3 + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,12 @@ public class BlockBOPLog3 extends BlockBOPLogBase
|
||||||
super(VARIANT_PROP);
|
super(VARIANT_PROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(IBlockState state)
|
||||||
|
{
|
||||||
|
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
|
@ -76,7 +82,7 @@ public class BlockBOPLog3 extends BlockBOPLogBase
|
||||||
@Override
|
@Override
|
||||||
public int getDefaultMetadata()
|
public int getDefaultMetadata()
|
||||||
{
|
{
|
||||||
return this.ordinal() * 3;
|
return this.ordinal() * 3 + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,12 @@ public class BlockBOPLog4 extends BlockBOPLogBase
|
||||||
super(VARIANT_PROP);
|
super(VARIANT_PROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(IBlockState state)
|
||||||
|
{
|
||||||
|
return this.getMetaFromState(this.getDefaultState().withProperty(VARIANT_PROP, state.getValue(VARIANT_PROP)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta)
|
public IBlockState getStateFromMeta(int meta)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +78,7 @@ public class BlockBOPLog4 extends BlockBOPLogBase
|
||||||
@Override
|
@Override
|
||||||
public int getDefaultMetadata()
|
public int getDefaultMetadata()
|
||||||
{
|
{
|
||||||
return this.ordinal() * 3;
|
return this.ordinal() * 3 + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.world.World;
|
||||||
import biomesoplenty.api.block.BOPBlock;
|
import biomesoplenty.api.block.BOPBlock;
|
||||||
import biomesoplenty.common.util.inventory.CreativeTabBOP;
|
import biomesoplenty.common.util.inventory.CreativeTabBOP;
|
||||||
|
|
||||||
//TODO: Commented methods and calls
|
|
||||||
public abstract class BlockBOPLogBase extends BOPBlock
|
public abstract class BlockBOPLogBase extends BOPBlock
|
||||||
{
|
{
|
||||||
public static final PropertyEnum AXIS_PROP = PropertyEnum.create("axis", EnumFacing.Axis.class);
|
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.setDefaultState(this.getDefaultState().withProperty(AXIS_PROP, EnumFacing.Axis.Y));
|
||||||
|
|
||||||
//this.setHarvestLevel("axe", 0);
|
this.setHarvestLevel("axe", 0);
|
||||||
|
|
||||||
this.setHardness(2.0F);
|
this.setHardness(2.0F);
|
||||||
this.setResistance(5.0F);
|
this.setResistance(5.0F);
|
||||||
|
|
|
@ -29,7 +29,18 @@ public class BlockBOPMushroom extends BOPPlant
|
||||||
super(VARIANT_PROP);
|
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
|
@Override
|
||||||
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
|
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
|
||||||
|
|
Loading…
Reference in a new issue