From 6815d237b523c05ac3509a30e40c5961bc8248b8 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 29 Jan 2024 20:47:01 +0100 Subject: [PATCH 1/6] docs: missing main tag for whats new --- docs/pages/whats-new.html | 75 ++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/docs/pages/whats-new.html b/docs/pages/whats-new.html index a52b2eb..f0829ec 100644 --- a/docs/pages/whats-new.html +++ b/docs/pages/whats-new.html @@ -5,58 +5,61 @@
- +

Other releases

From 527e83ab787e5f281660ff482dd8052632919fb8 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 29 Jan 2024 20:48:21 +0100 Subject: [PATCH 2/6] fix: bump refined architect version for neoforge version detection --- .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-changelog.yml | 2 +- .github/workflows/validate-commit-messages.yml | 2 +- build.gradle | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ac7ae7..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.11.3 + 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 196cb28..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.11.3 + 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 1fc7129..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.11.3 \ 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 a9de795..a894673 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.11.3 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.11.4 secrets: inherit with: project-name: 'Ranged Pumps' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index 8d3457d..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.11.3 \ 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 b3852e5..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.11.3 \ 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 58cbc6a..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.11.3 + 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 f08e600..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.11.3 \ 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/build.gradle b/build.gradle index 1ba732c..55f5363 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.11.3/helper.gradle" +apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.11.4/helper.gradle" group = 'com.refinedmods' From 3beba1711a672914286fd5e5831416433e618d77 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 12 Feb 2024 21:58:03 +0100 Subject: [PATCH 3/6] chore: minecraft version in bug template --- .github/CONTRIBUTING.md | 5 ----- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d8ecf0c..ef40699 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -162,11 +162,6 @@ The build workflow takes care of the following: - Running a Gradle build, running our tests in the process and generating an aggregated code coverage report for the API modules. -- Analyzing the code on SonarQube. - > Because of - > [limitations with SonarQube](https://portal.productboard.com/sonarsource/1-sonarcloud/c/50-sonarcloud-analyzes-external-pull-request), - > pull requests originating from a fork aren't analyzed on SonarQube. - - Code style validation with Checkstyle. - Mutation and line coverage test with Pitest. - Uploading the artifacts on the action. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 6d1353b..3d847d4 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 From 16f3ac654f80651e152cad96be254018a6c4d750 Mon Sep 17 00:00:00 2001 From: gisellevonbingen Date: Sun, 10 Mar 2024 22:35:51 +0900 Subject: [PATCH 4/6] feat(lang): update ko_kr translation --- CHANGELOG.md | 4 ++++ .../resources/assets/rangedpumps/lang/ko_kr.json | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25d0a00..28cc585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- Korean translation updated by [@gisellevonbingen](https://github.com/gisellevonbingen). + ## [1.2.0] - 2024-01-29 ### Changed diff --git a/src/main/resources/assets/rangedpumps/lang/ko_kr.json b/src/main/resources/assets/rangedpumps/lang/ko_kr.json index d78a705..d483d60 100644 --- a/src/main/resources/assets/rangedpumps/lang/ko_kr.json +++ b/src/main/resources/assets/rangedpumps/lang/ko_kr.json @@ -1,11 +1,11 @@ { - "itemGroup.rangedpumps": "랜지드 펌프", + "itemGroup.rangedpumps": "Ranged Pumps", "block.rangedpumps.pump": "펌프", - "block.rangedpumps.pump.state": "%s의 %d mB - %d / %d FE", - "block.rangedpumps.pump.state_empty": "비어 있음 - %d / %d FE", + "block.rangedpumps.pump.state": "%2$s %1$d mb - %3$d / %4$d FE", + "block.rangedpumps.pump.state_empty": "비어있음 - %d / %d FE", "block.rangedpumps.pump.state.energy": "에너지가 부족합니다.", - "block.rangedpumps.pump.state.redstone": "레드스톤 신호로 인해 작동하지 않습니다.", - "block.rangedpumps.pump.state.working": "%d, %d, %d(범위: %d / %d)에서 검색 중입니다.", + "block.rangedpumps.pump.state.redstone": "레드스톤 신호로 인해 동작하지 않습니다.", + "block.rangedpumps.pump.state.working": "스캔 중 입니다: %d, %d, %d (범위: %d / 전체: %d).", "block.rangedpumps.pump.state.full": "내부 탱크가 가득 찼습니다.", - "block.rangedpumps.pump.state.done": "끝났습니다." + "block.rangedpumps.pump.state.done": "완료했습니다." } From adeeadb3738199cf17935a4d9e744d94ddf07ea0 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 6 Jul 2024 18:37:43 +0200 Subject: [PATCH 5/6] chore: port to minecraft 1.21 --- .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 | 1 + build.gradle | 4 +- config/intellij-code-style.xml | 66 +++++++++++++++++++ gradle.properties | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../refinedmods/rangedpumps/RangedPumps.java | 9 ++- .../rangedpumps/block/PumpBlock.java | 11 ++-- .../blockentity/PumpBlockEntity.java | 32 ++++----- .../{mods.toml => neoforge.mods.toml} | 0 .../blocks/pump.json | 0 .../rangedpumps/{recipes => recipe}/pump.json | 2 +- 21 files changed, 106 insertions(+), 46 deletions(-) create mode 100644 config/intellij-code-style.xml rename src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (100%) rename src/main/resources/data/rangedpumps/{loot_tables => loot_table}/blocks/pump.json (100%) rename src/main/resources/data/rangedpumps/{recipes => recipe}/pump.json (92%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3d847d4..693e35a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -38,6 +38,7 @@ body: - Minecraft 1.19.2 - Minecraft 1.20.1 - Minecraft 1.20.4 + - Minecraft 1.21 validations: required: true - type: input diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 448b30e..1a120cf 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.11.4 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.15.3 with: mutation-testing: false sonarqube: false diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 9fc1f33..f066a48 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.11.4 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.15.3 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 b2ad193..fbe9339 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.11.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.15.3 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index a894673..371e7a4 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.11.4 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.15.3 secrets: inherit with: project-name: 'Ranged Pumps' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index 2b7957c..d81c8f6 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.11.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.15.3 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index db81528..3786119 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.11.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.15.3 \ No newline at end of file diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index 44feba6..b74a6d5 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.11.4 + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.15.3 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 2656a4d..cc3220c 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.11.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.15.3 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1353ebd..32c9771 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ eclipse/ .nb-gradle-properties .project *.launch -runs/ +run/ *.iml *.ipr *.iws diff --git a/CHANGELOG.md b/CHANGELOG.md index 28cc585..d6af577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed +- Ported to Minecraft 1.21. - Korean translation updated by [@gisellevonbingen](https://github.com/gisellevonbingen). ## [1.2.0] - 2024-01-29 diff --git a/build.gradle b/build.gradle index 55f5363..0cc2816 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ -apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.11.4/helper.gradle" +apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.15.3/helper.gradle" group = 'com.refinedmods' -forgeProject("rangedpumps") +neoForgeProject("rangedpumps") archivesBaseName = 'rangedpumps' diff --git a/config/intellij-code-style.xml b/config/intellij-code-style.xml new file mode 100644 index 0000000..49b79c2 --- /dev/null +++ b/config/intellij-code-style.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 878bf1f..a8d260d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,2 @@ -# Sets default memory used for gradle commands. Can be overridden by user or command line properties. -# This is required to provide enough memory for the Minecraft decompilation process. -org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=false \ No newline at end of file +# Gradle +org.gradle.jvmargs=-Xmx1G diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e09..a441313 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/refinedmods/rangedpumps/RangedPumps.java b/src/main/java/com/refinedmods/rangedpumps/RangedPumps.java index 5b7037f..ef69dd2 100644 --- a/src/main/java/com/refinedmods/rangedpumps/RangedPumps.java +++ b/src/main/java/com/refinedmods/rangedpumps/RangedPumps.java @@ -3,7 +3,6 @@ import com.refinedmods.rangedpumps.block.PumpBlock; import com.refinedmods.rangedpumps.blockentity.PumpBlockEntity; import com.refinedmods.rangedpumps.config.ServerConfig; - import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; @@ -15,7 +14,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntityType; import net.neoforged.bus.api.IEventBus; -import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; import net.neoforged.fml.config.ModConfig; import net.neoforged.neoforge.capabilities.Capabilities; @@ -40,9 +39,9 @@ public final class RangedPumps { public static final ServerConfig SERVER_CONFIG = new ServerConfig(); - public RangedPumps(final IEventBus eventBus) { + public RangedPumps(final IEventBus eventBus, final ModContainer container) { ITEMS.register("pump", () -> new BlockItem(PUMP_BLOCK.get(), new Item.Properties())); - ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG.getSpec()); + container.registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG.getSpec()); BLOCKS.register(eventBus); ITEMS.register(eventBus); BLOCK_ENTITY_TYPES.register(eventBus); @@ -65,7 +64,7 @@ public static void onRegisterCapabilities(RegisterCapabilitiesEvent e) { public static void onRegister(RegisterEvent e) { e.register(Registries.CREATIVE_MODE_TAB, helper -> { - helper.register(new ResourceLocation(RangedPumps.ID, "general"), CreativeModeTab.builder() + helper.register(ResourceLocation.fromNamespaceAndPath(RangedPumps.ID, "general"), CreativeModeTab.builder() .title(Component.translatable("itemGroup.rangedpumps")) .icon(() -> new ItemStack(RangedPumps.PUMP_BLOCK.get())) .displayItems((params, output) -> { diff --git a/src/main/java/com/refinedmods/rangedpumps/block/PumpBlock.java b/src/main/java/com/refinedmods/rangedpumps/block/PumpBlock.java index 568f0f3..c7a5827 100644 --- a/src/main/java/com/refinedmods/rangedpumps/block/PumpBlock.java +++ b/src/main/java/com/refinedmods/rangedpumps/block/PumpBlock.java @@ -27,9 +27,12 @@ public PumpBlock() { super(Block.Properties.of().strength(1.9F).sound(SoundType.STONE)); } - @SuppressWarnings("deprecation") - public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, - BlockHitResult hit) { + @Override + protected InteractionResult useWithoutItem(final BlockState state, + final Level level, + final BlockPos pos, + final Player player, + final BlockHitResult hitResult) { if (!level.isClientSide) { BlockEntity blockEntity = level.getBlockEntity(pos); @@ -54,7 +57,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player energy.getEnergyStored(), energy.getMaxEnergyStored())); } else { player.sendSystemMessage(Component.translatable("block." + RangedPumps.ID + ".pump.state", - pump.getTank().getFluidAmount(), pump.getTank().getFluid().getDisplayName(), + pump.getTank().getFluidAmount(), pump.getTank().getFluid().getHoverName(), energy.getEnergyStored(), energy.getMaxEnergyStored())); } } diff --git a/src/main/java/com/refinedmods/rangedpumps/blockentity/PumpBlockEntity.java b/src/main/java/com/refinedmods/rangedpumps/blockentity/PumpBlockEntity.java index 433bab4..de98307 100644 --- a/src/main/java/com/refinedmods/rangedpumps/blockentity/PumpBlockEntity.java +++ b/src/main/java/com/refinedmods/rangedpumps/blockentity/PumpBlockEntity.java @@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; @@ -27,7 +28,6 @@ import net.neoforged.neoforge.energy.IEnergyStorage; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.FluidType; -import net.neoforged.neoforge.fluids.IFluidBlock; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.fluids.capability.templates.FluidTank; @@ -157,7 +157,7 @@ public void tick() { if (RangedPumps.SERVER_CONFIG.getReplaceLiquidWithBlock()) { if (blockToReplaceLiquidsWith == null) { blockToReplaceLiquidsWith = BuiltInRegistries.BLOCK.get( - new ResourceLocation(RangedPumps.SERVER_CONFIG.getBlockIdToReplaceLiquidsWith()) + ResourceLocation.parse(RangedPumps.SERVER_CONFIG.getBlockIdToReplaceLiquidsWith()) ); } @@ -181,23 +181,15 @@ private FluidStack drainAt(BlockPos pos, IFluidHandler.FluidAction action) { BlockState frontBlockState = level.getBlockState(pos); Block frontBlock = frontBlockState.getBlock(); - if (frontBlock instanceof LiquidBlock) { - // @Volatile: Logic from LiquidBlock#pickupFluid + if (frontBlock instanceof LiquidBlock liquidBlock) { + // @Volatile: Logic from LiquidBlock#pickupBlock if (frontBlockState.getValue(LiquidBlock.LEVEL) == 0) { - Fluid fluid = ((LiquidBlock) frontBlock).getFluid(); - + Fluid fluid = liquidBlock.fluid; if (action == IFluidHandler.FluidAction.EXECUTE) { level.setBlock(pos, Blocks.AIR.defaultBlockState(), 11); } - return new FluidStack(fluid, FluidType.BUCKET_VOLUME); } - } else if (frontBlock instanceof IFluidBlock) { - IFluidBlock fluidBlock = (IFluidBlock) frontBlock; - - if (fluidBlock.canDrain(level, pos)) { - return fluidBlock.drain(level, pos, action); - } } return FluidStack.EMPTY; @@ -214,7 +206,7 @@ int getRange() { PumpState getState() { if (range > RangedPumps.SERVER_CONFIG.getRange()) { return PumpState.DONE; - } else if (level.hasNeighborSignal(worldPosition)) { + } else if (level != null && level.hasNeighborSignal(worldPosition)) { return PumpState.REDSTONE; } else if (energy.getEnergyStored() == 0) { return PumpState.ENERGY; @@ -234,8 +226,8 @@ public IEnergyStorage getEnergy() { } @Override - public void saveAdditional(CompoundTag tag) { - super.saveAdditional(tag); + public void saveAdditional(CompoundTag tag, HolderLookup.Provider provider) { + super.saveAdditional(tag, provider); tag.putInt("Energy", energy.getEnergyStored()); @@ -251,12 +243,12 @@ public void saveAdditional(CompoundTag tag) { tag.put("Surfaces", surfaces); - tank.writeToNBT(tag); + tank.writeToNBT(provider, tag); } @Override - public void load(CompoundTag tag) { - super.load(tag); + public void loadAdditional(CompoundTag tag, HolderLookup.Provider provider) { + super.loadAdditional(tag, provider); if (tag.contains("Energy")) { energy.receiveEnergy(tag.getInt("Energy"), false); @@ -278,7 +270,7 @@ public void load(CompoundTag tag) { } } - tank.readFromNBT(tag); + tank.readFromNBT(provider, tag); } private static class PumpTank extends FluidTank { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 100% rename from src/main/resources/META-INF/mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml diff --git a/src/main/resources/data/rangedpumps/loot_tables/blocks/pump.json b/src/main/resources/data/rangedpumps/loot_table/blocks/pump.json similarity index 100% rename from src/main/resources/data/rangedpumps/loot_tables/blocks/pump.json rename to src/main/resources/data/rangedpumps/loot_table/blocks/pump.json diff --git a/src/main/resources/data/rangedpumps/recipes/pump.json b/src/main/resources/data/rangedpumps/recipe/pump.json similarity index 92% rename from src/main/resources/data/rangedpumps/recipes/pump.json rename to src/main/resources/data/rangedpumps/recipe/pump.json index 4c062c6..875c02d 100644 --- a/src/main/resources/data/rangedpumps/recipes/pump.json +++ b/src/main/resources/data/rangedpumps/recipe/pump.json @@ -23,6 +23,6 @@ } }, "result": { - "item": "rangedpumps:pump" + "id": "rangedpumps:pump" } } \ No newline at end of file From f799a8fc600674a6547aab4ea68f2f95c35e1b30 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 6 Jul 2024 16:43:07 +0000 Subject: [PATCH 6/6] chore: prepare release v1.3.0 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6af577..73ba3b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.3.0] - 2024-07-06 + ### Changed - Ported to Minecraft 1.21. @@ -151,7 +153,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Initial release for Minecraft 1.10.2. -[Unreleased]: https://github.com/refinedmods/rangedpumps/compare/v1.2.0...HEAD +[Unreleased]: https://github.com/refinedmods/rangedpumps/compare/v1.3.0...HEAD + +[1.3.0]: https://github.com/refinedmods/rangedpumps/compare/v1.2.0...v1.3.0 [1.2.0]: https://github.com/refinedmods/rangedpumps/compare/v1.1.0...v1.2.0