aromaa / WorldGuardExtraFlags

Extension for the WorldGuard plugin.
https://www.spigotmc.org/resources/worldguard-extra-flags.4823
MIT License
88 stars 70 forks source link

[Bug] Keep-inventory not dropping items on death if gamerule keep inventory true is set #229

Open rm20killer opened 1 year ago

rm20killer commented 1 year ago

Steps to reproduce: 1) Install WorldGuard & WorldGuardExtraFlags 2) Create a region with "Keep-inventory" flags set to false and /gamerule keepInventory true 3) kill player inside the region

Expected result: Player drops items on the ground when killed.

Actual results: Player inventory is cleared and items are not dropped.

aromaa commented 1 year ago

This is a tricky area because the list of items that are going to be dropped is empty due to the world having keep inventory on. But it's somewhat straight forward to fix as you can set the drop content to be the whole inventory minus items with vanishing enchantment but this would need to be manually specified and is a bit fragile in my opinion. Also due to the way plugins could alter the drop list based on its content is somewhat worrying to me as this could lead to several incompatibilities with other plugins. But I guess that should not be as big worry as those should have specified higher priority than normal.

I was actually aware of this issue and decided to not implement any fixes for it due to the problematic edge cases and just take another look at it if someone complained about it.

As a workaround, you can remove the keep inventory game rule and set it to the global region. This way everything actually just works.

BoudewijnPopkema commented 5 months ago

This workaround doesn't seem to work anymore. I have the gamerule set to false, keepInventory set to allow on the global region and set to deny for my subregion, I lose my items on death but they don't drop. Outside of the subregion I keep them as intended.

aromaa commented 5 months ago

Plugins are known to conflict with the the keep inventory flag itself. Most likely the case here too.