BentoBoxWorld / BentoBox

Expandable Minecraft server plugin for island-type games like SkyBlock or AcidIsland.
https://bentobox.world
Eclipse Public License 2.0
328 stars 137 forks source link

Feature request: Inventory clear on island reset #1461

Open SlimeDog opened 4 years ago

SlimeDog commented 4 years ago

Description

Describe the bug

Per configuration option island.reset.on-join.inventory: true inventory is cleared. Unfortunately, that includes locked ItemJoin items. It would be nice if such items remained in inventory. In my case, they are used for inter-world navigation and other server-specific features.

Steps to reproduce the behavior

Expected behavior

It would be nice if BSB recognized locked items and left them in the inventory. Recognizing ItemJoin locked items would be fine, but very plugin-specific. As a generic solution: allow (arbitrary) commands that are run at the beginning and end of the reset sequence. Something like:

island:
  reset:
    on-join:
      # Reset inventory - if true, the player's inventory will be cleared.
      # Note: if you have MultiInv running or a similar inventory control plugin, that
      # plugin may still reset the inventory when the world changes.
      inventory: true
      commands-pre-reset: []
      commands-post-reset: []

which for me would be:

      commands-pre-reset: []
      commands-post-reset: 
      - itemjoin:ij getAll

Environment

Output of /bbox version (Mandatory)
>bbox version
[18:01:12] [Server thread/INFO]: Running SPIGOT 1.16.1.
[18:01:12] [Server thread/INFO]: BentoBox version: 1.15.0-SNAPSHOT-b1843
[18:01:12] [Server thread/INFO]: Database: JSON
[18:01:12] [Server thread/INFO]: Loaded Game Worlds:
[18:01:12] [Server thread/INFO]: world_skyblock (SkyBlock): Overworld, [nether_color]Nether, [end_color]End
[18:01:12] [Server thread/INFO]: Loaded Addons:
[18:01:12] [Server thread/INFO]: Biomes 1.13.0-SNAPSHOT-b180 (ENABLED)
[18:01:12] [Server thread/INFO]: BSkyBlock 1.13.0-SNAPSHOT-b601 (ENABLED)
[18:01:12] [Server thread/INFO]: Challenges 0.8.4-SNAPSHOT-b428 (ENABLED)
[18:01:12] [Server thread/INFO]: ExtraMobs 1.11.0.4-SNAPSHOT-b7 (ENABLED)
[18:01:12] [Server thread/INFO]: Level 2.3.3-SNAPSHOT-b399 (ENABLED)

Plugins (Optional)

>version Multiverse-Core
[18:06:19] [Server thread/INFO]: Multiverse-Core version 4.1.1-SNAPSHOT-b777
[18:06:19] [Server thread/INFO]: Website: https://dev.bukkit.org/projects/multiverse-core
[18:06:19] [Server thread/INFO]: Authors: Rigby, fernferret, lithium3141, main-- and dumptruckman
>version Multiverse-Inventories
[18:06:25] [Server thread/INFO]: Multiverse-Inventories version 4.0.0-SNAPSHOT-b469
[18:06:25] [Server thread/INFO]: Author: dumptruckman
>version ItemJoin
[18:01:34] [Server thread/INFO]: ItemJoin version 5.0.7-SNAPSHOT-b474
[18:01:34] [Server thread/INFO]: Get custom items on join.
[18:01:34] [Server thread/INFO]: Website: https://www.spigotmc.org/resources/itemjoin.12661/
[18:01:34] [Server thread/INFO]: Author: RockinChaos
RedstoneFuture commented 3 months ago

https://github.com/BentoBoxWorld/InvSwitcher/issues/27