MoxCore - Basic Utilities Library 1.2

No permission to download
Provides lots of usefull functions and APIs
Supported software
Supported versions
Tags
Tags
api library moxcore utilities utils
Introduction:
  • Do you want to have everything essential like SQL databases in some lines instead of few files and hundreds lines?
  • Do you need basic maths like .chanceOf(30)?
  • Do you want to create action bars, titles very easy without working with packets?
  • Do you want to have tools like calculating distance 2D or 3D and much more?
Then this Library is for you.
We have created this library to create plugins faster without unessesary managing with minecraft server classes. Our Mox plugins will usually use those APIs.


Donation wall:

If you want be on this list, send us donate.
We will promote your server here or whatever you will want!
Donations are giving us motivation to add new things into our plugins because by that we know that someone appreciates our work!
Also we are adding and developing our stuff for free, so dontaions are, for us, very nice gift from you :p!
If you want donate us, please give information in donation in which plugin you want to be added to the donation wall.

  1. Null :c You can be first!



Example features:

SQL Databases:
MySQLDatabase is working with scheduler. It means that update queries will not affect performance and will not dreadlock your machine due to too many Threads created!
Example code:
Java:
SQLDatabase database;
if (getConfig().getString("database.type").equalsIgnoreCase("mysql")){
   String host = getConfig().getString("database.mysql.host");
   String port = getConfig().getString("database.mysql.port");
   String databaseName = getConfig().getString("database.mysql.database");
   String user = getConfig().getString("database.mysql.user");
   String password = getConfig().getString("database.mysql.password");
   database = new MySQLDatabase(this);
   database.createConnection(host, port, databaseName, user, password);
} else {
   String fileLocation = getConfig().getString("database.sqlite.file-location").replace("%plugin-folder%", getDataFolder().getPath());
   database = new SQLiteDatabase(this);
   database.createConnection(fileLocation);
}
Example config:
YAML:
#Types: "mysql" (network), "sqlite" (.db file).
database:
  type: "sqlite"
  sqlite:
    file-location: "%plugin-folder%/database.db"
  mysql:
    host: "localhost"
    port: "3306"
    database: "MoxCore"
    user: "root"
    password: "password"
ActionBar:

Actionbars are called asynchronously so you will not experience any affect on main thread.
Example code:
Java:
ActionBar actionBar = new ActionBar("&bSome text!");
actionBar.send(player); // Can be send to List<Player> or .sendToAll()
Title:

Ending titles are called asynchronously so you will not experience any affect on main thread.
Example code:
Java:
// Example method
public void showTitle(String titleText, String subTitleText, Player player) {
   Title title = new Title(titleText, subTitleText, 40); // 40 is in ticks how long title will appear. 20 ticks = 1 second.
   title.setFadeIn(8); // Default value is 10
   title.setFadeOut(12); // Default value is 10
   title.send(player); // Can be send to List<Player> or .sendToAll()
}
ServerUtils:

This API has utils that are related to server stuff.
Example code:
Java:
ServerUtils.sendMessage(player, "&c[&4Prefix&c] ", "&cMessage with prefix!");
ServerUtils.sendMessage(player, "&cMessage without prefix!");
ServerUtils.sendMessage(Bukkit.getOnlinePlayers(), "&cMessage to list of players!");
ServerUtils.setTablistHeaderFooter(player, "&aThis is tab header!", "&2This is tab footer!");
MathUtils:

This API contains method that will calculate something for you with return.
Example code:
Java:
if (MathUtils.chanceOfProcent(50){
   player.setHealth(0);
} else {
   Double distance = MathUtils.calculateDistance3D(player.getLocation(), dungeonLocation);
   player.teleport(dungeonLocation);
   ServerUtils.sendMessage(player, "&bYou have been teleported &3"+distance+" &bblocks away!");
}
ItemUtils:

With this API you can create itemstacks and modify them. You can use it by callig it directly, for example ItemUtils.setCustomTag(itemStack, "Word", "Love");
Example code:
Java:
ItemStack itemStack = ItemUtils.createItemStack(Material.STICK, 1, 0, "&5Stick with hidden word Love", "&dDo you believe in true love?");
itemStack = ItemUtils.setCustomTag(itemStack, "Word", "Love");
Creating custom potion:
Java:
ItemStack potion = ItemUtils.createPotionItemStack(Material.POTION, 1, PotionEffectType.REGENERATION, 100, 1); // Normal regeneration potion II with 5s duration (100 ticks)
potion = ItemUtils.setPotionColor(potion, Color.fromRGB(175, 0, 0)); // Adding pink color. You can define your own as you want.
potion = ItemUtils.addPotionEffect(potion, PotionEffectType.HEAL, 0, 2); // Adding HEAL III to potion.
// Here it is. We have created normal potion with custom color that heals instantly and gives regeneration for 5s
ConfigUtils:

This API allows you to do nice things with your configuration file, for example - set missing keys automaticly with default values from plugin's source config.
Example code:
Java:
ItemStack configItem = ConfigUtils.loadItemStack(myPlugin.getConfig(), "my.item", myPlugin);
Example config:
YAML:
my:
  item:
    material: "POTION"
    data: 0
    amount: 2
    name: "&b&lMy Potion!"
    lore: "&dMy Supa potion!"
    potion-data:
      effect: "INVISIBILITY"
      duration: 400
      amplifer: 0
      color: "0,0,150"
    enchants:
      - KNOCKBACK 4
There is lots of more things that are inside MoxCore. Code blocks and descriptions above are only examples. Check it out by downloading this source. If you will experience any problem then please PM me or create issue ticket here, I will try to help or fix this problem! Latest version can be find here.
Top
You need to upgrade!
Our dark style is reserved for our Premium members. Upgrade here.