Fixed branch block break sound and particles.
@@ -68,7 +68,7 @@ public abstract class BranchBlock extends BlockWithDynamicHardness implements IT
}
public BranchBlock(Properties properties) {
- super(properties.noDrops().harvestTool(ToolType.AXE).harvestLevel(0)); //removes drops from block
+ super(properties); //removes drops from block
}
public BranchBlock setCanBeStripped(boolean truth){
@@ -435,6 +435,9 @@ public abstract class BranchBlock extends BlockWithDynamicHardness implements IT
final BlockRayTraceResult ragTraceResult = this.playerRayTrace(entity, reachDistance, 1.0F);
final Direction toolDir = ragTraceResult != null ? (entity.isShiftKeyDown() ? ragTraceResult.getDirection().getOpposite() : ragTraceResult.getDirection()) : Direction.DOWN;
+ // Play and render block break sound and particles (must be done before block is broken).
+ world.levelEvent(null, 2001, cutPos, getId(state));
+
// Do the actual destruction.
final BranchDestructionData destroyData = this.destroyBranchFromNode(world, cutPos, toolDir, false, entity);
@@ -455,7 +458,7 @@ public abstract class BranchBlock extends BlockWithDynamicHardness implements IT
FallingTreeEntity.dropTree(world, destroyData, woodDropList, DestroyType.HARVEST);
// Damage the axe by a prescribed amount.
- this.damageAxe(entity, heldItem, getRadius(state), woodVolume, true);
+ this.damageAxe(entity, heldItem, this.getRadius(state), woodVolume, true);
}
/**
@@ -602,7 +605,6 @@ public abstract class BranchBlock extends BlockWithDynamicHardness implements IT
destroyMode = DynamicTrees.DestroyMode.SLOPPY; // Ready the state machine for sloppy breaking again.
}
- // Super member also does nothing
@Override
public void playerWillDestroy(World world, BlockPos pos, BlockState state, PlayerEntity player) {
}
