diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59bff02..1d3cfcf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,6 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: Malts + name: Insights path: | build/libs/Insights-*.jar \ No newline at end of file diff --git a/Insights-Core/src/main/java/dev/frankheijden/insights/listeners/BlockListener.java b/Insights-Core/src/main/java/dev/frankheijden/insights/listeners/BlockListener.java index 2525504..819e9f2 100644 --- a/Insights-Core/src/main/java/dev/frankheijden/insights/listeners/BlockListener.java +++ b/Insights-Core/src/main/java/dev/frankheijden/insights/listeners/BlockListener.java @@ -9,6 +9,7 @@ import dev.frankheijden.insights.api.util.MaterialTags; import dev.frankheijden.insights.api.utils.BlockUtils; import dev.frankheijden.insights.api.utils.ChunkUtils; +import io.papermc.paper.event.block.BlockBreakBlockEvent; import org.bukkit.Material; import org.bukkit.Tag; import org.bukkit.block.Block; @@ -120,12 +121,10 @@ public void onBlockBreak(BlockBreakEvent event) { if (Tag.BEDS.isTagged(material)) { Optional blockOptional = BlockUtils.getOtherHalf(block); - if (blockOptional.isPresent()) { - var otherHalf = blockOptional.get(); - - // Update the other half's location + // Update the other half's location + blockOptional.ifPresent(otherHalf -> { handleModification(otherHalf.getLocation(), material, -1); - } + }); } // Handle the removal @@ -274,6 +273,16 @@ public void onBlockExplode(BlockExplodeEvent event) { } } + /** + * Handles blocks breaking other blocks (like flowing water breaking redstone/torches). + */ + @AllowDisabling + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void onBlockBreakBlock(BlockBreakBlockEvent event) { + var block = event.getBlock(); + handleModification(block, -1); + } + /** * Handles blocks melting/fading. */ diff --git a/Insights-NMS/Current/build.gradle.kts b/Insights-NMS/Current/build.gradle.kts index 2dbc691..2959261 100644 --- a/Insights-NMS/Current/build.gradle.kts +++ b/Insights-NMS/Current/build.gradle.kts @@ -1,3 +1,3 @@ dependencies { - paperweight.paperDevBundle("1.21.10-R0.1-SNAPSHOT") + paperweight.paperDevBundle("1.21.11-R0.1-SNAPSHOT") } diff --git a/build.gradle.kts b/build.gradle.kts index af5593a..8f958b4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ plugins { group = "dev.frankheijden.insights" -version = "6.20.1" +version = "6.20.2" val dependencyDir = "$group.dependencies" val targetMinecraftVersions = listOf("1.21.10", "1.21.9") @@ -132,8 +132,9 @@ dependencies { .list(rootProject.projectDir.toPath().resolve("Insights-NMS")) .filter { !it.fileName.toString().startsWith(".") } .forEach { - val configuration = if (it.fileName.toString() == "Core") "shadow" else "reobf" - implementation(project(":Insights-NMS-${it.fileName}", configuration)) + //val configuration = if (it.fileName.toString() == "Core") "shadow" else "reobf" + // reobf is no longer needed as we don't support spigot servers and minecraft is no longer obfuscated + implementation(project(":Insights-NMS-${it.fileName}", "shadow")) } }