Headhunter enchant not processed
Ipsis opened this issue ยท 2 comments
Due to a change in the processing of the LivingDropEvent the following currently happens:
if e.getEntity != EntityLiving
return
if no damage source
return
if the thing that caused the damage isn't our factory fake player
return
process drops
process EnchantHeadhunter
This of course means that we don't process the Headhunter enchant if the factory didn't cause the kill.
The Headhunter enchant therefore does NOTHING :(
The code needs to change to do the following:
if e.getEntity != EntityLiving
return
if no damage source
return
if the thing that caused the damage isn't our factory fake player
process EnchantHeadhunter
return
process drops
Someone did mention they were having problems with the enchant on reddit, but the assumption that I made was that the enchant was working (as it was before) and it was just the interaction with another mod.
Clearly I've broken the enchant at some point but not noticed.
Old code
/woot dev debug event
/woot dev debug decap
[11:19:43] [Server thread/INFO]: Woot: onLivingDropsEvent: net.minecraftforge.event.entity.living.LivingDropsEvent@35be9a30
[11:19:43] [Server thread/INFO]: Woot: onLivingDropsEvent: non-factory kill
New code
/woot dev debug event
/woot dev debug decap
[11:21:14] [Server thread/INFO]: Woot: onLivingDropsEvent: net.minecraftforge.event.entity.living.LivingDropsEvent@527c9f2e
[11:21:14] [Server thread/INFO]: Woot: onLivingDropsEvent: non-factory kill
[11:21:14] [Server thread/INFO]: Woot: EnchantmentHeadhunter:handleLivingDrops: net.minecraftforge.event.entity.living.LivingDropsEvent@527c9f2e
[11:21:14] [Server thread/INFO]: Woot: EnchantmentHeadhunter:handleLivingDrops: headhunterLevel:1
[11:21:14] [Server thread/INFO]: Woot: EnchantmentHeadhunter:hasDecapitated: rolled:0.09966844 chance:0.3
[11:21:14] [Server thread/INFO]: Woot: EnchantmentHeadhunter:handleLivingDrops: skull:1xitem.skull@4