Class ActionManager

java.lang.Object
de.themoep.resourcepacksplugin.core.PackManager
de.themoep.resourcepacksplugin.core.ActionManager

public class ActionManager extends de.themoep.resourcepacksplugin.core.PackManager
Created by Phoenix616 on 17.06.2015.
  • Constructor Details

  • Method Details

    • init

      public void init()
      Overrides:
      init in class de.themoep.resourcepacksplugin.core.PackManager
    • getApplicablePacks

      public LinkedHashSet<de.themoep.resourcepacksplugin.core.ResourcePack> getApplicablePacks(UUID playerId, String serverName)
      Overrides:
      getApplicablePacks in class de.themoep.resourcepacksplugin.core.PackManager
    • checkPack

      public de.themoep.resourcepacksplugin.core.events.IResourcePackSelectEvent.Status checkPack(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack, de.themoep.resourcepacksplugin.core.events.IResourcePackSelectEvent.Status status)
      Overrides:
      checkPack in class de.themoep.resourcepacksplugin.core.PackManager
    • loadAssignment

      public PackActionAssignment loadAssignment(String name, Map<String,Object> config)
      Overrides:
      loadAssignment in class de.themoep.resourcepacksplugin.core.PackManager
    • getApplicableAssignment

      public PackActionAssignment getApplicableAssignment(String serverName)
      Get the assignment that corresponds to the world/server name
      Parameters:
      serverName - The name
      Returns:
      The assignment or the global one
    • getAssignment

      public PackActionAssignment getAssignment(String name)
      Overrides:
      getAssignment in class de.themoep.resourcepacksplugin.core.PackManager
    • getGlobalAssignment

      public PackActionAssignment getGlobalAssignment()
      Overrides:
      getGlobalAssignment in class de.themoep.resourcepacksplugin.core.PackManager
    • getAssignments

      public Collection<? extends PackActionAssignment> getAssignments()
      Overrides:
      getAssignments in class de.themoep.resourcepacksplugin.core.PackManager
    • runActions

      @Deprecated public void runActions(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack, ResourcePackStatus status)
      Run actions and set the current status of a player by his id
      Parameters:
      playerId - The UUID of the player
      pack - The ResourcePack that was sent to the player
      status - The ResourcePackStatus of the player
    • runActions

      public void runActions(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, de.themoep.resourcepacksplugin.core.ResourcePack pack, ResourcePackStatus status)
      Run actions and set the current status of a player
      Parameters:
      player - The player
      pack - The ResourcePack that was sent to the player
      status - The ResourcePackStatus of the player
    • addAction

      @Deprecated public void addAction(String server, ResourcePackStatus status, PackAction action)
      Add an action to a server to react on a specific status
      Parameters:
      server - The name of the server
      status - The ResourcePackStatus
      action - The action to execute
    • addAction

      @Deprecated public void addAction(String server, ResourcePackStatus status, ActionType action, String msg)
      Add an action to a server to react on a specific status with a sendMessage
      Parameters:
      server - The name of the server
      status - The ResourcePackStatus
      action - The action to execute
      msg - An additional sendMessage for the action
    • getActions

      @Deprecated public Set<PackAction> getActions(String server, ResourcePackStatus status)
      Get the global actions of a certain server/world and a status
      Parameters:
      server - The server/world to get the action for
      status - The ResourcePackStatus
    • addGlobalAction

      @Deprecated public void addGlobalAction(ResourcePackStatus status, ActionType action, String msg)
      Deprecated.
      Add a global action to react on a specific status with a message
      Parameters:
      status - The ResourcePackStatus
      action - The action to execute
      msg - An additional sendMessage for the action
    • getGlobalActions

      @Deprecated public Set<PackAction> getGlobalActions(ResourcePackStatus status)
      Get the global actions of a status
      Parameters:
      status - The ResourcePackStatus
    • setKickDelay

      public void setKickDelay(int kickDelay)
      Set the delay before kicking a player for the kick action
      Parameters:
      kickDelay - The delay in ticks before kicking a player
    • getKickDelay

      public int getKickDelay()
      Get the delay before kicking a player for the kick action
      Returns:
      The delay in ticks before kicking a player
    • kickPlayer

      public void kickPlayer(UUID playerId, String msg)
      Kick the player while applying a configured delay
      Parameters:
      playerId - The UUID of the player to kick
      msg - The kick message. Displayed as title and in chat when kick is delayed
    • onPackSelect

      public void onPackSelect(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack, de.themoep.resourcepacksplugin.core.events.IResourcePackSelectEvent.Status status)
    • getAppliedCount

      public int getAppliedCount(de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Get the amount of online players using the specified pack
      Parameters:
      pack - The pack
      Returns:
      THe amount of players using it