TanningAPI
API for interacting with the Tanner interface.
ClassRLPlugins API
public class TanningAPIProvides methods to tan various leather types using typed packets.
Members
Static methods
- intcalculateCost(TanningAPI.LeatherType, int)
Calculate total cost for a tanning operation.
- booleancanTan(TanningAPI.LeatherType, int)
Check if a player can afford and has the skill to tan.
- voidclose()
Closes the tanning interface.
- intgetMaxAffordableAmount(TanningAPI.LeatherType)
Get the maximum amount that can be tanned with current coins.
- booleanhasEnoughCoinsToPay(TanningAPI.LeatherType, int)
Check if the player has enough coins to tan the specified amount.
- booleanhasInputItems(TanningAPI.LeatherType, int)
Check if the player has the required input items.
- booleanisOpen()
Checks if the tanning interface is currently open.
- voidtan(String, int)
Tans leather by item name.
- voidtan(TanningAPI.LeatherType, int)
Tans leather of the specified type.
calculateCost(TanningAPI.LeatherType, int)static
public static int calculateCost(TanningAPI.LeatherType type, int amount)Calculate total cost for a tanning operation.
Parameters
type- The leather type to tan.
amount- The quantity to tan.
Returns
Total cost in coins.
canTan(TanningAPI.LeatherType, int)static
public static boolean canTan(TanningAPI.LeatherType type, int amount)Check if a player can afford and has the skill to tan.
Parameters
type- The leather type to tan.
amount- The quantity to tan.
Returns
True if all requirements are met.
close()static
public static void close()Closes the tanning interface.
getMaxAffordableAmount(TanningAPI.LeatherType)static
public static int getMaxAffordableAmount(TanningAPI.LeatherType type)Get the maximum amount that can be tanned with current coins.
Parameters
type- The leather type to tan.
Returns
Maximum affordable amount.
hasEnoughCoinsToPay(TanningAPI.LeatherType, int)static
public static boolean hasEnoughCoinsToPay(TanningAPI.LeatherType type, int amount)Check if the player has enough coins to tan the specified amount.
Parameters
type- The leather type to tan.
amount- The quantity to tan.
Returns
True if a player has enough coins.
hasInputItems(TanningAPI.LeatherType, int)static
public static boolean hasInputItems(TanningAPI.LeatherType type, int amount)Check if the player has the required input items.
Parameters
type- The leather type to tan.
amount- The quantity to tan.
Returns
True if the player has enough input items.
isOpen()static
public static boolean isOpen()Checks if the tanning interface is currently open.
Returns
True if the tanning interface is visible, false otherwise.
tan(String, int)static
public static void tan(String itemName, int amount)Tans leather by item name.
Parameters
itemName- The name of the leather to tan (e.g., "Soft leather", "Green d'hide").
amount- The quantity to tan: 1, 5, -1 for All, or any other value for X.
tan(TanningAPI.LeatherType, int)static
public static void tan(TanningAPI.LeatherType type, int amount)Tans leather of the specified type.
Parameters
type- The leather type to tan.
amount- The quantity to tan: 1, 5, -1 for All, or any other value for X.
Also allowed
Every class has these, as in plain Java.
equals, toString