From 11987ddde2592125639ec1767bcf76a8e9f412d3 Mon Sep 17 00:00:00 2001 From: JernejTDO Date: Tue, 3 May 2022 16:14:46 +0200 Subject: [PATCH] Update 1.1.2 --- README.md | 20 +++++++++--------- plugin.yml | 5 +++++ pom.xml | 2 +- src/main/java/net/hypple/EasyAPI/EasyAPI.java | 11 +++++++++- .../classes/net/hypple/EasyAPI/EasyAPI.class | Bin 2849 -> 3347 bytes 5 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 plugin.yml 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 948c163c70681e0d89c8bb5571f44d157fbe4595..44e3ad25400a92ef0755ddbfe09db9402bc33474 100644 GIT binary patch delta 602 zcmbVIO-mb56g_W}_RUN~58 z^l2MEsx`)@T5XdC{G|SX{wVQI40h37-{Rf#&OP_Md+%P8Xz~BKxx5C@i!z7A&?2(D zK`e1z4!z=a401}hN8csJV+%8<<0;cH^eLN+ zT5Yp6soB~a&C~Jx*ZYg+?UPyqAH3w@<2g>!98tSHqGeBhe%Fv-qJIMmUiHr zW?747CMm|`h@v{P(w^kXirgp#6?}l89XukcouYHxzpz%KD8Wnj!zvpUS+#BXWBHy| zDGfZu13ZJT%7S{?!gkH9kD_CzhA!}#;T-?e_LF{~TI;z}l2@K86zro=bIDV;ZsOwS zFs~qfE7A19DPErTLOIILjpZ*yL_sOULf;swSrSp6h)XN2!~PdT#0 YF(IeLI8F#T z*pwan^sD1(D&3(d*OP=6dD@h+FBldqQTWpPlIqJfF02%1{@kwcz03`Mq-^cQP#m(o F;|G;QA94Ty