Improve registry and config (#33)

Use namespace instead of name to identify enchantments
This commit is contained in:
alexcrea 2024-10-04 22:57:09 +02:00 committed by GitHub
parent a00bb919f4
commit 7029254526
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 822 additions and 885 deletions

View file

@ -97,49 +97,46 @@ default_limit: 5
#
# Valid range of 1 - 255 for each enchantment
enchant_limits:
aqua_affinity: 1
binding_curse: 1
channeling: 1
flame: 1
infinity: 1
mending: 1
multishot: 1
silk_touch: 1
vanishing_curse: 1
depth_strider: 3 # anything more than 3 is treated as 3 by the game
protection: 4
fire_protection: 4
blast_protection: 4
projectile_protection: 4
feather_falling: 4
thorns: 3
respiration: 3
sharpness: 5
smite: 5
bane_of_arthropods: 5
knockback: 2
fire_aspect: 2
looting: 3
sweeping: 3
sweeping_edge: 3
efficiency: 5
unbreaking: 3
fortune: 3
power: 5
punch: 2
luck_of_the_sea: 3
lure: 3
frost_walker: 2
impaling: 5
riptide: 3
loyalty: 3
piercing: 4
quick_charge: 3
soul_speed: 3
swift_sneak: 3
density: 5
breach: 4
wind_burst: 3
minecraft:aqua_affinity: 1
minecraft:binding_curse: 1
minecraft:channeling: 1
minecraft:flame: 1
minecraft:infinity: 1
minecraft:mending: 1
minecraft:multishot: 1
minecraft:silk_touch: 1
minecraft:vanishing_curse: 1
minecraft:depth_strider: 3 # anything more than 3 is treated as 3 by the game
minecraft:protection: 4
minecraft:fire_protection: 4
minecraft:blast_protection: 4
minecraft:projectile_protection: 4
minecraft:feather_falling: 4
minecraft:thorns: 3
minecraft:respiration: 3
minecraft:sharpness: 5
minecraft:smite: 5
minecraft:bane_of_arthropods: 5
minecraft:knockback: 2
minecraft:fire_aspect: 2
minecraft:looting: 3
minecraft:sweeping: 3
minecraft:sweeping_edge: 3
minecraft:efficiency: 5
minecraft:unbreaking: 3
minecraft:fortune: 3
minecraft:power: 5
minecraft:punch: 2
minecraft:luck_of_the_sea: 3
minecraft:lure: 3
minecraft:frost_walker: 2
minecraft:impaling: 5
minecraft:riptide: 3
minecraft:loyalty: 3
minecraft:piercing: 4
minecraft:quick_charge: 3
minecraft:soul_speed: 3
minecraft:swift_sneak: 3
# Multipliers used to calculate the enchantment's value in repair/combining
#
@ -153,135 +150,137 @@ enchant_limits:
# With default values protection 4 would have a value of 4 when
# coming from either a book (4 * 1) or an item (4 * 1)
enchant_values:
aqua_affinity:
minecraft:aqua_affinity:
item: 4
book: 2
bane_of_arthropods:
minecraft:bane_of_arthropods:
item: 2
book: 1
binding_curse:
minecraft:binding_curse:
item: 8
book: 4
blast_protection:
minecraft:blast_protection:
item: 4
book: 2
channeling:
minecraft:channeling:
item: 8
book: 4
depth_strider:
minecraft:depth_strider:
item: 4
book: 2
efficiency:
minecraft:efficiency:
item: 1
book: 1
flame:
minecraft:flame:
item: 4
book: 2
feather_falling:
minecraft:feather_falling:
item: 2
book: 1
fire_aspect:
minecraft:fire_aspect:
item: 4
book: 2
fire_protection:
minecraft:fire_protection:
item: 2
book: 1
fortune:
minecraft:fortune:
item: 4
book: 2
frost_walker:
minecraft:frost_walker:
item: 4
book: 2
impaling:
minecraft:impaling:
item: 4
book: 2
infinity:
minecraft:infinity:
item: 8
book: 4
knockback:
minecraft:knockback:
item: 2
book: 1
looting:
minecraft:looting:
item: 4
book: 2
loyalty:
minecraft:loyalty:
item: 1
book: 1
luck_of_the_sea:
minecraft:luck_of_the_sea:
item: 4
book: 2
lure:
minecraft:lure:
item: 4
book: 2
mending:
minecraft:mending:
item: 4
book: 2
multishot:
minecraft:multishot:
item: 4
book: 2
piercing:
minecraft:piercing:
item: 1
book: 1
power:
minecraft:power:
item: 1
book: 1
projectile_protection:
minecraft:projectile_protection:
item: 2
book: 1
protection:
minecraft:protection:
item: 1
book: 1
punch:
minecraft:punch:
item: 4
book: 2
quick_charge:
minecraft:quick_charge:
item: 2
book: 1
respiration:
minecraft:respiration:
item: 4
book: 2
riptide:
minecraft:riptide:
item: 4
book: 2
silk_touch:
minecraft:silk_touch:
item: 8
book: 4
sharpness:
minecraft:sharpness:
item: 1
book: 1
smite:
minecraft:smite:
item: 2
book: 1
soul_speed:
minecraft:soul_speed:
item: 8
book: 4
swift_sneak:
minecraft:swift_sneak:
item: 8
book: 4
sweeping:
minecraft:sweeping:
item: 4
book: 2
sweeping_edge:
minecraft:sweeping_edge:
item: 4
book: 2
thorns:
minecraft:thorns:
item: 8
book: 4
unbreaking:
minecraft:unbreaking:
item: 2
book: 1
vanishing_curse:
minecraft:vanishing_curse:
item: 8
book: 4
density:
item: 1
book: 1
breach:
item: 4
book: 2
wind_burst:
item: 4
book: 2
# Disable enchantment merging for level above the set value
# Enchantment merging is when, for example, 2 unbreaking II book combine to give sharpness III
# But Enchantment above this value can still be applied. following the previous example, we could still apply a unbreaking III book to a sword
# Even if disable-merge-over of unbreaking is set to 2
# -1 mean enchantment merge for this enchantment is not disabled. default to -1 if absent.
disable-merge-over:
# Sharpness is set to -1. it equivalent to it not being set to anything (and work as vanilla)
minecraft:sharpness: -1
# If uncommented. 2 unbreaking II book would not give an unbreaking III book. but unbreaking III book can still be applied
#minecraft:unbreaking: 2
# Whether to show debug logging
debug_log: false
@ -296,4 +295,3 @@ debug_log_verbose: false
force_protocolib: false
configVersion: 1.6.2
lowMinecraftVersion: '1.21'

View file

@ -17,158 +17,158 @@
# ----------------------------------------------------
restriction_aqua_affinity:
enchantments: [ aqua_affinity ]
enchantments: [ minecraft:aqua_affinity ]
notAffectedGroups: [ enchanted_book, helmets ]
restriction_bane_of_arthropods:
enchantments: [ bane_of_arthropods ]
enchantments: [ minecraft:bane_of_arthropods ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_blast_protection:
enchantments: [ blast_protection ]
enchantments: [ minecraft:blast_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_channeling:
enchantments: [ channeling ]
enchantments: [ minecraft:channeling ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_binding_curse:
enchantments: [ binding_curse ]
enchantments: [ minecraft:binding_curse ]
notAffectedGroups: [ enchanted_book, wearable ]
restriction_vanishing_curse:
enchantments: [ vanishing_curse ]
enchantments: [ minecraft:vanishing_curse ]
notAffectedGroups: [ enchanted_book, can_vanish ]
restriction_depth_strider:
enchantments: [ depth_strider ]
enchantments: [ minecraft:depth_strider ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_efficiency:
enchantments: [ efficiency ]
enchantments: [ minecraft:efficiency ]
notAffectedGroups: [ enchanted_book, tools, shears ]
restriction_feather_falling:
enchantments: [ feather_falling ]
enchantments: [ minecraft:feather_falling ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_fire_aspect:
enchantments: [ fire_aspect ]
enchantments: [ minecraft:fire_aspect ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_fire_protection:
enchantments: [ fire_protection ]
enchantments: [ minecraft:fire_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_flame:
enchantments: [ flame ]
enchantments: [ minecraft:flame ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_fortune:
enchantments: [ fortune ]
enchantments: [ minecraft:fortune ]
notAffectedGroups: [ enchanted_book, tools ]
restriction_frost_walker:
enchantments: [ frost_walker ]
enchantments: [ minecraft:frost_walker ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_impaling:
enchantments: [ impaling ]
enchantments: [ minecraft:impaling ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_infinity:
enchantments: [ infinity ]
enchantments: [ minecraft:infinity ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_knockback:
enchantments: [ knockback ]
enchantments: [ minecraft:knockback ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_looting:
enchantments: [ looting ]
enchantments: [ minecraft:looting ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_loyalty:
enchantments: [ loyalty ]
enchantments: [ minecraft:loyalty ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_lure:
enchantments: [ lure ]
enchantments: [ minecraft:lure ]
notAffectedGroups: [ enchanted_book, fishing_rod ]
restriction_mending:
enchantments: [ mending ]
enchantments: [ minecraft:mending ]
notAffectedGroups: [ enchanted_book, can_unbreak ]
restriction_multishot:
enchantments: [ multishot ]
restriction_minecraft_multishot:
enchantments: [ minecraft:multishot ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_piercing:
enchantments: [ piercing ]
enchantments: [ minecraft:piercing ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_power:
enchantments: [ power ]
enchantments: [ minecraft:power ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_projectile_protection:
enchantments: [ projectile_protection ]
enchantments: [ minecraft:projectile_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_protection:
enchantments: [ protection ]
enchantments: [ minecraft:protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_punch:
enchantments: [ punch ]
enchantments: [ minecraft:punch ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_quick_charge:
enchantments: [ quick_charge ]
enchantments: [ minecraft:quick_charge ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_respiration:
enchantments: [ respiration ]
enchantments: [ minecraft:respiration ]
notAffectedGroups: [ enchanted_book, helmets ]
restriction_riptide:
enchantments: [ riptide ]
enchantments: [ minecraft:riptide ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_sharpness:
enchantments: [ sharpness ]
enchantments: [ minecraft:sharpness ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_silk_touch:
enchantments: [ silk_touch ]
restriction__silk_touch:
enchantments: [ minecraft:silk_touch ]
notAffectedGroups: [ enchanted_book, tools ]
restriction_smite:
enchantments: [ smite ]
enchantments: [ minecraft:smite ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_soul_speed:
enchantments: [ soul_speed ]
enchantments: [ minecraft:soul_speed ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_sweeping_edge:
enchantments: [ sweeping, sweeping_edge ]
enchantments: [ minecraft:sweeping, minecraft:sweeping_edge ]
notAffectedGroups: [ enchanted_book, swords ]
# Do not exist in 1.18, that mean useInFuture will be set to true
# useInFuture set to true also mean it will not warn if there is an issue
restriction_swift_sneak:
useInFuture: true
enchantments: [ swift_sneak ]
enchantments: [ minecraft:swift_sneak ]
notAffectedGroups: [ enchanted_book, leggings ]
restriction_thorns:
enchantments: [ thorns ]
enchantments: [ minecraft:thorns ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_unbreaking:
enchantments: [ unbreaking ]
restriction__unbreaking:
enchantments: [ minecraft:unbreaking ]
notAffectedGroups: [ enchanted_book, can_unbreak ]
# ----------------------------------------------------
@ -180,60 +180,60 @@ restriction_unbreaking:
sword_enchant_conflict:
enchantments:
- bane_of_arthropods
- smite
- sharpness
- minecraft:bane_of_arthropods
- minecraft:smite
- minecraft:sharpness
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
protection_enchant_conflict:
enchantments:
- blast_protection
- fire_protection
- projectile_protection
- protection
- minecraft:blast_protection
- minecraft:fire_protection
- minecraft:projectile_protection
- minecraft:protection
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
trident_conflict1:
enchantments:
- channeling
- riptide
- minecraft:channeling
- minecraft:riptide
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
trident_conflict2:
enchantments:
- loyalty
- riptide
- minecraft:loyalty
- minecraft:riptide
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
boot_conflict:
enchantments:
- depth_strider
- frost_walker
- minecraft:depth_strider
- minecraft:frost_walker
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
tool_conflict:
enchantments:
- fortune
- silk_touch
- minecraft:fortune
- minecraft:silk_touch
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
bow_conflict:
enchantments:
- mending
- infinity
- minecraft:mending
- minecraft:infinity
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
crossbow_conflict:
enchantments:
- multishot
- piercing
- minecraft:multishot
- minecraft:piercing
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1

View file

@ -97,49 +97,46 @@ default_limit: 5
#
# Valid range of 1 - 255 for each enchantment
enchant_limits:
aqua_affinity: 1
binding_curse: 1
channeling: 1
flame: 1
infinity: 1
mending: 1
multishot: 1
silk_touch: 1
vanishing_curse: 1
depth_strider: 3 # anything more than 3 is treated as 3 by the game
protection: 4
fire_protection: 4
blast_protection: 4
projectile_protection: 4
feather_falling: 4
thorns: 3
respiration: 3
sharpness: 5
smite: 5
bane_of_arthropods: 5
knockback: 2
fire_aspect: 2
looting: 3
sweeping: 3
sweeping_edge: 3
efficiency: 5
unbreaking: 3
fortune: 3
power: 5
punch: 2
luck_of_the_sea: 3
lure: 3
frost_walker: 2
impaling: 5
riptide: 3
loyalty: 3
piercing: 4
quick_charge: 3
soul_speed: 3
swift_sneak: 3
density: 5
breach: 4
wind_burst: 3
minecraft:aqua_affinity: 1
minecraft:binding_curse: 1
minecraft:channeling: 1
minecraft:flame: 1
minecraft:infinity: 1
minecraft:mending: 1
minecraft:multishot: 1
minecraft:silk_touch: 1
minecraft:vanishing_curse: 1
minecraft:depth_strider: 3 # anything more than 3 is treated as 3 by the game
minecraft:protection: 4
minecraft:fire_protection: 4
minecraft:blast_protection: 4
minecraft:projectile_protection: 4
minecraft:feather_falling: 4
minecraft:thorns: 3
minecraft:respiration: 3
minecraft:sharpness: 5
minecraft:smite: 5
minecraft:bane_of_arthropods: 5
minecraft:knockback: 2
minecraft:fire_aspect: 2
minecraft:looting: 3
minecraft:sweeping: 3
minecraft:sweeping_edge: 3
minecraft:efficiency: 5
minecraft:unbreaking: 3
minecraft:fortune: 3
minecraft:power: 5
minecraft:punch: 2
minecraft:luck_of_the_sea: 3
minecraft:lure: 3
minecraft:frost_walker: 2
minecraft:impaling: 5
minecraft:riptide: 3
minecraft:loyalty: 3
minecraft:piercing: 4
minecraft:quick_charge: 3
minecraft:soul_speed: 3
minecraft:swift_sneak: 3
# Multipliers used to calculate the enchantment's value in repair/combining
#
@ -153,135 +150,137 @@ enchant_limits:
# With default values protection 4 would have a value of 4 when
# coming from either a book (4 * 1) or an item (4 * 1)
enchant_values:
aqua_affinity:
minecraft:aqua_affinity:
item: 4
book: 2
bane_of_arthropods:
minecraft:bane_of_arthropods:
item: 2
book: 1
binding_curse:
minecraft:binding_curse:
item: 8
book: 4
blast_protection:
minecraft:blast_protection:
item: 4
book: 2
channeling:
minecraft:channeling:
item: 8
book: 4
depth_strider:
minecraft:depth_strider:
item: 4
book: 2
efficiency:
minecraft:efficiency:
item: 1
book: 1
flame:
minecraft:flame:
item: 4
book: 2
feather_falling:
minecraft:feather_falling:
item: 2
book: 1
fire_aspect:
minecraft:fire_aspect:
item: 4
book: 2
fire_protection:
minecraft:fire_protection:
item: 2
book: 1
fortune:
minecraft:fortune:
item: 4
book: 2
frost_walker:
minecraft:frost_walker:
item: 4
book: 2
impaling:
minecraft:impaling:
item: 4
book: 2
infinity:
minecraft:infinity:
item: 8
book: 4
knockback:
minecraft:knockback:
item: 2
book: 1
looting:
minecraft:looting:
item: 4
book: 2
loyalty:
minecraft:loyalty:
item: 1
book: 1
luck_of_the_sea:
minecraft:luck_of_the_sea:
item: 4
book: 2
lure:
minecraft:lure:
item: 4
book: 2
mending:
minecraft:mending:
item: 4
book: 2
multishot:
minecraft:multishot:
item: 4
book: 2
piercing:
minecraft:piercing:
item: 1
book: 1
power:
minecraft:power:
item: 1
book: 1
projectile_protection:
minecraft:projectile_protection:
item: 2
book: 1
protection:
minecraft:protection:
item: 1
book: 1
punch:
minecraft:punch:
item: 4
book: 2
quick_charge:
minecraft:quick_charge:
item: 2
book: 1
respiration:
minecraft:respiration:
item: 4
book: 2
riptide:
minecraft:riptide:
item: 4
book: 2
silk_touch:
minecraft:silk_touch:
item: 8
book: 4
sharpness:
minecraft:sharpness:
item: 1
book: 1
smite:
minecraft:smite:
item: 2
book: 1
soul_speed:
minecraft:soul_speed:
item: 8
book: 4
swift_sneak:
minecraft:swift_sneak:
item: 8
book: 4
sweeping:
minecraft:sweeping:
item: 4
book: 2
sweeping_edge:
minecraft:sweeping_edge:
item: 4
book: 2
thorns:
minecraft:thorns:
item: 8
book: 4
unbreaking:
minecraft:unbreaking:
item: 2
book: 1
vanishing_curse:
minecraft:vanishing_curse:
item: 8
book: 4
density:
item: 1
book: 1
breach:
item: 4
book: 2
wind_burst:
item: 4
book: 2
# Disable enchantment merging for level above the set value
# Enchantment merging is when, for example, 2 unbreaking II book combine to give sharpness III
# But Enchantment above this value can still be applied. following the previous example, we could still apply a unbreaking III book to a sword
# Even if disable-merge-over of unbreaking is set to 2
# -1 mean enchantment merge for this enchantment is not disabled. default to -1 if absent.
disable-merge-over:
# Sharpness is set to -1. it equivalent to it not being set to anything (and work as vanilla)
minecraft:sharpness: -1
# If uncommented. 2 unbreaking II book would not give an unbreaking III book. but unbreaking III book can still be applied
#minecraft:unbreaking: 2
# Whether to show debug logging
debug_log: false
@ -296,4 +295,3 @@ debug_log_verbose: false
force_protocolib: false
configVersion: 1.6.2
lowMinecraftVersion: '1.21'

View file

@ -17,278 +17,159 @@
# ----------------------------------------------------
restriction_aqua_affinity:
enchantments:
- aqua_affinity
notAffectedGroups:
- enchanted_book
- helmets
enchantments: [ minecraft:aqua_affinity ]
notAffectedGroups: [ enchanted_book, helmets ]
restriction_bane_of_arthropods:
enchantments:
- bane_of_arthropods
notAffectedGroups:
- enchanted_book
- melee_weapons
- mace
enchantments: [ minecraft:bane_of_arthropods ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_blast_protection:
enchantments:
- blast_protection
notAffectedGroups:
- enchanted_book
- armors
enchantments: [ minecraft:blast_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_channeling:
enchantments:
- channeling
notAffectedGroups:
- enchanted_book
- trident
enchantments: [ minecraft:channeling ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_binding_curse:
enchantments:
- binding_curse
notAffectedGroups:
- enchanted_book
- wearable
enchantments: [ minecraft:binding_curse ]
notAffectedGroups: [ enchanted_book, wearable ]
restriction_vanishing_curse:
enchantments:
- vanishing_curse
notAffectedGroups:
- enchanted_book
- can_vanish
enchantments: [ minecraft:vanishing_curse ]
notAffectedGroups: [ enchanted_book, can_vanish ]
restriction_depth_strider:
enchantments:
- depth_strider
notAffectedGroups:
- enchanted_book
- boots
enchantments: [ minecraft:depth_strider ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_efficiency:
enchantments:
- efficiency
notAffectedGroups:
- enchanted_book
- tools
- shears
enchantments: [ minecraft:efficiency ]
notAffectedGroups: [ enchanted_book, tools, shears ]
restriction_feather_falling:
enchantments:
- feather_falling
notAffectedGroups:
- enchanted_book
- boots
enchantments: [ minecraft:feather_falling ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_fire_aspect:
enchantments:
- fire_aspect
notAffectedGroups:
- enchanted_book
- swords
- mace
enchantments: [ minecraft:fire_aspect ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_fire_protection:
enchantments:
- fire_protection
notAffectedGroups:
- enchanted_book
- armors
enchantments: [ minecraft:fire_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_flame:
enchantments:
- flame
notAffectedGroups:
- enchanted_book
- bow
enchantments: [ minecraft:flame ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_fortune:
enchantments:
- fortune
notAffectedGroups:
- enchanted_book
- tools
enchantments: [ minecraft:fortune ]
notAffectedGroups: [ enchanted_book, tools ]
restriction_frost_walker:
enchantments:
- frost_walker
notAffectedGroups:
- enchanted_book
- boots
enchantments: [ minecraft:frost_walker ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_impaling:
enchantments:
- impaling
notAffectedGroups:
- enchanted_book
- trident
enchantments: [ minecraft:impaling ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_infinity:
enchantments:
- infinity
notAffectedGroups:
- enchanted_book
- bow
enchantments: [ minecraft:infinity ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_knockback:
enchantments:
- knockback
notAffectedGroups:
- enchanted_book
- swords
enchantments: [ minecraft:knockback ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_looting:
enchantments:
- looting
notAffectedGroups:
- enchanted_book
- swords
enchantments: [ minecraft:looting ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_loyalty:
enchantments:
- loyalty
notAffectedGroups:
- enchanted_book
- trident
enchantments: [ minecraft:loyalty ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_lure:
enchantments:
- lure
notAffectedGroups:
- enchanted_book
- fishing_rod
enchantments: [ minecraft:lure ]
notAffectedGroups: [ enchanted_book, fishing_rod ]
restriction_mending:
enchantments:
- mending
notAffectedGroups:
- enchanted_book
- can_unbreak
enchantments: [ minecraft:mending ]
notAffectedGroups: [ enchanted_book, can_unbreak ]
restriction_multishot:
enchantments:
- multishot
notAffectedGroups:
- enchanted_book
- crossbow
restriction_minecraft_multishot:
enchantments: [ minecraft:multishot ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_piercing:
enchantments:
- piercing
notAffectedGroups:
- enchanted_book
- crossbow
enchantments: [ minecraft:piercing ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_power:
enchantments:
- power
notAffectedGroups:
- enchanted_book
- bow
enchantments: [ minecraft:power ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_projectile_protection:
enchantments:
- projectile_protection
notAffectedGroups:
- enchanted_book
- armors
enchantments: [ minecraft:projectile_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_protection:
enchantments:
- protection
notAffectedGroups:
- enchanted_book
- armors
enchantments: [ minecraft:protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_punch:
enchantments:
- punch
notAffectedGroups:
- enchanted_book
- bow
enchantments: [ minecraft:punch ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_quick_charge:
enchantments:
- quick_charge
notAffectedGroups:
- enchanted_book
- crossbow
enchantments: [ minecraft:quick_charge ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_respiration:
enchantments:
- respiration
notAffectedGroups:
- enchanted_book
- helmets
enchantments: [ minecraft:respiration ]
notAffectedGroups: [ enchanted_book, helmets ]
restriction_riptide:
enchantments:
- riptide
notAffectedGroups:
- enchanted_book
- trident
enchantments: [ minecraft:riptide ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_sharpness:
enchantments:
- sharpness
notAffectedGroups:
- enchanted_book
- melee_weapons
enchantments: [ minecraft:sharpness ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_silk_touch:
enchantments:
- silk_touch
notAffectedGroups:
- enchanted_book
- tools
restriction__silk_touch:
enchantments: [ minecraft:silk_touch ]
notAffectedGroups: [ enchanted_book, tools ]
restriction_smite:
enchantments:
- smite
notAffectedGroups:
- enchanted_book
- melee_weapons
- mace
enchantments: [ minecraft:smite ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_soul_speed:
enchantments:
- soul_speed
notAffectedGroups:
- enchanted_book
- boots
enchantments: [ minecraft:soul_speed ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_sweeping_edge:
enchantments:
- sweeping
- sweeping_edge
notAffectedGroups:
- enchanted_book
- swords
enchantments: [ minecraft:sweeping, minecraft:sweeping_edge ]
notAffectedGroups: [ enchanted_book, swords ]
# Do not exist in 1.18, that mean useInFuture will be set to true
# useInFuture set to true also mean it will not warn if there is an issue
restriction_swift_sneak:
useInFuture: true
enchantments:
- swift_sneak
notAffectedGroups:
- enchanted_book
- leggings
enchantments: [ minecraft:swift_sneak ]
notAffectedGroups: [ enchanted_book, leggings ]
restriction_thorns:
enchantments:
- thorns
notAffectedGroups:
- enchanted_book
- armors
enchantments: [ minecraft:thorns ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_unbreaking:
enchantments:
- unbreaking
notAffectedGroups:
- enchanted_book
- can_unbreak
restriction__unbreaking:
enchantments: [ minecraft:unbreaking ]
notAffectedGroups: [ enchanted_book, can_unbreak ]
# ----------------------------------------------------
# Now we have conflicts about enchantment Incompatibility
@ -299,87 +180,62 @@ restriction_unbreaking:
sword_enchant_conflict:
enchantments:
- bane_of_arthropods
- smite
- sharpness
- minecraft:bane_of_arthropods
- minecraft:smite
- minecraft:sharpness
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
protection_enchant_conflict:
enchantments:
- blast_protection
- fire_protection
- projectile_protection
- protection
- minecraft:blast_protection
- minecraft:fire_protection
- minecraft:projectile_protection
- minecraft:protection
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
trident_conflict1:
enchantments:
- channeling
- riptide
- minecraft:channeling
- minecraft:riptide
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
trident_conflict2:
enchantments:
- loyalty
- riptide
- minecraft:loyalty
- minecraft:riptide
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
boot_conflict:
enchantments:
- depth_strider
- frost_walker
- minecraft:depth_strider
- minecraft:frost_walker
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
tool_conflict:
enchantments:
- fortune
- silk_touch
- minecraft:fortune
- minecraft:silk_touch
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
bow_conflict:
enchantments:
- mending
- infinity
- minecraft:mending
- minecraft:infinity
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
crossbow_conflict:
enchantments:
- multishot
- piercing
- minecraft:multishot
- minecraft:piercing
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
restriction_density:
enchantments:
- density
notAffectedGroups:
- mace
- enchanted_book
restriction_breach:
enchantments:
- breach
notAffectedGroups:
- mace
- enchanted_book
restriction_wind_burst:
enchantments:
- wind_burst
notAffectedGroups:
- mace
- enchanted_book
mace_enchant_conflict:
enchantments:
- density
- breach
- smite
- bane_of_arthropods
maxEnchantmentBeforeConflict: 1
# ----------------------------------------------------
# Bellow is for custom conflicts.

View file

@ -121,6 +121,7 @@ wearable:
- player_head
- creeper_head
- dragon_head
# do not exist in 1.18 but exist in future update
- piglin_head
groups:
- armors
@ -187,6 +188,7 @@ can_unbreak:
- shield
- carrot_on_a_stick
- warped_fungus_on_a_stick
# do not exist in 1.18 but exist in future update
- brush
groups:
- melee_weapons
@ -197,7 +199,6 @@ can_unbreak:
- crossbow
- fishing_rod
- shears
- mace
can_vanish:
type: include
@ -206,8 +207,4 @@ can_vanish:
groups:
- wearable
- can_unbreak
mace:
type: include
items:
- mace

View file

@ -188,5 +188,3 @@ warped_planks:
wooden_shovel: 0.25
wooden_hoe: 0.25
shield: 0.25
breeze_rod:
mace: 0.25

View file

@ -119,7 +119,7 @@ public class ConflictAPI {
private static List<String> extractEnchantments(@NotNull ConflictBuilder builder){
List<String> result = new ArrayList<>(builder.getEnchantmentNames());
for (NamespacedKey enchantmentKey : builder.getEnchantmentKeys()) {
result.add(enchantmentKey.getKey());
result.add(enchantmentKey.toString());
}
return result;

View file

@ -10,6 +10,7 @@ import xyz.alexcrea.cuanvil.enchant.CAEnchantment;
import xyz.alexcrea.cuanvil.group.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
@ -372,7 +373,7 @@ public class ConflictBuilder {
*/
protected void appendEnchantments(@NotNull EnchantConflictGroup conflict){
for (String enchantmentName : getEnchantmentNames()){
if(appendEnchantment(conflict, EnchantmentApi.getByName(enchantmentName))){
if(appendEnchantments(conflict, EnchantmentApi.getListByName(enchantmentName)) == 0){
CustomAnvil.instance.getLogger().warning("Could not find enchantment " + enchantmentName + " for conflict " + getName());
ConflictAPI.logConflictOrigin(this);
}
@ -399,6 +400,24 @@ public class ConflictBuilder {
return true;
}
/**
* Append a list of enchantments.
*
* @param conflict The conflict target
* @param enchantments List of enchantment to add
* @return Number of enchantment added
*/
protected static int appendEnchantments(@NotNull EnchantConflictGroup conflict, @NotNull List<CAEnchantment> enchantments){
int numberValid = 0;
for (CAEnchantment enchantment : enchantments) {
if(appendEnchantment(conflict, enchantment)){
numberValid++;
}
}
return numberValid;
}
/**
* Extract group abstract material group.
*

View file

@ -18,6 +18,7 @@ import xyz.alexcrea.cuanvil.gui.config.global.EnchantCostConfigGui;
import xyz.alexcrea.cuanvil.gui.config.global.EnchantLimitConfigGui;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
@ -104,7 +105,7 @@ public class EnchantmentApi {
* @return True if successful.
*/
public static boolean unregisterEnchantment(@NotNull NamespacedKey key){
CAEnchantment enchantment = CAEnchantmentRegistry.getInstance().getByKey(key);
CAEnchantment enchantment = CAEnchantment.getByKey(key);
return unregisterEnchantment(enchantment);
}
@ -126,7 +127,7 @@ public class EnchantmentApi {
*/
@Nullable
public static CAEnchantment getByKey(@NotNull NamespacedKey key){
return CAEnchantmentRegistry.getInstance().getByKey(key);
return CAEnchantment.getByKey(key);
}
/**
@ -134,10 +135,22 @@ public class EnchantmentApi {
*
* @param name The name used to fetch
* @return The custom anvil enchantment of this name. null if not found.
* @deprecated use {@link #getListByName(String)}
*/
@Deprecated(since = "1.6.3")
@Nullable
public static CAEnchantment getByName(@NotNull String name){
return CAEnchantmentRegistry.getInstance().getByName(name);
return CAEnchantment.getByName(name);
}
/**
* Get list of enchantment using the provided name.
*
* @param name The name used to fetch
* @return List of custom anvil enchantments of this name. May be empty if not found.
*/
public static List<CAEnchantment> getListByName(@NotNull String name){
return CAEnchantment.getListByName(name);
}
/**
@ -167,9 +180,9 @@ public class EnchantmentApi {
private static void writeDefaultConfig(FileConfiguration defaultConfig, CAEnchantment enchantment) {
defaultConfig.set("enchant_limits." + enchantment.getKey().getKey(), enchantment.defaultMaxLevel());
defaultConfig.set("enchant_limits." + enchantment.getKey(), enchantment.defaultMaxLevel());
String basePath = "enchant_values." + enchantment.getKey().getKey();
String basePath = "enchant_values." + enchantment.getKey();
EnchantmentRarity rarity = enchantment.defaultRarity();
defaultConfig.set(basePath + ".item", rarity.getItemValue());

View file

@ -12,6 +12,7 @@ import xyz.alexcrea.cuanvil.group.EnchantConflictGroup;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -226,12 +227,24 @@ public interface CAEnchantment {
}
/**
* Gets a list of all the unoptimised enchantments.
* @param name The enchantment name
* @return List of enchantment.
* Gets the enchantment by the provided name.
* @param name Name to fetch.
* @return Registered enchantment. null if absent.
*
* @deprecated use {@link #getListByName(String)}
*/
@Deprecated(since = "1.6.3")
static @Nullable CAEnchantment getByName(@NotNull String name){
return CAEnchantmentRegistry.getInstance().getByName(name);
}
/**
* Gets list of enchantment using the provided name.
* @param name Name to fetch.
* @return List of registered enchantment.
*/
static List<CAEnchantment> getListByName(@NotNull String name){
return CAEnchantmentRegistry.getInstance().getListByName(name);
}
}

View file

@ -22,7 +22,7 @@ public class CAEnchantmentRegistry {
// Register enchantment functions
private final HashMap<NamespacedKey, CAEnchantment> byKeyMap;
private final HashMap<String, CAEnchantment> byNameMap;
private final HashMap<String, List<CAEnchantment>> byNameMap;
private final SortedSet<CAEnchantment> nameSortedEnchantments;
@ -62,6 +62,8 @@ public class CAEnchantmentRegistry {
}
private static boolean hasWarnedRegistering = false;
/**
* Can be used to register new enchantment.
* <p>
@ -73,19 +75,25 @@ public class CAEnchantmentRegistry {
public boolean register(@NotNull CAEnchantment enchantment){
if(byKeyMap.containsKey(enchantment.getKey())){
CustomAnvil.instance.getLogger().log(Level.WARNING,
"Duplicate registered enchantment. This should NOT happen.",
"Duplicate registered enchantment. This should NOT happen any time.\n" +
"If you are a custom anvil developer. You maybe custom anvil detected your enchantment as a bukkit enchantment. " +
"maybe remove enchantment with the same key before registering yours",
new IllegalStateException(enchantment.getKey()+" enchantment was already registered"));
return false;
}
if(byNameMap.containsKey(enchantment.getName())){
if((!hasWarnedRegistering) && byNameMap.containsKey(enchantment.getName())){
hasWarnedRegistering = true;
CustomAnvil.instance.getLogger().log(Level.WARNING,
"Duplicate registered enchantment name. There will have issue. " +
"\nI hope this do not happen to you on a production server. If it do, there is probably a plugin trying to register an enchantment with the same name than another one",
new IllegalStateException(enchantment.getKey()+" enchantment name was already registered"));
"Duplicate registered enchantment name. Please check that configuration is using namespace.");
}
byKeyMap.put(enchantment.getKey(), enchantment);
byNameMap.put(enchantment.getName(), enchantment);
byNameMap.putIfAbsent(enchantment.getName(), new ArrayList<>());
byNameMap.get(enchantment.getName()).add(enchantment);
nameSortedEnchantments.add(enchantment);
if(!enchantment.isGetOptimised()){
@ -112,7 +120,7 @@ public class CAEnchantmentRegistry {
public boolean unregister(@Nullable CAEnchantment enchantment){
if(enchantment == null) return false;
byKeyMap.remove(enchantment.getKey());
byNameMap.remove(enchantment.getName());
byNameMap.get(enchantment.getName()).remove(enchantment);
nameSortedEnchantments.remove(enchantment);
@ -135,10 +143,26 @@ public class CAEnchantmentRegistry {
* Gets the enchantment by the provided name.
* @param name Name to fetch.
* @return Registered enchantment. null if absent.
*
* @deprecated use {@link #getListByName(String)}
*/
@Deprecated(since = "1.6.3")
@Nullable
public CAEnchantment getByName(@NotNull String name){
return byNameMap.get(name);
List<CAEnchantment> enchantments = getListByName(name);
if(enchantments.isEmpty()) return null;
return enchantments.get(0);
}
/**
* Gets list of enchantment using the provided name.
* @param name Name to fetch.
* @return List of registered enchantment.
*/
@NotNull
public List<CAEnchantment> getListByName(@NotNull String name){
return byNameMap.getOrDefault(name, Collections.emptyList());
}
/**

View file

@ -44,24 +44,16 @@ public class EnchantCostConfigGui extends AbstractEnchantConfigGui<EnchantCostSe
@Override
public EnchantCostSettingsGui.EnchantCostSettingFactory createFactory(CAEnchantment enchant) {
String key = enchant.getKey().getKey().toLowerCase(Locale.ENGLISH);
String prettyKey = CasedStringUtil.snakeToUpperSpacedCase(key);
String key = enchant.getKey().toString().toLowerCase(Locale.ENGLISH);
String prettyKey = CasedStringUtil.snakeToUpperSpacedCase(key.replace(":", "_"));
// try to find rarity. default to 0 if not found
EnchantmentRarity rarity = enchant.defaultRarity();
try {
rarity = EnchantmentProperties.valueOf(key.toUpperCase(Locale.ENGLISH)).getRarity();
} catch (IllegalArgumentException ignored) {
}
return EnchantCostSettingsGui.enchantCostFactory(prettyKey + " Level Cost", this,
ConfigHolder.DEFAULT_CONFIG, SECTION_NAME + '.' + key,
return new EnchantCostSettingsGui.EnchantCostSettingFactory(prettyKey + " Cost", this,
SECTION_NAME + '.' + key, ConfigHolder.DEFAULT_CONFIG,
Arrays.asList(
"§7How many level should " + prettyKey,
"§7cost when applied by book or by another item."
),
0, 255,
rarity.getItemValue(), rarity.getBookValue(),
enchant, 0, 255,
1, 10, 50);
}

View file

@ -1,6 +1,7 @@
package xyz.alexcrea.cuanvil.gui.config.global;
import com.github.stefvanschie.inventoryframework.gui.GuiItem;
import io.delilaheve.util.ConfigOptions;
import org.bukkit.Material;
import org.jetbrains.annotations.Nullable;
import xyz.alexcrea.cuanvil.config.ConfigHolder;
@ -37,17 +38,23 @@ public class EnchantLimitConfigGui extends AbstractEnchantConfigGui<IntSettingsG
@Override
public IntSettingsGui.IntSettingFactory createFactory(CAEnchantment enchant) {
String key = enchant.getKey().getKey().toLowerCase(Locale.ROOT);
String prettyKey = CasedStringUtil.snakeToUpperSpacedCase(key);
String key = enchant.getKey().toString().toLowerCase(Locale.ROOT);
String prettyKey = CasedStringUtil.snakeToUpperSpacedCase(key.replace(":", "_"));
return new IntSettingsGui.IntSettingFactory(prettyKey + " Level Limit", this,
return new IntSettingsGui.IntSettingFactory(prettyKey + " Limit", this,
SECTION_NAME + '.' + key, ConfigHolder.DEFAULT_CONFIG,
Collections.singletonList(
"§7Maximum applied level of " + prettyKey
),
0, 255,
enchant.defaultMaxLevel(),
1, 5, 10, 50, 100);
1, 5, 10, 50, 100){
@Override
public int getConfiguredValue() {
return ConfigOptions.INSTANCE.enchantLimit(enchant);
}
};
}
@Override

View file

@ -1,6 +1,7 @@
package xyz.alexcrea.cuanvil.gui.config.global;
import com.github.stefvanschie.inventoryframework.gui.GuiItem;
import io.delilaheve.util.ConfigOptions;
import org.bukkit.Material;
import org.jetbrains.annotations.Nullable;
import xyz.alexcrea.cuanvil.config.ConfigHolder;
@ -34,8 +35,8 @@ public class EnchantMergeLimitConfigGui extends AbstractEnchantConfigGui<IntSett
@Override
public IntSettingsGui.IntSettingFactory createFactory(CAEnchantment enchant) {
String key = enchant.getKey().getKey().toLowerCase(Locale.ROOT);
String prettyKey = CasedStringUtil.snakeToUpperSpacedCase(key);
String key = enchant.getKey().toString().toLowerCase(Locale.ROOT);
String prettyKey = CasedStringUtil.snakeToUpperSpacedCase(key.replace(":", "_"));
return new IntSettingsGui.IntSettingFactory(prettyKey + " Merge Limit", this,
SECTION_NAME + '.' + key, ConfigHolder.DEFAULT_CONFIG,
@ -48,7 +49,13 @@ public class EnchantMergeLimitConfigGui extends AbstractEnchantConfigGui<IntSett
"§e-1 §7(default) will set the merge limit to enchantment's maximum level"
),
-1, 255, -1,
1, 5, 10, 50, 100);
1, 5, 10, 50, 100){
@Override
public int getConfiguredValue() {
return ConfigOptions.INSTANCE.maxBeforeMergeDisabled(enchant);
}
};
}
@Override

View file

@ -258,7 +258,7 @@ public class EnchantConflictSubSettingGui extends MappedToListSubSettingGui impl
String[] enchantKeys = new String[enchantments.size()];
int index = 0;
for (CAEnchantment enchantment : enchantments) {
enchantKeys[index++] = enchantment.getKey().getKey();
enchantKeys[index++] = enchantment.getKey().toString();
}
ConfigHolder.CONFLICT_HOLDER.getConfig().set(enchantConflict + ".enchantments", enchantKeys);

View file

@ -5,6 +5,7 @@ import com.github.stefvanschie.inventoryframework.gui.type.util.Gui;
import com.github.stefvanschie.inventoryframework.pane.PatternPane;
import com.github.stefvanschie.inventoryframework.pane.util.Pattern;
import io.delilaheve.CustomAnvil;
import io.delilaheve.util.ConfigOptions;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemFlag;
@ -13,6 +14,7 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import xyz.alexcrea.cuanvil.config.ConfigHolder;
import xyz.alexcrea.cuanvil.enchant.CAEnchantment;
import xyz.alexcrea.cuanvil.gui.ValueUpdatableGui;
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalActions;
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalItems;
@ -237,43 +239,13 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
return super.hadChange() || nowBook != beforeBook;
}
/**
* Create an int setting factory from setting's parameters.
*
* @param title The title of the gui.
* @param parent Parent gui to go back when completed.
* @param config Configuration holder of this setting.
* @param configPath Configuration path of this setting.
* @param displayLore Gui display item lore.
* @param min Minimum value of this setting.
* @param max Maximum value of this setting.
* @param defaultItemVal Default item value if not found on the config.
* @param defaultBookVal Default book value if not found on the config.
* @param steps List of step the value can increment/decrement.
* List's size should be between 1 (included) and 3 (included).
* it is visually preferable to have an odd number of step.
* If step only contain 1 value, no step item should be displayed.
* @return A factory for an enchant cost setting gui.
*/
public static EnchantCostSettingFactory enchantCostFactory(
@NotNull String title, @NotNull ValueUpdatableGui parent,
@NotNull ConfigHolder config, @NotNull String configPath,
@Nullable List<String> displayLore,
int min, int max, int defaultItemVal, int defaultBookVal,
int... steps) {
return new EnchantCostSettingFactory(
title, parent,
configPath, config,
displayLore,
min, max, defaultItemVal, defaultBookVal, steps);
}
/**
* A factory for an enchantment cost setting gui that hold setting's information.
*/
public static class EnchantCostSettingFactory extends IntSettingsGui.IntSettingFactory {
int defaultBookVal;
@NotNull CAEnchantment enchantment;
/**
* Constructor for an enchantment cost setting gui factory.
@ -285,25 +257,27 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
* @param displayLore Gui display item lore.
* @param min Minimum value of this setting.
* @param max Maximum value of this setting.
* @param defaultItemVal Default item value if not found on the config.
* @param defaultBookVal Default book value if not found on the config.
* @param enchantment Enchantment to change the cost to
* @param steps List of step the value can increment/decrement.
* List's size should be between 1 (included) and 3 (included).
* it is visually preferable to have an odd number of step.
* If step only contain 1 value, no step item should be displayed.
*/
protected EnchantCostSettingFactory(
public EnchantCostSettingFactory(
@NotNull String title, ValueUpdatableGui parent,
@NotNull String configPath, @NotNull ConfigHolder config,
@Nullable List<String> displayLore,
int min, int max, int defaultItemVal, int defaultBookVal,
int... steps) {
@NotNull CAEnchantment enchantment,
int min, int max, int... steps) {
super(title, parent,
configPath, config,
displayLore,
min, max, defaultItemVal, steps);
this.defaultBookVal = defaultBookVal;
min, max, enchantment.defaultRarity().getItemValue(),
steps);
this.defaultBookVal = enchantment.defaultRarity().getBookValue();
this.enchantment = enchantment;
}
/**
@ -311,14 +285,14 @@ public class EnchantCostSettingsGui extends IntSettingsGui {
*/
@Override
public int getConfiguredValue() {
return this.config.getConfig().getInt(this.configPath + ITEM_PATH, this.defaultVal);
return ConfigOptions.INSTANCE.enchantmentValue(enchantment, false);
}
/**
* @return The configured value for the enchant setting book value.
*/
public int getConfiguredBookValue() {
return this.config.getConfig().getInt(this.configPath + BOOK_PATH, this.defaultBookVal);
return ConfigOptions.INSTANCE.enchantmentValue(enchantment, true);
}
@Override

View file

@ -45,13 +45,13 @@ public class Update_1_21 {
addToStringList(groupConfig, "can_unbreak.groups", "mace");
// Add new enchant conflicts
addToStringList(conflictConfig, "restriction_density.enchantments", "density");
addToStringList(conflictConfig, "restriction_density.enchantments", "minecraft:density");
addToStringList(conflictConfig, "restriction_density.notAffectedGroups", "mace", "enchanted_book");
addToStringList(conflictConfig, "restriction_breach.enchantments", "breach");
addToStringList(conflictConfig, "restriction_breach.enchantments", "minecraft:breach");
addToStringList(conflictConfig, "restriction_breach.notAffectedGroups", "mace", "enchanted_book");
addToStringList(conflictConfig, "restriction_wind_burst.enchantments", "wind_burst");
addToStringList(conflictConfig, "restriction_wind_burst.enchantments", "minecraft:wind_burst");
addToStringList(conflictConfig, "restriction_wind_burst.notAffectedGroups", "mace", "enchanted_book");
// Add mace to conflicts
@ -59,13 +59,14 @@ public class Update_1_21 {
addToStringList(conflictConfig, "restriction_smite.notAffectedGroups", "mace");
addToStringList(conflictConfig, "restriction_bane_of_arthropods.notAffectedGroups", "mace");
addToStringList(conflictConfig, "mace_enchant_conflict.enchantments", "density", "breach", "smite", "bane_of_arthropods");
addToStringList(conflictConfig, "mace_enchant_conflict.enchantments",
"minecraft:density", "minecraft:breach", "minecraft:smite", "minecraft:bane_of_arthropods");
conflictConfig.set("mace_enchant_conflict.maxEnchantmentBeforeConflict", 1);
// Add level limit
baseConfig.set("enchant_limits.density", 5);
baseConfig.set("enchant_limits.breach", 4);
baseConfig.set("enchant_limits.wind_burst", 3);
baseConfig.set("enchant_limits.minecraft:density", 5);
baseConfig.set("enchant_limits.minecraft:breach", 4);
baseConfig.set("enchant_limits.minecraft:wind_burst", 3);
// Add enchant values
baseConfig.set("enchant_values.density.item", 1);

View file

@ -301,21 +301,28 @@ object ConfigOptions {
* Get the given [enchantment]'s limit
*/
fun enchantLimit(enchantment: CAEnchantment): Int {
return enchantLimit(enchantment.enchantmentName)
// Test namespace
var limit = enchantLimit(enchantment.key.toString())
if(limit != null) return limit;
// Test legacy (name only)
limit = enchantLimit(enchantment.enchantmentName)
if(limit != null) return limit;
// get default (and test old legacy if present)
return getDefaultLevel(enchantment.enchantmentName)
}
/**
* Get the given [enchantmentName]'s limit
*/
private fun enchantLimit(enchantmentName: String): Int {
val default = getDefaultLevel(enchantmentName)
private fun enchantLimit(enchantmentName: String): Int? {
val path = "${ENCHANT_LIMIT_ROOT}.$enchantmentName"
return CustomAnvil.instance
.config
.getInt(path, default)
.getInt(path, ENCHANT_LIMIT_RANGE.first-1)
.takeIf { it in ENCHANT_LIMIT_RANGE }
?: default
}
/**
@ -324,7 +331,9 @@ object ConfigOptions {
private fun getDefaultLevel(enchantmentName: String, // compatibility with 1.20.5. TODO better update system
) : Int {
if(enchantmentName == "sweeping_edge"){
return enchantLimit("sweeping")
val limit = enchantLimit("sweeping")
if(limit != null) return limit
}
return defaultEnchantLimit
}
@ -337,7 +346,17 @@ object ConfigOptions {
enchantment: CAEnchantment,
isFromBook: Boolean
): Int {
return enchantmentValue(enchantment.enchantmentName, isFromBook)
// Test namespace
var limit = enchantmentValue(enchantment.key.toString(), isFromBook)
if(limit != null) return limit;
// Test legacy (name only)
limit = enchantmentValue(enchantment.enchantmentName, isFromBook)
if(limit != null) return limit;
// get default (and test old legacy if present)
return getDefaultValue(enchantment, isFromBook)
}
/**
@ -347,36 +366,36 @@ object ConfigOptions {
private fun enchantmentValue(
enchantmentName: String,
isFromBook: Boolean
): Int {
val default = getDefaultValue(enchantmentName, isFromBook)
): Int? {
val typeKey = if (isFromBook) KEY_BOOK else KEY_ITEM
val path = "${ENCHANT_VALUES_ROOT}.${enchantmentName}.$typeKey"
return CustomAnvil.instance
.config
.getInt(path, default)
.getInt(path, DEFAULT_ENCHANT_VALUE - 1)
.takeIf { it >= DEFAULT_ENCHANT_VALUE }
?: DEFAULT_ENCHANT_VALUE
}
/**
* Get default value if enchantment do not exist on config
*/
private fun getDefaultValue(enchantmentName: String, // compatibility with 1.20.5. TODO better update system
private fun getDefaultValue(enchantment: CAEnchantment, // compatibility with 1.20.5. TODO better update system
isFromBook: Boolean) : Int {
if(enchantmentName == "sweeping_edge"){
return enchantmentValue("sweeping", isFromBook)
val enchantmentName = enchantment.key.toString()
if(enchantmentName == "minecraft:sweeping_edge"){
var limit = enchantmentValue("minecraft:sweeping", isFromBook)
if(limit != null) return limit
// legacy name
limit = enchantmentValue("sweeping", isFromBook)
if(limit != null) return limit
}
val enchantment = CAEnchantment.getByName(enchantmentName)
if(enchantment != null){
val rarity = enchantment.defaultRarity()
return if(isFromBook) rarity.bookValue
else rarity.itemValue
}
return DEFAULT_ENCHANT_VALUE
return if(isFromBook)
rarity.bookValue
else
rarity.itemValue
}
/**
@ -384,28 +403,39 @@ object ConfigOptions {
* a negative value would mean never disabled
*/
fun maxBeforeMergeDisabled(enchantment: CAEnchantment): Int {
return maxBeforeMergeDisabled(enchantment.enchantmentName)
val key = enchantment.key.toString()
var value = maxBeforeMergeDisabled(key)
if(value != null) return value
// Legacy name
val legacy = enchantment.enchantmentName
value = maxBeforeMergeDisabled(legacy)
if(value != null) return value
if(key == "minecraft:sweeping_edge"){
value = maxBeforeMergeDisabled("minecraft:sweeping")
if(value != null) return value
// legacy name of legacy enchantment name
value = maxBeforeMergeDisabled("sweeping")
if(value != null) return value
}
return DEFAULT_MAX_BEFORE_MERGE_DISABLED
}
/**
* Get the given [enchantmentName]'s level before merge is disabled
* a negative value would mean never disabled
*/
private fun maxBeforeMergeDisabled(enchantmentName: String) : Int {
private fun maxBeforeMergeDisabled(enchantmentName: String) : Int? {
// find if set
val path = "${DISABLE_MERGE_OVER_ROOT}.$enchantmentName"
val value = CustomAnvil.instance
return CustomAnvil.instance
.config
.getInt(path, DEFAULT_MAX_BEFORE_MERGE_DISABLED)
.getInt(path, ENCHANT_LIMIT_RANGE.min() - 1)
.takeIf { it in ENCHANT_LIMIT_RANGE }
?: DEFAULT_MAX_BEFORE_MERGE_DISABLED;
if((value == DEFAULT_MAX_BEFORE_MERGE_DISABLED) && (enchantmentName == "sweeping_edge")){
return maxBeforeMergeDisabled("sweeping")
}
return value
}
}

View file

@ -15,6 +15,9 @@ class EnchantConflictGroup(
fun addEnchantment(enchant: CAEnchantment) {
enchantments.add(enchant)
}
fun addEnchantments(enchants: List<CAEnchantment>) {
enchantments.addAll(enchants)
}
fun allowed(enchants: Set<CAEnchantment>, mat: Material): Boolean {
if (enchantments.size < minBeforeBlock) {

View file

@ -30,9 +30,9 @@ class EnchantConflictManager {
const val DEFAULT_GROUP_NAME = "joinedGroup"
// 1.20.5 compatibility TODO better update system
private val SWEEPING_EDGE_ENCHANT =
private val SWEEPING_EDGE_ENCHANT = Collections.singletonList<CAEnchantment>(
CAEnchantment.getByKey(NamespacedKey.minecraft("sweeping_edge")) ?:
CAEnchantment.getByKey(Enchantment.SWEEPING_EDGE.key)
CAEnchantment.getByKey(Enchantment.SWEEPING_EDGE.key))
}
@ -94,14 +94,14 @@ class EnchantConflictManager {
// Read and add enchantment to conflict
val enchantList = section.getStringList(ENCH_LIST_PATH)
for (enchantName in enchantList) {
val enchant = getEnchantByName(enchantName)
if (enchant == null) {
val enchants = getEnchantByIdentifier(enchantName)
if (enchants.isEmpty()) {
if (!futureUse) { //TODO future use will be deprecated once the new update system is finished
CustomAnvil.instance.logger.warning("Enchantment $enchantName do not exist but was asked for conflict $conflictName")
}
continue
}
conflict.addEnchantment(enchant)
conflict.addEnchantments(enchants)
}
if (conflict.getEnchants().isEmpty()) {
if (!futureUse) { //TODO future use will be deprecated once the new update system is finished
@ -112,16 +112,23 @@ class EnchantConflictManager {
return conflict
}
private fun getEnchantByName(enchantName: String): CAEnchantment? {
private fun getEnchantByIdentifier(enchantName: String): List<CAEnchantment> {
val key = NamespacedKey.fromString(enchantName)
if(key != null){
val enchantment = CAEnchantment.getByKey(key)
if(enchantment != null) return Collections.singletonList(enchantment)
}
// Temporary solution for 1.20.5
when(enchantName){
"sweeping", "sweeping_edge" -> {
"minecraft:sweeping", "sweeping",
"minecraft:sweeping_edge", "sweeping_edge" -> {
return SWEEPING_EDGE_ENCHANT
}
}
return CAEnchantment.getByName(enchantName)
return CAEnchantment.getListByName(enchantName)
}

View file

@ -97,46 +97,46 @@ default_limit: 5
#
# Valid range of 1 - 255 for each enchantment
enchant_limits:
aqua_affinity: 1
binding_curse: 1
channeling: 1
flame: 1
infinity: 1
mending: 1
multishot: 1
silk_touch: 1
vanishing_curse: 1
depth_strider: 3 # anything more than 3 is treated as 3 by the game
protection: 4
fire_protection: 4
blast_protection: 4
projectile_protection: 4
feather_falling: 4
thorns: 3
respiration: 3
sharpness: 5
smite: 5
bane_of_arthropods: 5
knockback: 2
fire_aspect: 2
looting: 3
sweeping: 3
sweeping_edge: 3
efficiency: 5
unbreaking: 3
fortune: 3
power: 5
punch: 2
luck_of_the_sea: 3
lure: 3
frost_walker: 2
impaling: 5
riptide: 3
loyalty: 3
piercing: 4
quick_charge: 3
soul_speed: 3
swift_sneak: 3
minecraft:aqua_affinity: 1
minecraft:binding_curse: 1
minecraft:channeling: 1
minecraft:flame: 1
minecraft:infinity: 1
minecraft:mending: 1
minecraft:multishot: 1
minecraft:silk_touch: 1
minecraft:vanishing_curse: 1
minecraft:depth_strider: 3 # anything more than 3 is treated as 3 by the game
minecraft:protection: 4
minecraft:fire_protection: 4
minecraft:blast_protection: 4
minecraft:projectile_protection: 4
minecraft:feather_falling: 4
minecraft:thorns: 3
minecraft:respiration: 3
minecraft:sharpness: 5
minecraft:smite: 5
minecraft:bane_of_arthropods: 5
minecraft:knockback: 2
minecraft:fire_aspect: 2
minecraft:looting: 3
minecraft:sweeping: 3
minecraft:sweeping_edge: 3
minecraft:efficiency: 5
minecraft:unbreaking: 3
minecraft:fortune: 3
minecraft:power: 5
minecraft:punch: 2
minecraft:luck_of_the_sea: 3
minecraft:lure: 3
minecraft:frost_walker: 2
minecraft:impaling: 5
minecraft:riptide: 3
minecraft:loyalty: 3
minecraft:piercing: 4
minecraft:quick_charge: 3
minecraft:soul_speed: 3
minecraft:swift_sneak: 3
# Multipliers used to calculate the enchantment's value in repair/combining
#
@ -150,124 +150,124 @@ enchant_limits:
# With default values protection 4 would have a value of 4 when
# coming from either a book (4 * 1) or an item (4 * 1)
enchant_values:
aqua_affinity:
minecraft:aqua_affinity:
item: 4
book: 2
bane_of_arthropods:
minecraft:bane_of_arthropods:
item: 2
book: 1
binding_curse:
minecraft:binding_curse:
item: 8
book: 4
blast_protection:
minecraft:blast_protection:
item: 4
book: 2
channeling:
minecraft:channeling:
item: 8
book: 4
depth_strider:
minecraft:depth_strider:
item: 4
book: 2
efficiency:
minecraft:efficiency:
item: 1
book: 1
flame:
minecraft:flame:
item: 4
book: 2
feather_falling:
minecraft:feather_falling:
item: 2
book: 1
fire_aspect:
minecraft:fire_aspect:
item: 4
book: 2
fire_protection:
minecraft:fire_protection:
item: 2
book: 1
fortune:
minecraft:fortune:
item: 4
book: 2
frost_walker:
minecraft:frost_walker:
item: 4
book: 2
impaling:
minecraft:impaling:
item: 4
book: 2
infinity:
minecraft:infinity:
item: 8
book: 4
knockback:
minecraft:knockback:
item: 2
book: 1
looting:
minecraft:looting:
item: 4
book: 2
loyalty:
minecraft:loyalty:
item: 1
book: 1
luck_of_the_sea:
minecraft:luck_of_the_sea:
item: 4
book: 2
lure:
minecraft:lure:
item: 4
book: 2
mending:
minecraft:mending:
item: 4
book: 2
multishot:
minecraft:multishot:
item: 4
book: 2
piercing:
minecraft:piercing:
item: 1
book: 1
power:
minecraft:power:
item: 1
book: 1
projectile_protection:
minecraft:projectile_protection:
item: 2
book: 1
protection:
minecraft:protection:
item: 1
book: 1
punch:
minecraft:punch:
item: 4
book: 2
quick_charge:
minecraft:quick_charge:
item: 2
book: 1
respiration:
minecraft:respiration:
item: 4
book: 2
riptide:
minecraft:riptide:
item: 4
book: 2
silk_touch:
minecraft:silk_touch:
item: 8
book: 4
sharpness:
minecraft:sharpness:
item: 1
book: 1
smite:
minecraft:smite:
item: 2
book: 1
soul_speed:
minecraft:soul_speed:
item: 8
book: 4
swift_sneak:
minecraft:swift_sneak:
item: 8
book: 4
sweeping:
minecraft:sweeping:
item: 4
book: 2
sweeping_edge:
minecraft:sweeping_edge:
item: 4
book: 2
thorns:
minecraft:thorns:
item: 8
book: 4
unbreaking:
minecraft:unbreaking:
item: 2
book: 1
vanishing_curse:
minecraft:vanishing_curse:
item: 8
book: 4
@ -278,9 +278,9 @@ enchant_values:
# -1 mean enchantment merge for this enchantment is not disabled. default to -1 if absent.
disable-merge-over:
# Sharpness is set to -1. it equivalent to it not being set to anything (and work as vanilla)
sharpness: -1
minecraft:sharpness: -1
# If uncommented. 2 unbreaking II book would not give an unbreaking III book. but unbreaking III book can still be applied
#unbreaking: 2
#minecraft:unbreaking: 2
# Whether to show debug logging
debug_log: false

View file

@ -17,158 +17,158 @@
# ----------------------------------------------------
restriction_aqua_affinity:
enchantments: [ aqua_affinity ]
enchantments: [ minecraft:aqua_affinity ]
notAffectedGroups: [ enchanted_book, helmets ]
restriction_bane_of_arthropods:
enchantments: [ bane_of_arthropods ]
enchantments: [ minecraft:bane_of_arthropods ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_blast_protection:
enchantments: [ blast_protection ]
enchantments: [ minecraft:blast_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_channeling:
enchantments: [ channeling ]
enchantments: [ minecraft:channeling ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_binding_curse:
enchantments: [ binding_curse ]
enchantments: [ minecraft:binding_curse ]
notAffectedGroups: [ enchanted_book, wearable ]
restriction_vanishing_curse:
enchantments: [ vanishing_curse ]
enchantments: [ minecraft:vanishing_curse ]
notAffectedGroups: [ enchanted_book, can_vanish ]
restriction_depth_strider:
enchantments: [ depth_strider ]
enchantments: [ minecraft:depth_strider ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_efficiency:
enchantments: [ efficiency ]
enchantments: [ minecraft:efficiency ]
notAffectedGroups: [ enchanted_book, tools, shears ]
restriction_feather_falling:
enchantments: [ feather_falling ]
enchantments: [ minecraft:feather_falling ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_fire_aspect:
enchantments: [ fire_aspect ]
enchantments: [ minecraft:fire_aspect ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_fire_protection:
enchantments: [ fire_protection ]
enchantments: [ minecraft:fire_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_flame:
enchantments: [ flame ]
enchantments: [ minecraft:flame ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_fortune:
enchantments: [ fortune ]
enchantments: [ minecraft:fortune ]
notAffectedGroups: [ enchanted_book, tools ]
restriction_frost_walker:
enchantments: [ frost_walker ]
enchantments: [ minecraft:frost_walker ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_impaling:
enchantments: [ impaling ]
enchantments: [ minecraft:impaling ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_infinity:
enchantments: [ infinity ]
enchantments: [ minecraft:infinity ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_knockback:
enchantments: [ knockback ]
enchantments: [ minecraft:knockback ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_looting:
enchantments: [ looting ]
enchantments: [ minecraft:looting ]
notAffectedGroups: [ enchanted_book, swords ]
restriction_loyalty:
enchantments: [ loyalty ]
enchantments: [ minecraft:loyalty ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_lure:
enchantments: [ lure ]
enchantments: [ minecraft:lure ]
notAffectedGroups: [ enchanted_book, fishing_rod ]
restriction_mending:
enchantments: [ mending ]
enchantments: [ minecraft:mending ]
notAffectedGroups: [ enchanted_book, can_unbreak ]
restriction_multishot:
enchantments: [ multishot ]
restriction_minecraft_multishot:
enchantments: [ minecraft:multishot ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_piercing:
enchantments: [ piercing ]
enchantments: [ minecraft:piercing ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_power:
enchantments: [ power ]
enchantments: [ minecraft:power ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_projectile_protection:
enchantments: [ projectile_protection ]
enchantments: [ minecraft:projectile_protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_protection:
enchantments: [ protection ]
enchantments: [ minecraft:protection ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_punch:
enchantments: [ punch ]
enchantments: [ minecraft:punch ]
notAffectedGroups: [ enchanted_book, bow ]
restriction_quick_charge:
enchantments: [ quick_charge ]
enchantments: [ minecraft:quick_charge ]
notAffectedGroups: [ enchanted_book, crossbow ]
restriction_respiration:
enchantments: [ respiration ]
enchantments: [ minecraft:respiration ]
notAffectedGroups: [ enchanted_book, helmets ]
restriction_riptide:
enchantments: [ riptide ]
enchantments: [ minecraft:riptide ]
notAffectedGroups: [ enchanted_book, trident ]
restriction_sharpness:
enchantments: [ sharpness ]
enchantments: [ minecraft:sharpness ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_silk_touch:
enchantments: [ silk_touch ]
restriction__silk_touch:
enchantments: [ minecraft:silk_touch ]
notAffectedGroups: [ enchanted_book, tools ]
restriction_smite:
enchantments: [ smite ]
enchantments: [ minecraft:smite ]
notAffectedGroups: [ enchanted_book, melee_weapons ]
restriction_soul_speed:
enchantments: [ soul_speed ]
enchantments: [ minecraft:soul_speed ]
notAffectedGroups: [ enchanted_book, boots ]
restriction_sweeping_edge:
enchantments: [ sweeping, sweeping_edge ]
enchantments: [ minecraft:sweeping, minecraft:sweeping_edge ]
notAffectedGroups: [ enchanted_book, swords ]
# Do not exist in 1.18, that mean useInFuture will be set to true
# useInFuture set to true also mean it will not warn if there is an issue
restriction_swift_sneak:
useInFuture: true
enchantments: [ swift_sneak ]
enchantments: [ minecraft:swift_sneak ]
notAffectedGroups: [ enchanted_book, leggings ]
restriction_thorns:
enchantments: [ thorns ]
enchantments: [ minecraft:thorns ]
notAffectedGroups: [ enchanted_book, armors ]
restriction_unbreaking:
enchantments: [ unbreaking ]
restriction__unbreaking:
enchantments: [ minecraft:unbreaking ]
notAffectedGroups: [ enchanted_book, can_unbreak ]
# ----------------------------------------------------
@ -180,60 +180,60 @@ restriction_unbreaking:
sword_enchant_conflict:
enchantments:
- bane_of_arthropods
- smite
- sharpness
- minecraft:bane_of_arthropods
- minecraft:smite
- minecraft:sharpness
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
protection_enchant_conflict:
enchantments:
- blast_protection
- fire_protection
- projectile_protection
- protection
- minecraft:blast_protection
- minecraft:fire_protection
- minecraft:projectile_protection
- minecraft:protection
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
trident_conflict1:
enchantments:
- channeling
- riptide
- minecraft:channeling
- minecraft:riptide
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
trident_conflict2:
enchantments:
- loyalty
- riptide
- minecraft:loyalty
- minecraft:riptide
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
boot_conflict:
enchantments:
- depth_strider
- frost_walker
- minecraft:depth_strider
- minecraft:frost_walker
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
tool_conflict:
enchantments:
- fortune
- silk_touch
- minecraft:fortune
- minecraft:silk_touch
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
bow_conflict:
enchantments:
- mending
- infinity
- minecraft:mending
- minecraft:infinity
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1
crossbow_conflict:
enchantments:
- multishot
- piercing
- minecraft:multishot
- minecraft:piercing
notAffectedGroups: [ ]
maxEnchantmentBeforeConflict: 1