diff --git a/README.md b/README.md index d0b8ca9..2d5fae1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Create a region - First you need to make to make 2 locations. - Create the region. - Last step add the region to the list. -```sh +```java Location loc1 = new Location(Bukkit.getWorld(""), 0, 0, 0); Location loc2 = new Location(Bukkit.getWorld(""), 0, 0, 0); Region region = new Region("", loc1, loc2); @@ -26,7 +26,7 @@ Regions.addRegion(region); Region Events - PlayerEnterRegionEvent - When a player joins the region. - PlayerExitRegionEvent - When a player leaves a region. -```sh +```java @EventHandler public void regionEnter(PlayerEnterRegionEvent event) { } @@ -37,7 +37,7 @@ public void Region(PlayerExitRegionEvent event) { ``` Get info of region. -```sh +```java Region region = null; //Your region Location loc = null; //Bukkit location @@ -50,7 +50,7 @@ Regions.getRegionsInLocation(loc); //List of all the regions in that location. ``` ## Json Manager You need to use Google`s json dependency. -```sh +```html com.googlecode.json-simple json-simple @@ -59,7 +59,7 @@ You need to use Google`s json dependency. ``` Json Features -```sh +```java import net.hypple.EasyAPI.Json.JsonManager; JsonManager.createJsonFile(""); @@ -70,7 +70,7 @@ JsonManager.updateJsonBody("", JSONObject); ## MySQL Connect to database. _put in onEnable()_ -```sh +```java @Override public void onEnable() { EasyAPI.setupMySQL("Host", "Data Base", "Username", "Password"); @@ -78,7 +78,7 @@ public void onEnable() { ``` You need to install this dependency -```sh +```yml mysql mysql-connector-java @@ -87,14 +87,14 @@ You need to install this dependency ``` Get the connection to data base. -```sh -EasyAPI.mysql.GetConnection(); +```java +EasyAPI.getMySQL().GetConnection(); ``` ## Hex Coler Codes Its for the version 1.16+ that support RGB. You can you this on spigot and Bungee servers. _You just need to put the & symbol in front of the hex code_ -```sh +```java Player player = null; //Your player player.sendMessage(HexColors.replaceHexCodes("�f2ff message in your coler.")); ``` diff --git a/plugin.yml b/plugin.yml new file mode 100644 index 0000000..6bfb860 --- /dev/null +++ b/plugin.yml @@ -0,0 +1,5 @@ +name: EasyAPI +main: net.hypple.EasyAPI.EasyAPI +version: 1.1.1 +api-version: 1.18 +authors: [JernejTDO, alandioda] \ No newline at end of file diff --git a/pom.xml b/pom.xml index d57e4e1..30b36de 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 net.hypple EasyAPI - 1.1.1 + 1.1.2 EasyAPI diff --git a/src/main/java/net/hypple/EasyAPI/EasyAPI.java b/src/main/java/net/hypple/EasyAPI/EasyAPI.java index ec3011a..ea2a4b5 100644 --- a/src/main/java/net/hypple/EasyAPI/EasyAPI.java +++ b/src/main/java/net/hypple/EasyAPI/EasyAPI.java @@ -15,7 +15,7 @@ import net.md_5.bungee.api.ChatColor; public class EasyAPI extends JavaPlugin { private static EasyAPI plugin; - public static EasyMySQL mysql; + private static EasyMySQL mysql; @Override public void onEnable() { @@ -46,6 +46,10 @@ public class EasyAPI extends JavaPlugin { return plugin; } + public static EasyMySQL getMySQL() { + return mysql; + } + private static void defaultFile() { JsonManager.createJsonFile("EasyAPI"); } @@ -53,5 +57,10 @@ public class EasyAPI extends JavaPlugin { public static void createPluginConfig(Plugin plugin) { JsonManager.createJsonFile(plugin.getName()); } + + public static void setupMySQL(String host, String dataBase, String username, String password) { + Bukkit.getConsoleSender().sendMessage(ChatColor.of(new Color(51,255,255))+"EasyAPI §7- "+ChatColor.of(new Color(0,255,0))+"connecting to database."); + mysql = new EasyMySQL(host, dataBase, username, password); + } } diff --git a/target/classes/net/hypple/EasyAPI/EasyAPI.class b/target/classes/net/hypple/EasyAPI/EasyAPI.class index 948c163..44e3ad2 100644 Binary files a/target/classes/net/hypple/EasyAPI/EasyAPI.class and b/target/classes/net/hypple/EasyAPI/EasyAPI.class differ