Enchantment config (#334)
This commit is contained in:
parent
3b570cd80e
commit
ce7a8fc70a
4 changed files with 24 additions and 19 deletions
20
src/main/java/ru/betterend/registry/EndEnchantments.java
Normal file
20
src/main/java/ru/betterend/registry/EndEnchantments.java
Normal 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() {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue