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 voidaddLimit(MultiplierLimit limit) Adds a multiplier limit.static voidAdds a new multiplier.voidclear()Clears the current data.static voidClears the limits.static @Nullable AreaMultipliergetAreaMultiplier(org.bukkit.entity.Player p, Shop s) Checks whether the player has an area-based multiplier.static doubleGets the default limit for multipliers.static MultiplierGets the global multiplier.static doublegetLimit(org.bukkit.entity.Player p) Gets the limit for a player.static Map<Integer, MultiplierLimit> Gets the map of multiplier limits.static @Nullable MultipliergetMultiplier(String playerName) Deprecated.static @Nullable MultipliergetMultiplier(org.bukkit.entity.Player p) Gets a multiplier for a player.static @Nullable MultipliergetMultiplierByUuid(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 PermissionMultipliergetPermissionMultiplier(org.bukkit.entity.Player p) Checks whether the player has a permission-based multiplier.static booleanChecks whether the global multiplier is set.static voidremoveMultiplier(String playerName) Deprecated.static voidremoveMultiplier(org.bukkit.entity.Player p) Removes a multiplier for a player.static voidremoveMultiplierByUuid(String uuid) Removes a multiplier for a player by their UUID.static voidResets all multipliers.static voidsetDefaultLimit(double limit) Sets the default limit for multipliers.static voidsetGlobalMultiplier(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.
-