IVisDiscountGear
Package: thaumcraft.api
Author: Azanor
Extends: —
ItemArmor with this interface grants a discount to the vis cost of actions the wearer performs with casting wands. The amount returned is the percentage by which the cost is discounted.
Interface Definition
public interface IVisDiscountGear {
int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect);
}
Methods
| Method | Signature | Description |
|---|---|---|
getVisDiscount |
ItemStack stack, EntityPlayer player, Aspect aspect → int |
Returns the vis discount percentage for the given aspect. Built-in max discount is 50%. Individual items should not exceed 5%. |
Notes
- The discount is per-aspect; different aspects can have different discount values
- Thaumcraft enforces a global maximum of 50% vis discount
- Individual items should generally not exceed 5% discount to maintain balance
- Discount applies to wand casting actions performed by the wearer
Example Implementation
public class MyVisDiscountItem extends ItemArmor implements IVisDiscountGear {
@Override
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
if (aspect == Aspect.FIRE) {
return 5; // 5% discount on fire aspect spells
}
return 0; // No discount for other aspects
}
}
Related
- Aspect: Thaumcraft’s aspect system for categorizing vis types
- IWarpingGear: Another item modifier interface for equipment effects
Tags
#api #item-effect #vis #discount #armor