Mineuniverse
Log in Register
Plugins

DRC-API

An API with helpfull methods for lazy programmers (Weren't those the best?)
by Minevid
Download Claim this project
522 downloads
0 likes
Updated Jun 30, 2026
0 hypes
Fixes
About the API
This API add some usefull methods to avoid to write a ton of code over and over again.
 
Methods
MainHelper.reformateText("&cSome text");
This will give back the colored text. You can use '&' and '§'.
 
MainHelper.hasPermission(player, permission);
Will check if the given Player has op, * or the given permission
permission can be of type String or Permission
 
MainHelper.isPluginThere(mainPlugin, "Litebans");
Will check if the given pluginname is in the Pluginsfolder.
 
MainHelper.addLore(lore, itemstack);
Will add the given lore to the itemstack
lore has to be a list of Strings
 
MainHelper.getRenamedItemstack(customname, itemstack);
Will rename the given itemstack with the given name. (The name can be colored)
 
Other features
- Adds an UpdateChecker function
 
private void checkUpdate() {
    UpdateChecker updater = new UpdateChecker(this, 52712, false);
 
    UpdateChecker.UpdateResult result = updater.getResult();
 
    switch (result) {
        case NO_UPDATE: {
            getLogger().info(perfix + MainHelper.reformateText("&6There is no update available! Everything is up to date!"));
            break;
        }
        case UPDATE_AVAILABLE: {
            // TODO: 4/12/2017 Fix link
            getLogger().info(perfix + MainHelper.reformateText("&aThere is an update available! You can download it at https://www.spigotmc.org/resources/anti-combat-log.52712/"));
            break;
        }
 
        case FAIL_SPIGOT: {
            getLogger().info(perfix + MainHelper.reformateText("&cThere is a problem with Spigot. sorry for the inconvenience"));
            break;
        }
        case BAD_RESOURCEID: {
            getLogger().info(perfix + MainHelper.reformateText("&cStupid me. I placed the wrong ResourceID. Contact him on Spigot!"));
            break;
        }
    }
}
If you insert and call this in your main plugin class it will check if the given resourceID has an update. (Change "52712" to your plugin id and ofcourse the link)
 
- A ConfigHandler which makes it super easy to have more than 1 config file. Just make a class for each configfile and extends ConfigHandler. Implement the constructor.
Once you've done that, go to where you want to init your configs and use the following syntax:
For example:
Config config = new Config(plugin, "config.yml");
After you made the config.yml file inside the src folder, add static methods for each value you want to have access to. Add a load methode and add getters and you can access them from everywhere in your project. 
Here is an example Configfile from AntiCombatLog.
config.yml
#Enables if you want to auto check for updates
updatechecker: true
#These commands will be disabled when being in combat.
command-blacklist:
- /spawn
- /ci
 
#When this is allowed, players can be punished for combat logging
allow-punishments: true
Config.java
public class Config extends ConfigHandler {
private static boolean updateChecker;
private static boolean punishmentsAllowed;
private static List<String> blacklistedCommands;
 
public Config(JavaPlugin plugin, String filename) {
     super(plugin, filename);
     loadConfig();
}
 
private void loadConfig() {
     updateChecker = getConfig().getBoolean("updatechecker");
 
     punishmentsAllowed = getConfig().getBoolean("allow-punishments");
 
     blacklistedCommands= getConfig().getStringList("command-blacklist");
}
 
public static List<String> getBlacklistedCommands() {
        return blacklistedCommands;
}
 
public static boolean isUpdateChecker() {
        return updateChecker;
}
 
public static boolean ispunishmentsAllowed () {
        return punishmentsAllowed ;
}
 
}
Now wherever you need it, you can call
Config.ispunishmentsAllowed();
Plugins who currently use this API
If you are using this plugin feel free to let me know and I'll add you on this list.
 
Developers
Feel free to add this plugin to your libraries. No maven support yet.
 
DRCAPI-1.0
MC 1.7.2, 1.9, 1.11, 1.7.4, 1.8.3, 1.8.1, 1.8, 1.12, 1.10
Release 2018-02-11 Get

More from Minevid

Anti Combat Log Lite
6,727
AntiEvents
410
dtlTraders
293,895
Halloween Scare
2,681
SignURLs Reloaded
1,739

You Might Also Like

PlayerSkinChanger
Change your skin without client mod !
96,438
EndReward
Get a reward for killing the EnderDragon!
9,792
ConfigExp
configurable exp drops for everyone!
9,294
RightOnSpawn
You will never spawn on a roof again!
9,235
Server Resource Packs
Allows for a new way to get players the files for your server Resource Pack.
9,027
SleepDay
It's enough that one player sleep in order to night to day.
8,968