This repository was archived by the owner on Mar 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Chaffic edited this page May 5, 2021
·
12 revisions
CrucialAPI is an open-source easy-to-use Spigot API that strives to make plugin development easier.
Note: If you have any suggestions/questions/feedback for this wiki please use Discussions.
Attention! Do not forget to place CrucialAPI as a dependency in your "plugin.yml" file!
<dependency>
<groupId>io.github.chafficui</groupId>
<artifactId>CrucialAPI</artifactId>
<version>1.2</version>
</dependency>implementation 'io.github.chafficui:CrucialAPI:1.2'public class Main extends JavaPlugin {
private final String CrucialAPIVersion = "1.2";
/** Auto-download CrucialAPI */
@Override
public void onLoad(){
if(getServer().getPluginManager().getPlugin("CrucialAPI") == null){
try {
URL website = new URL("https://github.com/Chafficui/CrucialAPI/releases/download/v" + CrucialAPIVersion + "/CrucialAPI-v" + CrucialAPIVersion + ".jar");
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream("plugins/CrucialAPI.jar");
fos.getChannel().transferFrom(rbc, 0L, Long.MAX_VALUE);
Bukkit.getPluginManager().loadPlugin(new File("plugins/CrucialAPI.jar"));
} catch (IOException | InvalidDescriptionException | org.bukkit.plugin.InvalidPluginException e) {
e.printStackTrace();
Bukkit.getPluginManager().disablePlugin(this);
}
}
}
/** Auto-update CrucialAPI */
@Override
public void onEnable(){
if(Server.checkVersion(new String[]{"1.16", "1.15"})){
Crucial.getVersion(CrucialAPIVersion, this);
} else {
//CrucialAPI only supports 1.16 and 1.15
Bukkit.getPluginManager().disablePlugin(this);
}
new CrucialItem("Super shovel", Material.DIAMOND_SHOVEL, "item").setCrafting(new String[]{"Air", "AIR", "AIR", "DIAMOND", "DIAMOND", "DIAMOND", "AIR", "AIR", "AIR"});
}
}You can get the latest release build here: Stable Build
If you want the most up-to-date builds, you can get one here: Releases
Docs
At the moment parts of CrucialAPI are not really have any documentation. However, we are working hard on it!
If you need help, or just want to talk with the CAPI or other Devs, you can join the Official ChafficPlugins Discord Server.
Alternatively just use the discussions.
This project requires Spigot 1.15 or higher.