Psi

Psi

45M Downloads

CAD break block harvests blocks that require specialized tools (e.g. Forestry Scoop on Hives)

BlueAgent opened this issue ยท 2 comments

commented

Minecraft version & Mod Versions:

Minecraft: 1.12.2
Forge: 14.23.5.2847
Psi: r1.1-77
AutoRegLib: 1.3-32
Forestry: 1.12.2-5.8.2.387

Expected Behaviour

CAD should not be able to harvest the Forestry Hive, or not drop bees from the hive.
(Maybe?) Unless you have a scoop as the tool in the main hand, in which it should take damage?

Current behaviour

CAD harvests Forestry Hive successfully without a scoop.
Video Demonstration

Discussion

I believe this bug was introducted in #484 which fixed the mining level being taken from the currently held item the CAD was changed to no longer be considered the combination of a pickaxe, shovel and axe as well as no longer properly checking the tool type required only the harvest level. In addition the PR also fixed an apparant minor bug with the CAD being used to break blocks, which is strange since for anything with a significant break time, iirc, it would just reset the mining progress so the player wouldn't get anywhere with breaking the blocks with a CAD.

Although the PR did fix a something unintended (the ability to use the mining level of another tool with the CAD), it did result in useful gameplay for certain packs being removed, especially ones that have more tiered mining levels, allowing the CAD to scale with a player's progression through the pack.
An example of this is Enigmatica 2 Expert which has custom mining levels. (This is probably a seperate issue).

Potential Solution

Have break block spell check that it is harvestable with a pickaxe, shovel or axe before harvesting.
I think it was correct (implementation before the PR) to reference ForgeHooks::canHarvestBlock.

Additional / Alternative Change (maybe should be another issue?)

Have it configurable to use the old behaviour where it uses main hand tool. (Although maintaining both behaviours is probably a bad idea, should stick with one...)

Another option is you could have it so that break block uses the main hand's tool as if it was used to break the block (it takes damage in that case too which might balance the behaviour?)
This might be unintuitive behaviour though. Vanilla has something similar where you can kill with a bow in the offhand and have a looting sword in the main hand to apply looting at range. You can also apply looting to TNT that you set off, since that counts as a player kill.

Or maybe have a way to upgrade the mining level of the CAD, or another tool to add or something like that.

Related Issues and PRs

#482 (Original Issue) about spells using mining level of held item
#484 (PR fixing the above)

I'm willing to do a PR for this but I think something like this probably needs some discussion before implementation.

commented

Hey! If you could, please make another PR targetting 1.15, I tried merging the changes from master onto 1.15 but that ended up doing absolutely nothing since a lot has changed.

commented

Closing as this is fixed!