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

API #186

Open
GrangerTheDog opened this issue Jul 6, 2017 · 2 comments
Open

API #186

GrangerTheDog opened this issue Jul 6, 2017 · 2 comments

Comments

@GrangerTheDog
Copy link

Want to create a Control Panel for attractions, but i need a way to interface with wireless redstone
Like activateRedstone("Channelname", TIME);
and things like isActivated("Channelname")

@GrangerTheDog
Copy link
Author

@Bart-0110 is there already a way that i can do it on a hacky way, like the way it is handled in commands

@Bart-0110
Copy link
Collaborator

Bart-0110 commented Jul 6, 2017

There is a hacky way since I made everything public (maybe not the best idea). But you can do things like this:

WirelessChannel channel = WirelessRedstone.getStorage().getWirelessChannel("testChannel");

if (channel == null) //If it doesn't exist it is null
    return false;

//I have no idea why we have two different functions. Try both out and see which works the best. (I probably remove one of these methods)
boolean isActive = channel.isActive();
boolean isOn = channel.isOn();

//Some basic on/off functions
channel.turnOn(); //Turn on infinite
channel.turnOn(1000); //The argument is how long the channel should be active. KEEP IN MIND this is milliseconds NOT ticks.
channel.turnOff(); //Turn off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants