garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
189 stars 150 forks source link

Added config option `keep-drops` which allows players to keep items t… #751

Closed Fisher2911 closed 4 months ago

Fisher2911 commented 1 year ago

…hey find in the arena

Summary

It adds the config option keep-drops which allows players to keep items from the arena after is is complete.

Problem

It is just an extra feature that could be helpful for people who want mob drops or other items to be kept.

Solution

I made it so that when the player joins the arena, PDC is set to all their items to identify them. Then, when the player leaves, the items with the PDC are removed from the inventory, and the rest of the items are stored. Then, after the player's inventory has been reset, the extra items are added back to their inventory.

Action

It would be helpful if you could review it to make sure I didn't miss any areas where players' inventories are cleared and restored.

garbagemule commented 1 year ago

Thanks for submitting an issue and a pull request!

I'm not entirely sure what the proper way to accommodate something like this would be, but I'd be happy to review the PR after a cleanup. There are way too many formatter-related changes that should not be included. The best approach is probably to disable all formatter automations in your IDE and change/add just the lines necessary for the implementation to work.

garbagemule commented 4 months ago

Closing this to clear out stale PRs. There's still way too much noise in this PR. The overall idea is fine, but the implementation is a bit too "creative", and the execution is messy. I think an easier way around this would be to build on top of the rewards system and just add drops as rewards when they get picked up, similar to how keep-exp works. Worth a try!