namespace WeaveLoader.API.Item; /// /// Fluent builder for defining item properties. /// public class ItemProperties { internal int MaxStackSizeValue = 64; internal int MaxDamageValue = 0; internal float AttackDamageValue = 0.0f; internal string IconValue = ""; internal CreativeTab CreativeTabValue = CreativeTab.None; internal string? NameValue; public ItemProperties MaxStackSize(int size) { MaxStackSizeValue = size; return this; } /// Icon name in the items atlas. Use namespaced ID for mod textures (e.g. "examplemod:ruby" from assets/items/ruby.png), or vanilla names like "diamond", "ingotIron". public ItemProperties Icon(string iconName) { IconValue = iconName; return this; } /// /// Set max damage for a tool/armor item. Setting this to a positive value /// makes the item damageable with a durability bar. /// public ItemProperties MaxDamage(int damage) { MaxDamageValue = damage; MaxStackSizeValue = 1; return this; } /// Override the native attack damage value for tool items. public ItemProperties AttackDamage(float damage) { AttackDamageValue = damage; return this; } public ItemProperties InCreativeTab(CreativeTab tab) { CreativeTabValue = tab; return this; } /// Display name shown in-game (e.g. "Ruby"). Used for localization. public ItemProperties Name(string displayName) { NameValue = displayName; return this; } }