Class Multipliers

java.lang.Object
com.vk2gpz.autosell.multiplier.Multipliers

public class Multipliers extends Object
This class is used to manage multipliers for players and global multipliers. It provides methods to add, remove, and retrieve multipliers for players, as well as managing global multipliers and limits.
  • Field Details

  • Constructor Details

    • Multipliers

      public Multipliers(org.bukkit.plugin.Plugin plugin)
      The constructor for the Multipliers class
      Parameters:
      plugin - The plugin instance
  • Method Details

    • clear

      public void clear()
      Clears the current data.
    • hasGlobalMultiplier

      public static boolean hasGlobalMultiplier()
      Checks whether the global multiplier is set.
      Returns:
      whether the global multiplier is set.
    • getPermissionMultiplier

      @Nullable public static @Nullable PermissionMultiplier getPermissionMultiplier(org.bukkit.entity.Player p)
      Checks whether the player has a permission-based multiplier.
      Parameters:
      p - The player to check.
      Returns:
      the permission-based multiplier if found, null otherwise.
    • getAreaMultiplier

      @Nullable public static @Nullable AreaMultiplier getAreaMultiplier(org.bukkit.entity.Player p, Shop s)
      Checks whether the player has an area-based multiplier.
      Parameters:
      p - The player to check.
      s - The shop to check.
      Returns:
      the area multiplier if found, null otherwise.
    • getMultipliers

      @NotNull public static @NotNull List<Multiplier> getMultipliers()
      Gets a list of multipliers for all players.
      Returns:
      a list of multipliers for all players.
    • resetAllMultipliers

      public static void resetAllMultipliers()
      Resets all multipliers.
    • addMultiplier

      public static void addMultiplier(Multiplier m)
      Adds a new multiplier.
      Parameters:
      m - the new multiplier to add.
    • getMultiplier

      @Nullable public static @Nullable Multiplier getMultiplier(org.bukkit.entity.Player p)
      Gets a multiplier for a player.
      Parameters:
      p - The player to check.
      Returns:
      The multiplier for the player, or null if not found.
    • getMultiplier

      @Deprecated @Nullable public static @Nullable Multiplier getMultiplier(String playerName)
      Deprecated.
      Gets a multiplier for a player by their name.
      Parameters:
      playerName - The name of the player to check.
      Returns:
      The multiplier for the player, or null if not found.
    • getMultiplierByUuid

      @Nullable public static @Nullable Multiplier getMultiplierByUuid(String uuid)
      Gets a multiplier for a player by their UUID.
      Parameters:
      uuid - The UUID of the player to check.
      Returns:
      The multiplier for the player, or null if not found.
    • removeMultiplierByUuid

      public static void removeMultiplierByUuid(String uuid)
      Removes a multiplier for a player by their UUID.
      Parameters:
      uuid - The UUID of the player to remove the multiplier for.
    • removeMultiplier

      @Deprecated public static void removeMultiplier(String playerName)
      Deprecated.
      Removes a multiplier for a player by their name.
      Parameters:
      playerName - The name of the player to remove the multiplier for.
    • removeMultiplier

      public static void removeMultiplier(org.bukkit.entity.Player p)
      Removes a multiplier for a player.
      Parameters:
      p - The player to remove the multiplier for.
    • getGlobalMultiplier

      public static Multiplier getGlobalMultiplier()
      Gets the global multiplier.
      Returns:
      The global multiplier.
    • setGlobalMultiplier

      public static void setGlobalMultiplier(Multiplier globalMultiplier)
      Sets the global multiplier.
      Parameters:
      globalMultiplier - The new global multiplier.
    • getLimits

      public static Map<Integer,MultiplierLimit> getLimits()
      Gets the map of multiplier limits.
      Returns:
      the map of multiplier limits.
    • addLimit

      public static void addLimit(MultiplierLimit limit)
      Adds a multiplier limit.
      Parameters:
      limit - The multiplier limit to add.
    • clearLimits

      public static void clearLimits()
      Clears the limits.
    • getLimit

      public static double getLimit(org.bukkit.entity.Player p)
      Gets the limit for a player.
      Parameters:
      p - The player to check.
      Returns:
      The limit for the player.
    • getDefaultLimit

      public static double getDefaultLimit()
      Gets the default limit for multipliers.
      Returns:
      The default limit for multipliers.
    • setDefaultLimit

      public static void setDefaultLimit(double limit)
      Sets the default limit for multipliers.
      Parameters:
      limit - The new default limit for multipliers.