Git Product home page Git Product logo

crucialapi's Introduction

CrucialAPI

CrucialAPI

CrucialAPI is an open-source, easy-to-use Spigot API that aims to simplify plugin development.

Note: If you have any suggestions, questions, or feedback for this wiki, please use Discussions.

Setup

Attention! Do not forget to add CrucialAPI as a dependency in your "plugin.yml" file!

Maven

<dependency>
  <groupId>io.github.chafficui</groupId>
  <artifactId>CrucialAPI</artifactId>
  <version>1.2</version>
</dependency>

Gradle

implementation 'io.github.chafficui:CrucialAPI:1.2'

Examples

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"});
    }
}

Download

You can get the latest stable release build here: Stable Build
If you want the most up-to-date builds, you can find them here: Releases

Documentation

Documentation
Currently, some parts of CrucialAPI lack proper documentation. However, we are working hard to improve it!

Getting Help

If you need help or want to chat with the CAPI team or other developers, you can join the Official ChafficPlugins Discord Server.
Alternatively, you can use the Discussions section.

Dependencies

This project requires Spigot 1.15 or higher.

Here are some additional information about LTS versions:

Version Supported
2.2.x
2.1.x
2.0.x
1.x.x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.