refactor: remove commodore support

It doesn't support modern versions that well, and causes conflicts. We'll replace this with a native tab completion solution soonish
This commit is contained in:
William committed 2024-05-30 17:18:25 +01:00
1 parent 7d076c4c7f
commit ac4b4365b2
23 files changed
-177

No files matched your search

-2
View File
@@ -4,7 +4,6 @@ dependencies {
implementation 'org.bstats:bstats-bukkit:3.0.2'
implementation 'io.papermc:paperlib:1.0.8'
implementation 'space.arim.morepaperlib:morepaperlib:0.4.4'
implementation 'me.lucko:commodore:2.2'
implementation 'net.kyori:adventure-platform-bukkit:4.3.2'
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
@@ -50,7 +49,6 @@ shadowJar {
relocate 'org.bstats', 'net.william278.huskhomes.libraries.bstats'
relocate 'io.papermc.lib', 'net.william278.huskhomes.libraries.paperlib'
relocate 'space.arim.morepaperlib', 'net.william278.huskhomes.libraries.paperlib'
relocate 'me.lucko.commodore', 'net.william278.huskhomes.libraries.commodore'
minimize()
}
@@ -1,59 +0,0 @@
/*
* This file is part of HuskHomes, licensed under the Apache License 2.0.
*
* Copyright (c) William278 <[email protected]>
* Copyright (c) contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.william278.huskhomes.command;
import me.lucko.commodore.CommodoreProvider;
import me.lucko.commodore.file.CommodoreFileReader;
import net.william278.huskhomes.BukkitHuskHomes;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
public class BrigadierUtil {
/**
* Uses commodore to register command completions.
*
* @param plugin instance of the registering Bukkit plugin
* @param bukkitCommand the Bukkit PluginCommand to register completions for
* @param command the {@link Command} to register completions for
*/
protected static void registerCommodore(@NotNull BukkitHuskHomes plugin,
@NotNull org.bukkit.command.Command bukkitCommand,
@NotNull Command command) {
final InputStream commodoreFile = plugin.getResource(
String.format("commodore/%s.commodore", bukkitCommand.getName())
);
if (commodoreFile == null) {
return;
}
try {
CommodoreProvider.getCommodore(plugin).register(bukkitCommand,
CommodoreFileReader.INSTANCE.parse(commodoreFile),
player -> player.hasPermission(command.getPermission()));
} catch (IOException e) {
plugin.log(Level.SEVERE, "Failed to read command commodore completions for "
+ bukkitCommand.getName(), e);
}
}
}
@@ -1,3 +0,0 @@
delhome {
name brigadier:string single_word;
}
@@ -1,3 +0,0 @@
delwarp {
name brigadier:string single_word;
}
@@ -1,15 +0,0 @@
edithome {
name brigadier:string single_word {
rename {
new brigadier:string single_word;
}
description {
text brigadier:string greedy_phrase;
}
relocate;
privacy {
public;
private;
}
}
}
@@ -1,11 +0,0 @@
editwarp {
name brigadier:string single_word {
rename {
new brigadier:string single_word;
}
description {
text brigadier:string greedy_phrase;
}
relocate;
}
}
@@ -1,3 +0,0 @@
home {
name brigadier:string single_word;
}
@@ -1,6 +0,0 @@
homelist {
page brigadier:integer;
player brigadier:string single_word {
page brigadier:integer;
}
}
@@ -1,31 +0,0 @@
huskhomes {
about;
help {
page brigadier:integer;
}
reload;
import {
list {
page brigadier:integer;
}
start {
name brigadier:string single_word;
}
}
delete {
player {
name brigadier:string single_word;
}
homes {
world brigadier:string single_word {
server brigadier:string single_word;
}
}
warps {
world brigadier:string single_word {
server brigadier:string single_word;
}
}
}
update;
}
@@ -1,3 +0,0 @@
publichome {
name brigadier:string single_word;
}
@@ -1,3 +0,0 @@
publichomelist {
page brigadier:integer;
}
@@ -1,5 +0,0 @@
rtp {
player brigadier:string single_word {
world brigadier:string single_word;
}
}
@@ -1,3 +0,0 @@
sethome {
name brigadier:string single_word;
}
@@ -1,3 +0,0 @@
setwarp {
name brigadier:string single_word;
}
@@ -1,3 +0,0 @@
tpa {
player brigadier:string single_word;
}
@@ -1,3 +0,0 @@
tpaccept {
player brigadier:string single_word;
}
@@ -1,3 +0,0 @@
tpahere {
player brigadier:string single_word;
}
@@ -1,3 +0,0 @@
tpdecline {
player brigadier:string single_word;
}
@@ -1,3 +0,0 @@
tphere {
player brigadier:string single_word;
}
@@ -1,3 +0,0 @@
tpoffline {
player brigadier:string single_word;
}
@@ -1,3 +0,0 @@
warp {
name brigadier:string single_word;
}
@@ -1,3 +0,0 @@
warplist {
page brigadier:integer;
}
@@ -159,9 +159,6 @@ public final class Settings {
@Comment("How many items should be displayed per-page in chat menu lists")
private int listItemsPerPage = 12;
@Comment("Whether to provide modern, rich TAB suggestions for commands (if available)")
private boolean brigadierTabCompletion = true;
@Comment("Whether the user should always be put back at the /spawn point when they die "
+ "(ignores beds/respawn anchors)")
private boolean alwaysRespawnAtSpawn = false;