
[Question] Add support for Mattocks for Khendral Knights
016Nojr opened this issue ยท 3 comments
Can you add support for Tinkers Construct mattocks so Khendral Knights doesnt spawn when using a mattock.
If I understand correctly:
The check for whether to spawn the Khendral Knight, is whether isToolEffective(event.getState(), event.getHarvester().getHeldItemMainhand())
in MobSpawnEventHandler.java returns false.
This isToolEffective function, checks if one is holding nothing, and if not, checks if either the type of tool one is using is "shovel" (which it is not; it is a mattock) or if state.getBlock().getHarvestLevel(state)
returns true. So, we would need this function to return true.
In forge MDK's Block.java, isToolEffective checks if the type queried is equal to getHarvestTool(state). getHarvestTool():
/**
* Queries the class of tool required to harvest this block, if null is returned
* we assume that anything can harvest this block.
*/
So, it appears to only check if the tool is a single, specified type that is defined to be the type for the block. This will not work, if multiple types of tools can harvest the block, as is the case with Tinker's Construct.
To be fair though, I don't know Java well, so could be misunderstanding that last getHarvestTool() function.
Woah, I just got pinged. What a blast from the past! Github says I'm subscribed to this issue because I commented on this thread. Yet, I do not see my comment. Perhaps it was deleted? I wonder why? I always try to be polite and helpful on issue trackers.