diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d39569c..2d03711 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,8 @@ jobs: github-token: ${{ github.token }} game-versions: | - 1.19.4 + 1.20 + 1.20.1 loaders: | fabric quilt diff --git a/gradle.properties b/gradle.properties index 36957f0..64b1d43 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/versions.html -minecraft_version=1.19.4 -yarn_mappings=1.19.4+build.2 +minecraft_version=1.20.1 +yarn_mappings=1.20.1+build.10 loader_version=0.14.21 #Fabric api -fabric_version=0.86.1+1.19.4 +fabric_version=0.86.1+1.20.1 # Dependencies diff --git a/src/main/java/dev/upcraft/glassential/Glassential.java b/src/main/java/dev/upcraft/glassential/Glassential.java index df54fe7..c92f496 100644 --- a/src/main/java/dev/upcraft/glassential/Glassential.java +++ b/src/main/java/dev/upcraft/glassential/Glassential.java @@ -10,8 +10,12 @@ import net.minecraft.item.*; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.text.Text; import net.minecraft.util.Identifier; +import net.minecraft.util.Util; import org.jetbrains.annotations.Nullable; import java.util.Comparator; @@ -28,16 +32,21 @@ public class Glassential implements ModInitializer { public static Block REDSTONE_GLASS; @SuppressWarnings("unused") - public static final ItemGroup GLASSENTIAL_ITEM_GROUP = FabricItemGroup.builder(new Identifier(MODID, "items")).icon(() -> new ItemStack(LIGHT_GLASS)) - .entries((displayContext, entries) -> Registries.ITEM.streamEntries() - .filter(itemReference -> itemReference.registryKey().getValue().getNamespace().equals(MODID)) - .sorted(Comparator.comparing(itemReference -> itemReference.registryKey().getValue().getPath())) - .map(RegistryEntry.Reference::value) - .forEachOrdered(entries::add)) - .build(); + public static final RegistryKey GLASSENTIAL_ITEM_GROUP = RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier(MODID, "items")); @Override public void onInitialize() { + Registry.register(Registries.ITEM_GROUP, GLASSENTIAL_ITEM_GROUP, FabricItemGroup.builder() + .displayName(Text.translatable(Util.createTranslationKey("itemGroup", new Identifier(MODID, "items")))) + .icon(() -> new ItemStack(LIGHT_GLASS)) + .entries((displayContext, entries) -> Registries.ITEM.streamEntries() + .filter(itemReference -> itemReference.registryKey().getValue().getNamespace().equals(MODID)) + .sorted(Comparator.comparing(itemReference -> itemReference.registryKey().getValue().getPath())) + .map(RegistryEntry.Reference::value) + .forEachOrdered(entries::add)) + .build() + ); + TINTED_ETHEREAL_GLASS = registerBlock("tinted_ethereal_glass", new GlassentialGlassBlock(AbstractBlock.Settings::noCollision, BlockProperties.TINTED, BlockProperties.ETHEREAL)); TINTED_REVERSE_ETHEREAL_GLASS = registerBlock("tinted_reverse_ethereal_glass", new GlassentialGlassBlock(AbstractBlock.Settings::noCollision, BlockProperties.TINTED, BlockProperties.REVERSE_ETHEREAL)); ETHEREAL_GLASS = registerBlock("ethereal_glass", new GlassentialGlassBlock(AbstractBlock.Settings::noCollision, BlockProperties.ETHEREAL)); @@ -47,7 +56,7 @@ public void onInitialize() { REDSTONE_GLASS = registerBlock("redstone_glass", new GlassentialGlassBlock(BlockProperties.REDSTONE), ItemGroups.REDSTONE); } - private static Block registerBlock(String name, Block block, @Nullable ItemGroup itemGroup) { + private static Block registerBlock(String name, Block block, @Nullable RegistryKey itemGroup) { Identifier blockName = new Identifier(MODID, name); block = Registry.register(Registries.BLOCK, blockName, block); Item item = Registry.register(Registries.ITEM, blockName, new BlockItem(block, new Item.Settings())); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 26c224d..d979307 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -36,7 +36,7 @@ "depends": { "fabricloader": ">=0.14.9", "fabric-api": "*", - "minecraft": "1.19.4", + "minecraft": "1.20.x", "java": ">=17" } }