Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please, allow configure additional signs #562

Open
2 tasks done
vgrynch opened this issue Aug 12, 2023 · 7 comments
Open
2 tasks done

Please, allow configure additional signs #562

vgrynch opened this issue Aug 12, 2023 · 7 comments
Labels
enhancement For addition requests server issue Issues caused by the used server (Spigot/Paper/etc.)

Comments

@vgrynch
Copy link

vgrynch commented Aug 12, 2023

Is your feature request related to a problem? Please describe.

Would be good if, in addition to the list of supported containers, we could specify the list of signs allowed to use. Custom data packs and hybrid server (modded) content may add new signs.

Describe the solution you'd like

ChestShop works great with the custom modded or custom data pack chests added (with a custom namespace) when added to the list of supported containers. I hope, since there is already some support for custom namespace chests, it would not be hard to allow specifying additional signs for use.

Describe alternatives you've considered

No response

Agreements

  • I have checked if there are already similar issues open.
  • I have checked that the latest build doesn't already implement the feature.

Additional context

No response

@vgrynch vgrynch added the enhancement For addition requests label Aug 12, 2023
@Phoenix616
Copy link
Member

With which datapack/mod do you have issues with? Because the current code should already work with any block which behaves like a proper sign.

@vgrynch
Copy link
Author

vgrynch commented Aug 13, 2023

I use BYG.
Behaves - right, but, unfortunately, I doubt the plugin would always know well that certain custom items have the required behavior (belongs to certain types of items). This exactly happens in my case. That's why I propose adding a new config parameter to force ChestShop to know it is a sign. Just allow adding custom items into a list of supported signs, the same way as for chests. Custom chests work great!

To add some context (I'm Java developer, but do not know well internals of Minecraft):
All modded items are exposed to the plugins on the server I'm using in the form of {namespace}_{id}. For example, for the sign on the image below, it will be "BYG_LAMENT_SIGN".

So, something in the config file like:

.............

# What signs are allowed to hold a shop?
SIGNS:
- "SIGN"
- "BYG_LAMENT_SIGN"

# What containers are allowed to hold a shop? (Only blocks with inventories work!)
SHOP_CONTAINERS: 
- "CHEST"
- "TRAPPED_CHEST"

...............

(Make sure you do not access custom items using "minecraft" namespace - some plugins fail to work with custom items exactly because of that.)

image

@Phoenix616
Copy link
Member

So if I read this right then there is no issue in you case? That's good to hear that the code indeed works as I expected.

As I said: Any custom block that behaves like a sign is supported. (As long as the mod and the server implementation implements the Bukkit API properly) The type of the sign block is not checked anywhere in the plugin.

The only reason why there is a config for containers is because the plugin is meant for chests in the first place and people might not want to allow specific container types/sizes, especially as they might have special behaviour different from a chest (e.g. a Dropper). That's not something that is part of signs in Minecraft so I personally don'f t see a need for this.

I'm of course open for a proper PR if you really want to add/get someone to add it.

@vgrynch
Copy link
Author

vgrynch commented Aug 13, 2023

No, it does not work in my case, you can see it in the last image. ChestShop simply does not recognize it as a sign. Maybe I can fix it somehow with a data pack or additional tags? Any known examples of making a "correct" custom sign item that works with ChestShop?

@Phoenix616
Copy link
Member

Phoenix616 commented Aug 13, 2023

@vgrynch Ah, I see. The text was pretty hard to read on there.

Contact support of your server software then. They are not properly implementing the Bukkit/Spigot API, there is nothing I can do about your issue as there is no "list of allowed sign blocks" in ChestShop which would be blocking this.

@Phoenix616 Phoenix616 added the server issue Issues caused by the used server (Spigot/Paper/etc.) label Aug 13, 2023
@vgrynch
Copy link
Author

vgrynch commented Aug 13, 2023

You mean this event, right?

import org.bukkit.event.block.SignChangeEvent;
import static com.Acrobot.ChestShop.Permission.OTHER_NAME_DESTROY;
/**
* @author Acrobot
*/
public class SignCreate implements Listener {
@EventHandler(ignoreCancelled = true)
public static void onSignChange(SignChangeEvent event) {

I will contact them and check what they say. Please, do not close this ticket for now.

@Phoenix616
Copy link
Member

That's the main listener for shop creation, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For addition requests server issue Issues caused by the used server (Spigot/Paper/etc.)
Projects
None yet
Development

No branches or pull requests

2 participants