Bassebombecraft

Bassebombecraft

18.5k Downloads

1.14.3: Book of digging/small hole doesn't dig expected hole

Closed this issue ยท 2 comments

commented

The book should dig a hole of either sizes:

public class BuildSmallHole implements BlockClickedItemAction {

	Structure createHorizontalStructure() {
		CompositeStructure composite = new CompositeStructure();
		BlockPos offset = new BlockPos(-1, -1, -1);
		BlockPos size = new BlockPos(3, 1, 3);
		composite.add(createAirStructure(offset, size));
		return composite;
	}

	Structure createVerticalStructure() {
		CompositeStructure composite = new CompositeStructure();
		BlockPos offset = new BlockPos(-1, 0, 0);
		BlockPos size = new BlockPos(3, 3, 1);
		composite.add(createAirStructure(offset, size));
		return composite;
	}

commented

Solution:
The method BlockPos.getAllInBox(from, to) where returning of stream of mutable BlockPos,
The create block directive would all end up with the same BlockPos instances and with the same position.
The solution was to create an immutable BlockPos when a block directive is created.

commented

Close with commit 4cb3327.