From c23a18ab99f615bc0799a7c3a0b61abe6b4af509 Mon Sep 17 00:00:00 2001 From: DevDrizzy Date: Fri, 1 Dec 2023 13:14:24 +0500 Subject: [PATCH] Update project description Signed-off-by: DevDrizzy --- Paper/pom.xml | 6 ----- README.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++----- pom.xml | 10 +------ 3 files changed, 68 insertions(+), 21 deletions(-) diff --git a/Paper/pom.xml b/Paper/pom.xml index 83fd735..86647f9 100644 --- a/Paper/pom.xml +++ b/Paper/pom.xml @@ -17,12 +17,6 @@ - - org.github.spigot - 1.8.8 - 1.8.8 - provided - xyz.refinedev.api SpigotAPI-API diff --git a/README.md b/README.md index ce74cd0..1cf3ab2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,70 @@ # SpigotAPI -The most modern and support friendly public SpigotAPI +The most modern and support friendly public SpigotAPI (1.8 only) -This SpigotAPI supports and enchances how implement KnockbackAPI support from different spigot forks, along with helping the issue of -EntityHider with spigots that don't have it. +This SpigotAPI supports KnockbackAPI from different spigot forks, along with helping the issue of EntityHider with spigots that don't have it. +Also, useful if you need PotionExpireEvent or EquipmentSetEvent. -To contribute or add another spigot, just create a new module with the same package path, then implement the correct API interface -and add the usage from the Spigot. Besure to never push the actual spigot jar here, only its API with permission of developer. -You can then create a pull-request with your changes. This API will be used in a lot of RefineDevelopment's plugins. +## Features +- Support for popular spigots. +- Support for HCF Bukkit Events. (PotionExpireEvent, EquipmentSetEvent) +- Custom Entity Hider using protocol lib. +- Easy to use. + +## Installing +You can either shade this repository into your plugin, or run it as a plugin by itself. + +1. Clone this repository +2. Enter the directory: `cd SpigotAPI` +3. Build & install with Maven: `mvn clean package install` + +OR +```xml + + + refine-public + https://maven.refinedev.xyz/repository/refine-public/ + + +``` +Next, add SpigotAPI to your project's dependencies via Maven + +Add this to your `pom.xml` ``: +```xml + + xyz.refinedev.api + SpigotAPI + 1.2 + compile + +``` + +## Usage +This only requires ProtocolLib if you use the API's EntityHider. +You can initiate and set up the API using the following code: + +```java +import xyz.refinedev.api.spigot.SpigotHandler; +import xyz.refinedev.api.spigot.SpigotType; + +public class ExamplePlugin extends JavaPlugin { + + private SpigotHandler spigotHandler; + + @Override + public void onEnable() { + this.spigotHandler = new SpigotHandler(instance); + // This will automatically detect if Entity Hider is needed or not. + // If it's needed, then it'll register it accordingly. + this.spigotHandler.init(true); // Boolean is for HCF mode. + + SpigotType type = this.spigotHandler.getType(); + if (type != SpigotType.Default) { + this.getLogger().info("Found " + type.getName() + ", hooking in for support, HCF-TeamFights will be supported."); + } + + // Usage can be like so + Player player = Bukkit.getPlayer("NotDrizzy"); // your player object + this.spigotHandler.getKnockback().setKnockback(player, "knockback name"); + } +} +``` diff --git a/pom.xml b/pom.xml index 15e65f0..645a206 100644 --- a/pom.xml +++ b/pom.xml @@ -37,14 +37,6 @@ UTF-8 - - - refine-releases - https://maven.insidious.cc/repository/maven-releases/ - - - - jitpack.io @@ -66,7 +58,7 @@ org.projectlombok lombok - 1.18.12 + 1.18.26 provided