File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/pro/cloudnode/smp/enchantbookplus Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ private void registerEvents() {
3535 * Config enchantments cache
3636 */
3737 public @ NotNull List <@ NotNull ConfigEnchantmentEntry > getConfigEnchantments () {
38- if (configEnchantments .size () == 0 ) reload ();
3938 return configEnchantments ;
4039 }
4140
@@ -45,7 +44,8 @@ private void registerEvents() {
4544 * @param enchantment The Minecraft enchantment
4645 */
4746 public @ NotNull Optional <@ NotNull ConfigEnchantmentEntry > getConfigEnchantment (final @ NotNull Enchantment enchantment ) {
48- return getConfigEnchantments ().stream ().filter (c -> c .isEnchantment (enchantment )).findFirst ();
47+ final @ NotNull Optional <@ NotNull ConfigEnchantmentEntry > entry = getConfigEnchantments ().stream ().filter (c -> c .isEnchantment (enchantment )).findFirst ();
48+ return entry .isEmpty () ? getConfigEnchantments ().stream ().filter (c -> c .getName ().equalsIgnoreCase ("ALL" )).findFirst () : entry ;
4949 }
5050
5151 /**
You can’t perform that action at this time.
0 commit comments