BaseCore is a library that adds lot of features for the developers and the server owners. All of the lib is found on the documents so it's very easy to use.
Here are the features of BaseCore [for server owners]:
-
As a server owner, You can usually select yourself where does the data save (MySQL / FlatFile). So if plugin uses BaseCore, You don't have to config him to save your data.
- If you have economy plugins that use BaseCore, You can config BaseCore to use Vault's Economy or his one economy. And if Vault is not found, It's just going to use BaseCore's economy.
Here are the features of BaseCore [for developers]:
Data
You can use the default saver (that the server owner configured) if you want to let the owner of the server to choose the way to save the information. To use it, You only have to code:
Code (Text):
Saver s = BaseCore.getDefaultSaver(NAME, JavaPlugin);
// For Example:
Saver s = BaseCore.getDefaultSaver("Banana", Main.plugin);
s.set("OHLY FUCKING SHIT", "BaseCore");
// For Example:
Saver s = BaseCore.getDefaultSaver("Banana", Main.plugin);
s.set("OHLY FUCKING SHIT", "BaseCore");
ConfigSaver:
You can create easily custom configs with the "ConfigSaver" system. I recommend to use it only when you want to be able to change the values easily.
For example:
Code (Text):
ConfigSaver saver = new ConfigSaver(Main.getInstance(), "banana");
saver.set("I_Love_Bananas", true); // It saves the file automatically!
saver.set("I_Love_Bananas", true); // It saves the file automatically!
With SQLSaver you can easily save data to MySQL DataBase. It works very similar to ConfigSaver.
For example:
Code (Text):
try {
SQLSaver saver = new SQLSaver(new MySQLDataBase("localhost", "3306", "root", "very_secret_password"), "banana");
saver.set("I_Love_Bananas", "YEAH!!");
} catch (ClassNotFoundException | IOException | SQLException e) {
e.printStackTrace();
}
SQLSaver saver = new SQLSaver(new MySQLDataBase("localhost", "3306", "root", "very_secret_password"), "banana");
saver.set("I_Love_Bananas", "YEAH!!");
} catch (ClassNotFoundException | IOException | SQLException e) {
e.printStackTrace();
}
You can save every object that implemets Serializable. For example:
Code (Text):
// Set
Saver saver = BaseCore.getDefaultSaver();
saver.set("Hey", new BaseKit(player));
// Get
BaseKit bk = (BaseKit) saver.get("Hey");
Saver saver = BaseCore.getDefaultSaver();
saver.set("Hey", new BaseKit(player));
// Get
BaseKit bk = (BaseKit) saver.get("Hey");
BaseKit allows you to create kits with listeners and short-listeners* and bring him to a player. The short-listeners run only when the event runs because of the player that owns the kit. So you don't have to check it on the method...
Also, You can check lot of things on the annotation itself. But It depends, I recommend to read the docs.
For example:
Code (Text):
public class Banana extends BaseKit {
public Banana(Player p) {
super(p);
Main.mc.send("You've got the BananaKit!", p);
}
@LaunchProjectileEvent(permission="bananakit.launch.firesnowball", projectile_type={EntityType.SNOWBALL, EntityType.FIREBALL}, rand={1, 3}) // rand means that the event runs with a chance of 1 from 3.
public void onLaunchASnowballOrFireball(ProjectileLaunchEvent e) { // The parameter for every annotation is found on the docs
getPlayer().sendMessage("Dude you've done it!!! :DD");
}
@DeathEvent(cause=DamageCause.FIRE)
public void onDeath(PlayerDeathEvent e) {
getPlayer().sendMessage("You mustn't death by fire! You won't have the bananakit anymore!");
removeBaseKit(); // If you want to do it from another class, you can call the static method: BaseKit.removeBaseKit(Player)
}
}
public Banana(Player p) {
super(p);
Main.mc.send("You've got the BananaKit!", p);
}
@LaunchProjectileEvent(permission="bananakit.launch.firesnowball", projectile_type={EntityType.SNOWBALL, EntityType.FIREBALL}, rand={1, 3}) // rand means that the event runs with a chance of 1 from 3.
public void onLaunchASnowballOrFireball(ProjectileLaunchEvent e) { // The parameter for every annotation is found on the docs
getPlayer().sendMessage("Dude you've done it!!! :DD");
}
@DeathEvent(cause=DamageCause.FIRE)
public void onDeath(PlayerDeathEvent e) {
getPlayer().sendMessage("You mustn't death by fire! You won't have the bananakit anymore!");
removeBaseKit(); // If you want to do it from another class, you can call the static method: BaseKit.removeBaseKit(Player)
}
}
- DamageByEntityEvent
- DamageEntityEvent
- DamageEvent
- DeathEvent
- KillEvent
- DamageProjectileEvent
- LaunchProjectileEvent
- HitProjectileEvent
- InteractEvent
Region
Region manages the area that is found between 2 locations.
For example:
Code (Text):
public class Banana extends BaseKit {
public Banana(Player p) {
super(p);
Main.mc.send("You've got the BananaKit!", p);
}
@InteractEvent(permission="banana.centerofworld", action={Action.LEFT_CLICK_BLOCK})
public void onInteract(PlayerInteractEvent e) {
Region region = new Region(Bukkit.getWorld("world"), 1, 0, 1, -1, 255, -1);
if (region.contains(e.getClickedBlock().getLocation())) {
getPlayer().sendMessage("R U TRYING TO BRICK THE CENTER OF THE WORLD?! IT'S A DIAMOND NOW!");
region.setBlocks(Material.DIAMOND);
}
}
}
public Banana(Player p) {
super(p);
Main.mc.send("You've got the BananaKit!", p);
}
@InteractEvent(permission="banana.centerofworld", action={Action.LEFT_CLICK_BLOCK})
public void onInteract(PlayerInteractEvent e) {
Region region = new Region(Bukkit.getWorld("world"), 1, 0, 1, -1, 255, -1);
if (region.contains(e.getClickedBlock().getLocation())) {
getPlayer().sendMessage("R U TRYING TO BRICK THE CENTER OF THE WORLD?! IT'S A DIAMOND NOW!");
region.setBlocks(Material.DIAMOND);
}
}
}
Right now you can set a default prefix + suffix to every message that you send and send it to more than one CommandSender (By permission or array). Also, You can add default messages. It'll be greater soon.
Code (Text):
message_core = new MessageCore("§d[BaseCore] §e");
message_core.send("Hey!"); // Broadcast
message_core.send("LOLOLOL", getServer().getConsoleSender());
message_core.send("You have a cool permission", "basecore.cool.permission");
// DEFAULT MESSAGES
message_core.addDefault("noperms", "§cYou don't have permissions to do it!");
message_core.sendDefault("noperms"); // Broadcast the default // ETC...
message_core.send("Hey!"); // Broadcast
message_core.send("LOLOLOL", getServer().getConsoleSender());
message_core.send("You have a cool permission", "basecore.cool.permission");
// DEFAULT MESSAGES
message_core.addDefault("noperms", "§cYou don't have permissions to do it!");
message_core.sendDefault("noperms"); // Broadcast the default // ETC...
AdvancedItem allows you to create easily ItemStack.
Code (Text):
AdvancedItem item = new AdvancedItem(Material.APPLE, 1, 0, "Banana", "Lore1", "Lore2"...).setGlow(true);
getPlayer().getInventory().addItem(item);
getPlayer().getInventory().addItem(item);
Via ScoreboardUtils, scoreboards become easy! You only have to create the scoreboard where you want it to be. For example on the PlayerJoinEvent:
Code (Text):
new ScoreboardUtils(e.getPlayer(), "§3VERY COOL NAME!!!", DisplaySlot.SIDEBAR...).setLine("BaseCore?!!?").setLine("NewLine 0.0");
// VERY COOL NAME
//
// NewLine 0.0
// BaseCore?!!?
// You also can code the specific score:
new ScoreboardUtils(e.getPlayer(), "§3VERY COOL NAME!!!", DisplaySlot.SIDEBAR...).setLine("BaseCore?!!?", 1).setLine("NewLine 0.0", 2);
// VERY COOL NAME
//
// NewLine 0.0
// BaseCore?!!?
// You also can code the specific score:
new ScoreboardUtils(e.getPlayer(), "§3VERY COOL NAME!!!", DisplaySlot.SIDEBAR...).setLine("BaseCore?!!?", 1).setLine("NewLine 0.0", 2);
Code (Text):
ScoreboardUtils.getUtils(PLAYER).setLine("NEW LINE", "OLD LINE"); // It only has to start with the "OLD LINE" to be replaced.
ScoreboardUtils.getUtils(PLAYER).setLine("NEW LINE #2", 2); // Sets with the specific score.
ScoreboardUtils.getUtils(PLAYER).setLine("NEW LINE #TOP"); // Only adds a new line at the top.
ScoreboardUtils.getUtils(PLAYER).setLine("NEW LINE #2", 2); // Sets with the specific score.
ScoreboardUtils.getUtils(PLAYER).setLine("NEW LINE #TOP"); // Only adds a new line at the top.
Code (Text):
ScoreboardUtils.getUtils(PLAYER).destroyScoreboard()
BaseCore has "built-in" economy system that can interacts with vault. See the owners section on the post.
Code (Text):
// Create an object
Economy eco = new Economy(getPlayer());
eco.addBalance(666); // It can add by Vault or by the built-in system. Depends by the owner of the server.
// Static Method
Economy.delBalance(getPlayer(), 666);
Economy eco = new Economy(getPlayer());
eco.addBalance(666); // It can add by Vault or by the built-in system. Depends by the owner of the server.
// Static Method
Economy.delBalance(getPlayer(), 666);
The plugin contains 3 custom events that run by the default listener of bukkit.
EnableServerEvent:
Runs when the server enables, After all of the plugins.
ReloadServerEvent:
Runs directly after the "/reload" command.
StopServerEvent:
Runs directly after the "/stop" command.
DebugEvent:
Runs when BaseCore debugs.
TODO List
- SOON
SourceCode
Contact Me
You can always contact me with ideas / problems by PM on spigot. Also:
Skype: ben.ben396
Discord: DrBenana#8172
EMail: nsgi3111@gmail.com
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9, 1.10
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
[LIB] BaseCore - Makes your life easier...! is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 325 times (via Spigot). Download it and open it directly in the game.