Package com.vk2gpz.autosell.multiplier
Class Multipliers
java.lang.Object
com.vk2gpz.autosell.multiplier.Multipliers
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static TreeMap
<Integer, AreaMultiplier> A map of area multipliersprotected static TreeMap
<Integer, PermissionMultiplier> A map of permission multipliers -
Constructor Summary
ConstructorsConstructorDescriptionMultipliers
(org.bukkit.plugin.Plugin plugin) The constructor for the Multipliers class -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addLimit
(MultiplierLimit limit) Adds a multiplier limit.static void
Adds a new multiplier.void
clear()
Clears the current data.static void
Clears the limits.static @Nullable AreaMultiplier
getAreaMultiplier
(org.bukkit.entity.Player p, Shop s) Checks whether the player has an area-based multiplier.static double
Gets the default limit for multipliers.static Multiplier
Gets the global multiplier.static double
getLimit
(org.bukkit.entity.Player p) Gets the limit for a player.static Map
<Integer, MultiplierLimit> Gets the map of multiplier limits.static @Nullable Multiplier
getMultiplier
(String playerName) Deprecated.static @Nullable Multiplier
getMultiplier
(org.bukkit.entity.Player p) Gets a multiplier for a player.static @Nullable Multiplier
getMultiplierByUuid
(String uuid) Gets a multiplier for a player by their UUID.static @NotNull List
<Multiplier> Gets a list of multipliers for all players.static @Nullable PermissionMultiplier
getPermissionMultiplier
(org.bukkit.entity.Player p) Checks whether the player has a permission-based multiplier.static boolean
Checks whether the global multiplier is set.static void
removeMultiplier
(String playerName) Deprecated.static void
removeMultiplier
(org.bukkit.entity.Player p) Removes a multiplier for a player.static void
removeMultiplierByUuid
(String uuid) Removes a multiplier for a player by their UUID.static void
Resets all multipliers.static void
setDefaultLimit
(double limit) Sets the default limit for multipliers.static void
setGlobalMultiplier
(Multiplier globalMultiplier) Sets the global multiplier.
-
Field Details
-
permMultipliers
A map of permission multipliers -
areaMultipliers
A map of area multipliers
-
-
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
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
Adds a new multiplier.- Parameters:
m
- the new multiplier to add.
-
getMultiplier
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.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
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
Removes a multiplier for a player by their UUID.- Parameters:
uuid
- The UUID of the player to remove the multiplier for.
-
removeMultiplier
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
Gets the global multiplier.- Returns:
- The global multiplier.
-
setGlobalMultiplier
Sets the global multiplier.- Parameters:
globalMultiplier
- The new global multiplier.
-
getLimits
Gets the map of multiplier limits.- Returns:
- the map of multiplier limits.
-
addLimit
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.
-