Browse Source

fix: Snow-covered flowers dropping while broken in creative

merge-requests/32/head
Brandon Pearce 2 years ago
parent
commit
353800d53d
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      src/main/java/com/gildedgames/aether/common/blocks/natural/plants/BlockAetherFlower.java

+ 4
- 6
src/main/java/com/gildedgames/aether/common/blocks/natural/plants/BlockAetherFlower.java View File

@@ -55,7 +55,8 @@ public class BlockAetherFlower extends BlockAetherPlant implements IBlockMultiNa
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX,
float hitY, float hitZ)
{
ItemStack main = playerIn.getHeldItemMainhand();
ItemStack offhand = playerIn.getHeldItemOffhand();
@@ -88,14 +89,11 @@ public class BlockAetherFlower extends BlockAetherPlant implements IBlockMultiNa
}

@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state)
{
super.breakBlock(world, pos, state);

if (state.getValue(PROPERTY_SNOWY))
{
dropBlockAsItem(world, pos, state, 1);
world.setBlockState(pos, Blocks.SNOW_LAYER.getDefaultState().withProperty(BlockSnow.LAYERS, 1), 2);
worldIn.setBlockState(pos, Blocks.SNOW_LAYER.getDefaultState().withProperty(BlockSnow.LAYERS, 1), 2);
}
}



Loading…
Cancel
Save