From 0d06eca882085ffd0bcfc0078956276d9dac629f Mon Sep 17 00:00:00 2001 From: Redart15 Date: Sun, 23 Nov 2025 03:56:03 +0100 Subject: [PATCH 1/2] hopefully no more weird protection issues remain. --- .../redart15/commandly/command/CommandProtect.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/redart15/commandly/command/CommandProtect.java b/src/main/java/redart15/commandly/command/CommandProtect.java index df9e6ee..686e0ff 100644 --- a/src/main/java/redart15/commandly/command/CommandProtect.java +++ b/src/main/java/redart15/commandly/command/CommandProtect.java @@ -7,6 +7,7 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.core.block.Block; +import net.minecraft.core.block.Blocks; import net.minecraft.core.entity.player.Player; import net.minecraft.core.net.command.CommandManager; import net.minecraft.core.net.command.CommandSource; @@ -97,7 +98,8 @@ private static int chunks_protect(CommandSource source, World world, Predicate block = world.getBlock(fx + x, y, fz + z); if (block == null) continue; if (treecapitator.test(block) || veinmining.test(block)) { - world.setBlockMetadata(fx + x, y, fz + z, (1 << CommandlyMod.getMask())); + int metadata = world.getBlockMetadata(fx + x, y, fz + z); + world.setBlockMetadata(fx + x, y, fz + z, (1 << CommandlyMod.getMask()) | metadata); count_protected++; } } @@ -157,7 +159,7 @@ private static int radius_protect( } if ((int) Math.floor(1.25 * Math.PI * Math.pow(radius, 3)) > CommandlyMod.getMaxBlockCount()) { - source.sendTranslatableMessage("commadly.protected.tolarge"); + source.sendTranslatableMessage("commadly.protected.toolarge"); return code(CANNOT); } int count_protected = 0; @@ -168,7 +170,8 @@ private static int radius_protect( Block block = world.getBlock(fx + x, fy + y, fz + z); if (block == null) continue; if (treecapitator.test(block) || veinmining.test(block)) { - world.setBlockMetadata(fx + x, fy + y, fz + z, (1 << CommandlyMod.getMask())); + int metadata = world.getBlockMetadata(fx + x, y, fz + z); + world.setBlockMetadata(fx + x, y, fz + z, (1 << CommandlyMod.getMask()) | metadata); count_protected++; } } @@ -240,7 +243,8 @@ public static int point_protect( Block block = world.getBlock(x, y, z); if (block == null) continue; if (treecapitator.test(block) || veinmining.test(block)) { - world.setBlockMetadata(x, y, z, (1 << CommandlyMod.getMask())); + int metadata = world.getBlockMetadata(fx + x, y, fz + z); + world.setBlockMetadata(fx + x, y, fz + z, (1 << CommandlyMod.getMask()) | metadata); count_protected++; } } From 94ad4ec96e42adc56e6c185dcd68e9edd304f4dc Mon Sep 17 00:00:00 2001 From: Redart15 Date: Mon, 24 Nov 2025 11:34:20 +0100 Subject: [PATCH 2/2] version bump --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index cf585d3..b2041ed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ loom_version = 1.13.0-bta java_version = 8 ########################################################################## # Mod Properties -mod_version = 1.1.2+7.3_04 +mod_version = 1.1.3+7.3_04 mod_group = redart15 mod_name = Commandly ##########################################################################