Dropt

Dropt

3M Downloads

Silk touch not working as expected with mod Geolosys

codetaylor opened this issue ยท 3 comments

commented

Hey there,
I've been having some trouble getting the silktouch rule to work with dropt, and was wondering if you could help. I'm trying to customize the drops for an ore block, where fortune 0-1 drops 1-2 items and fortune 2-3 drops 2-3 items. However, I also want this ore to drop a specific block when mined with silk touch. I attempt to accomplish this by having all of the non-silk methods have "silktouch": "EXCLUDED" while the silk method has "silktouch": "REQUIRED". In game however, only the "EXCLUDED" drops are selected, even when using a silk touch enchanted pickaxe. Am I doing something wrong with this file? Is the "silktouch" method busted?

Here is the drop file in question: https://pastebin.com/9t6a0mzL

commented

The drop file looks fine with the exception of the negative weight value. Weight should be >= 1. This is not the source of your issue however.

Investigation revealed that the event, BlockEvent.HarvestDropsEvent, for the Geolosys ore in question always returns false for silk touch. This is due to how Geolosys handles silk touch.

https://github.com/oitsjustjose/Geolosys/blob/master/src/main/java/com/oitsjustjose/geolosys/blocks/BlockOre.java#L159

The line indicated above will only allow geolosys:ore:0 and geolosys:ore:1 to be silk touched.

Off the top of my head I can think of two possible solutions to this problem. One would be to request a Geolosys config feature to allow silk touching all blocks. The other solution would be to change Dropt so it doesn't rely on the event to tell it if the player is silk touching, instead it would interrogate the item the player is holding to determine if it is appropriately enchanted.

The first solution will solve this specific problem, but will not help in other cases where a mod has disabled silk touch on a block.

The second solution will solve more cases, but may not catch cases where a modded silk touch alternative, like a Tinker's trait, is used. I will have to look into that.

I will likely implement the workaround on my end in the future.

commented

Additional silk touch checks applied in 1.12.2-1.9.3

commented

Interesting! Part of the reason I was looking to do this was because I don't like the default behavior of geolosys with regards to silk touch. Thanks for adding this feature!