Config refactor
This commit is contained in:
parent
7f2bad86ca
commit
0f12a477e0
10 changed files with 408 additions and 265 deletions
|
@ -31,6 +31,7 @@ import net.minecraft.util.math.BlockPointer;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.config.ItemConfig;
|
||||
import ru.betterend.config.MainConfig;
|
||||
import ru.betterend.item.EndArmorMaterial;
|
||||
import ru.betterend.item.EndAxe;
|
||||
|
@ -44,7 +45,7 @@ import ru.betterend.util.TagHelper;
|
|||
|
||||
public class EndItems {
|
||||
|
||||
private static final MainConfig CONFIG = MainConfig.getInstance();
|
||||
private static final ItemConfig CONFIG = MainConfig.ITEM_CONFIG;
|
||||
private static final List<Item> MOD_BLOCKS = Lists.newArrayList();
|
||||
private static final List<Item> MOD_ITEMS = Lists.newArrayList();
|
||||
|
||||
|
@ -106,7 +107,7 @@ public class EndItems {
|
|||
}
|
||||
|
||||
public static Item registerItem(Identifier id, Item item) {
|
||||
if (!(item instanceof BlockItem) && !CONFIG.getBoolean("items", id.getPath(), true)) {
|
||||
if (!(item instanceof BlockItem) && !CONFIG.getBoolean(id, "items", true)) {
|
||||
return item;
|
||||
}
|
||||
if (item != Items.AIR) {
|
||||
|
@ -120,10 +121,11 @@ public class EndItems {
|
|||
}
|
||||
|
||||
protected static ToolItem registerTool(String name, ToolItem item) {
|
||||
if (!CONFIG.getBoolean("items", name, true)) {
|
||||
Identifier id = BetterEnd.makeID(name);
|
||||
if (!CONFIG.getBoolean(id, "items", true)) {
|
||||
return item;
|
||||
}
|
||||
Registry.register(Registry.ITEM, BetterEnd.makeID(name), item);
|
||||
Registry.register(Registry.ITEM, id, item);
|
||||
MOD_ITEMS.add(item);
|
||||
|
||||
if (item instanceof ShovelItem) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue