codetaylor / dropt-1.12

Flexible block drop strategies.
https://minecraft.curseforge.com/projects/dropt
Other
6 stars 2 forks source link

harvester type: explosive #49

Closed WarlordWossman closed 5 years ago

WarlordWossman commented 5 years ago

Currently we got the harvester types player, non-player and any, I think it would be very cool if I could specify that explosives have to break a block to get a specific drop from it. Would enable a lot of cool in world crafting options with explosives, creepers etc.

codetaylor commented 5 years ago

I could hook the ExplosionEvent.Detonate and cache the list of affected blocks when an explosion happens. Then, in the BlockEvent.HarvestDropsEvent, check if the broken block is in the list of explosion affected blocks and, finally, clear the cache of explosion affected blocks.

The cache couldn't be cleared from the harvest drops event, because that event is fired for every block. It would have to be cleared during the ServerTickEvent's END phase.

This is doable.

codetaylor commented 5 years ago

Feature available in version 1.12.2-1.13.0