CameraAPI
CameraAPI
Please note that this plugin is extremely experimental and should be used with caution. It definitely requires improvements or a new and intuitive way of moving the player's character/camera. If you have any thoughts/suggestions please get in touch.
I'm currently working on updating CameraAPI
About
The cameraAPI plugin is just a small plugin which teleports a player ever second to the new location in the path created by using separate locations as way points. It's very clean and doesn't lag too much. Sometimes on big servers the camera might start to seem 'jumpy' but there isn't really anything to be done about that right now.
Commands
You can use this plugin by using the following commands:
- /camera - Displays the help page
- /camera help - Also displays the help page
- /camera list - Lists all of the saved camera paths
- /camera plan - Start planning a camera route
- /camera setpoint - Set a point in the camera route
- /camera cancel - Cancel the planning of your current route
- /camera undo - Undos your last point add
- /camera create <route> - Create your planned path
- /camera play <route> <seconds> - Play a camera route in a specific amount of seconds
- /camera interrupt - If you're playing a route, this interrupts the camera sequence
permissions:
- cameraapi.help
- cameraapi.list
- cameraapi.plan
- cameraapi.setpoint
- cameraapi.cancel
- cameraapi.undo
- cameraapi.create
- cameraapi.delete
- cameraapi.play
- cameraapi.interrupt
You can use these permissions for time-saving purposes:
- cameraapi.use
- Gives you access to cameraapi.help
- Gives you access to cameraapi.list
- Gives you access to cameraapi.play
- Gives you access to cameraapi.interrupt
- cameraapi.*
- Gives you access to every permission node
Developer API
If you're a developer you can use this plugin in your plugins. Here is an example of how you would use it:
// First we get the API instance CameraAPI api = CameraAPI.getInstance(); // Player Player player = (Player) Bukkit.getOfflinePlayer("player"); // Start the travel, (player, <seconds>, locations...) api.travel(player, 15, loc1, loc2, loc3 etc...); // End the travel api.stopTravel(player); //You can use the api to check if someone is currently travelling if(api.isTravelling(player)) { //You can get all of the players currently travelling by using the following line of code Set<Player> travellers = api.getTravellers(); //You can use the api to save. The arguments are (name, locations...) api.savePath("name_of_the_route", loc1, loc2, loc3, loc4); //Load the location points of a path route api.loadPath("name_of_the_route"); //Returns a Location[] object //Delete a specific path route api.deletePath("name_of_the_route"); //Get all of the saved path routes api.getPathRoutes(); //Returns a String[] object
It is possible to check when a point has been hit or when a travel has ended by using the two events listen below. Now please bear in mind that these events are fairly new and the functionality of these events will be extended further as the development of the API progresses.
@EventHandler public void onTravelEnd(TravelEndEvent event) { //Get the player Player player = event.getPlayer(); } @EventHandler public void onTravelPointHit(TravelPointHitEvent event) { //Get the player Player player = event.getPlayer(); //Get the location of the point hit Location location = event.getLocation() }
Source
You can view the source code on github here.
Credit
This plugin was originally inspired by the CameraStudio plugin. However I've revamped it to be much more cleaner, a little simpler and works a lot nicer. My goal was to make a developer friendly version of CameraStudio. I've had permission from the developers of the CameraStudio plugin to revamp it and upload it here.
No download?!
@Kiigesensei
Don't mention it, but don't bother, I've already started rewriting it just for you :P. I'm adding in 'cutscenes' and I'm also adding in the ability to keep looping the camera until told otherwise.
Keep checking back for updates!
@KieronWiltshire
i forgot that this was an API,
i must apologize.
Im into developing, too
still a beginner but everyone has to start.
The needs of an RPG Server needs more than the regular plugins
that one can find. especially if it is a Cauldron Server.(forgot to mention this)
i wouldnt mind to make a plugin for this API
in the next few weeks, while learning Java.
thank you very much, for your fast answer
@Kiigesensei
Thanks for the input but this is an API to allow people to create plugins like the one you request. The main reason I made this API was so I could make a cool tutorial plugin, but I just never got around to it. I don't have the time at the moment to create this plugin for you but if you post a thread describing what you just described to me here, someone might make it. Make sure to link them to this plugin's dev page so they have something to work off of.
Regarding the permissions, I'll look into it and get back to you when I have some free time. Thanks for letting me know!
a nice plugin, but i have a suggestion.
Im making a RPG Server,
so i started to use this plugin for Cut-Scenes
(first time in Town/Dungeon/etc)
to show them the Scenery.
I would love to make them unvisible while in the "play" mode,
would be weird if dozens of player fly around.
And maybe an option to teleport them back, to the point before
they start the "play" mode.
and maybe jump-cuts would be nice, like connecting 2 plays
with a command like
/camera play cut1 20s cut2 30s cut3 22s
So in short
1. while play Potioneffect for invisible(maybe even nigtsight)
2. memorize where the player stand before "play"
3. jump-cuts
thank you for your time to read this
btw it seems the plugin ignores permissions
but that could be a mistake on my side (got lots of plugins)
(using PEX as Permission plugin)
Very nice plugin and really helpful in some situations!