diff --git a/README.MD b/README.MD index 33826ae..7d57115 100644 --- a/README.MD +++ b/README.MD @@ -1,174 +1,10 @@ +# HoloEasy HoloEasy is a simple, modern and high-performant Java and Kotlin Minecraft Hologram library for 1.8-1.20.4 servers. -Lightweight replacement for Holographic Display. HoloEasy only uses packets instead of registering the entity in the actual Minecraft server. -

- holoeasy video -

- -## Quickstart - -### Requirements -* ProtocolLib installed on your server - -### Add dependency -#### Maven - -```xml - - com.github.unldenis.holoeasy - holoeasy-core - 4.0.0 - - - - - org.jetbrains.kotlin - kotlin-stdlib - 1.9.21 - -``` - -#### Gradle - -```kotlin -implementation("com.github.unldenis.holoeasy:holoeasy-core:4.0.0") - -// For java projects include also the kotlin stdlib -implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.21") - -``` - -Make sure you include the repository as well. - - - - - -## Hello World - -### Kotlin -```kotlin -class HelloWorldHologram(location: Location) : Hologram(location) { - var line = textLine("Hello World") -} - -// When you need -val hologram = HelloWorldHologram(location) -hologram.show() -``` - -### Java -```java -public class HelloWorldHologram extends Hologram { - - ITextLine line = textLine("Hello World"); - - public HelloWorldHologram(@NotNull Location location) { - super(location); - } - -} - -// When you need -HelloWorldHologram hologram = new HelloWorldHologram(location); -hologram.show(); -``` - -## Deep into holoeasy - -### Kotlin -```kotlin -class MyHolo(location: Location) : Hologram(location) { - - private val clickCount = mutableStateOf(0) // can be any type - - val counter = textLine("Clicked {} times", TextLineModifiers() - .args(clickCount) - .clickable { _ -> clickCount.update { it + 1 } }) - - var status= blockLine(ItemStack(Material.RED_DYE)) - -} - -// Create new hologram -val myHolo = MyHolo(location) -myHolo.show() - -Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, Runnable { - // access lines - myHolo.status.update(ItemStack(Material.GREEN_DYE)) -}, 20L * 5) -``` - -### Java -```java -class MyHolo extends Hologram { - - private final MutableState clickCount = mutableStateOf(0); // can be any type - - public ITextLine counter = textLine("Clicked {} times", new TextLineModifiers() - .args(clickCount) - .clickable(player -> clickCount.update(it -> it + 1))); - public ILine status = blockLine(new ItemStack(Material.RED_DYE)); - - public MyHolo(@NotNull Location location) { - super(location); - } -} - -// Create new hologram -MyHolo myHolo = new MyHolo(location); -myHolo.show(); - -Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, () -> { - // access lines - myHolo.status.update(new ItemStack(Material.GREEN_DYE)); -}, 20L * 5); -``` - -## Custom pool - -### Kotlin -```kotlin -// you can use a Pool or a org.bukkit.Plugin -val pool = HoloEasy.startInteractivePool(this, 60.0, - minHitDistance = 0.5f, /* optional */ - maxHitDistance = 5f, /* optional */ - clickAction = ClickAction.LEFT_CLICK /* optional */ -) - -// show on the right pool -hologram.show(pool) -``` - -### Java -```java -// you can use a Pool or a org.bukkit.Plugin -IHologramPool pool = HoloEasy.startInteractivePool(60, 0.5f, 5f); - -// show on the right pool -hologram.show(pool); -``` - -## Serialization - -### Kotlin -```kotlin -val serialized: Map = hologram.serialize() - -val deserialized : HelloWorldHologram = Hologram.deserialize(serialized) -deserialized.show() -``` - -### Java -```java -Map serialized = hologram.serialize(); - -HelloWorldHologram deserialized = Hologram.deserialize(serialized, HelloWorldHologram.class); -deserialized.show();; -``` +## Documentation +Visit https://www.holoeasy.dev to view the documentation. ## History Are you using a version older than 4.0.0? You can find the documentation here. diff --git a/website/hello-world/index.html b/website/hello-world/index.html new file mode 100644 index 0000000..f825a79 --- /dev/null +++ b/website/hello-world/index.html @@ -0,0 +1,172 @@ + + + + + + HoloEasy + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
Customize
+ +
+
+ + +
+
+ +
+
+

Hello World

+

+ Your first hologram. +

+ + +

Start programming

+ + +

+ 1. Register HoloEasy api. +

+ +
+
HoloEasy.bind(org.bukkit.plugin.Plugin);
+
+ +

+ 2. Define your first Hologram class. +

+ +
+
public class HelloWorldHologram extends Hologram  {
+
+    ITextLine line = textLine("Hello World");
+
+    public HelloWorldHologram(@NotNull Location location) {
+        super(location);
+    }
+
+}
+
+ + +

+ 3. Now spawn a hologram. +

+ +
+
HelloWorldHologram hologram = new HelloWorldHologram(location);
+hologram.show();
+
+ +

+ 4. Once you’re done, you may now proceed creating your first hologram. +

+ + + + + +
+
+ +
+
+ + + \ No newline at end of file diff --git a/website/index.html b/website/index.html new file mode 100644 index 0000000..7ddf686 --- /dev/null +++ b/website/index.html @@ -0,0 +1,169 @@ + + + + + + HoloEasy + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
Customize
+ +
+
+ + +
+
+ +
+
+

Introduction

+

+ Get familiar with HoloEasy. +

+ +

What is HoloEasy

+

+ HoloEasy is an open-source minecraft hologram library. Under the hood, it uses ProtocolLib for sending packets. +

+ +

+ Other... +

+ +

Frequently Asked Questions

+ + +
+
    +
  • + + Why? + + +
    +

    + Lightweight replacement for Holographic Display. HoloEasy only uses packets instead of registering the entity in the actual Minecraft server. +

    +
    +
  • +
  • + + Do I need Kotlin with HoloEasy? + + +
    +

    + No, the API wasn't created for only Kotlin users, but rather to provide a clean, fluent API that works well in both Java and Kotlin environments. +

    +
    +
  • +
  • + + Who is HoloEasy designed for? + + +
    +

    + For library and plugin devs. +

    +
    +
  • +
+
+ + +

Installation

+ +
+ For installation instructions, please refer to our installation page. +
+
+
+ +
+
+ + + \ No newline at end of file diff --git a/website/installation/index.html b/website/installation/index.html new file mode 100644 index 0000000..8282185 --- /dev/null +++ b/website/installation/index.html @@ -0,0 +1,213 @@ + + + + + + HoloEasy + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
Customize
+ +
+
+ + +
+
+ +
+
+

Installation

+

+ Learn how to install and integrate HoloEasy in your projects. +

+ + +

Installation via Maven

+ +

+ 1. Add the JitPack repository to your build file. +

+ +
+
<repositories>
+    <repository>
+        <id>jitpack.io</id>
+        <url>https://jitpack.io</url>
+    </repository>
+</repositories>
+
+ +

+ 2. Add the dependency. +

+ +
+
<dependency>
+    <groupId>com.github.unldenis.holoeasy</groupId>
+    <artifactId>holoeasy-core</artifactId>
+    <version>4.0.0</version>
+</dependency>
+
+ + +

+ 3. For java plugins include also the kotlin stdlib. +

+ +
+
<dependency>
+    <groupId>org.jetbrains.kotlin</groupId>
+    <artifactId>kotlin-stdlib</artifactId>
+    <version>1.9.21</version>
+</dependency>
+
+ +

+ 4. Once you’re done, you may now proceed creating your first hologram. +

+ + + + +

Installation via Gradle

+ +

+ 1. Add the JitPack repository to your build file. +

+ +
+
dependencyResolutionManagement {
+    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+    repositories {
+        mavenCentral()
+        maven { url 'https://jitpack.io' }
+    }
+}
+
+ +

+ 2. Add the dependency. +

+ +
+
implementation 'com.github.unldenis.holoeasy:holoeasy-core:4.0.0'
+
+ + +

+ 3. For java plugins include also the kotlin stdlib. +

+ +
+
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.21'
+
+ +

+ 4. Once you’re done, you may now proceed creating your first hologram. +

+ +
+
+ +
+
+ + + \ No newline at end of file