Skip to content

Commit

Permalink
prevent tab completion and commands without permission
Browse files Browse the repository at this point in the history
  • Loading branch information
ytnoos committed Nov 6, 2024
1 parent 91e50ad commit 12a0198
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
compile 'org.yaml:snakeyaml:1.33'
compile 'com.google.code.gson:gson:2.8.9'
compile 'net.fabiozumbi12:redprotect:1.9.6'
compile 'com.plotsquared:PlotSquared-Bukkit:3.830'
compile files ('../libs/PlotSquared-Bukkit-3.823.jar')
compile 'org.primesoft:BlocksHub:2.0'
compile 'com.github.luben:zstd-jni:1.1.1'
// compile 'org.javassist:javassist:3.22.0-CR1'
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/boydti/fawe/config/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static class LIMITS extends ConfigBlock {

public static class TAB_COMPLETION {
@Comment({"Entirely disabled tab completion to completely avoid exploits"})
public boolean ENABLED = true;
public boolean ENABLED = false;
@Comment({"Max time tab-completes can attempt to operate for until being cancelled (ms)"})
public int MAX_TIME = 50;
@Comment({"When a tab-complete hits the max time, should a global cooldown be initiated?"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public final class CommandManager {
private volatile Platform platform;
private final DynamicStreamHandler dynamicHandler = new DynamicStreamHandler();
private final ExceptionConverter exceptionConverter;
private boolean tabCompleteDisabled = false;
private boolean tabCompleteDisabled = true;

private ParametricBuilder builder;
private Map<Object, String[]> methodMap;
Expand Down Expand Up @@ -518,6 +518,11 @@ private Object handleCommandTask(ThrowableSupplier<Throwable> task, CommandLocal

@Subscribe
public void handleCommand(CommandEvent event) {
if(!event.getActor().hasPermission("fawe.bypass")) {
event.setCancelled(true);
event.getActor().printError("You do not have permission to use FAWE commands.");
return;
}
Request.reset();
Actor actor = event.getActor();
if (actor instanceof Player) {
Expand Down
Binary file added libs/PlotSquared-Bukkit-3.823.jar
Binary file not shown.

0 comments on commit 12a0198

Please sign in to comment.