Enchantment config (#334)

This commit is contained in:
paulevsGitch 2021-10-26 16:49:28 +03:00
parent 3b570cd80e
commit ce7a8fc70a
4 changed files with 24 additions and 19 deletions

View file

@ -0,0 +1,20 @@
package ru.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.world.item.enchantment.Enchantment;
import ru.betterend.BetterEnd;
import ru.betterend.config.Configs;
import ru.betterend.effects.enchantment.EndVeilEnchantment;
public class EndEnchantments {
public final static Enchantment END_VEIL = registerEnchantment("end_veil", new EndVeilEnchantment());
public static Enchantment registerEnchantment(String name, Enchantment enchantment) {
if (!Configs.ENCHANTMENT_CONFIG.getBooleanRoot(name, true)) {
return enchantment;
}
return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment);
}
public static void register() {}
}