This repository has been archived by the owner on Jul 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Using_The_Quick_Start_Module
Nico edited this page Sep 17, 2020
·
15 revisions
The QuickStart module was designed to be used on Spigot/BungeeCord and to make the usage of the SimplixCore as easy as possible. It allows you to check whether the SimplixCore was properly installed on your server. You can configure it to download the SimplixCore if the check fails or to not enable your plugin.
<repository>
<id>SimplixPublic</id>
<url>https://repo.simplix.dev/repository/simplixsoft-public/</url>
</repository>
<dependency>
<groupId>dev.simplix</groupId>
<artifactId>simplixcore-minecraft-spigot-quickstart</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>dev.simplix</groupId>
<artifactId>simplixcore-minecraft-bungeecord-quickstart</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
This example was made for BungeeCord but it also applies for Spigot.
import dev.simplix.core.common.CommonSimplixModule;
import dev.simplix.core.common.aop.SimplixApplication;
import dev.simplix.core.common.inject.SimplixInstaller;
import dev.simplix.core.minecraft.bungeecord.dynamiccommands.DynamicCommandsSimplixModule;
import dev.simplix.core.minecraft.bungeecord.dynamiclisteners.DynamicListenersSimplixModule;
import dev.simplix.core.minecraft.bungeecord.quickstart.SimplixQuickStart;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.plugin.Plugin;
public class ExampleSimplixPlugin extends Plugin {
@Override
public void onEnable() {
if (!SimplixQuickStart.ensureSimplixCore(this)) {
/*
* Handling the lack of the SimplixCore here...
* Example possibilities
* 1) Try to download it
* 2) Disable plugin
* and or Encourage user to install it using
* /simplix install (will be automatically registered by the SimplixQuickStartModule when the plugin is not present)
*/
return;
}
SimplixInstaller
.instance()
.register(
ExampleApplication.class,
new CommonSimplixModule(),
new DynamicCommandsSimplixModule(this),
new DynamicListenersSimplixModule(this));
}
}
ExampleApplication.java
package com.simplixsoft.example.common;
import dev.simplix.core.common.aop.ScanComponents;
import dev.simplix.core.common.aop.SimplixApplication;
@SimplixApplication(name = "SimplixExample",
version = "1.0",
authors = "Exceptionflug",
dependencies = "SimplixCore",
workingDirectory = "plugins/SimplixExample")
@ScanComponents("com.simplixsoft.example") // Scan common base package
public class ExampleApplication {
}
2020 - SimplixSoftworks
- Introduction
- Getting started
- Maven Dependencies
- How to use the Dependency-Injection
- Localization
- Listener API
- SQL
- Libraries
- Utilities
- Contribute