allow modification of the arrow spread for volley enchant

This commit is contained in:
2025-05-13 21:11:33 +02:00
parent ea11cd1bb7
commit ea933b72e2
2 changed files with 11 additions and 5 deletions
@@ -31,6 +31,7 @@ public class VolleyEnchant implements EnchantioEnchant {
private final Set<TagEntry<ItemType>> supportedItemTags;
private final Set<TagKey<Enchantment>> enchantTagKeys = new HashSet<>();
private final Set<EquipmentSlotGroup> activeSlots = new HashSet<>();
private final double spread;
public VolleyEnchant(
int anvilCost,
@@ -41,7 +42,8 @@ public class VolleyEnchant implements EnchantioEnchant {
Set<TagEntry<ItemType>> supportedItemTags,
Set<EquipmentSlotGroup> activeSlots,
int maxLevel,
int additionalArrowsPerLevel
int additionalArrowsPerLevel,
double spread
) {
this.anvilCost = anvilCost;
this.weight = weight;
@@ -51,6 +53,7 @@ public class VolleyEnchant implements EnchantioEnchant {
this.maxLevel = maxLevel;
this.activeSlots.addAll(activeSlots);
this.additionalArrowsPerLevel = additionalArrowsPerLevel;
this.spread = spread;
if (canGetFromEnchantingTable) {
enchantTagKeys.add(EnchantmentTagKeys.IN_ENCHANTING_TABLE);
}
@@ -80,6 +83,10 @@ public class VolleyEnchant implements EnchantioEnchant {
return additionalArrowsPerLevel;
}
public double getSpread() {
return spread;
}
@Override
public int getWeight() {
return weight;
@@ -138,7 +145,8 @@ public class VolleyEnchant implements EnchantioEnchant {
)
)),
EnchantioConfig.getInt(configurationSection, "maxLevel", 3),
EnchantioConfig.getInt(configurationSection, "additionalArrowsPerLevel", 1)
EnchantioConfig.getInt(configurationSection, "additionalArrowsPerLevel", 1),
EnchantioConfig.getDouble(configurationSection, "spread", 0.5)
);
if (EnchantioConfig.getBoolean(configurationSection, "enabled", true)) {