From 9da2e0932132c6cdc19be10df60ee985608604f8 Mon Sep 17 00:00:00 2001 From: Philipp Daniels Date: Wed, 11 Dec 2024 23:56:01 +0100 Subject: [PATCH] feature: add wildcard to anti_build (resolves #224) --- docs/chapters/module/anti_build/anti_build.tex | 3 +++ gradle.properties | 2 +- .../module/initializer/anti_build/AntiBuildInitializer.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/chapters/module/anti_build/anti_build.tex b/docs/chapters/module/anti_build/anti_build.tex index ea8e42fb4..13aa27204 100644 --- a/docs/chapters/module/anti_build/anti_build.tex +++ b/docs/chapters/module/anti_build/anti_build.tex @@ -26,4 +26,7 @@ \cmd{/lp user \player permission set fuji.anti\_build.place\_block.bypass.minecraft:tnt} \end{example} +\begin{example}{Ban to place any kind of block} + add * into place\_block list +\end{example} diff --git a/gradle.properties b/gradle.properties index 138b15e95..799b57251 100755 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.parallel=true # project maven_group=io.github.sakurawald mod_id=fuji -mod_version=6.0.0 +mod_version=6.1.0 # loader minecraft_version=1.21.4 diff --git a/src/main/java/io/github/sakurawald/module/initializer/anti_build/AntiBuildInitializer.java b/src/main/java/io/github/sakurawald/module/initializer/anti_build/AntiBuildInitializer.java index 162a5dac6..2f401cfff 100644 --- a/src/main/java/io/github/sakurawald/module/initializer/anti_build/AntiBuildInitializer.java +++ b/src/main/java/io/github/sakurawald/module/initializer/anti_build/AntiBuildInitializer.java @@ -16,7 +16,7 @@ public class AntiBuildInitializer extends ModuleInitializer { public static final BaseConfigurationHandler config = new ObjectConfigurationHandler<>(BaseConfigurationHandler.CONFIG_JSON, AntiBuildConfigModel.class); public static void checkAntiBuild(PlayerEntity player, String antiType, Set ids, String id, CallbackInfoReturnable cir, T cancelWithValue, Supplier shouldSendFeedback) { - if (ids.contains(id) + if ((ids.contains(id) || ids.contains("*")) && !PermissionHelper.hasPermission(player.getUuid(), "fuji.anti_build.%s.bypass.%s".formatted(antiType, id)) ) { if (shouldSendFeedback.get()) {