mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-02-10 08:00:05 +00:00
![Jonathan Coates](/assets/img/avatar_default.png)
Computer drops are currently[^1] implemented via a dynamic drop. To support this, we need to inject the dynamic drop into the loot parameters. We currently do this by implementing our own drop logic in playerWillDestroy[^2], manually creating the loot params and adding our additional drop. However, if the item is dropped via some other method (such as via explosions), we'll go through vanilla's drop logic and so never add the dynamic drop! The correct way to do this is to override getDrops to add the dynamic drop instead. I don't know why we didn't always do this -- the code in question was first written for MC 1.14[^3], when things were very different. [^1]: This is no longer the case on 1.21, where we can just copy capabilities. [^2]: We need to override vanilla's drop behaviour to ensure items are dropped in creative mode. [^3]: See 594bc4203c6470e624a5f5e5edb2436590d1706c. Which probably means the bug has been around for 5 years :/.