-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from TheNextLvl-net/2.0.0
2.0.0
- Loading branch information
Showing
56 changed files
with
562 additions
and
1,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
api/src/main/java/net/thenextlvl/hologram/api/Hologram.java
This file was deleted.
Oops, something went wrong.
86 changes: 22 additions & 64 deletions
86
api/src/main/java/net/thenextlvl/hologram/api/HologramFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,43 @@ | ||
package net.thenextlvl.hologram.api; | ||
|
||
import net.thenextlvl.hologram.api.line.BlockLine; | ||
import net.thenextlvl.hologram.api.line.HologramLine; | ||
import net.thenextlvl.hologram.api.line.ItemLine; | ||
import net.thenextlvl.hologram.api.line.TextLine; | ||
import net.kyori.adventure.text.Component; | ||
import net.thenextlvl.hologram.api.hologram.BlockHologram; | ||
import net.thenextlvl.hologram.api.hologram.Hologram; | ||
import net.thenextlvl.hologram.api.hologram.ItemHologram; | ||
import net.thenextlvl.hologram.api.hologram.TextHologram; | ||
import org.bukkit.Location; | ||
import org.bukkit.entity.BlockDisplay; | ||
import org.bukkit.entity.ItemDisplay; | ||
import org.bukkit.entity.TextDisplay; | ||
|
||
import java.util.Collection; | ||
import java.util.function.Consumer; | ||
import java.util.function.Function; | ||
import org.bukkit.block.data.BlockData; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
/** | ||
* A factory that creates {@link Hologram holograms} and {@link HologramLine hologram lines} | ||
* A factory that creates {@link Hologram holograms} | ||
*/ | ||
public interface HologramFactory { | ||
/** | ||
* Create a new hologram object | ||
* | ||
* @param location the location of the hologram | ||
* @param lines the lines of the hologram | ||
* @return the new hologram | ||
*/ | ||
Hologram createHologram(Location location, Collection<? extends HologramLine> lines); | ||
|
||
/** | ||
* Create a new hologram object | ||
* Create a new text hologram object | ||
* | ||
* @param location the location of the hologram | ||
* @param lines the lines of the hologram | ||
* @return the new hologram | ||
*/ | ||
Hologram createHologram(Location location, HologramLine... lines); | ||
|
||
/** | ||
* Creates a new line of the type block | ||
* | ||
* @param function provides the block-display and returns the offset | ||
* @return the new line | ||
*/ | ||
BlockLine createBlockLine(Function<BlockDisplay, Number> function); | ||
|
||
/** | ||
* Creates a new line of the type block | ||
* | ||
* @param consumer provides the block-display | ||
* @return the new line | ||
*/ | ||
BlockLine createBlockLine(Consumer<BlockDisplay> consumer); | ||
|
||
/** | ||
* Creates a new line of the type item | ||
* | ||
* @param function provides the item-display and returns the offset | ||
* @return the new line | ||
* @param text the text of the hologram | ||
* @return the new text hologram | ||
*/ | ||
ItemLine createItemLine(Function<ItemDisplay, Number> function); | ||
TextHologram createHologram(Location location, Component text); | ||
|
||
/** | ||
* Creates a new line of the type item | ||
* Create a new block hologram object | ||
* | ||
* @param consumer provides the item-display | ||
* @return the new line | ||
*/ | ||
ItemLine createItemLine(Consumer<ItemDisplay> consumer); | ||
|
||
/** | ||
* Creates a new line of the type text | ||
* | ||
* @param function provides the text-display and returns the offset | ||
* @return the new line | ||
* @param location the location of the hologram | ||
* @param block the block of the hologram | ||
* @return the new block hologram | ||
*/ | ||
TextLine createTextLine(Function<TextDisplay, Number> function); | ||
BlockHologram createHologram(Location location, BlockData block); | ||
|
||
/** | ||
* Creates a new line of the type text | ||
* Create a new item hologram object | ||
* | ||
* @param consumer provides the text-display | ||
* @return the new line | ||
* @param location the location of the hologram | ||
* @param itemStack the item of the hologram | ||
* @return the new item hologram | ||
*/ | ||
TextLine createTextLine(Consumer<TextDisplay> consumer); | ||
ItemHologram createHologram(Location location, ItemStack itemStack); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
api/src/main/java/net/thenextlvl/hologram/api/hologram/BlockHologram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.thenextlvl.hologram.api.hologram; | ||
|
||
import org.bukkit.entity.BlockDisplay; | ||
|
||
/** | ||
* An interface that represents a hologram displaying a block | ||
*/ | ||
public interface BlockHologram extends Hologram, BlockDisplay { | ||
} |
24 changes: 24 additions & 0 deletions
24
api/src/main/java/net/thenextlvl/hologram/api/hologram/Hologram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.thenextlvl.hologram.api.hologram; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.entity.Display; | ||
|
||
/** | ||
* An interface that represents a hologram | ||
*/ | ||
public interface Hologram extends Display { | ||
/** | ||
* Get the location of the hologram | ||
* | ||
* @return the current location the hologram is | ||
*/ | ||
Location getLocation(); | ||
|
||
/** | ||
* Set the location of the hologram<br> | ||
* <i>Only applies on load, not for teleportation or updating</i> | ||
* | ||
* @param location the location the hologram should appear | ||
*/ | ||
void setLocation(Location location); | ||
} |
9 changes: 9 additions & 0 deletions
9
api/src/main/java/net/thenextlvl/hologram/api/hologram/ItemHologram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.thenextlvl.hologram.api.hologram; | ||
|
||
import org.bukkit.entity.ItemDisplay; | ||
|
||
/** | ||
* An interface that represents a hologram displaying an item | ||
*/ | ||
public interface ItemHologram extends Hologram, ItemDisplay { | ||
} |
9 changes: 9 additions & 0 deletions
9
api/src/main/java/net/thenextlvl/hologram/api/hologram/TextHologram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.thenextlvl.hologram.api.hologram; | ||
|
||
import org.bukkit.entity.TextDisplay; | ||
|
||
/** | ||
* An interface that represents a hologram displaying a text | ||
*/ | ||
public interface TextHologram extends Hologram, TextDisplay { | ||
} |
2 changes: 1 addition & 1 deletion
2
.../hologram/v1_19_R3/line/package-info.java → ...l/hologram/api/hologram/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
@MethodsReturnNotNullByDefault | ||
@ParametersAreNotNullByDefault | ||
package net.thenextlvl.hologram.v1_19_R3.line; | ||
package net.thenextlvl.hologram.api.hologram; | ||
|
||
import core.annotation.MethodsReturnNotNullByDefault; | ||
import core.annotation.ParametersAreNotNullByDefault; |
11 changes: 0 additions & 11 deletions
11
api/src/main/java/net/thenextlvl/hologram/api/line/BlockLine.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
api/src/main/java/net/thenextlvl/hologram/api/line/HologramLine.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
api/src/main/java/net/thenextlvl/hologram/api/line/ItemLine.java
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
api/src/main/java/net/thenextlvl/hologram/api/line/LineType.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
api/src/main/java/net/thenextlvl/hologram/api/line/TextLine.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.