Open pollend opened 8 years ago
this is my workaround at the moment:
for (Vector3i pos: hasMineBeenMarked) {
if(!pos.equals(blockComponent.getPosition()))
worldProvider.setBlock(pos,blockManager.getBlock(BlockManager.AIR_ID));
}
Not sure if this really needs to be addressed. Should the DoDestroyEvent account for the case when the associated block is changed.
What you were trying to do
https://github.com/pollend/TerasologyMineSweeper
For my minesweeper mod I wanted mines to explode if you mine them. The problem is when you mine an explosive mine and attempt to pick up the blocks on the ground. The game will crash with this exception:
Before that exception was this exception during the explosion:
Walking through the code i noticed addOrUpdateBlockMeshComponent was updating an Airblock component which does not have a mesh. I believe the player might be attempting to pick up an invisible air block on the ground. I haven't examined the condition after picking up blocks on the ground but i suspect that the null reference exception may be due to an air block. Be aware this is after I set the block to air in a DoDestroyEvent.