aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/mayaqq/ygasi/registry
diff options
context:
space:
mode:
authorMaximusbarcz <maxim.baranek@gmail.com>2023-01-11 19:50:29 +0100
committerMaximusbarcz <maxim.baranek@gmail.com>2023-01-11 19:50:29 +0100
commit5bcb1830298caad87a63f44c4e7f1553074cf4c8 (patch)
treec0c193496f96a201ecd8b3ce44c24fd0ac0d6214 /src/main/java/dev/mayaqq/ygasi/registry
parent5e48daa137cda5043ebce80b7e3e975da2d7c069 (diff)
downloadygasi-5bcb1830298caad87a63f44c4e7f1553074cf4c8.tar.gz
ygasi-5bcb1830298caad87a63f44c4e7f1553074cf4c8.tar.bz2
ygasi-5bcb1830298caad87a63f44c4e7f1553074cf4c8.zip
Made everything work on 1.19.3, wasnt that bad after all!
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/registry')
-rw-r--r--src/main/java/dev/mayaqq/ygasi/registry/ItemRegistry.java27
-rw-r--r--src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java2
2 files changed, 17 insertions, 12 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);
}
}
diff --git a/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java b/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java
index 039b0b6..5d095ba 100644
--- a/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java
+++ b/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java
@@ -1,6 +1,6 @@
package dev.mayaqq.ygasi.registry;
-import eu.pb4.polymer.api.other.PolymerStat;
+import eu.pb4.polymer.core.api.other.PolymerStat;
import net.minecraft.stat.StatFormatter;
import net.minecraft.util.Identifier;