diff --git a/README.MD b/README.MD index 1bfe8bf..f653b3a 100644 --- a/README.MD +++ b/README.MD @@ -1,6 +1,74 @@ -A simple, modern and high-performant Java and Kotlin Minecraft Hologram library for 1.8-1.20.4 servers. -Coming in HologramLib 3 +HoloEasy is a simple, modern and high-performant Java and Kotlin Minecraft Hologram library for 1.8-1.20.4 servers. + +

+ holoeasy video +

+ +## Quickstart +
+ +### As a dependency + +#### Maven + +```xml + + com.github.unldenis + holoeasy + 3.0.0 + +``` + +#### Gradle + +```kotlin +implementation("com.github.unldenis:holoeasy:3.0.0") +``` + +### Start programming (Java) + +```java +import static org.holoeasy.builder.HologramBuilder.*; + +// you can use a Pool or a org.bukkit.Plugin for HologramKey +IHologramPool pool = HoloEasy.startInteractivePool(plugin, 60, 0.5f, 5f); + +public void addHologram(Location location) { + hologram(new HologramKey(pool, "unique-id-holo"), location, () -> { + textline("Hello"); + textline("{} Stats", Player::getName); + textline("Score {} - {}", $ -> 0, $ -> 1); + clickable("Click me").onClick(p -> { + p.sendTitle(ChatColor.AQUA + "Hi", ChatColor.BOLD + "by HoloEasy", + 20, 20, 20); + }); + item(new ItemStack(Material.ENCHANTED_GOLDEN_APPLE)); + }); +} +``` + +### Start programming (Kotlin) +```kotlin +import org.holoeasy.builder.HologramBuilder.* + +// you can use a Pool or a org.bukkit.Plugin for HologramKey +val pool = startInteractivePool(plugin, 60.0, 0.5f, 5f) + +fun addHologram(location: Location) { + hologram(HologramKey(pool, "unique-id-holo"), location) { + textline("Hello") + textline("{} Stats", Player::getName) + textline("Score {} - {}", { 0 }, { 1 }) + clickable("Click me").onClick { + it.sendTitle(ChatColor.AQUA + "Hi", ChatColor.BOLD + "by HoloEasy", + 20, 20, 20) + } + item(ItemStack(Material.ENCHANTED_GOLDEN_APPLE)) + } +} +``` + ### Alpha If you are reading this readme and want to use the latest stable version (2.6.0) the documentation can be found here: diff --git a/gif.gif b/gif.gif new file mode 100644 index 0000000..861a6c2 Binary files /dev/null and b/gif.gif differ diff --git a/src/main/java/org/holoeasy/MyPlugin.java b/src/main/java/org/holoeasy/MyPlugin.java deleted file mode 100644 index b2c2915..0000000 --- a/src/main/java/org/holoeasy/MyPlugin.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.holoeasy; - - -import org.holoeasy.config.HologramKey; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.holoeasy.hologram.Hologram; -import org.holoeasy.pool.IHologramPool; - - -import java.util.UUID; - -import static org.holoeasy.builder.HologramBuilder.*; - -public class MyPlugin extends JavaPlugin { - - private static IHologramPool pool; - - - @Override - public void onEnable() { - pool = HoloEasy.startInteractivePool(this, 60, 0.5f, 5f); - - - getCommand("test").setExecutor((commandSender, command, s, strings) -> { - - if (commandSender instanceof Player) { - Player player = (Player) commandSender; - - Hologram hologram = hologram(new HologramKey(pool, UUID.randomUUID().toString()), player.getLocation(), () -> { - - textline("Hello"); - - textline("{} Stats", Player::getName); - textline("Score {} - {}", $ -> 0, $ -> 1); - clickable("Click me") - .onClick(p -> p.sendMessage("Hi")); - - item(new ItemStack(Material.EGG)); - }); - - - player.sendMessage("Done"); - - } - return true; - }); - } - - -} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml deleted file mode 100644 index a966e2d..0000000 --- a/src/main/resources/plugin.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: MyPlugin -main: org.holoeasy.MyPlugin -version: 1.0 -depend: [ProtocolLib] -api-version: 1.13 -commands: - test: \ No newline at end of file