Skip to content

Commit

Permalink
feature: add wildcard to anti_build (resolves #224)
Browse files Browse the repository at this point in the history
  • Loading branch information
phaldan committed Dec 12, 2024
1 parent c476fc2 commit 9da2e09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/chapters/module/anti_build/anti_build.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class AntiBuildInitializer extends ModuleInitializer {
public static final BaseConfigurationHandler<AntiBuildConfigModel> config = new ObjectConfigurationHandler<>(BaseConfigurationHandler.CONFIG_JSON, AntiBuildConfigModel.class);

public static <T> void checkAntiBuild(PlayerEntity player, String antiType, Set<String> ids, String id, CallbackInfoReturnable<T> cir, T cancelWithValue, Supplier<Boolean> 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()) {
Expand Down

0 comments on commit 9da2e09

Please sign in to comment.