Files
2019-02-24 22:29:41 +08:00

68 lines
2.9 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -13,7 +13,7 @@
public abstract class BlockLog extends BlockRotatedPillar
{
- public static final PropertyEnum<BlockLog.EnumAxis> LOG_AXIS = PropertyEnum.<BlockLog.EnumAxis>create("axis", BlockLog.EnumAxis.class);
+ public static final PropertyEnum<EnumAxis> LOG_AXIS = PropertyEnum.<EnumAxis>create("axis", EnumAxis.class);
public BlockLog()
{
@@ -34,9 +34,9 @@
{
IBlockState iblockstate = worldIn.getBlockState(blockpos);
- if (iblockstate.getMaterial() == Material.LEAVES && !((Boolean)iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue())
+ if (iblockstate.getBlock().isLeaves(iblockstate, worldIn, blockpos))
{
- worldIn.setBlockState(blockpos, iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4);
+ iblockstate.getBlock().beginLeavesDecay(iblockstate, worldIn, blockpos);
}
}
}
@@ -44,7 +44,7 @@
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
- return this.getStateFromMeta(meta).withProperty(LOG_AXIS, BlockLog.EnumAxis.fromFacingAxis(facing.getAxis()));
+ return this.getStateFromMeta(meta).withProperty(LOG_AXIS, EnumAxis.fromFacingAxis(facing.getAxis()));
}
public IBlockState withRotation(IBlockState state, Rotation rot)
@@ -54,12 +54,12 @@
case COUNTERCLOCKWISE_90:
case CLOCKWISE_90:
- switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS))
+ switch ((EnumAxis)state.getValue(LOG_AXIS))
{
case X:
- return state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
+ return state.withProperty(LOG_AXIS, EnumAxis.Z);
case Z:
- return state.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
+ return state.withProperty(LOG_AXIS, EnumAxis.X);
default:
return state;
}
@@ -69,6 +69,9 @@
}
}
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
public static enum EnumAxis implements IStringSerializable
{
X("x"),
@@ -88,7 +91,7 @@
return this.name;
}
- public static BlockLog.EnumAxis fromFacingAxis(EnumFacing.Axis axis)
+ public static EnumAxis fromFacingAxis(EnumFacing.Axis axis)
{
switch (axis)
{