Nourish tags
This commit is contained in:
parent
155b2b2b21
commit
5f20079a30
4 changed files with 49 additions and 1 deletions
|
@ -9,6 +9,7 @@ import ru.betterend.integration.byg.BYGIntegration;
|
||||||
public class Integrations {
|
public class Integrations {
|
||||||
public static final List<ModIntegration> INTEGRATIONS = Lists.newArrayList();
|
public static final List<ModIntegration> INTEGRATIONS = Lists.newArrayList();
|
||||||
public static final ModIntegration BYG = register(new BYGIntegration());
|
public static final ModIntegration BYG = register(new BYGIntegration());
|
||||||
|
public static final ModIntegration NOURISH = register(new NourishIntegration());
|
||||||
//public static final ModIntegration EXTRA_PIECES = register(new ExtraPiecesIntegration());
|
//public static final ModIntegration EXTRA_PIECES = register(new ExtraPiecesIntegration());
|
||||||
//public static final ModIntegration ADORN = register(new AdornIntegration());
|
//public static final ModIntegration ADORN = register(new AdornIntegration());
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,15 @@ import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.tag.TagRegistry;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.tag.BlockTags;
|
||||||
|
import net.minecraft.tag.ItemTags;
|
||||||
|
import net.minecraft.tag.Tag;
|
||||||
|
import net.minecraft.tag.Tag.Identified;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.registry.BuiltinRegistries;
|
import net.minecraft.util.registry.BuiltinRegistries;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
|
@ -168,4 +174,16 @@ public abstract class ModIntegration {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Tag.Identified<Item> getItemTag(String name) {
|
||||||
|
Identifier id = getID(name);
|
||||||
|
Tag<Item> tag = ItemTags.getTagGroup().getTag(id);
|
||||||
|
return tag == null ? (Identified<Item>) TagRegistry.item(id) : (Identified<Item>) tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tag.Identified<Block> getBlockTag(String name) {
|
||||||
|
Identifier id = getID(name);
|
||||||
|
Tag<Block> tag = BlockTags.getTagGroup().getTag(id);
|
||||||
|
return tag == null ? (Identified<Block>) TagRegistry.block(id) : (Identified<Block>) tag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package ru.betterend.integration;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.tag.Tag;
|
||||||
|
import ru.betterend.registry.EndItems;
|
||||||
|
import ru.betterend.util.TagHelper;
|
||||||
|
|
||||||
|
public class NourishIntegration extends ModIntegration {
|
||||||
|
public NourishIntegration() {
|
||||||
|
super("nourish");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void register() {
|
||||||
|
Tag.Identified<Item> fats = getItemTag("fats");
|
||||||
|
Tag.Identified<Item> fruit = getItemTag("fruit");
|
||||||
|
Tag.Identified<Item> protein = getItemTag("protein");
|
||||||
|
Tag.Identified<Item> sweets = getItemTag("sweets");
|
||||||
|
|
||||||
|
TagHelper.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED);
|
||||||
|
TagHelper.addTag(fruit, EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED, EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY);
|
||||||
|
TagHelper.addTag(protein, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED);
|
||||||
|
TagHelper.addTag(sweets, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBiomes() {}
|
||||||
|
}
|
|
@ -44,6 +44,7 @@
|
||||||
},
|
},
|
||||||
"suggests": {
|
"suggests": {
|
||||||
"byg": ">=1.1.3",
|
"byg": ">=1.1.3",
|
||||||
"blockus": ">=2.0.2"
|
"blockus": ">=2.0.2",
|
||||||
|
"nourish": ">=1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue