Reenabled CommandAPI

This commit is contained in:
xSquishyLiam
2025-12-16 22:36:33 +00:00
parent 9cd1db1351
commit b023751c61
6 changed files with 28 additions and 21 deletions

2
.idea/workspace.xml generated
View File

@@ -11,7 +11,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="DarkyenusTimeTracker"> <component name="DarkyenusTimeTracker">
<option name="totalTimeSeconds" value="32226" /> <option name="totalTimeSeconds" value="34744" />
</component> </component>
<component name="ExternalProjectsData"> <component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$"> <projectState path="$PROJECT_DIR$">

View File

@@ -4,7 +4,7 @@ plugins {
} }
group = "re.imc" group = "re.imc"
version = "1.0.1" version = "1.0.2"
repositories { repositories {
mavenCentral() mavenCentral()
@@ -21,7 +21,7 @@ repositories {
dependencies { dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
// implementation("dev.jorel:commandapi-paper-shade:11.0.0") implementation("dev.jorel:commandapi-paper-shade:11.1.0")
compileOnly("com.ticxo.modelengine:ModelEngine:R4.0.9") compileOnly("com.ticxo.modelengine:ModelEngine:R4.0.9")
compileOnly("io.github.toxicity188:bettermodel:1.14.0") compileOnly("io.github.toxicity188:bettermodel:1.14.0")

View File

@@ -2,6 +2,8 @@ package re.imc.geysermodelengine;
import com.github.retrooper.packetevents.PacketEvents; import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketListenerPriority; import com.github.retrooper.packetevents.event.PacketListenerPriority;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.CommandAPIPaperConfig;
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder; import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder;
import org.bstats.bukkit.Metrics; import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@@ -34,7 +36,7 @@ public class GeyserModelEngine extends JavaPlugin {
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(this)); PacketEvents.setAPI(SpigotPacketEventsBuilder.build(this));
PacketEvents.getAPI().load(); PacketEvents.getAPI().load();
// CommandAPI.onLoad(new CommandAPIPaperConfig(this)); CommandAPI.onLoad(new CommandAPIPaperConfig(this));
preLoadManagers(); preLoadManagers();
} }
@@ -56,13 +58,13 @@ public class GeyserModelEngine extends JavaPlugin {
this.modelManager.removeEntities(); this.modelManager.removeEntities();
PacketEvents.getAPI().terminate(); PacketEvents.getAPI().terminate();
// CommandAPI.onDisable(); CommandAPI.onDisable();
} }
private void loadHooks() { private void loadHooks() {
PacketEvents.getAPI().init(); PacketEvents.getAPI().init();
FloodgateAPIHook.loadHook(this); FloodgateAPIHook.loadHook(this);
// CommandAPI.onEnable(); CommandAPI.onEnable();
} }
private void loadBStats() { private void loadBStats() {

View File

@@ -1,5 +1,7 @@
package re.imc.geysermodelengine.commands.geysermodelenginecommands; package re.imc.geysermodelengine.commands.geysermodelenginecommands;
import dev.jorel.commandapi.CommandAPICommand;
import org.bukkit.Bukkit;
import re.imc.geysermodelengine.GeyserModelEngine; import re.imc.geysermodelengine.GeyserModelEngine;
import re.imc.geysermodelengine.managers.commands.subcommands.SubCommands; import re.imc.geysermodelengine.managers.commands.subcommands.SubCommands;
import re.imc.geysermodelengine.util.ColourUtils; import re.imc.geysermodelengine.util.ColourUtils;
@@ -14,13 +16,13 @@ public class GeyserModelEngineReloadCommand implements SubCommands {
this.plugin = plugin; this.plugin = plugin;
} }
// @Override @Override
// public CommandAPICommand onCommand() { public CommandAPICommand onCommand() {
// return new CommandAPICommand("reload") return new CommandAPICommand("reload")
// .withPermission("geysermodelengine.commands.reload") .withPermission("geysermodelengine.commands.reload")
// .executes((sender, args) -> { .executes((sender, args) -> {
// Bukkit.getAsyncScheduler().runNow(plugin, scheduledTask -> plugin.getConfigManager().load()); Bukkit.getAsyncScheduler().runNow(plugin, scheduledTask -> plugin.getConfigManager().load());
// sender.sendMessage(colourUtils.miniFormat(plugin.getConfigManager().getLang().getString("commands.reload.successfully-reloaded"))); sender.sendMessage(colourUtils.miniFormat(plugin.getConfigManager().getLang().getString("commands.reload.successfully-reloaded")));
// }); });
// } }
} }

View File

@@ -1,5 +1,6 @@
package re.imc.geysermodelengine.managers.commands.managers.geysermodelengine; package re.imc.geysermodelengine.managers.commands.managers.geysermodelengine;
import dev.jorel.commandapi.CommandAPICommand;
import re.imc.geysermodelengine.GeyserModelEngine; import re.imc.geysermodelengine.GeyserModelEngine;
import re.imc.geysermodelengine.commands.geysermodelenginecommands.GeyserModelEngineReloadCommand; import re.imc.geysermodelengine.commands.geysermodelenginecommands.GeyserModelEngineReloadCommand;
import re.imc.geysermodelengine.managers.commands.CommandManagers; import re.imc.geysermodelengine.managers.commands.CommandManagers;
@@ -18,11 +19,11 @@ public class GeyserModelEngineCommandManager implements CommandManagers {
} }
private void registerCommand() { private void registerCommand() {
// CommandAPICommand geyserModelEngineCommand = new CommandAPICommand(getName()); CommandAPICommand geyserModelEngineCommand = new CommandAPICommand(getName());
//
// commands.forEach(subCommands -> geyserModelEngineCommand.withSubcommand(subCommands.onCommand())); commands.forEach(subCommands -> geyserModelEngineCommand.withSubcommand(subCommands.onCommand()));
//
// geyserModelEngineCommand.register(); geyserModelEngineCommand.register();
} }
@Override @Override

View File

@@ -1,9 +1,11 @@
package re.imc.geysermodelengine.managers.commands.subcommands; package re.imc.geysermodelengine.managers.commands.subcommands;
import dev.jorel.commandapi.CommandAPICommand;
public interface SubCommands { public interface SubCommands {
/** /**
* Subcommand setup * Subcommand setup
*/ */
// CommandAPICommand onCommand(); CommandAPICommand onCommand();
} }