|
|
|
@ -25,6 +25,7 @@ import de.exlll.configlib.Configuration;
|
|
|
|
|
import lombok.AccessLevel;
|
|
|
|
|
import lombok.Getter;
|
|
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
import net.william278.husksync.command.PluginCommand;
|
|
|
|
|
import net.william278.husksync.data.DataSnapshot;
|
|
|
|
|
import net.william278.husksync.data.Identifier;
|
|
|
|
|
import net.william278.husksync.database.Database;
|
|
|
|
@ -75,6 +76,9 @@ public class Settings {
|
|
|
|
|
@Comment("Whether to cancel game event packets directly when handling locked players if ProtocolLib or PacketEvents is installed")
|
|
|
|
|
private boolean cancelPackets = true;
|
|
|
|
|
|
|
|
|
|
@Comment("Add HuskSync commands to this list to prevent them from being registered (e.g. ['userdata'])")
|
|
|
|
|
@Getter(AccessLevel.NONE)
|
|
|
|
|
private List<String> disabledCommands = Lists.newArrayList();
|
|
|
|
|
|
|
|
|
|
// Database settings
|
|
|
|
|
@Comment("Database settings")
|
|
|
|
@ -182,7 +186,7 @@ public class Settings {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Synchronization settings
|
|
|
|
|
@Comment("Redis settings")
|
|
|
|
|
@Comment("Data syncing settings")
|
|
|
|
|
private SynchronizationSettings synchronization = new SynchronizationSettings();
|
|
|
|
|
|
|
|
|
|
@Getter
|
|
|
|
@ -294,4 +298,10 @@ public class Settings {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isCommandDisabled(@NotNull PluginCommand command) {
|
|
|
|
|
return disabledCommands.stream().map(c -> c.startsWith("/") ? c.substring(1) : c)
|
|
|
|
|
.anyMatch(c -> c.equalsIgnoreCase(command.getName()) || command.getAliases().contains(c));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|