A coal pile with only one item left in it will be 0 layers tall, which has no hitbox.
public int Layers => inventory[0].StackSize / 2; rounds down, so having 1 coal in the stack will result in 0 layers.
Two possible solutions:
1) Make it so CollisionBoxesByFillLevel[0] isn't empty.
2) Make it so Layers on BlockEntityCoalPile rounds up rather than down, so 1 coal = 1 layer, 3 coal = 2 layers instead of 0 layers and 1 layer respectively.
I would prefer the second, personally.
How to reproduce
Create a coal pile with only one coal remaining.
It has no hitbox and the only way to remove it is by breaking the block beneath it.
Game Version
v1.18.5
Platform
Windows
Modded
Vanilla
SP/MP
Singleplayer
Description
A coal pile with only one item left in it will be 0 layers tall, which has no hitbox.
public int Layers => inventory[0].StackSize / 2;
rounds down, so having 1 coal in the stack will result in 0 layers. Two possible solutions: 1) Make it soCollisionBoxesByFillLevel[0]
isn't empty. 2) Make it soLayers
onBlockEntityCoalPile
rounds up rather than down, so 1 coal = 1 layer, 3 coal = 2 layers instead of 0 layers and 1 layer respectively.I would prefer the second, personally.
How to reproduce
Screenshots
No response
Logs
No response