Nokorbis / ar-command-signs

Minecraft (Spigot) plugin that allows to transform some blocks (Signs, plates and buttons) into a Commands executor
https://www.spigotmc.org/resources/command-signs.10512/
Apache License 2.0
13 stars 10 forks source link

Redstone support for Commandsigns #52

Open Akasus opened 4 years ago

Akasus commented 4 years ago

Hello this isnt an issue.

More a question. Is it possible to add Redstone support to your plugin? Like you can Run CMDS with redstone power also with inverted Signal support.

Nokorbis commented 4 years ago

This is not supported no. The closest is Tripwire support.

Akasus commented 4 years ago

when i want to add it by my own, which class you would prefer to add it ?

Akasus commented 4 years ago

in executeTasks i found this section:

@Override
    public void run() {
        final Player player = this.executor.getPlayer();
        if (player != null) {
            try {
                if (player.isOnline() && !player.isDead()) {
                    this.executor.execute();
                }
            }
            catch (CommandSignsException e) {
                Bukkit.getScheduler().runTask(CommandSignsPlugin.getPlugin(), () -> player.sendMessage(e.getMessage()));
            }
            finally {
                this.executor.stopPlayerTask(this);
            }
        }
    }

is this the event when player clicks on it ?

Nokorbis commented 4 years ago

Not exactly Events are received in the CommandSignListener (controller package)

There, there is a executeCommandBlock method that triggers the command sign

Akasus commented 4 years ago

Thanks for that. I hope I get some working stuff out :D

Akasus commented 4 years ago

How do you choose between the possible Blocks (Sign,Lever) to Generate the Individual menu.

Because only the Lever has the ActivationMode where you did this ?

Nokorbis commented 4 years ago

There is a method to override in the EditionMenu "shouldBeDisplayed"

It is overriden in CoreMenuActivationMode

Akasus commented 4 years ago

ok i wont destroy the functionality of your base so i try to Implement it via Addon

Nokorbis commented 4 years ago

I'm a bit curious, wouldn't it be easier for you to simply use the game's base CommandBlock if you need redstone ?

Akasus commented 4 years ago

Maybe it will, but its still more comfortable with your plugin to do the stuff i want. Also im not good at coding on a CommandBlock... even its simple. also i want unified using. Like run specify commands wenn a train goes over an detection rail. stuff like that. i also dont like CommandBlocks because they not really safe.

Akasus commented 4 years ago

Ok i got a new idea out of that what i wanna to do. but i dont know exactly where i get started...

I want to write a new Plugin to make Scriptable Books tha you can enchant on Blocks or items. with a customized Scripting Language that supports custom variables than can be used like placeholders when you like to execute commands z.B(the Players X coordinate + 100) and stuff like that. Even get scripts on Cubes and Execute them over PlayerClickEvent or RedstonePowered.

Im a very new to Java but even very good at C# which looks for me very similar to Java.

But i think when i try to do that all by my own I think it could get very worse..