Guest User

ByteCore API

a guest
Sep 25th, 2017
3,883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.01 KB | None | 0 0
  1. package org.projectbyte.bytecore.api;
  2.  
  3. import java.util.Map;
  4. import java.util.UUID;
  5.  
  6. import org.bukkit.entity.Player;
  7. import org.projectbyte.bytecore.ByteCore;
  8. import org.projectbyte.bytecore.cooldown.Cooldown;
  9. import org.projectbyte.bytecore.cooldown.CooldownManager;
  10. import org.projectbyte.bytecore.cooldown.CooldownType;
  11. import org.projectbyte.bytecore.faction.IFaction;
  12. import org.projectbyte.bytecore.game.Event;
  13. import org.projectbyte.bytecore.game.EventManager;
  14. import org.projectbyte.bytecore.game.EventType;
  15. import org.projectbyte.bytecore.kit.KitManager;
  16. import org.projectbyte.bytecore.mountain.Mountain;
  17. import org.projectbyte.bytecore.mountain.MountainManager;
  18. import org.projectbyte.bytecore.mountain.MountainType;
  19. import org.projectbyte.bytecore.profile.Profile;
  20. import org.projectbyte.bytecore.storage.IUserDataStorage;
  21.  
  22. public class ByteAPI {
  23.    
  24.     private ByteCore plugin;
  25.    
  26.     public ByteAPI(ByteCore plugin) {
  27.         this.plugin = plugin;
  28.     }
  29.    
  30.     /**
  31.      * Get the Profile of a player by providing a player Object
  32.      *
  33.      * @param player - A Player object
  34.      * @return Profile of the player
  35.      * @see getProfile(UUID uuid)
  36.      */
  37.     public Profile getProfile(Player player) {
  38.         return plugin.getProfile(player);
  39.     }
  40.    
  41.     /**
  42.      * Get the Profile of a UUID by providing a Player's UUID
  43.      *
  44.      * @param uuid - The player's UUID
  45.      * @return Profile of the UUID
  46.      * @see getProfile(Player player)
  47.      */
  48.     public Profile getProfile(UUID uuid) {
  49.         return plugin.getProfile(uuid);
  50.     }
  51.    
  52.     /**
  53.      * Get a Map which stores loaded profiles on the server
  54.      *
  55.      * @return Map<UUID, Profile> - key = Player's UUID, value = Matching Profile object
  56.      */
  57.     public Map<UUID, Profile> getProfiles() {
  58.         return plugin.getProfiles();
  59.     }
  60.    
  61.     /**
  62.      * Get an Event object
  63.      * <p>
  64.      * You can use this Object to handle and manage the Event
  65.      * @param eventType - An Enumeration EventType
  66.      * @return the Event object
  67.      * @see getEventManager()
  68.      */
  69.     public Event getEvent(EventType eventType) {
  70.         return plugin.getEventManager().getEvent(eventType);
  71.     }
  72.    
  73.     /**
  74.      * Get a Mountain object
  75.      * <p>
  76.      * You can use to get the Cuboid instance of a Mountain or to
  77.      * reset the mountain entirely
  78.      * @param mountainType - An enumeration MountainType
  79.      * @return the Mountain object
  80.      * @see getMountainManager()
  81.      */
  82.     public Mountain getMountain(MountainType mountainType) {
  83.         return plugin.getMountainManager().getMountain(mountainType);
  84.     }
  85.    
  86.     /**
  87.      * Get a Cooldown object
  88.      * <p>
  89.      * You can use a Cooldown object to apply certain timers/cooldowns to player
  90.      * Profiles, as well as manage the cooldown's aspects such as who has a current
  91.      * cooldown and it's time
  92.      * @param cooldownType - An enumeration CooldownType
  93.      * @return the Cooldown object
  94.      * @see getCooldownManager()
  95.      */
  96.     public Cooldown getCooldown(CooldownType cooldownType) {
  97.         return plugin.getCooldownManager().getCooldown(cooldownType);
  98.     }
  99.    
  100.     /**
  101.      * Get the EventMangager instance to manage Events
  102.      * <p>
  103.      * Currently, you can use the EventManager to get or add a certain Event object,
  104.      * however, more will be added in the upcoming updates
  105.      * @return the EventManager
  106.      * @see getEvent(EventType eventType)
  107.      */
  108.     public EventManager getEventManager() {
  109.         return plugin.getEventManager();
  110.     }
  111.    
  112.     /**
  113.      * Get the MountainManager instance to manage mountains
  114.      * <p>
  115.      * Currently, you can use the MountainManager to get or add a certain Mountain object,
  116.      * however, more will be added in the upcoming updates
  117.      * @return the MountainManager
  118.      * @see getMountian(MountainType mountainType)
  119.      */
  120.     public MountainManager getMountainManager() {
  121.         return plugin.getMountainManager();
  122.     }
  123.    
  124.     /**
  125.      * Get the CooldownManager instance to handle cooldowns/timers
  126.      * <p>
  127.      * Currently, you can use this manager to get a List of Cooldown objects which are loaded
  128.      * into ByteCore, later on you will be able to add in your own cooldowns and manage each
  129.      * loaded Cooldown object
  130.      * @return the CooldownManager
  131.      * @see getCooldown(CooldownType cooldownType)
  132.      */
  133.     public CooldownManager getCooldownManager() {
  134.         return plugin.getCooldownManager();
  135.     }
  136.    
  137.     /**
  138.      * Get the KitManager instance to handle aspects of classes
  139.      * <p>
  140.      * Currently, you can use the KitManager to manager certain aspects of all of the classes
  141.      * loaded in ByteCore, later on, you will be able to add in your own classes while allowing
  142.      * to change and manage all effects and features of that class
  143.      * @return the KitManager
  144.      */
  145.     public KitManager getKitManager() {
  146.         return plugin.getKitManager();
  147.     }
  148.    
  149.     /**
  150.      * Get the supported Faction plugin for ByteCore
  151.      *
  152.      * @return an IFaction instance
  153.      */
  154.     public IFaction getSupportedFactionPlugin() {
  155.         return plugin.getFactionSupportManager().getSupportedFaction();
  156.     }
  157.    
  158.     /**
  159.      * Get the UserDataStorage object that is being used by the core
  160.      *
  161.      * @return a IUserDataStorage instance
  162.      */
  163.     public IUserDataStorage getUserDataStorage() {
  164.         return plugin.getUserDataStorageManager().getUserDataStorage();
  165.     }
  166.  
  167. }
Advertisement
Add Comment
Please, Sign In to add comment