aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java')
-rw-r--r--src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java b/src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java
index 61cb93d..06f3196 100644
--- a/src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java
+++ b/src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java
@@ -1,25 +1,30 @@
package dev.mayaqq.ygasi.registry;
import dev.mayaqq.ygasi.items.SkillBookItem;
-import eu.pb4.polymer.api.item.PolymerItemGroup;
-import eu.pb4.polymer.api.resourcepack.PolymerModelData;
-import eu.pb4.polymer.api.resourcepack.PolymerRPUtils;
+import eu.pb4.polymer.core.api.item.PolymerItemGroupUtils;
+import eu.pb4.polymer.resourcepack.api.PolymerModelData;
+import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
+import net.minecraft.registry.Registries;
+import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
-import net.minecraft.util.registry.Registry;
public class ItemRegistry {
- public static final PolymerItemGroup YGASI_GROUP = PolymerItemGroup.create(new Identifier("ygasi"), Text.translatable("creative.ygasi.group"), () -> new ItemStack(Items.BOOK));
-
- public static final SkillBookItem SKILL_BOOK = new SkillBookItem(new Item.Settings().group(YGASI_GROUP).maxCount(1), Items.BOOK);
+ public static final SkillBookItem SKILL_BOOK = new SkillBookItem(new Item.Settings().maxCount(1), Items.BOOK);
public static void register() {
- PolymerRPUtils.addAssetSource("ygasi");
-
- PolymerModelData skillBookModelData = PolymerRPUtils.requestModel(Items.BOOK, new Identifier("ygasi", "item/skill_book"));
+ PolymerItemGroupUtils.builder(new Identifier("ygasi", "ygasi"))
+ .displayName(Text.translatable("creative.ygasi.group"))
+ .icon(() -> new ItemStack(Items.BOOK))
+ .entries((enabledFeatures, entries, operatorEnabled) -> {
+ entries.add(SKILL_BOOK);
+ })
+ .build();
+ PolymerResourcePackUtils.addModAssets("ygasi");
+ PolymerModelData skillBookModelData = PolymerResourcePackUtils.requestModel(Items.BOOK, new Identifier("ygasi", "item/skill_book"));
- Registry.register(Registry.ITEM, "ygasi:skill_book", SKILL_BOOK);
+ Registry.register(Registries.ITEM, new Identifier("ygasi", "skill_book"), SKILL_BOOK);
}
}