mirror of
https://github.com/GeyserExtensionists/GeyserModelEngine.git
synced 2025-12-19 06:59:16 +00:00
Reenabled CommandAPI
This commit is contained in:
2
.idea/workspace.xml
generated
2
.idea/workspace.xml
generated
@@ -11,7 +11,7 @@
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="DarkyenusTimeTracker">
|
||||
<option name="totalTimeSeconds" value="32226" />
|
||||
<option name="totalTimeSeconds" value="34744" />
|
||||
</component>
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
|
||||
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "re.imc"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -21,7 +21,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
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("io.github.toxicity188:bettermodel:1.14.0")
|
||||
|
||||
@@ -2,6 +2,8 @@ package re.imc.geysermodelengine;
|
||||
|
||||
import com.github.retrooper.packetevents.PacketEvents;
|
||||
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 org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -34,7 +36,7 @@ public class GeyserModelEngine extends JavaPlugin {
|
||||
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(this));
|
||||
PacketEvents.getAPI().load();
|
||||
|
||||
// CommandAPI.onLoad(new CommandAPIPaperConfig(this));
|
||||
CommandAPI.onLoad(new CommandAPIPaperConfig(this));
|
||||
preLoadManagers();
|
||||
}
|
||||
|
||||
@@ -56,13 +58,13 @@ public class GeyserModelEngine extends JavaPlugin {
|
||||
this.modelManager.removeEntities();
|
||||
|
||||
PacketEvents.getAPI().terminate();
|
||||
// CommandAPI.onDisable();
|
||||
CommandAPI.onDisable();
|
||||
}
|
||||
|
||||
private void loadHooks() {
|
||||
PacketEvents.getAPI().init();
|
||||
FloodgateAPIHook.loadHook(this);
|
||||
// CommandAPI.onEnable();
|
||||
CommandAPI.onEnable();
|
||||
}
|
||||
|
||||
private void loadBStats() {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package re.imc.geysermodelengine.commands.geysermodelenginecommands;
|
||||
|
||||
import dev.jorel.commandapi.CommandAPICommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import re.imc.geysermodelengine.GeyserModelEngine;
|
||||
import re.imc.geysermodelengine.managers.commands.subcommands.SubCommands;
|
||||
import re.imc.geysermodelengine.util.ColourUtils;
|
||||
@@ -14,13 +16,13 @@ public class GeyserModelEngineReloadCommand implements SubCommands {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public CommandAPICommand onCommand() {
|
||||
// return new CommandAPICommand("reload")
|
||||
// .withPermission("geysermodelengine.commands.reload")
|
||||
// .executes((sender, args) -> {
|
||||
// Bukkit.getAsyncScheduler().runNow(plugin, scheduledTask -> plugin.getConfigManager().load());
|
||||
// sender.sendMessage(colourUtils.miniFormat(plugin.getConfigManager().getLang().getString("commands.reload.successfully-reloaded")));
|
||||
// });
|
||||
// }
|
||||
@Override
|
||||
public CommandAPICommand onCommand() {
|
||||
return new CommandAPICommand("reload")
|
||||
.withPermission("geysermodelengine.commands.reload")
|
||||
.executes((sender, args) -> {
|
||||
Bukkit.getAsyncScheduler().runNow(plugin, scheduledTask -> plugin.getConfigManager().load());
|
||||
sender.sendMessage(colourUtils.miniFormat(plugin.getConfigManager().getLang().getString("commands.reload.successfully-reloaded")));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package re.imc.geysermodelengine.managers.commands.managers.geysermodelengine;
|
||||
|
||||
import dev.jorel.commandapi.CommandAPICommand;
|
||||
import re.imc.geysermodelengine.GeyserModelEngine;
|
||||
import re.imc.geysermodelengine.commands.geysermodelenginecommands.GeyserModelEngineReloadCommand;
|
||||
import re.imc.geysermodelengine.managers.commands.CommandManagers;
|
||||
@@ -18,11 +19,11 @@ public class GeyserModelEngineCommandManager implements CommandManagers {
|
||||
}
|
||||
|
||||
private void registerCommand() {
|
||||
// CommandAPICommand geyserModelEngineCommand = new CommandAPICommand(getName());
|
||||
//
|
||||
// commands.forEach(subCommands -> geyserModelEngineCommand.withSubcommand(subCommands.onCommand()));
|
||||
//
|
||||
// geyserModelEngineCommand.register();
|
||||
CommandAPICommand geyserModelEngineCommand = new CommandAPICommand(getName());
|
||||
|
||||
commands.forEach(subCommands -> geyserModelEngineCommand.withSubcommand(subCommands.onCommand()));
|
||||
|
||||
geyserModelEngineCommand.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package re.imc.geysermodelengine.managers.commands.subcommands;
|
||||
|
||||
import dev.jorel.commandapi.CommandAPICommand;
|
||||
|
||||
public interface SubCommands {
|
||||
|
||||
/**
|
||||
* Subcommand setup
|
||||
*/
|
||||
// CommandAPICommand onCommand();
|
||||
CommandAPICommand onCommand();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user