NEW PLUGIN COMMING SOON!
With this plugin you can control your attractions with simple commands. When you run a command the block that is set in the attraction file will be changed to a redstone block. Besides that a custom variable will be set on a sign.
I made this plugin because I had issues with that redstone was to slow for my systems. For example the Release wouldn't immediately lock when the gates were opened. This plugin is to make it easier and more reliable to control your attractions. You still have to create most of your systems of your attraction.
Minecraft Spigot - 1.12+
Download the plugin.
Put the plugin in your plugins folder and restart your server.
Create a full system for your attraction. Leave the parts out that checks if, for example, the gates are closed before a attraction starts.
Copy the Sample file, change its name to the name of your attraction and add the name of the file in the Config.
Put the locations of your system in the attraction file and tweak the settings to your likings.
Reload the config by typing /cao ReloadConfig.
Use the commands to control your attractions.
<> - Required!
{} - Custom Command.
/cao <attraction> {RESTRAINTS} - To open/close the restraints.
/cao <attraction> {GATES} - To open/close the gates.
/cao <attraction> {RELEASE} - To release/start the attraction.
/cao <attraction> {POWER} <TOGGLE/DONE> - Use 'toggle' to enable/disable the attraction. Use 'done' when your system has finished switching.
/cao <attraction> {BUSY} <TRUE/FALSE> - Set the status of the attraction to busy. You cannot release/start the attraction if busy is true.
/cao <attraction> {STATION} <TRUE/FALSE> - If the attraction is in the station. Only if this is true you can open/close the restraints/gates. (This is disabled when 'stationMode' is set to 'false' in the attraction file)
/caoadmin ReloadConfig - Reloads the config.
/caoadmin ReloadAttraction <attraction> - Reload the variables of the attraction.
/caoadmin Info <Setup/Commands/Placeholders/Support> - Shows a info page.
CAO.* - Gives all permissions.
CAO.use - Gives permission to the /cao command.
CAO.sign - Gives permission to click signs.
CAO.admin - Gives permission to the /caoadmin command.
Attractions:
Type: List
Put the name and location of the file. (Case Sensitive)
E.G. Sample: Attractions/Sample.yml
Commands:
Type: String
You can edit the names of the commands u use.
Example: RELEASE: start to use '/CAO <attraction> start'
Variables:
Type: String
The variables that will be displayed on the signs.
The NoClosed / NoPowerOn is used when it cannot be switched.
Messages:
Type: String
You can edit all of the messages the plugin sends. Use '' to disable.
Message Placeholders:
%attraction%
%args%
%prefix%
PlaceholderAPI Supported
StationMode:
Type: Boolean
Normally the gates and restraints cannot be opened when BUSY is true. If you set this to true, the command STATION will be activated. The gates and restraints will then no longer check for BUSY but will look if STATION is set to true. Run the command to set the station to TRUE to let the system know that there is a train in the station. (Handy for multi-train rides, where u want to let people board whil a other train is on the track)
ReleaseTime:
Type: Long
The time in ticks for how long the release block remains a redstone block.
ClickSign:
Type: Boolean
If true you can click the sign to run the function.
ClickSignMessage:
Type: Boolean
If you get a message when you click the sign.
SignLine:
Type: Interger
The line in which the variable is placed. (1 to 4)
World:
Type: String
The world of the attraction.
DO NOT TOUCH THIS PART!
Restraints:
Type: Int Int Int (X Y Z)
The location of where the restone block for the restraints will be placed.
RestraintsSign:
Type: Int Int Int (X Y Z)
The location of the sign of the restraints.
Gates:
Type: Int Int Int (X Y Z)
The location of where the restone block for the gates will be placed.
GatesSign:
Type: Int Int Int (X Y Z)
The location of the sign of the gates.
Release:
Type: Int Int Int (X Y Z)
The location of where the restone block for the release will be placed.
ReleaseSign:
Type: Int Int Int (X Y Z)
The location of the sign of the release.
Power:
Type: Int Int Int (X Y Z)
The location of where the restone block for the power will be placed.
PowerSign:
Type: Int Int Int (X Y Z)
The location of the sign of the power.
Status:
Type: Int Int Int (X Y Z)
The location of the output status.
This is a block that changes to different colors based on the status of the attraction:
RED = Not Allowed to release
ORANGE = Allowed to release
GREEN = RELEASING.
%CAO_<attraction>_<mode>%
This placeholder will show the variable that is set in the config.
<attraction> - Set this to the name of the attraction. (case sensitive)
<mode> - Set this to Gates, Restraints, Release or Power. Or use your custom command.
First you have to import the API. You can do this by using the import: me.casiebarie.casieattractionoperate.API
I created an example code:
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import me.casiebarie.casieattractionoperate.API;
public class Main extends JavaPlugin {
public me.casiebarie.casieattractionoperate.Main cao;
public API cao_API;
@Override
public void onEnable() {
cao_API = getCAOapi();
if(cao_API != null) {
//ENABLE PLUGIN
} else {
//DISABLE PLUGIN
getLogger().warning("CasieAttractionOperate not found! Disabling plugin.");
Bukkit.getServer().getPluginManager().disablePlugin(this);
}
}
public API getCAOapi() {
cao = (me.casiebarie.casieattractionoperate.Main) getServer().getPluginManager().getPlugin("CasieAttractionOperate");
return cao.api;
}
}
cao_API.restraints(CommandSender sender, String attractionName);
cao_API.gates(CommandSender sender, String attractionName);
cao.API.release(CommandSender sender, String attractionName);
Call these methods with the attraction name to open/close the restraints/gates or to release the attraction.
In all methods the 'CommandSender' can eather be Null or a player. This is used to send a message to that player when the function is runned.
cao_API.power(CommandSender sender, String attractionName, String mode);
This one is to run the method of the power. It is almost the same as the ones above. The only difference is that you now have to specify a mode. Eather "TOGGLE" or "DONE".
cao_API.busy(CommandSender sender, String attractionName, Boolean bool);
cao_API.station(CommandSender sender, String attractionName, Boolean bool);
These ones are to run the methods for busy and station. You have to specify a boolean.
CAO_API.isLegacy();
Returns a boolean that indicates if the server is legacy or 1.13+.
cao_API.GetCmds();
Returns a Arraylist of the custom commands set in the CAO config.
0 = Restraints, 1 = Gates, 2 = Release, 3 = Power, 4 = Busy, 5 = Station
cao_API.sendMessage(CommandSender sender, String msgName, String attractionName, String args);
This method will send a message that is defined in the CAO config. Put the receiver at 'sender' and the exact name of the message to 'msgName'. The 'attractionName' and 'args' will replace the %attraction% and %args% placeholders in the message.
Example: cao_API.sendMessage(player, "NoPermission", "", ""); - This will send the message that is defined in the CAO config under 'NoPermission:'
cao_API.getVariable(String attractionName, String mode);
This returns a string of the specified attraction. It works the same as the PAPI placeholder.
File caoFile = new File(Bukkit.getPluginManager().getPlugin("CasieAttractionOperate").getDataFolder() + File.seperator + "config.yml");
CAOconfig = YamlConfiguration.loadConfiguration(caoFile);
Use this to get the CAO config.