PlayerSpeedAPI

PlayerSpeedAPI

PlayerSpeedAPI is system for managing players speed across plugins. Makes possibility to accept plugin's request to change player speed only once by average of those speeds requested by plugins with some smoothing. I think you may like it because changing of speed is better by one plugin so other plugins can work together without much "flickering".

I plan to make it configurable so you can choose between some types speed merge (average, the lowest one, the highest one, some other complex ways,...).

Permissions

PermissionDefaultDescription
playerspeedapi.playertrueGrants right to plugin to change this player's speed
playerspeedapi.adminopWill be required for admin commands

Commands

CommandPermissionDescriptionOptionals
/psapi defaultplayerspeedapi.adminChange speed to default(Disable API)[on/off]
/psapi info [player name]playerspeedapi.adminShow info about player
/psapi unregplayerspeedapi.adminForce to unregister all plugins from API(Clears speed data)[player]

For devs

  • Main class is PlayerSpeedAPI with method getAPI()
  • API contains 3 usable methods
    • String[] registerMeForPlayer(Player player, int id) - used for registering speed for this player. You must register before setting speed!
    • String[] unregisterMeFromPlayer(Player player, int id) - if you want to remove your value from player, use this.
    • String[] putSpeed(Player player, int id, float speed) - base method for setting player speed. Uses standard MC speed (-1;1) def: 0.2.
  • What is ID: ID should be unique for every plugin or part of plugin so they could not interfere. Ex: My RealWeather plugin uses ID:1. :-D. If you try to register already registered ID for same player, you will get return code "01" what means "Already registered!", but NOT exception, so you should take care of it. List of used IDs HERE.
  • Return variances of String[]: Contains always 2 strings. First is return code and second is message for code.
CodeMessageDescription
"00""Success"Doesn't need description
"01""Already registered"/"Not registered"Message depends on method you call
"02""User does not exist"Means that user is not registered in API

Current work status: alpha stage - version 1.7.2alpha1

Your ideas here

Do you think you have something to share? Write it down right here.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    73771
  • Created
    Feb 3, 2014
  • Last Released File
    Never
  • Total Downloads
    516
  • License

Categories

Members

Recent Files