From 79ad1dcfdac0e76e2f4b8dcce48a8332ad719230 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Wed, 5 Jul 2023 13:12:13 +0200 Subject: [PATCH 1/6] docs: missing changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4991659..035a58f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [0.10.0] - 2023-07-05 +### Added + +- Brazilian Portuguese translation. + ### Changed - Ported to Minecraft 1.20.1. From ed84fa27584a34bf2f16e5683276d47885f36588 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 7 Jul 2023 21:44:38 +0200 Subject: [PATCH 2/6] docs: update for new Javadoc location --- .github/CONTRIBUTING.md | 4 ++-- .github/workflows/build.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/issue-for-unsupported-version.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/resolved-issue-locking.yml | 2 +- .github/workflows/validate-branch-name.yml | 2 +- .github/workflows/validate-commit-messages.yml | 2 +- README.md | 1 + build.gradle | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0e22663..6dbcc7c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -88,7 +88,7 @@ Documentation must be kept up to date when adding or changing functionality. ### Javadoc -Javadoc is available after every release on https://refinedmods.com/refinedstorageaddons/. +Javadoc is available after every release on https://refinedmods.com/javadoc/refinedstorageaddons/. ### API annotations @@ -196,7 +196,7 @@ The workflow takes care of the following: - Running a build. - Publishing on [GitHub packages](https://github.com/refinedmods/refinedstorageaddons/packages) and CreeperHost Maven. -- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/refinedstorageaddons/tree/gh-pages). +- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/javadoc). - Deploying on [GitHub releases](https://github.com/refinedmods/refinedstorageaddons/releases). - Announcing the release on Discord and Twitter. - Creating a PR that merges `main` back into `develop` to get the changes to `CHANGELOG.md` and `build.gradle` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5813d99..dfd82ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: types: [ opened, synchronize, reopened ] jobs: build: - uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.6.0 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.7.1 with: mutation-testing: false sonarqube: false diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index fd2b11e..9ad68df 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ on: type: string jobs: draft: - uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.6.0 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.7.1 with: release-type: ${{ inputs.release-type }} version-number-override: ${{ inputs.version-number-override }} diff --git a/.github/workflows/issue-for-unsupported-version.yml b/.github/workflows/issue-for-unsupported-version.yml index b80bdc2..682945e 100644 --- a/.github/workflows/issue-for-unsupported-version.yml +++ b/.github/workflows/issue-for-unsupported-version.yml @@ -4,4 +4,4 @@ on: types: [ labeled, unlabeled, reopened ] jobs: unsupported-labeler: - uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.6.0 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.7.1 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 9dcd148..b6d29e0 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,7 +7,7 @@ on: - closed jobs: publish-release: - uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.6.0 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.7.1 secrets: inherit with: project-name: 'Refined Storage Addons' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index 73023ae..a3c881c 100644 --- a/.github/workflows/resolved-issue-locking.yml +++ b/.github/workflows/resolved-issue-locking.yml @@ -4,4 +4,4 @@ on: - cron: '0 0 * * *' jobs: lock: - uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.6.0 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.7.1 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index 5db6ae8..02b7d4c 100644 --- a/.github/workflows/validate-branch-name.yml +++ b/.github/workflows/validate-branch-name.yml @@ -2,4 +2,4 @@ name: Validate branch name on: [ pull_request ] jobs: validate-branch-name: - uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.6.0 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.7.1 \ No newline at end of file diff --git a/.github/workflows/validate-commit-messages.yml b/.github/workflows/validate-commit-messages.yml index 4decd4a..2eb1843 100644 --- a/.github/workflows/validate-commit-messages.yml +++ b/.github/workflows/validate-commit-messages.yml @@ -2,4 +2,4 @@ name: Validate commit messages on: [ pull_request ] jobs: validate-commit-messages: - uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.6.0 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.7.1 \ No newline at end of file diff --git a/README.md b/README.md index a8938d8..96c1584 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Currently, Refined Storage Addons only adds the "Wireless Crafting Grid", a wire - [CurseForge](https://curseforge.com/minecraft/mc-mods/refined-storage-addons) - [Modrinth](https://modrinth.com/mod/refined-storage-addons) - [Wiki](https://refinedmods.com/refined-storage-addons/) +- [Javadoc](https://refinedmods.com/javadoc/refinedstorageaddons) - [Discord](https://discordapp.com/invite/VYzsydb) - [Twitter](https://twitter.com/refinedmods) - [Mastodon](https://anvil.social/@refinedmods) diff --git a/build.gradle b/build.gradle index ef8f88c..0495233 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.6.0/helper.gradle" +apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.7.1/helper.gradle" repositories { maven { From 8a4867c50b5586f6d67fb83463e6c2260dc37438 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 7 Jul 2023 21:44:58 +0200 Subject: [PATCH 3/6] ci: validate changelog pipeline can warn --- .github/workflows/validate-changelog.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index 8f3f0d0..43125b2 100644 --- a/.github/workflows/validate-changelog.yml +++ b/.github/workflows/validate-changelog.yml @@ -4,4 +4,6 @@ on: types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ] jobs: validate-changelog: - uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.6.0 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.7.1 + with: + validation-level: 'warn' \ No newline at end of file From a4c2d42dac08653af503decdcb1cf76e0242feb2 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 18 Nov 2023 14:36:27 +0100 Subject: [PATCH 4/6] docs: update curseforge link, add modrinth badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96c1584..89db159 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Refined Storage Addons [![Build Status](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_272302_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md) +# Refined Storage Addons [![Build Status](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_272302_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage-addons) [![Downloads on Modrinth](https://img.shields.io/modrinth/dt/refined-storage-addons?logo=modrinth)](https://modrinth.com/mod/refined-storage-addons) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md) ## About From e19e6b085ffe51544f4b94b8c876cb44f1d9084a Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 16 Feb 2024 16:02:21 +0100 Subject: [PATCH 5/6] feat: port to minecraft 1.20.4 --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/workflows/build.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .../issue-for-unsupported-version.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/resolved-issue-locking.yml | 2 +- .github/workflows/validate-branch-name.yml | 2 +- .github/workflows/validate-changelog.yml | 2 +- .../workflows/validate-commit-messages.yml | 2 +- .gitignore | 2 +- CHANGELOG.md | 4 +++ LICENSE.md | 2 +- build.gradle | 8 ++--- gradle/wrapper/gradle-wrapper.properties | 4 ++- .../refinedstorageaddons/RSAddons.java | 34 +++++++++---------- .../refinedstorageaddons/RSAddonsItems.java | 19 ++++++----- .../RSAddonsKeyBindings.java | 4 +-- .../item/WirelessCraftingGridNetworkItem.java | 11 +++--- .../config/ServerConfig.java | 20 +++++------ .../item/WirelessCraftingGrid.java | 5 ++- .../setup/ClientSetup.java | 8 ++--- .../setup/CommonSetup.java | 20 ++++++++--- src/main/resources/META-INF/mods.toml | 8 ++--- src/main/resources/pack.mcmeta | 2 +- 24 files changed, 96 insertions(+), 72 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index cbec65e..e1ba0fb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -37,6 +37,7 @@ body: options: - Minecraft 1.19.2 - Minecraft 1.20.1 + - Minecraft 1.20.4 validations: required: true - type: input diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfd82ed..448b30e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: types: [ opened, synchronize, reopened ] jobs: build: - uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.7.1 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.11.4 with: mutation-testing: false sonarqube: false diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 9ad68df..9fc1f33 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ on: type: string jobs: draft: - uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.7.1 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.11.4 with: release-type: ${{ inputs.release-type }} version-number-override: ${{ inputs.version-number-override }} diff --git a/.github/workflows/issue-for-unsupported-version.yml b/.github/workflows/issue-for-unsupported-version.yml index 682945e..b2ad193 100644 --- a/.github/workflows/issue-for-unsupported-version.yml +++ b/.github/workflows/issue-for-unsupported-version.yml @@ -4,4 +4,4 @@ on: types: [ labeled, unlabeled, reopened ] jobs: unsupported-labeler: - uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.7.1 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.11.4 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index b6d29e0..41fdbd9 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,7 +7,7 @@ on: - closed jobs: publish-release: - uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.7.1 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.11.4 secrets: inherit with: project-name: 'Refined Storage Addons' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index a3c881c..2b7957c 100644 --- a/.github/workflows/resolved-issue-locking.yml +++ b/.github/workflows/resolved-issue-locking.yml @@ -4,4 +4,4 @@ on: - cron: '0 0 * * *' jobs: lock: - uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.7.1 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.11.4 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index 02b7d4c..db81528 100644 --- a/.github/workflows/validate-branch-name.yml +++ b/.github/workflows/validate-branch-name.yml @@ -2,4 +2,4 @@ name: Validate branch name on: [ pull_request ] jobs: validate-branch-name: - uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.7.1 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.11.4 \ No newline at end of file diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index 43125b2..44feba6 100644 --- a/.github/workflows/validate-changelog.yml +++ b/.github/workflows/validate-changelog.yml @@ -4,6 +4,6 @@ on: types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ] jobs: validate-changelog: - uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.7.1 + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.11.4 with: validation-level: 'warn' \ No newline at end of file diff --git a/.github/workflows/validate-commit-messages.yml b/.github/workflows/validate-commit-messages.yml index 2eb1843..2656a4d 100644 --- a/.github/workflows/validate-commit-messages.yml +++ b/.github/workflows/validate-commit-messages.yml @@ -2,4 +2,4 @@ name: Validate commit messages on: [ pull_request ] jobs: validate-commit-messages: - uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.7.1 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.11.4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index da9f2a9..59bfde1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ eclipse/ .nb-gradle-properties .project *.launch -run/ +runs/ *.iml *.ipr *.iws diff --git a/CHANGELOG.md b/CHANGELOG.md index 035a58f..418ff49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- Ported to Minecraft 1.20.4. + ## [0.10.0] - 2023-07-05 ### Added diff --git a/LICENSE.md b/LICENSE.md index c2a7486..153f931 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright © 2017 - 2023 Refined Mods +Copyright © 2017 - 2024 Refined Mods Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/build.gradle b/build.gradle index 0495233..da87f0e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.7.1/helper.gradle" +apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.11.4/helper.gradle" repositories { maven { @@ -28,8 +28,8 @@ enableModrinth("Z4Z5ccuT") enableJavadoc() dependencies { - compileOnly "com.refinedmods:refinedstorage:1.12.1" - runtimeOnly fg.deobf("com.refinedmods:refinedstorage:1.12.1") { - transitive false + compileOnly "com.refinedmods:refinedstorage:1.13.0-beta.2" + runtimeOnly("com.refinedmods:refinedstorage:1.13.0-beta.2") { + transitive = false } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae0804..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/RSAddons.java b/src/main/java/com/refinedmods/refinedstorageaddons/RSAddons.java index 23de059..c3bcc72 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/RSAddons.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/RSAddons.java @@ -5,13 +5,13 @@ import com.refinedmods.refinedstorageaddons.config.ServerConfig; import com.refinedmods.refinedstorageaddons.setup.ClientSetup; import com.refinedmods.refinedstorageaddons.setup.CommonSetup; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.DistExecutor; -import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.config.ModConfig; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.common.NeoForge; @Mod(RSAddons.ID) public final class RSAddons { @@ -21,19 +21,19 @@ public final class RSAddons { public static final String ID = "refinedstorageaddons"; public static final ServerConfig SERVER_CONFIG = new ServerConfig(); - public RSAddons() { - //new ItemStack(RSAddonsItems.CREATIVE_WIRELESS_CRAFTING_GRID.get()) - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { - FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientSetup::onClientSetup); - MinecraftForge.EVENT_BUS.addListener(ClientSetup::onKeyInput); - FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientSetup::onRegisterKeymappings); - }); + public RSAddons(IEventBus eventBus) { + if (FMLEnvironment.dist == Dist.CLIENT) { + eventBus.addListener(ClientSetup::onClientSetup); + eventBus.addListener(ClientSetup::onRegisterKeymappings); + NeoForge.EVENT_BUS.addListener(ClientSetup::onKeyInput); + } - RSAddonsItems.register(); + RSAddonsItems.register(eventBus); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG.getSpec()); - FMLJavaModLoadingContext.get().getModEventBus().addListener(CommonSetup::onCommonSetup); - FMLJavaModLoadingContext.get().getModEventBus().addListener(CommonSetup::onRegister); + eventBus.addListener(CommonSetup::onCommonSetup); + eventBus.addListener(CommonSetup::onRegisterCapabilities); + eventBus.addListener(CommonSetup::onRegister); } } diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsItems.java b/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsItems.java index 8cf246f..77bd96c 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsItems.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsItems.java @@ -1,24 +1,25 @@ package com.refinedmods.refinedstorageaddons; import com.refinedmods.refinedstorageaddons.item.WirelessCraftingGridItem; + +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.Item; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; public final class RSAddonsItems { - private static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, RSAddons.ID); + private static final DeferredRegister ITEMS = DeferredRegister.create(BuiltInRegistries.ITEM, RSAddons.ID); static { WIRELESS_CRAFTING_GRID = ITEMS.register("wireless_crafting_grid", () -> new WirelessCraftingGridItem(WirelessCraftingGridItem.Type.NORMAL)); CREATIVE_WIRELESS_CRAFTING_GRID = ITEMS.register("creative_wireless_crafting_grid", () -> new WirelessCraftingGridItem(WirelessCraftingGridItem.Type.CREATIVE)); } - public static final RegistryObject WIRELESS_CRAFTING_GRID; - public static final RegistryObject CREATIVE_WIRELESS_CRAFTING_GRID; + public static final DeferredHolder WIRELESS_CRAFTING_GRID; + public static final DeferredHolder CREATIVE_WIRELESS_CRAFTING_GRID; - public static void register() { - ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); + public static void register(IEventBus eventBus) { + ITEMS.register(eventBus); } } diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsKeyBindings.java b/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsKeyBindings.java index 9b78b73..5590e4b 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsKeyBindings.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/RSAddonsKeyBindings.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.platform.InputConstants; import net.minecraft.client.KeyMapping; -import net.minecraftforge.client.settings.KeyConflictContext; -import net.minecraftforge.client.settings.KeyModifier; +import net.neoforged.neoforge.client.settings.KeyConflictContext; +import net.neoforged.neoforge.client.settings.KeyModifier; import org.lwjgl.glfw.GLFW; public final class RSAddonsKeyBindings { diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/apiimpl/network/item/WirelessCraftingGridNetworkItem.java b/src/main/java/com/refinedmods/refinedstorageaddons/apiimpl/network/item/WirelessCraftingGridNetworkItem.java index e076598..77ea475 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/apiimpl/network/item/WirelessCraftingGridNetworkItem.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/apiimpl/network/item/WirelessCraftingGridNetworkItem.java @@ -14,8 +14,8 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; public class WirelessCraftingGridNetworkItem implements INetworkItem { private final INetworkItemManager handler; @@ -37,7 +37,7 @@ public Player getPlayer() { @Override public boolean onOpen(INetwork network) { - IEnergyStorage energy = stack.getCapability(ForgeCapabilities.ENERGY, null).orElse(null); + IEnergyStorage energy = stack.getCapability(Capabilities.EnergyStorage.ITEM); if (RSAddons.SERVER_CONFIG.getWirelessCraftingGrid().getUseEnergy() && ((WirelessCraftingGridItem) stack.getItem()).getType() != WirelessCraftingGridItem.Type.CREATIVE && @@ -64,7 +64,8 @@ public boolean onOpen(INetwork network) { @Override public void drainEnergy(int energy) { if (RSAddons.SERVER_CONFIG.getWirelessCraftingGrid().getUseEnergy() && ((WirelessCraftingGridItem) stack.getItem()).getType() != WirelessCraftingGridItem.Type.CREATIVE) { - stack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyStorage -> { + IEnergyStorage energyStorage = stack.getCapability(Capabilities.EnergyStorage.ITEM); + if (energyStorage != null) { energyStorage.extractEnergy(energy, false); if (energyStorage.getEnergyStored() <= 0) { @@ -74,7 +75,7 @@ public void drainEnergy(int energy) { sendOutOfEnergyMessage(); } - }); + } } } diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/config/ServerConfig.java b/src/main/java/com/refinedmods/refinedstorageaddons/config/ServerConfig.java index e7108dc..b4b84c5 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/config/ServerConfig.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/config/ServerConfig.java @@ -1,11 +1,11 @@ package com.refinedmods.refinedstorageaddons.config; -import net.minecraftforge.common.ForgeConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec; public class ServerConfig { - private ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); - private ForgeConfigSpec spec; - private WirelessCraftingGrid wirelessCraftingGrid; + private final ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); + private final ModConfigSpec spec; + private final WirelessCraftingGrid wirelessCraftingGrid; public ServerConfig() { wirelessCraftingGrid = new WirelessCraftingGrid(); @@ -18,11 +18,11 @@ public WirelessCraftingGrid getWirelessCraftingGrid() { } public class WirelessCraftingGrid { - private final ForgeConfigSpec.BooleanValue useEnergy; - private final ForgeConfigSpec.IntValue capacity; - private final ForgeConfigSpec.IntValue openUsage; - private final ForgeConfigSpec.IntValue craftUsage; - private final ForgeConfigSpec.IntValue clearUsage; + private final ModConfigSpec.BooleanValue useEnergy; + private final ModConfigSpec.IntValue capacity; + private final ModConfigSpec.IntValue openUsage; + private final ModConfigSpec.IntValue craftUsage; + private final ModConfigSpec.IntValue clearUsage; public WirelessCraftingGrid() { builder.push("wirelessCraftingGrid"); @@ -57,7 +57,7 @@ public int getClearUsage() { } } - public ForgeConfigSpec getSpec() { + public ModConfigSpec getSpec() { return spec; } } diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/item/WirelessCraftingGrid.java b/src/main/java/com/refinedmods/refinedstorageaddons/item/WirelessCraftingGrid.java index ecbe2d5..fdcd94b 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/item/WirelessCraftingGrid.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/item/WirelessCraftingGrid.java @@ -22,6 +22,7 @@ import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; @@ -108,7 +109,9 @@ public ResultContainer getCraftingResult() { @Override public void onCraftingMatrixChanged() { if (currentRecipe == null || !currentRecipe.matches(craftingContainer, level)) { - currentRecipe = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingContainer, level).orElse(null); + currentRecipe = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingContainer, level) + .map(RecipeHolder::value) + .orElse(null); } if (currentRecipe == null) { craftingResultContainer.setItem(0, ItemStack.EMPTY); diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/setup/ClientSetup.java b/src/main/java/com/refinedmods/refinedstorageaddons/setup/ClientSetup.java index cb86466..f497554 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/setup/ClientSetup.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/setup/ClientSetup.java @@ -7,10 +7,10 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.item.ItemProperties; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.client.event.InputEvent; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.neoforge.client.event.InputEvent; +import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; public final class ClientSetup { private ClientSetup() { diff --git a/src/main/java/com/refinedmods/refinedstorageaddons/setup/CommonSetup.java b/src/main/java/com/refinedmods/refinedstorageaddons/setup/CommonSetup.java index 693cbfb..a8bbddf 100644 --- a/src/main/java/com/refinedmods/refinedstorageaddons/setup/CommonSetup.java +++ b/src/main/java/com/refinedmods/refinedstorageaddons/setup/CommonSetup.java @@ -5,11 +5,14 @@ import com.refinedmods.refinedstorageaddons.apiimpl.network.grid.WirelessCraftingGridGridFactory; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.registries.RegisterEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.registries.RegisterEvent; public final class CommonSetup { private CommonSetup() { @@ -20,10 +23,19 @@ public static void onCommonSetup(FMLCommonSetupEvent e) { RSAddons.RSAPI.getGridManager().add(WirelessCraftingGridGridFactory.ID, new WirelessCraftingGridGridFactory()); } + @SubscribeEvent + public static void onRegisterCapabilities(RegisterCapabilitiesEvent e) { + e.registerItem( + Capabilities.EnergyStorage.ITEM, + (stack, ctx) -> RSAddonsItems.WIRELESS_CRAFTING_GRID.get().createEnergyStorage(stack), + RSAddonsItems.WIRELESS_CRAFTING_GRID.get() + ); + } + @SubscribeEvent public static void onRegister(RegisterEvent e) { e.register(Registries.CREATIVE_MODE_TAB, helper -> { - helper.register("general", CreativeModeTab.builder() + helper.register(new ResourceLocation(RSAddons.ID, "general"), CreativeModeTab.builder() .title(Component.translatable("itemGroup.refinedstorageaddons")) .icon(() -> new ItemStack(RSAddonsItems.CREATIVE_WIRELESS_CRAFTING_GRID.get())) .displayItems((params, output) -> { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 3646231..9cda804 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,19 +1,19 @@ modLoader = "javafml" -loaderVersion = "[47,)" +loaderVersion = "[2,)" issueTrackerURL = "https://github.com/refinedmods/refinedstorageaddons" license = "MIT" [[mods]] modId = "refinedstorageaddons" version = "${version}" displayName = "Refined Storage Addons" -displayURL = "https://refinedmods.com/refined-storage-addons" +displayURL = "https://refinedmods.com/refined-storage/wireless-networking/wireless-crafting-grid.html" authors = "Refined Mods" description = ''' An addon mod for Refined Storage ''' [[dependencies.refinedstorageaddons]] modId = "refinedstorage" -versionRange = "[1.12.1,)" -mandatory = true +versionRange = "[1.13.0-beta.1,)" +type = "REQUIRED" ordering = "AFTER" side = "BOTH" diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 2fefe4a..bd53598 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -3,6 +3,6 @@ "description": { "text": "Refined Storage Addons resources" }, - "pack_format": 15 + "pack_format": 18 } } From 4508bcc7b07030c8f9363a6273a6600ddb17e5d6 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 16 Feb 2024 15:11:48 +0000 Subject: [PATCH 6/6] chore: prepare release v0.11.0 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 418ff49..8b15cd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.11.0] - 2024-02-16 + ### Changed - Ported to Minecraft 1.20.4. @@ -201,7 +203,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Initial release for Minecraft 1.12 and Refined Storage 1.5.12. -[Unreleased]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.10.0...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.11.0...HEAD + +[0.11.0]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.10.0...v0.11.0 [0.10.0]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.9.0...v0.10.0