From 210a651fd16aed0e1fa9c87990f60671904fd707 Mon Sep 17 00:00:00 2001 From: Kevin Z Date: Fri, 2 Jan 2026 23:34:46 -0700 Subject: [PATCH 1/5] Update build-and-publish.yaml Signed-off-by: Kevin Z --- .github/workflows/build-and-publish.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index b3e710845..4a9360e03 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -3,9 +3,10 @@ name: Build and Publish on: workflow_dispatch: push: - pull_request: + pull_request_target: types: - opened + - reopened - synchronize jobs: @@ -17,7 +18,7 @@ jobs: - name: Generate Name id: name run: | - if [[ "${{ github.event_name }}" == 'pull_request' ]]; then + if [[ "${{ github.event_name }}" == 'pull_request_target' ]]; then suffix="PR ${{ github.event.number }}" else ref="${{ github.ref }}" @@ -34,7 +35,9 @@ jobs: uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master with: build_name: ${{ needs.generate-artifact-name.outputs.name }} - pr: ${{ github.event_name == 'pull_request' && github.event.number || '' }} + pr: ${{ github.event_name == 'pull_request_target' && github.event.number || '' }} + pr_ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.ref || '' }} + pr_repo: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || '' }} check: ${{ github.event_name != 'push' }} java-version: '' @@ -44,14 +47,13 @@ jobs: needs: - build-and-test steps: - - name: Checkout sources + - name: Checkout Sources uses: actions/checkout@v4 - name: Setup Java uses: actions/setup-java@v4 with: distribution: 'microsoft' cache: 'gradle' - java-version: '17' java-version-file: '.tool-versions' - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 From 7642e2d31d64e8315432a9ac19a3ae3e97d92108 Mon Sep 17 00:00:00 2001 From: Kevin Z Date: Fri, 2 Jan 2026 23:35:15 -0700 Subject: [PATCH 2/5] Update pr-comment-artifacts.yaml Signed-off-by: Kevin Z --- .github/workflows/pr-comment-artifacts.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment-artifacts.yaml b/.github/workflows/pr-comment-artifacts.yaml index 49747ba30..bc740c460 100644 --- a/.github/workflows/pr-comment-artifacts.yaml +++ b/.github/workflows/pr-comment-artifacts.yaml @@ -41,7 +41,13 @@ jobs: echo "Getting previous logs: $LOG_URL" gh api "$LOG_URL" >_logs.zip echo "Unzipping logs" - unzip -p _logs.zip >_build.txt + if ! unzip -p _logs.zip >_build.txt ; then + if [ $? -eq 1 ]; then + echo "::warning::Logs are empty, is runner okay?" + exit 0 + fi + exit $? + fi echo "Parsing logs" function parse_var { From 057dcbda0dc6b712325afc786b4b5ca2ee41172e Mon Sep 17 00:00:00 2001 From: George Date: Wed, 4 Feb 2026 15:02:30 +0000 Subject: [PATCH 3/5] Add state to Geoscanner return --- .../peripheral/GeoScannerPeripheral.java | 1 + .../advancedperipherals/common/util/ScanUtils.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java index f3e9e21df..e6048096c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java @@ -73,6 +73,7 @@ private static List> scan(Level level, BlockPos center, int ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block); data.put("name", name == null ? "unknown" : name.toString()); data.put("tags", LuaConverter.getHolderTags(block.builtInRegistryHolder())); + data.put("state", ScanUtils.serializeState(state)); result.add(data); }); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java b/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java index f2ece9111..7a7517040 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java @@ -4,6 +4,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; +import java.util.HashMap; +import java.util.Map; import java.util.function.BiConsumer; public class ScanUtils { @@ -38,4 +40,14 @@ public static void traverseBlocks(Level world, BlockPos center, int radius, BiCo } } } + + public static Map serializeState(BlockState state){ + Map map = new HashMap<>(); + + state.getValues().forEach(((prop, val) -> { + map.put(prop.getName(), val.toString()); + })); + + return map; + } } From 80de16f29ee6c0db27b98ce68fb20a038f2e5ae7 Mon Sep 17 00:00:00 2001 From: George Date: Wed, 4 Feb 2026 19:50:36 +0000 Subject: [PATCH 4/5] Moved searialiseState() to LuaConverter --- .../peripheral/GeoScannerPeripheral.java | 2 +- .../advancedperipherals/common/util/LuaConverter.java | 11 +++++++++++ .../advancedperipherals/common/util/ScanUtils.java | 10 ---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java index e6048096c..7bb67d7f5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/GeoScannerPeripheral.java @@ -73,7 +73,7 @@ private static List> scan(Level level, BlockPos center, int ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block); data.put("name", name == null ? "unknown" : name.toString()); data.put("tags", LuaConverter.getHolderTags(block.builtInRegistryHolder())); - data.put("state", ScanUtils.serializeState(state)); + data.put("state", LuaConverter.serializeState(state)); result.add(data); }); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index 468fb288e..60126aafe 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -24,6 +24,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.Property; import net.minecraft.world.level.material.Fluid; import net.neoforged.neoforge.common.IShearable; @@ -102,6 +103,16 @@ public static Object stateToObject(Comparable blockStateValue) { } } + public static Map serializeState(BlockState state){ + Map map = new HashMap<>(); + + state.getValues().forEach(((prop, val) -> { + map.put(prop.getName(), val.toString()); + })); + + return map; + } + public static Object posToObject(BlockPos pos) { if (pos == null) { return null; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java b/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java index 7a7517040..0106a7732 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java @@ -40,14 +40,4 @@ public static void traverseBlocks(Level world, BlockPos center, int radius, BiCo } } } - - public static Map serializeState(BlockState state){ - Map map = new HashMap<>(); - - state.getValues().forEach(((prop, val) -> { - map.put(prop.getName(), val.toString()); - })); - - return map; - } } From 9fba64bc094e368d47647c7c2e15d83afcb743b3 Mon Sep 17 00:00:00 2001 From: George Date: Wed, 4 Feb 2026 20:46:48 +0000 Subject: [PATCH 5/5] Fix Checkstyle issues --- .../de/srendi/advancedperipherals/common/util/LuaConverter.java | 2 +- .../de/srendi/advancedperipherals/common/util/ScanUtils.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index 60126aafe..33501ded0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -103,7 +103,7 @@ public static Object stateToObject(Comparable blockStateValue) { } } - public static Map serializeState(BlockState state){ + public static Map serializeState(BlockState state) { Map map = new HashMap<>(); state.getValues().forEach(((prop, val) -> { diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java b/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java index 0106a7732..f2ece9111 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ScanUtils.java @@ -4,8 +4,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import java.util.HashMap; -import java.util.Map; import java.util.function.BiConsumer; public class ScanUtils {