BentoBoxWorld / BentoBox

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

Bridge between bbox and shop plugins #1641

Open VozikCZE opened 3 years ago

VozikCZE commented 3 years ago

Description

Is your feature request related to a problem?

If player creates for expample shop for QuickShop and he restart his island, shop will be still in database. And if the shop was on location where is chest on starting island, player can not open and destroy it.

Describe the solution you'd like us to implement.

Make bridge plugin between bbox and some shop plugins and delete shops on island.

Additional context

Same thing have AdvancedRegionMarket, they have bridge plugin that is solving it: https://www.spigotmc.org/resources/advancedregionmarket-shop-bridge.77484/

image

BONNe commented 3 years ago

Well, the Advanced Region Market Shop Bridge should implement like this, not BentoBox.

As it would make more sense, then hooking it into BentoBox, just to remove them.

If there would be more functions that would be necessary for BentoBox, we could add a hook, but in this situation... I would say no implementation from our side.

BONNe commented 3 years ago

Like there is just 1 or 2 listeners (depending on if unregister should be considered)

    /**
     * This method handles Island Unregister event.
     *
     * @param event Event that must be handled.
     */
    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onIslandUnregister(IslandUnregisteredEvent event)
    {
        Island island = event.getIsland();
        BoundingBox area = event.getIsland().getProtectionBoundingBox();

        // Do stuff what you need.
    }

    /**
     * This method handles Island Deletion
     *
     * @param event Event that must be handled.
     */
    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onIslandDelete(IslandDeleteEvent event)
    {
        Island island = event.getIsland();
        BoundingBox area = event.getIsland().getProtectionBoundingBox();

        // Do stuff what you need.
    }
Poslovitch commented 3 years ago

I agree with Bonne. It sounds like something we could do, but it'd be better to have the shop plugins do the job themselves.

I'll keep this issue open for now.