public class WauzEquipmentBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
armorCategoryString
The display of the armor category of the equipment.
|
private int |
attackStat
The attack stat of the equipment.
|
private int |
defenseStat
The defense stat of the equipment.
|
private java.lang.String |
durabilityString
The display of the durability stat of the equipment.
|
static java.lang.String |
EMPTY_RUNE_SLOT
An empty rune slot, to put in the equipment lore.
|
static java.lang.String |
EMPTY_SKILL_SLOT
An empty skillgem slot, to put in the equipment lore.
|
private java.util.List<java.lang.String> |
enhancementStrings
The displays of the enhancements of the equipment.
|
private java.lang.String |
enhancementSuffix
The suffix to add behind the name of the equipment.
|
private org.bukkit.inventory.meta.ItemMeta |
itemMeta
The item meta of the equipment item.
|
private org.bukkit.inventory.ItemStack |
itemStack
The equipment item stack.
|
private java.lang.String |
rarityNamePrefix
The prefix of the name of the equipment's rarity.
|
private java.lang.String |
rarityStarPrefix
The prefix of the star rating of the equipment's rarity.
|
private java.lang.String |
scalingString
The display of the scaled level of the equipment.
|
private WauzPlayerSkill |
skillgem
The skillgem to socket into the equipment.
|
private java.lang.String |
speedString
The display of the speed stat of the equipment.
|
private java.lang.String |
swiftnessString
The display of the swiftness stat of the equipment.
|
Constructor and Description |
---|
WauzEquipmentBuilder(org.bukkit.Material material)
Constructs a builder for creating a new equipment item.
|
Modifier and Type | Method and Description |
---|---|
void |
addArmorCategory(ArmorCategory armorCategory)
Adds an armor category to the equipment item.
|
void |
addDurabilityStat(int durabilityStat)
Adds a durability stat to the equipment item.
|
void |
addEnhancementString(java.lang.String enhancementString,
java.lang.String enhancementSuffix)
Adds an enhancement string to the equipment item.
|
void |
addLeatherDye(org.bukkit.Color color)
Adds a leather dye to the equipment item.
|
private void |
addLoreIfNotBlank(java.util.List<java.lang.String> lores,
java.lang.String lore)
Extends the lore list, if the given lore string is not blank.
|
void |
addMainStats(int attackStat,
int defenseStat,
int requiredLevel,
float scalingLevel)
Adds a main stat, including level requirement to the equipment item.
|
void |
addRarityPrefixes(java.lang.String rarityNamePrefix,
java.lang.String rarityStarPrefix)
Adds custom prefixes to the rarity display of the equipment item.
|
void |
addShieldPattern()
Adds a random shield pattern to the equipment item.
|
void |
addSkillgem(WauzPlayerSkill skill)
Adds a skillgem to socket into the equipment item.
|
void |
addSpeedStat(double speedStat)
Adds a speed stat to the equipment item.
|
void |
addSwiftnessStat(int swiftnessStat)
Adds a swiftness stat to the equipment item.
|
private void |
applyCustomItemProperties(java.util.List<java.lang.String> lores,
CustomItem customItem,
Rarity rarity)
Adds the possible properties of a custom item class to the lores.
|
org.bukkit.inventory.ItemStack |
generate(Tier tier,
Rarity rarity,
EquipmentType type,
java.lang.String name)
Generates the equipment item stack, as configured in the builder.
|
void |
makeUnbreakable()
Makes the equipment item unbreakable.
|
public static final java.lang.String EMPTY_SKILL_SLOT
public static final java.lang.String EMPTY_RUNE_SLOT
private org.bukkit.inventory.ItemStack itemStack
private org.bukkit.inventory.meta.ItemMeta itemMeta
private java.lang.String rarityNamePrefix
private java.lang.String rarityStarPrefix
private int attackStat
private int defenseStat
private java.lang.String scalingString
private java.lang.String durabilityString
private java.lang.String speedString
private java.lang.String swiftnessString
private java.lang.String armorCategoryString
private java.util.List<java.lang.String> enhancementStrings
private java.lang.String enhancementSuffix
private WauzPlayerSkill skillgem
public WauzEquipmentBuilder(org.bukkit.Material material)
material
- The material of the equipment item.public void addShieldPattern()
public void addLeatherDye(org.bukkit.Color color)
color
- The color of the dye.public void addSkillgem(WauzPlayerSkill skill)
skill
- The skill to add.public void makeUnbreakable()
public void addRarityPrefixes(java.lang.String rarityNamePrefix, java.lang.String rarityStarPrefix)
rarityNamePrefix
- The prefix of the name of the equipment's rarity.rarityStarPrefix
- The prefix of the star rating of the equipment's rarity.public void addMainStats(int attackStat, int defenseStat, int requiredLevel, float scalingLevel)
attackStat
- The value of the attack stat.defenseStat
- The value of the defense stat.requiredLevel
- The level requirement.scalingLevel
- The scaling of the stats, where 1 = unscaled.public void addDurabilityStat(int durabilityStat)
durabilityStat
- The value of the stat.public void addSpeedStat(double speedStat)
speedStat
- The value of the stat.public void addSwiftnessStat(int swiftnessStat)
swiftnessStat
- The value of the stat.public void addArmorCategory(ArmorCategory armorCategory)
armorCategory
- The category.public void addEnhancementString(java.lang.String enhancementString, java.lang.String enhancementSuffix)
enhancementString
- The enhancement string.enhancementSuffix
- The suffix to add behind the name of the equipment or null.public org.bukkit.inventory.ItemStack generate(Tier tier, Rarity rarity, EquipmentType type, java.lang.String name)
tier
- The tier of the equipment item.rarity
- The rarity of the equipment item.type
- The type of the equipment item.name
- The name of the equipment item.addLoreIfNotBlank(List, String)
,
applyCustomItemProperties(List, CustomItem, Rarity)
private void addLoreIfNotBlank(java.util.List<java.lang.String> lores, java.lang.String lore)
lores
- The list of lores.lore
- The lore to add.private void applyCustomItemProperties(java.util.List<java.lang.String> lores, CustomItem customItem, Rarity rarity)
lores
- The list of lores.customItem
- The custom item class.rarity
- The rarity of the item.