Botania (Fabric/Quilt)

Botania (Fabric/Quilt)

5M Downloads

Bore Lens Bypasses Block Break

lucidobservor opened this issue ยท 0 comments

commented

Version Information

Forge version: 14.23.4.2756
Botania version: r-1.10-356

Further Information

When the bore lens breaks a block, it doesn't actually "break" the block. Rather it gets the drops for that block, then manually sets the block to air. See code from LensMine.java:

block.getDrops(items, world, pos_, world.getBlockState(pos_), 0);

if(!burst.hasAlreadyCollidedAt(pos_)) {
	if(!burst.isFake() && !entity.world.isRemote) {
		world.setBlockToAir(pos_);
		// ...
	}
}

Since this doesn't generate an onBlockBreakEvent, bore lenses don't function with any mod that changes block drops, such as Dropt or Block Drop Tweaker. If the drops for a block are tweaked using either of those mods, then the tweaks work when mining manually or with Quark's iron rod, but not when broken with a bore lens.

Steps to reproduce:

  1. Install Dropt
  2. Add the following JSON file to /config/dropt/
{
	"rules": [{
		"match": {
			"drops": {
				"drops": [
					"ore:gemLapis"
				]
			}
		},
		"replaceStrategy": "REPLACE_ITEMS_IF_SELECTED",
		"drops": [{
			"item": {
				"items": [
					"minecraft:stone"
				]
			}
		}]
	}]
}
  1. Place two blocks of lapis ore. Break one with a pickaxe, and break the other with a bore lens.

What I expected to happen: Both methods of breaking the block of lapis ore result in the same thing, one block of smooth stone being dropped.

What happened instead: Breaking the lapis ore with a pickaxe dropped one smooth stone, as expected. Breaking the lapis ore with a bore lens dropped 4-8 lapis, as if the drops were unmodified.