mirror of
https://github.com/YouHaveTrouble/Enchantio.git
synced 2026-05-12 06:06:55 +00:00
allow modification of the arrow spread for volley enchant
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user