Shopkeepers

Shopkeepers

2M Downloads

Allow creating shops with chests directly next to each other if those are not connected chests (or of different type)

blablubbabcDEV opened this issue ยท 3 comments

commented

Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/382

Originally posted by blablubbabc (Mar 31, 2016):

In minecraft it is possible to place normal and trapped-chests next to each other, without them connecting.
Currently shopkeepers doesn't allow creating shops on chests which are next to a chest which is already used by another shop.Maybe allow creating shops, if the chest next to it is of different type.

commented

Originally commented by blablubbabc (Mar 31, 2016):

Okay, I have looked into this, and I can think of the following problem which makes this more difficulty to implement than originally thought:

A player creates a double chest and puts a few items into it.
A player creates a shopkeeper, using one half of this double chest as 'shop-chest' (the shop will actually use the whole double chest content though).
The player (or something else) destroys the shop-chest-half of the double chest.
Now: Currently, the shopkeeper won't work anymore, however the items will stay in the other, remaining half of the previous double chest, and as that block is next to the 'shop-chest-block' of the shopkeeper, it is kept protected as long as the shopkeeper keeps existing.
However, with the change proposed above, that chest next to it will no longer be protected.

To workaround this situation, I would have to persistently store the chest type (which I currently prefer not to do..), so I can compare the chest type to the block next to the shop-chest-location, and only protect that other chest if their types are the same.

Edit (2018): Or simply accept this change in behavior. The new criterion for chest protection would then simply be: The chest is connected to a neighboring shop chest.

        Edited Mar 31, 2016
commented

Fixed in v2.5.0

commented

I have made some changes to the chest protection for the next update which is a lot less strict regarding placement of adjacent chests, hoppers, droppers and rails. I did some basic testing and haven't found any issues with it so far, but if someone else wants to take a look at it before I release it that would be great.
A snapshot containing these changes is available here, if someone wants to try it and provide some feedback / look for issues: nexus3.cube-nation.de/repository/snapshots/com/nisovin/shopkeepers/Shopkeepers/2.4.2-SNAPSHOT/Shopkeepers-2.4.2-20180918.210005-1.jar
A summary of the changes can be found here: d902d1b