diff --git a/api/pom.xml b/api/pom.xml
index afeecb06..af959598 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -1,29 +1,29 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-parent
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-parent
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-api
- HolographicDisplays API
+ holographicdisplays-api
+ HolographicDisplays API
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
-
-
- org.spigotmc
- spigot-api
-
-
+
+
+ org.spigotmc
+ spigot-api
+
+
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/Hologram.java b/api/src/main/java/me/filoghost/holographicdisplays/api/Hologram.java
index a9feeb4c..a1dfa7e9 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/Hologram.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/Hologram.java
@@ -27,193 +27,193 @@ import org.bukkit.inventory.ItemStack;
* To create one, please see {@link HologramsAPI#createHologram(org.bukkit.plugin.Plugin, Location)}.
*/
public interface Hologram {
-
- /**
- * Appends a text line to end of this hologram.
- *
- * @param text the content of the line, can be null for an empty line
- * @return the new TextLine appended
- */
- public TextLine appendTextLine(String text);
-
-
- /**
- * Appends an item line to end of this hologram.
- *
- * @param itemStack the content of the line
- * @return the new ItemLine appended
- */
- public ItemLine appendItemLine(ItemStack itemStack);
-
-
- /**
- * Inserts a text line in this hologram.
- *
- * @param index the line is inserted before this index. If 0, the new line will
- * be inserted before the first line.
- * @param text the content of the line, can be null for an empty line
- * @return the new TextLine inserted
- * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
- */
- public TextLine insertTextLine(int index, String text);
-
-
- /**
- * Inserts an item line in this hologram.
- *
- * @param index the line is inserted before this index. If 0, the new line will
- * be inserted before the first line.
- * @param itemStack the content of the line
- * @return the new ItemLine inserted
- * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
- */
- public ItemLine insertItemLine(int index, ItemStack itemStack);
-
-
- /**
- * Finds the element at a given index in the lines.
- *
- * @param index the index of the line to retrieve.
- * @return the hologram line at the given index, can be an {@link ItemLine} or a {@link TextLine}.
- * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
- */
- public HologramLine getLine(int index);
-
- /**
- * Removes a line at a given index. Since: v2.0.1
- *
- * @param index the index of the line, that should be between 0 and size() - 1.
- * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
- */
- public void removeLine(int index);
-
-
- /**
- * Removes all the lines from this hologram.
- */
- public void clearLines();
+
+ /**
+ * Appends a text line to end of this hologram.
+ *
+ * @param text the content of the line, can be null for an empty line
+ * @return the new TextLine appended
+ */
+ public TextLine appendTextLine(String text);
+
+
+ /**
+ * Appends an item line to end of this hologram.
+ *
+ * @param itemStack the content of the line
+ * @return the new ItemLine appended
+ */
+ public ItemLine appendItemLine(ItemStack itemStack);
+
+
+ /**
+ * Inserts a text line in this hologram.
+ *
+ * @param index the line is inserted before this index. If 0, the new line will
+ * be inserted before the first line.
+ * @param text the content of the line, can be null for an empty line
+ * @return the new TextLine inserted
+ * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
+ */
+ public TextLine insertTextLine(int index, String text);
+
+
+ /**
+ * Inserts an item line in this hologram.
+ *
+ * @param index the line is inserted before this index. If 0, the new line will
+ * be inserted before the first line.
+ * @param itemStack the content of the line
+ * @return the new ItemLine inserted
+ * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
+ */
+ public ItemLine insertItemLine(int index, ItemStack itemStack);
+
+
+ /**
+ * Finds the element at a given index in the lines.
+ *
+ * @param index the index of the line to retrieve.
+ * @return the hologram line at the given index, can be an {@link ItemLine} or a {@link TextLine}.
+ * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
+ */
+ public HologramLine getLine(int index);
+
+ /**
+ * Removes a line at a given index. Since: v2.0.1
+ *
+ * @param index the index of the line, that should be between 0 and size() - 1.
+ * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
+ */
+ public void removeLine(int index);
+
+
+ /**
+ * Removes all the lines from this hologram.
+ */
+ public void clearLines();
-
- /**
- * Checks the amount of lines of the hologram.
- *
- * @return the amount of lines
- */
- public int size();
-
-
- /**
- * The physical height of the hologram, counting all the lines. Since: v2.1.4
- *
- * @return the height of the hologram, counting all the lines and the gaps between them
- */
- public double getHeight();
-
-
- /**
- * Teleports a hologram to the given location.
- *
- * @param location the new location
- */
- public void teleport(Location location);
-
-
- /**
- * Teleports a hologram to the given location.
- *
- * @param world the world where the hologram should be teleported,
- * use {@link #getWorld()} to teleport it in the same world.
- * @param x the X coordinate
- * @param y the Y coordinate
- * @param z the Z coordinate
- */
- public void teleport(World world, double x, double y, double z);
-
- /**
- * Returns the position of the hologram.
- *
- * @return the Location of the hologram
- */
- public Location getLocation();
-
- /**
- * Returns the X coordinate.
- *
- * @return the X coordinate of the hologram
- */
- public double getX();
-
-
- /**
- * Returns the Y coordinate.
- *
- * @return the Y coordinate of the hologram
- */
- public double getY();
-
-
- /**
- * Returns the Z coordinate.
- *
- * @return the Z coordinate of the hologram
- */
- public double getZ();
-
-
- /**
- * Returns the world.
- *
- * @return the world of the hologram
- */
- public World getWorld();
-
-
- /**
- * Returns the {@link VisibilityManager} of this hologram.
- *
Note: the usage of the VisibilityManager requires ProtocolLib.
- * Without the plugin, holograms will be always visible.
- *
- * @return the VisibilityManager of this hologram
- */
- public VisibilityManager getVisibilityManager();
-
-
- /**
- * Returns when the hologram was created. Useful for removing old holograms.
- *
- * @return the timestamp of when the hologram was created, in milliseconds
- */
- public long getCreationTimestamp();
+
+ /**
+ * Checks the amount of lines of the hologram.
+ *
+ * @return the amount of lines
+ */
+ public int size();
+
+
+ /**
+ * The physical height of the hologram, counting all the lines. Since: v2.1.4
+ *
+ * @return the height of the hologram, counting all the lines and the gaps between them
+ */
+ public double getHeight();
+
+
+ /**
+ * Teleports a hologram to the given location.
+ *
+ * @param location the new location
+ */
+ public void teleport(Location location);
+
+
+ /**
+ * Teleports a hologram to the given location.
+ *
+ * @param world the world where the hologram should be teleported,
+ * use {@link #getWorld()} to teleport it in the same world.
+ * @param x the X coordinate
+ * @param y the Y coordinate
+ * @param z the Z coordinate
+ */
+ public void teleport(World world, double x, double y, double z);
+
+ /**
+ * Returns the position of the hologram.
+ *
+ * @return the Location of the hologram
+ */
+ public Location getLocation();
+
+ /**
+ * Returns the X coordinate.
+ *
+ * @return the X coordinate of the hologram
+ */
+ public double getX();
+
+
+ /**
+ * Returns the Y coordinate.
+ *
+ * @return the Y coordinate of the hologram
+ */
+ public double getY();
+
+
+ /**
+ * Returns the Z coordinate.
+ *
+ * @return the Z coordinate of the hologram
+ */
+ public double getZ();
+
+
+ /**
+ * Returns the world.
+ *
+ * @return the world of the hologram
+ */
+ public World getWorld();
+
+
+ /**
+ * Returns the {@link VisibilityManager} of this hologram.
+ *
Note: the usage of the VisibilityManager requires ProtocolLib.
+ * Without the plugin, holograms will be always visible.
+ *
+ * @return the VisibilityManager of this hologram
+ */
+ public VisibilityManager getVisibilityManager();
+
+
+ /**
+ * Returns when the hologram was created. Useful for removing old holograms.
+ *
+ * @return the timestamp of when the hologram was created, in milliseconds
+ */
+ public long getCreationTimestamp();
- /**
- * Checks if the hologram will track and replace placeholders.
- * This is false by default.
- *
- * @return if the hologram allows placeholders
- */
- public boolean isAllowPlaceholders();
+ /**
+ * Checks if the hologram will track and replace placeholders.
+ * This is false by default.
+ *
+ * @return if the hologram allows placeholders
+ */
+ public boolean isAllowPlaceholders();
- /**
- * Sets if the hologram should track and replace placeholders.
- * By default if will not track them.
- *
- * @param allowPlaceholders if the hologram should track placeholders
- */
- public void setAllowPlaceholders(boolean allowPlaceholders);
-
- /**
- * Deletes this hologram. Editing or teleporting the hologram when deleted
- * will throw an exception. Lines will be automatically cleared.
- * You should remove all the references of the hologram after deletion.
- */
- public void delete();
-
-
- /**
- * Checks if a hologram was deleted.
- *
- * @return true if this hologram was deleted
- */
- public boolean isDeleted();
-
+ /**
+ * Sets if the hologram should track and replace placeholders.
+ * By default if will not track them.
+ *
+ * @param allowPlaceholders if the hologram should track placeholders
+ */
+ public void setAllowPlaceholders(boolean allowPlaceholders);
+
+ /**
+ * Deletes this hologram. Editing or teleporting the hologram when deleted
+ * will throw an exception. Lines will be automatically cleared.
+ * You should remove all the references of the hologram after deletion.
+ */
+ public void delete();
+
+
+ /**
+ * Checks if a hologram was deleted.
+ *
+ * @return true if this hologram was deleted
+ */
+ public boolean isDeleted();
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/HologramsAPI.java b/api/src/main/java/me/filoghost/holographicdisplays/api/HologramsAPI.java
index f70148cb..396ecd55 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/HologramsAPI.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/HologramsAPI.java
@@ -27,94 +27,94 @@ import java.util.Collection;
* It provides methods to create holograms and to register custom placeholders.
*/
public class HologramsAPI {
-
-
- private HologramsAPI() {
- // No constructor needed.
- }
-
-
- /**
- * Creates a hologram at given location.
- *
- * @param plugin the plugin that creates it
- * @param source the location where it will appear
- * @return the new hologram created
- */
- public static Hologram createHologram(Plugin plugin, Location source) {
- return BackendAPI.getImplementation().createHologram(plugin, source);
- }
-
-
- /**
- * Finds all the holograms created by a given plugin.
- *
- * @param plugin the plugin to search for in holograms
- * @return the holograms created by a plugin. the Collection is a copy
- * and modifying it has no effect on the holograms.
- */
- public static Collection getHolograms(Plugin plugin) {
- return BackendAPI.getImplementation().getHolograms(plugin);
- }
-
-
- /**
- * Registers a new placeholder that can be used in holograms created with commands.
- * With this method, you can basically expand the core of HolographicDisplays.
- *
- * @param plugin the owner plugin of the placeholder
- * @param textPlaceholder the text that the placeholder will be associated to (e.g.: "{onlinePlayers}")
- * @param refreshRate the refresh rate of the placeholder, in seconds. Keep in mind that the minimum is 0.1 seconds, and that will be rounded to tenths of seconds
- * @param replacer the implementation that will return the text to replace the placeholder, where the update() method is called every refreshRate seconds
- * @return true if the registration was successfull, false if it was already registered
- */
- public static boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer) {
- return BackendAPI.getImplementation().registerPlaceholder(plugin, textPlaceholder, refreshRate, replacer);
- }
-
-
- /**
- * Finds all the placeholders registered by a given plugin.
- *
- * @param plugin the plugin to search for
- * @return a collection of placeholders registered by the plugin
- */
- public static Collection getRegisteredPlaceholders(Plugin plugin) {
- return BackendAPI.getImplementation().getRegisteredPlaceholders(plugin);
- }
-
-
- /**
- * Unregister a placeholder created by a plugin.
- *
- * @param plugin the plugin that owns the placeholder
- * @param textPlaceholder the placeholder to remove
- * @return true if found and removed, false otherwise
- */
- public static boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder) {
- return BackendAPI.getImplementation().unregisterPlaceholder(plugin, textPlaceholder);
- }
-
-
- /**
- * Resets and removes all the placeholders registered by a plugin. This is useful
- * when you have configurable placeholders and you want to remove all of them.
- *
- * @param plugin the plugin that owns the placeholders
- */
- public static void unregisterPlaceholders(Plugin plugin) {
- BackendAPI.getImplementation().unregisterPlaceholders(plugin);
- }
-
-
- /**
- * Checks if an entity is part of a hologram.
- *
- * @param bukkitEntity the entity to check
- * @return true if the entity is a part of a hologram
- */
- public static boolean isHologramEntity(Entity bukkitEntity) {
- return BackendAPI.getImplementation().isHologramEntity(bukkitEntity);
- }
+
+
+ private HologramsAPI() {
+ // No constructor needed.
+ }
+
+
+ /**
+ * Creates a hologram at given location.
+ *
+ * @param plugin the plugin that creates it
+ * @param source the location where it will appear
+ * @return the new hologram created
+ */
+ public static Hologram createHologram(Plugin plugin, Location source) {
+ return BackendAPI.getImplementation().createHologram(plugin, source);
+ }
+
+
+ /**
+ * Finds all the holograms created by a given plugin.
+ *
+ * @param plugin the plugin to search for in holograms
+ * @return the holograms created by a plugin. the Collection is a copy
+ * and modifying it has no effect on the holograms.
+ */
+ public static Collection getHolograms(Plugin plugin) {
+ return BackendAPI.getImplementation().getHolograms(plugin);
+ }
+
+
+ /**
+ * Registers a new placeholder that can be used in holograms created with commands.
+ * With this method, you can basically expand the core of HolographicDisplays.
+ *
+ * @param plugin the owner plugin of the placeholder
+ * @param textPlaceholder the text that the placeholder will be associated to (e.g.: "{onlinePlayers}")
+ * @param refreshRate the refresh rate of the placeholder, in seconds. Keep in mind that the minimum is 0.1 seconds, and that will be rounded to tenths of seconds
+ * @param replacer the implementation that will return the text to replace the placeholder, where the update() method is called every refreshRate seconds
+ * @return true if the registration was successfull, false if it was already registered
+ */
+ public static boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer) {
+ return BackendAPI.getImplementation().registerPlaceholder(plugin, textPlaceholder, refreshRate, replacer);
+ }
+
+
+ /**
+ * Finds all the placeholders registered by a given plugin.
+ *
+ * @param plugin the plugin to search for
+ * @return a collection of placeholders registered by the plugin
+ */
+ public static Collection getRegisteredPlaceholders(Plugin plugin) {
+ return BackendAPI.getImplementation().getRegisteredPlaceholders(plugin);
+ }
+
+
+ /**
+ * Unregister a placeholder created by a plugin.
+ *
+ * @param plugin the plugin that owns the placeholder
+ * @param textPlaceholder the placeholder to remove
+ * @return true if found and removed, false otherwise
+ */
+ public static boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder) {
+ return BackendAPI.getImplementation().unregisterPlaceholder(plugin, textPlaceholder);
+ }
+
+
+ /**
+ * Resets and removes all the placeholders registered by a plugin. This is useful
+ * when you have configurable placeholders and you want to remove all of them.
+ *
+ * @param plugin the plugin that owns the placeholders
+ */
+ public static void unregisterPlaceholders(Plugin plugin) {
+ BackendAPI.getImplementation().unregisterPlaceholders(plugin);
+ }
+
+
+ /**
+ * Checks if an entity is part of a hologram.
+ *
+ * @param bukkitEntity the entity to check
+ * @return true if the entity is a part of a hologram
+ */
+ public static boolean isHologramEntity(Entity bukkitEntity) {
+ return BackendAPI.getImplementation().isHologramEntity(bukkitEntity);
+ }
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/VisibilityManager.java b/api/src/main/java/me/filoghost/holographicdisplays/api/VisibilityManager.java
index 40c28819..900af421 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/VisibilityManager.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/VisibilityManager.java
@@ -22,59 +22,59 @@ import org.bukkit.entity.Player;
* (when a hologram is not specifically being hidden/shown to a player) can be customized.
*/
public interface VisibilityManager {
-
- /**
- * Returns if the hologram is visible by default. If not changed, this value
- * is true by default so the hologram is visible to everyone.
- *
- * @return if the hologram hologram is visible by default
- */
- public boolean isVisibleByDefault();
-
- /**
- * Sets if the hologram is visible by default. If not changed, this value
- * is true by default so the hologram is visible to everyone.
- *
- * @param visibleByDefault the new behaviour
- */
- public void setVisibleByDefault(boolean visibleByDefault);
-
- /**
- * Shows the hologram to a player, overriding the value of {@link #isVisibleByDefault()}.
- * This is persistent if the players goes offline.
- *
- * @param player the involved player
- */
- public void showTo(Player player);
-
- /**
- * Hides the hologram to a player, overriding the value of {@link #isVisibleByDefault()}.
- * This is persistent if the players goes offline.
- *
- * @param player the involved player
- */
- public void hideTo(Player player);
-
- /**
- * Checks if a hologram is visible to a player.
- *
- * @param player the involved player
- * @return if the player can see the hologram
- */
- public boolean isVisibleTo(Player player);
-
- /**
- * Resets the visibility to the default value. If you previously called {@link #showTo(Player)}
- * or {@link #hideTo(Player)} to override the default visibility, this method will reset it
- * to reflect the value of {@link #isVisibleByDefault()}.
- *
- * @param player the involved player
- */
- public void resetVisibility(Player player);
-
- /**
- * Resets the visibility for all the players. See {@link #resetVisibility(Player)} for more details.
- */
- public void resetVisibilityAll();
-
+
+ /**
+ * Returns if the hologram is visible by default. If not changed, this value
+ * is true by default so the hologram is visible to everyone.
+ *
+ * @return if the hologram hologram is visible by default
+ */
+ public boolean isVisibleByDefault();
+
+ /**
+ * Sets if the hologram is visible by default. If not changed, this value
+ * is true by default so the hologram is visible to everyone.
+ *
+ * @param visibleByDefault the new behaviour
+ */
+ public void setVisibleByDefault(boolean visibleByDefault);
+
+ /**
+ * Shows the hologram to a player, overriding the value of {@link #isVisibleByDefault()}.
+ * This is persistent if the players goes offline.
+ *
+ * @param player the involved player
+ */
+ public void showTo(Player player);
+
+ /**
+ * Hides the hologram to a player, overriding the value of {@link #isVisibleByDefault()}.
+ * This is persistent if the players goes offline.
+ *
+ * @param player the involved player
+ */
+ public void hideTo(Player player);
+
+ /**
+ * Checks if a hologram is visible to a player.
+ *
+ * @param player the involved player
+ * @return if the player can see the hologram
+ */
+ public boolean isVisibleTo(Player player);
+
+ /**
+ * Resets the visibility to the default value. If you previously called {@link #showTo(Player)}
+ * or {@link #hideTo(Player)} to override the default visibility, this method will reset it
+ * to reflect the value of {@link #isVisibleByDefault()}.
+ *
+ * @param player the involved player
+ */
+ public void resetVisibility(Player player);
+
+ /**
+ * Resets the visibility for all the players. See {@link #resetVisibility(Player)} for more details.
+ */
+ public void resetVisibilityAll();
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/handler/PickupHandler.java b/api/src/main/java/me/filoghost/holographicdisplays/api/handler/PickupHandler.java
index da4472fb..f05809f8 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/handler/PickupHandler.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/handler/PickupHandler.java
@@ -21,10 +21,10 @@ import org.bukkit.entity.Player;
*/
public interface PickupHandler {
- /**
- * Called when a player picks up the item.
- * @param player the player who picked up the item
- */
- public void onPickup(Player player);
-
+ /**
+ * Called when a player picks up the item.
+ * @param player the player who picked up the item
+ */
+ public void onPickup(Player player);
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/handler/TouchHandler.java b/api/src/main/java/me/filoghost/holographicdisplays/api/handler/TouchHandler.java
index 67429267..ec83e174 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/handler/TouchHandler.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/handler/TouchHandler.java
@@ -21,10 +21,10 @@ import org.bukkit.entity.Player;
*/
public interface TouchHandler {
- /**
- * Called when a player interacts with the hologram (right click).
- * @param player the player who interacts
- */
- public void onTouch(Player player);
-
+ /**
+ * Called when a player interacts with the hologram (right click).
+ * @param player the player who interacts
+ */
+ public void onTouch(Player player);
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/internal/BackendAPI.java b/api/src/main/java/me/filoghost/holographicdisplays/api/internal/BackendAPI.java
index 67910fff..fd821427 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/internal/BackendAPI.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/internal/BackendAPI.java
@@ -23,34 +23,34 @@ import org.bukkit.plugin.Plugin;
import java.util.Collection;
public abstract class BackendAPI {
-
- private static BackendAPI implementation;
-
- public static void setImplementation(BackendAPI implementation) {
- BackendAPI.implementation = implementation;
- }
-
- public static BackendAPI getImplementation() {
- if (implementation == null) {
- throw new IllegalStateException("No API implementation set. Is Holographic Displays enabled?");
- }
-
- return implementation;
- }
+
+ private static BackendAPI implementation;
+
+ public static void setImplementation(BackendAPI implementation) {
+ BackendAPI.implementation = implementation;
+ }
+
+ public static BackendAPI getImplementation() {
+ if (implementation == null) {
+ throw new IllegalStateException("No API implementation set. Is Holographic Displays enabled?");
+ }
+
+ return implementation;
+ }
- public abstract Hologram createHologram(Plugin plugin, Location source);
+ public abstract Hologram createHologram(Plugin plugin, Location source);
- public abstract Collection getHolograms(Plugin plugin);
+ public abstract Collection getHolograms(Plugin plugin);
- public abstract boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer);
+ public abstract boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer);
- public abstract Collection getRegisteredPlaceholders(Plugin plugin);
+ public abstract Collection getRegisteredPlaceholders(Plugin plugin);
- public abstract boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder);
+ public abstract boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder);
- public abstract void unregisterPlaceholders(Plugin plugin);
+ public abstract void unregisterPlaceholders(Plugin plugin);
- public abstract boolean isHologramEntity(Entity bukkitEntity);
-
+ public abstract boolean isHologramEntity(Entity bukkitEntity);
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/line/CollectableLine.java b/api/src/main/java/me/filoghost/holographicdisplays/api/line/CollectableLine.java
index f7f93e02..2b1abf6b 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/line/CollectableLine.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/line/CollectableLine.java
@@ -20,19 +20,19 @@ import me.filoghost.holographicdisplays.api.handler.PickupHandler;
* A line of a Hologram that can be picked up.
*/
public interface CollectableLine extends HologramLine {
-
- /**
- * Sets the PickupHandler for this line.
- *
- * @param pickupHandler the new PickupHandler, can be null.
- */
- public void setPickupHandler(PickupHandler pickupHandler);
-
- /**
- * Returns the current PickupHandler of this line.
- *
- * @return the current PickupHandler, can be null.
- */
- public PickupHandler getPickupHandler();
-
+
+ /**
+ * Sets the PickupHandler for this line.
+ *
+ * @param pickupHandler the new PickupHandler, can be null.
+ */
+ public void setPickupHandler(PickupHandler pickupHandler);
+
+ /**
+ * Returns the current PickupHandler of this line.
+ *
+ * @return the current PickupHandler, can be null.
+ */
+ public PickupHandler getPickupHandler();
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/line/HologramLine.java b/api/src/main/java/me/filoghost/holographicdisplays/api/line/HologramLine.java
index bb936cf5..c51f58d3 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/line/HologramLine.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/line/HologramLine.java
@@ -20,18 +20,18 @@ import me.filoghost.holographicdisplays.api.Hologram;
* Interface to represent a line in a Hologram.
*/
public interface HologramLine {
-
- /**
- * Returns the parent Hologram of this line.
- *
- * @return the parent Hologram.
- */
- public Hologram getParent();
-
- /**
- * Removes this line from the parent Hologram. Since: v2.0.1
- * Do not call if the Hologram has been deleted, an exception will be thrown.
- */
- public void removeLine();
+
+ /**
+ * Returns the parent Hologram of this line.
+ *
+ * @return the parent Hologram.
+ */
+ public Hologram getParent();
+
+ /**
+ * Removes this line from the parent Hologram. Since: v2.0.1
+ * Do not call if the Hologram has been deleted, an exception will be thrown.
+ */
+ public void removeLine();
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/line/ItemLine.java b/api/src/main/java/me/filoghost/holographicdisplays/api/line/ItemLine.java
index ac1db58f..08abbd21 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/line/ItemLine.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/line/ItemLine.java
@@ -18,18 +18,18 @@ import org.bukkit.inventory.ItemStack;
public interface ItemLine extends CollectableLine, TouchableLine {
- /**
- * Returns the ItemStack of this ItemLine.
- *
- * @return the ItemStack if this ItemLine.
- */
- public ItemStack getItemStack();
+ /**
+ * Returns the ItemStack of this ItemLine.
+ *
+ * @return the ItemStack if this ItemLine.
+ */
+ public ItemStack getItemStack();
- /**
- * Sets the ItemStack for this ItemLine.
- *
- * @param itemStack the new item, should not be null.
- */
- public void setItemStack(ItemStack itemStack);
-
+ /**
+ * Sets the ItemStack for this ItemLine.
+ *
+ * @param itemStack the new item, should not be null.
+ */
+ public void setItemStack(ItemStack itemStack);
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/line/TextLine.java b/api/src/main/java/me/filoghost/holographicdisplays/api/line/TextLine.java
index a0da2015..10c48118 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/line/TextLine.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/line/TextLine.java
@@ -16,18 +16,18 @@ package me.filoghost.holographicdisplays.api.line;
public interface TextLine extends TouchableLine {
- /**
- * Returns the current text of this TextLine.
- *
- * @return the current text of this line.
- */
- public String getText();
-
- /**
- * Sets the text of this TextLine.
- *
- * @param text the new text of this line.
- */
- public void setText(String text);
-
+ /**
+ * Returns the current text of this TextLine.
+ *
+ * @return the current text of this line.
+ */
+ public String getText();
+
+ /**
+ * Sets the text of this TextLine.
+ *
+ * @param text the new text of this line.
+ */
+ public void setText(String text);
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/line/TouchableLine.java b/api/src/main/java/me/filoghost/holographicdisplays/api/line/TouchableLine.java
index 085c6bc0..a3518c2b 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/line/TouchableLine.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/line/TouchableLine.java
@@ -21,18 +21,18 @@ import me.filoghost.holographicdisplays.api.handler.TouchHandler;
*/
public interface TouchableLine extends HologramLine {
- /**
- * Sets the TouchHandler for this line.
- *
- * @param touchHandler the new TouchHandler, can be null.
- */
- public void setTouchHandler(TouchHandler touchHandler);
-
- /**
- * Returns the current TouchHandler of this line.
- *
- * @return the current TouchHandler, can be null.
- */
- public TouchHandler getTouchHandler();
-
+ /**
+ * Sets the TouchHandler for this line.
+ *
+ * @param touchHandler the new TouchHandler, can be null.
+ */
+ public void setTouchHandler(TouchHandler touchHandler);
+
+ /**
+ * Returns the current TouchHandler of this line.
+ *
+ * @return the current TouchHandler, can be null.
+ */
+ public TouchHandler getTouchHandler();
+
}
diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java b/api/src/main/java/me/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java
index 2c16b150..0d7e9b7d 100644
--- a/api/src/main/java/me/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java
+++ b/api/src/main/java/me/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java
@@ -16,10 +16,10 @@ package me.filoghost.holographicdisplays.api.placeholder;
public interface PlaceholderReplacer {
- /**
- * Called to update a placeholder's replacement.
- * @return the replacement
- */
- public String update();
-
+ /**
+ * Called to update a placeholder's replacement.
+ * @return the replacement
+ */
+ public String update();
+
}
diff --git a/config/pom.xml b/config/pom.xml
index 274df788..4a47dfb3 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -1,34 +1,34 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-parent
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-parent
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-config
- HolographicDisplays Config
+ holographicdisplays-config
+ HolographicDisplays Config
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
-
-
- ${project.groupId}
- holographicdisplays-utils
-
+
+
+ ${project.groupId}
+ holographicdisplays-utils
+
-
- org.spigotmc
- spigot-api
-
-
+
+ org.spigotmc
+ spigot-api
+
+
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/disk/ConfigNode.java b/config/src/main/java/me/filoghost/holographicdisplays/disk/ConfigNode.java
index 33eeca56..a7b3620e 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/disk/ConfigNode.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/disk/ConfigNode.java
@@ -18,39 +18,39 @@ import java.util.Arrays;
public enum ConfigNode {
- SPACE_BETWEEN_LINES("space-between-lines", 0.02),
- QUICK_EDIT_COMMANDS("quick-edit-commands", true),
- IMAGES_SYMBOL("images.symbol", "[x]"),
- TRANSPARENCY_SPACE("images.transparency.space", " [|] "),
- TRANSPARENCY_COLOR("images.transparency.color", "&7"),
- UPDATE_NOTIFICATION("update-notification", true),
- BUNGEE_REFRESH_SECONDS("bungee.refresh-seconds", 3),
- BUNGEE_USE_REDIS_BUNGEE("bungee.use-RedisBungee", false),
- BUNGEE_USE_FULL_PINGER("bungee.pinger.enable", false),
- BUNGEE_PINGER_TIMEOUT("bungee.pinger.timeout", 500),
- BUNGEE_PINGER_OFFLINE_MOTD("bungee.pinger.offline-motd", "&cOffline, couldn't get the MOTD."),
- BUNGEE_PINGER_ONLINE_FORMAT("bungee.pinger.status.online", "&aOnline"),
- BUNGEE_PINGER_OFFLINE_FORMAT("bungee.pinger.status.offline", "&cOffline"),
- BUNGEE_PINGER_TRIM_MOTD("bungee.pinger.motd-remove-leading-trailing-spaces", true),
- BUNGEE_PINGER_SERVERS("bungee.pinger.servers", Arrays.asList("hub: 127.0.0.1:25565", "survival: 127.0.0.1:25566", "minigames: 127.0.0.1:25567")),
- TIME_FORMAT("time.format", "H:mm"),
- TIME_ZONE("time.zone", "GMT+1"),
- DEBUG("debug", false);
-
- private final String path;
- private final Object value;
-
- private ConfigNode(String path, Object defaultValue) {
- this.path = path;
- value = defaultValue;
- }
-
- public String getPath() {
- return path;
- }
-
- public Object getDefaultValue() {
- return value;
- }
-
+ SPACE_BETWEEN_LINES("space-between-lines", 0.02),
+ QUICK_EDIT_COMMANDS("quick-edit-commands", true),
+ IMAGES_SYMBOL("images.symbol", "[x]"),
+ TRANSPARENCY_SPACE("images.transparency.space", " [|] "),
+ TRANSPARENCY_COLOR("images.transparency.color", "&7"),
+ UPDATE_NOTIFICATION("update-notification", true),
+ BUNGEE_REFRESH_SECONDS("bungee.refresh-seconds", 3),
+ BUNGEE_USE_REDIS_BUNGEE("bungee.use-RedisBungee", false),
+ BUNGEE_USE_FULL_PINGER("bungee.pinger.enable", false),
+ BUNGEE_PINGER_TIMEOUT("bungee.pinger.timeout", 500),
+ BUNGEE_PINGER_OFFLINE_MOTD("bungee.pinger.offline-motd", "&cOffline, couldn't get the MOTD."),
+ BUNGEE_PINGER_ONLINE_FORMAT("bungee.pinger.status.online", "&aOnline"),
+ BUNGEE_PINGER_OFFLINE_FORMAT("bungee.pinger.status.offline", "&cOffline"),
+ BUNGEE_PINGER_TRIM_MOTD("bungee.pinger.motd-remove-leading-trailing-spaces", true),
+ BUNGEE_PINGER_SERVERS("bungee.pinger.servers", Arrays.asList("hub: 127.0.0.1:25565", "survival: 127.0.0.1:25566", "minigames: 127.0.0.1:25567")),
+ TIME_FORMAT("time.format", "H:mm"),
+ TIME_ZONE("time.zone", "GMT+1"),
+ DEBUG("debug", false);
+
+ private final String path;
+ private final Object value;
+
+ private ConfigNode(String path, Object defaultValue) {
+ this.path = path;
+ value = defaultValue;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public Object getDefaultValue() {
+ return value;
+ }
+
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java b/config/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java
index 0749def7..b2025c8f 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java
@@ -35,186 +35,186 @@ import java.util.logging.Level;
* Useful for fast access.
*/
public class Configuration {
-
- public static double spaceBetweenLines;
- public static boolean quickEditCommands;
- public static String imageSymbol;
- public static String transparencySymbol;
- public static boolean updateNotification;
- public static ChatColor transparencyColor;
-
- public static SimpleDateFormat timeFormat;
-
- public static int bungeeRefreshSeconds;
- public static boolean useRedisBungee;
-
- public static boolean pingerEnable;
- public static int pingerTimeout;
- public static String pingerOfflineMotd;
- public static String pingerStatusOnline;
- public static String pingerStatusOffline;
- public static boolean pingerTrimMotd;
- public static Map pingerServers;
+
+ public static double spaceBetweenLines;
+ public static boolean quickEditCommands;
+ public static String imageSymbol;
+ public static String transparencySymbol;
+ public static boolean updateNotification;
+ public static ChatColor transparencyColor;
+
+ public static SimpleDateFormat timeFormat;
+
+ public static int bungeeRefreshSeconds;
+ public static boolean useRedisBungee;
+
+ public static boolean pingerEnable;
+ public static int pingerTimeout;
+ public static String pingerOfflineMotd;
+ public static String pingerStatusOnline;
+ public static String pingerStatusOffline;
+ public static boolean pingerTrimMotd;
+ public static Map pingerServers;
-
- public static void load(Plugin plugin) {
- File configFile = new File(plugin.getDataFolder(), "config.yml");
- if (!configFile.exists()) {
- plugin.getDataFolder().mkdirs();
- plugin.saveResource("config.yml", true);
- }
-
- YamlConfiguration config = new YamlConfiguration();
- try {
- config.load(configFile);
- } catch (InvalidConfigurationException e) {
- e.printStackTrace();
- ConsoleLogger.log(Level.WARNING, "The configuration is not a valid YAML file! Please check it with a tool like http://yaml-online-parser.appspot.com/");
- return;
- } catch (IOException e) {
- e.printStackTrace();
- ConsoleLogger.log(Level.WARNING, "I/O error while reading the configuration. Was the file in use?");
- return;
- } catch (Exception e) {
- e.printStackTrace();
- ConsoleLogger.log(Level.WARNING, "Unhandled exception while reading the configuration!");
- return;
- }
-
- boolean needsSave = false;
-
- for (ConfigNode node : ConfigNode.values()) {
- if (!config.isSet(node.getPath())) {
- needsSave = true;
- config.set(node.getPath(), node.getDefaultValue());
- }
- }
-
- // Check the old values.
- List nodesToRemove = Arrays.asList(
- "vertical-spacing",
- "time-format",
- "bungee-refresh-seconds",
- "using-RedisBungee",
- "bungee-online-format",
- "bungee-offline-format",
- "precise-hologram-movement"
- );
+
+ public static void load(Plugin plugin) {
+ File configFile = new File(plugin.getDataFolder(), "config.yml");
+ if (!configFile.exists()) {
+ plugin.getDataFolder().mkdirs();
+ plugin.saveResource("config.yml", true);
+ }
+
+ YamlConfiguration config = new YamlConfiguration();
+ try {
+ config.load(configFile);
+ } catch (InvalidConfigurationException e) {
+ e.printStackTrace();
+ ConsoleLogger.log(Level.WARNING, "The configuration is not a valid YAML file! Please check it with a tool like http://yaml-online-parser.appspot.com/");
+ return;
+ } catch (IOException e) {
+ e.printStackTrace();
+ ConsoleLogger.log(Level.WARNING, "I/O error while reading the configuration. Was the file in use?");
+ return;
+ } catch (Exception e) {
+ e.printStackTrace();
+ ConsoleLogger.log(Level.WARNING, "Unhandled exception while reading the configuration!");
+ return;
+ }
+
+ boolean needsSave = false;
+
+ for (ConfigNode node : ConfigNode.values()) {
+ if (!config.isSet(node.getPath())) {
+ needsSave = true;
+ config.set(node.getPath(), node.getDefaultValue());
+ }
+ }
+
+ // Check the old values.
+ List nodesToRemove = Arrays.asList(
+ "vertical-spacing",
+ "time-format",
+ "bungee-refresh-seconds",
+ "using-RedisBungee",
+ "bungee-online-format",
+ "bungee-offline-format",
+ "precise-hologram-movement"
+ );
- for (String oldNode : nodesToRemove) {
- if (config.isSet(oldNode)) {
- config.set(oldNode, null);
- needsSave = true;
- }
- }
-
-
-
- if (needsSave) {
- config.options().header(String.join("\n",
- ".",
- ". Read the tutorial at: http://dev.bukkit.org/bukkit-plugins/holographic-displays/",
- ".",
- ". Plugin created by filoghost.",
- "."));
- config.options().copyHeader(true);
- try {
- config.save(configFile);
- } catch (IOException e) {
- e.printStackTrace();
- ConsoleLogger.log(Level.WARNING, "I/O error while saving the configuration. Was the file in use?");
- }
- }
-
- spaceBetweenLines = config.getDouble(ConfigNode.SPACE_BETWEEN_LINES.getPath());
- quickEditCommands = config.getBoolean(ConfigNode.QUICK_EDIT_COMMANDS.getPath());
-
- updateNotification = config.getBoolean(ConfigNode.UPDATE_NOTIFICATION.getPath());
-
- imageSymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.IMAGES_SYMBOL.getPath()));
- transparencySymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.TRANSPARENCY_SPACE.getPath()));
- bungeeRefreshSeconds = config.getInt(ConfigNode.BUNGEE_REFRESH_SECONDS.getPath());
- useRedisBungee = config.getBoolean(ConfigNode.BUNGEE_USE_REDIS_BUNGEE.getPath());
-
- pingerEnable = config.getBoolean(ConfigNode.BUNGEE_USE_FULL_PINGER.getPath());
- pingerTimeout = config.getInt(ConfigNode.BUNGEE_PINGER_TIMEOUT.getPath());
- pingerTrimMotd = config.getBoolean(ConfigNode.BUNGEE_PINGER_TRIM_MOTD.getPath());
-
- pingerOfflineMotd = StringConverter.toReadableFormat(config.getString(ConfigNode.BUNGEE_PINGER_OFFLINE_MOTD.getPath()));
- pingerStatusOnline = StringConverter.toReadableFormat(config.getString(ConfigNode.BUNGEE_PINGER_ONLINE_FORMAT.getPath()));
- pingerStatusOffline = StringConverter.toReadableFormat(config.getString(ConfigNode.BUNGEE_PINGER_OFFLINE_FORMAT.getPath()));
-
- if (pingerTimeout <= 0) {
- pingerTimeout = 100;
- } else if (pingerTimeout >= 10000) {
- pingerTimeout = 10000;
- }
-
- pingerServers = new HashMap<>();
-
- if (pingerEnable) {
- for (String singleServer : config.getStringList(ConfigNode.BUNGEE_PINGER_SERVERS.getPath())) {
- String[] nameAndAddress = singleServer.split(":", 2);
- if (nameAndAddress.length < 2) {
- ConsoleLogger.log(Level.WARNING, "The server info \"" + singleServer + "\" is not valid. There should be a name and an address, separated by a colon.");
- continue;
- }
-
- String name = nameAndAddress[0].trim();
- String address = nameAndAddress[1].replace(" ", "");
-
- String ip;
- int port;
-
- if (address.contains(":")) {
- String[] ipAndPort = address.split(":", 2);
- ip = ipAndPort[0];
- try {
- port = Integer.parseInt(ipAndPort[1]);
- } catch (NumberFormatException e) {
- ConsoleLogger.log(Level.WARNING, "Invalid port number in the server info \"" + singleServer + "\".");
- continue;
- }
- } else {
- ip = address;
- port = 25565; // The default Minecraft port.
- }
-
- pingerServers.put(name, new ServerAddress(ip, port));
- }
- }
-
- ConsoleLogger.setDebugEnabled(config.getBoolean(ConfigNode.DEBUG.getPath()));
-
- String tempColor = config.getString(ConfigNode.TRANSPARENCY_COLOR.getPath()).replace('&', ChatColor.COLOR_CHAR);
- boolean foundColor = false;
- for (ChatColor chatColor : ChatColor.values()) {
- if (chatColor.toString().equals(tempColor)) {
- Configuration.transparencyColor = chatColor;
- foundColor = true;
- }
- }
- if (!foundColor) {
- Configuration.transparencyColor = ChatColor.GRAY;
- ConsoleLogger.log(Level.WARNING, "You didn't set a valid chat color for transparency in the configuration, light gray (&7) will be used.");
- }
-
- try {
- timeFormat = new SimpleDateFormat(config.getString(ConfigNode.TIME_FORMAT.getPath()));
- timeFormat.setTimeZone(TimeZone.getTimeZone(config.getString(ConfigNode.TIME_ZONE.getPath())));
- } catch (IllegalArgumentException ex) {
- timeFormat = new SimpleDateFormat("H:mm");
- ConsoleLogger.log(Level.WARNING, "Time format not valid in the configuration, using the default.");
- }
-
- if (bungeeRefreshSeconds < 1) {
- ConsoleLogger.log(Level.WARNING, "The minimum interval for pinging BungeeCord's servers is 1 second. It has been automatically set.");
- bungeeRefreshSeconds = 1;
- }
-
- if (bungeeRefreshSeconds > 60) {
- ConsoleLogger.log(Level.WARNING, "The maximum interval for pinging BungeeCord's servers is 60 seconds. It has been automatically set.");
- bungeeRefreshSeconds = 60;
- }
- }
+ for (String oldNode : nodesToRemove) {
+ if (config.isSet(oldNode)) {
+ config.set(oldNode, null);
+ needsSave = true;
+ }
+ }
+
+
+
+ if (needsSave) {
+ config.options().header(String.join("\n",
+ ".",
+ ". Read the tutorial at: http://dev.bukkit.org/bukkit-plugins/holographic-displays/",
+ ".",
+ ". Plugin created by filoghost.",
+ "."));
+ config.options().copyHeader(true);
+ try {
+ config.save(configFile);
+ } catch (IOException e) {
+ e.printStackTrace();
+ ConsoleLogger.log(Level.WARNING, "I/O error while saving the configuration. Was the file in use?");
+ }
+ }
+
+ spaceBetweenLines = config.getDouble(ConfigNode.SPACE_BETWEEN_LINES.getPath());
+ quickEditCommands = config.getBoolean(ConfigNode.QUICK_EDIT_COMMANDS.getPath());
+
+ updateNotification = config.getBoolean(ConfigNode.UPDATE_NOTIFICATION.getPath());
+
+ imageSymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.IMAGES_SYMBOL.getPath()));
+ transparencySymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.TRANSPARENCY_SPACE.getPath()));
+ bungeeRefreshSeconds = config.getInt(ConfigNode.BUNGEE_REFRESH_SECONDS.getPath());
+ useRedisBungee = config.getBoolean(ConfigNode.BUNGEE_USE_REDIS_BUNGEE.getPath());
+
+ pingerEnable = config.getBoolean(ConfigNode.BUNGEE_USE_FULL_PINGER.getPath());
+ pingerTimeout = config.getInt(ConfigNode.BUNGEE_PINGER_TIMEOUT.getPath());
+ pingerTrimMotd = config.getBoolean(ConfigNode.BUNGEE_PINGER_TRIM_MOTD.getPath());
+
+ pingerOfflineMotd = StringConverter.toReadableFormat(config.getString(ConfigNode.BUNGEE_PINGER_OFFLINE_MOTD.getPath()));
+ pingerStatusOnline = StringConverter.toReadableFormat(config.getString(ConfigNode.BUNGEE_PINGER_ONLINE_FORMAT.getPath()));
+ pingerStatusOffline = StringConverter.toReadableFormat(config.getString(ConfigNode.BUNGEE_PINGER_OFFLINE_FORMAT.getPath()));
+
+ if (pingerTimeout <= 0) {
+ pingerTimeout = 100;
+ } else if (pingerTimeout >= 10000) {
+ pingerTimeout = 10000;
+ }
+
+ pingerServers = new HashMap<>();
+
+ if (pingerEnable) {
+ for (String singleServer : config.getStringList(ConfigNode.BUNGEE_PINGER_SERVERS.getPath())) {
+ String[] nameAndAddress = singleServer.split(":", 2);
+ if (nameAndAddress.length < 2) {
+ ConsoleLogger.log(Level.WARNING, "The server info \"" + singleServer + "\" is not valid. There should be a name and an address, separated by a colon.");
+ continue;
+ }
+
+ String name = nameAndAddress[0].trim();
+ String address = nameAndAddress[1].replace(" ", "");
+
+ String ip;
+ int port;
+
+ if (address.contains(":")) {
+ String[] ipAndPort = address.split(":", 2);
+ ip = ipAndPort[0];
+ try {
+ port = Integer.parseInt(ipAndPort[1]);
+ } catch (NumberFormatException e) {
+ ConsoleLogger.log(Level.WARNING, "Invalid port number in the server info \"" + singleServer + "\".");
+ continue;
+ }
+ } else {
+ ip = address;
+ port = 25565; // The default Minecraft port.
+ }
+
+ pingerServers.put(name, new ServerAddress(ip, port));
+ }
+ }
+
+ ConsoleLogger.setDebugEnabled(config.getBoolean(ConfigNode.DEBUG.getPath()));
+
+ String tempColor = config.getString(ConfigNode.TRANSPARENCY_COLOR.getPath()).replace('&', ChatColor.COLOR_CHAR);
+ boolean foundColor = false;
+ for (ChatColor chatColor : ChatColor.values()) {
+ if (chatColor.toString().equals(tempColor)) {
+ Configuration.transparencyColor = chatColor;
+ foundColor = true;
+ }
+ }
+ if (!foundColor) {
+ Configuration.transparencyColor = ChatColor.GRAY;
+ ConsoleLogger.log(Level.WARNING, "You didn't set a valid chat color for transparency in the configuration, light gray (&7) will be used.");
+ }
+
+ try {
+ timeFormat = new SimpleDateFormat(config.getString(ConfigNode.TIME_FORMAT.getPath()));
+ timeFormat.setTimeZone(TimeZone.getTimeZone(config.getString(ConfigNode.TIME_ZONE.getPath())));
+ } catch (IllegalArgumentException ex) {
+ timeFormat = new SimpleDateFormat("H:mm");
+ ConsoleLogger.log(Level.WARNING, "Time format not valid in the configuration, using the default.");
+ }
+
+ if (bungeeRefreshSeconds < 1) {
+ ConsoleLogger.log(Level.WARNING, "The minimum interval for pinging BungeeCord's servers is 1 second. It has been automatically set.");
+ bungeeRefreshSeconds = 1;
+ }
+
+ if (bungeeRefreshSeconds > 60) {
+ ConsoleLogger.log(Level.WARNING, "The maximum interval for pinging BungeeCord's servers is 60 seconds. It has been automatically set.");
+ bungeeRefreshSeconds = 60;
+ }
+ }
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/disk/LocationSerializer.java b/config/src/main/java/me/filoghost/holographicdisplays/disk/LocationSerializer.java
index 6e37bc48..b09835e0 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/disk/LocationSerializer.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/disk/LocationSerializer.java
@@ -25,38 +25,38 @@ import java.text.DecimalFormatSymbols;
import java.util.Locale;
public class LocationSerializer {
-
- private static DecimalFormat numberFormat = new DecimalFormat("0.000", DecimalFormatSymbols.getInstance(Locale.ROOT));
+
+ private static DecimalFormat numberFormat = new DecimalFormat("0.000", DecimalFormatSymbols.getInstance(Locale.ROOT));
- public static Location locationFromString(String input) throws WorldNotFoundException, InvalidFormatException {
- if (input == null) {
- throw new InvalidFormatException();
- }
-
- String[] parts = input.split(",");
-
- if (parts.length != 4) {
- throw new InvalidFormatException();
- }
-
- try {
- double x = Double.parseDouble(parts[1].replace(" ", ""));
- double y = Double.parseDouble(parts[2].replace(" ", ""));
- double z = Double.parseDouble(parts[3].replace(" ", ""));
-
- World world = Bukkit.getWorld(parts[0].trim());
- if (world == null) {
- throw new WorldNotFoundException(parts[0].trim());
- }
-
- return new Location(world, x, y, z);
-
- } catch (NumberFormatException ex) {
- throw new InvalidFormatException();
- }
- }
-
- public static String locationToString(Location loc) {
- return (loc.getWorld().getName() + ", " + numberFormat.format(loc.getX()) + ", " + numberFormat.format(loc.getY()) + ", " + numberFormat.format(loc.getZ()));
- }
+ public static Location locationFromString(String input) throws WorldNotFoundException, InvalidFormatException {
+ if (input == null) {
+ throw new InvalidFormatException();
+ }
+
+ String[] parts = input.split(",");
+
+ if (parts.length != 4) {
+ throw new InvalidFormatException();
+ }
+
+ try {
+ double x = Double.parseDouble(parts[1].replace(" ", ""));
+ double y = Double.parseDouble(parts[2].replace(" ", ""));
+ double z = Double.parseDouble(parts[3].replace(" ", ""));
+
+ World world = Bukkit.getWorld(parts[0].trim());
+ if (world == null) {
+ throw new WorldNotFoundException(parts[0].trim());
+ }
+
+ return new Location(world, x, y, z);
+
+ } catch (NumberFormatException ex) {
+ throw new InvalidFormatException();
+ }
+ }
+
+ public static String locationToString(Location loc) {
+ return (loc.getWorld().getName() + ", " + numberFormat.format(loc.getX()) + ", " + numberFormat.format(loc.getY()) + ", " + numberFormat.format(loc.getZ()));
+ }
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/disk/ServerAddress.java b/config/src/main/java/me/filoghost/holographicdisplays/disk/ServerAddress.java
index 9e42f88d..37dbea76 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/disk/ServerAddress.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/disk/ServerAddress.java
@@ -15,26 +15,26 @@
package me.filoghost.holographicdisplays.disk;
public class ServerAddress {
-
- private String ip;
- private int port;
-
- public ServerAddress(String ip, int port) {
- this.ip = ip;
- this.port = port;
- }
+
+ private String ip;
+ private int port;
+
+ public ServerAddress(String ip, int port) {
+ this.ip = ip;
+ this.port = port;
+ }
- public String getAddress() {
- return ip;
- }
+ public String getAddress() {
+ return ip;
+ }
- public int getPort() {
- return port;
- }
+ public int getPort() {
+ return port;
+ }
- @Override
- public String toString() {
- return ip + ":" + port;
- }
-
+ @Override
+ public String toString() {
+ return ip + ":" + port;
+ }
+
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/disk/StringConverter.java b/config/src/main/java/me/filoghost/holographicdisplays/disk/StringConverter.java
index 7c914193..a4998ebf 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/disk/StringConverter.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/disk/StringConverter.java
@@ -19,80 +19,80 @@ import org.bukkit.ChatColor;
public class StringConverter {
- private static final boolean HEX_CHAT_COLORS_ENABLED = Utils.classExists("org.bukkit.entity.Strider");
- private static final int HEX_COLOR_LENGTH = 6;
+ private static final boolean HEX_CHAT_COLORS_ENABLED = Utils.classExists("org.bukkit.entity.Strider");
+ private static final int HEX_COLOR_LENGTH = 6;
- public static String toReadableFormat(String input) {
- if (input == null) {
- return null;
- }
+ public static String toReadableFormat(String input) {
+ if (input == null) {
+ return null;
+ }
- input = UnicodeSymbols.placeholdersToSymbols(input);
- input = addColors(input);
- return input;
- }
+ input = UnicodeSymbols.placeholdersToSymbols(input);
+ input = addColors(input);
+ return input;
+ }
- public static String addColors(String input) {
- if (!input.contains("&")) {
- return input;
- }
+ public static String addColors(String input) {
+ if (!input.contains("&")) {
+ return input;
+ }
- StringBuilder output = new StringBuilder(input.length());
+ StringBuilder output = new StringBuilder(input.length());
- for (int i = 0; i < input.length(); i++) {
- char current = input.charAt(i);
+ for (int i = 0; i < input.length(); i++) {
+ char current = input.charAt(i);
- if (current == '&' && i + 1 < input.length()) {
- char next = input.charAt(i + 1);
+ if (current == '&' && i + 1 < input.length()) {
+ char next = input.charAt(i + 1);
- if (next == '#' && HEX_CHAT_COLORS_ENABLED && isValidHexColor(input, i + 2)) {
- output.append(ChatColor.COLOR_CHAR);
- output.append('x');
+ if (next == '#' && HEX_CHAT_COLORS_ENABLED && isValidHexColor(input, i + 2)) {
+ output.append(ChatColor.COLOR_CHAR);
+ output.append('x');
- for (int j = 0; j < HEX_COLOR_LENGTH; j++) {
- output.append(ChatColor.COLOR_CHAR);
- output.append(Character.toLowerCase(input.charAt(i + 2 + j)));
- }
+ for (int j = 0; j < HEX_COLOR_LENGTH; j++) {
+ output.append(ChatColor.COLOR_CHAR);
+ output.append(Character.toLowerCase(input.charAt(i + 2 + j)));
+ }
- i += 1 + HEX_COLOR_LENGTH; // Skip '#' and hex string, which are already converted and added
+ i += 1 + HEX_COLOR_LENGTH; // Skip '#' and hex string, which are already converted and added
- } else if (isColorCode(next)) {
- output.append(ChatColor.COLOR_CHAR);
- output.append(Character.toLowerCase(next));
+ } else if (isColorCode(next)) {
+ output.append(ChatColor.COLOR_CHAR);
+ output.append(Character.toLowerCase(next));
- i++; // Skip next character, which is already added
+ i++; // Skip next character, which is already added
- } else {
- output.append(current);
- }
- } else {
- output.append(current);
- }
- }
+ } else {
+ output.append(current);
+ }
+ } else {
+ output.append(current);
+ }
+ }
- return output.toString();
- }
+ return output.toString();
+ }
- private static boolean isValidHexColor(String input, int startIndex) {
- if (input.length() - startIndex < HEX_COLOR_LENGTH) {
- return false;
- }
+ private static boolean isValidHexColor(String input, int startIndex) {
+ if (input.length() - startIndex < HEX_COLOR_LENGTH) {
+ return false;
+ }
- for (int i = 0; i < HEX_COLOR_LENGTH; i++) {
- if (!isHexCode(input.charAt(startIndex + i))) {
- return false;
- }
- }
+ for (int i = 0; i < HEX_COLOR_LENGTH; i++) {
+ if (!isHexCode(input.charAt(startIndex + i))) {
+ return false;
+ }
+ }
- return true;
- }
+ return true;
+ }
- private static boolean isHexCode(char c) {
- return "0123456789AaBbCcDdEeFf".indexOf(c) > -1;
- }
+ private static boolean isHexCode(char c) {
+ return "0123456789AaBbCcDdEeFf".indexOf(c) > -1;
+ }
- private static boolean isColorCode(char c) {
- return "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(c) > -1;
- }
-
+ private static boolean isColorCode(char c) {
+ return "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(c) > -1;
+ }
+
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/disk/UnicodeSymbols.java b/config/src/main/java/me/filoghost/holographicdisplays/disk/UnicodeSymbols.java
index 12df4e8c..8cc04055 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/disk/UnicodeSymbols.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/disk/UnicodeSymbols.java
@@ -29,79 +29,79 @@ import java.util.logging.Level;
public class UnicodeSymbols {
- private static Map placeholders = new HashMap<>();
-
- public static void load(Plugin plugin) {
- placeholders.clear();
-
- File file = new File(plugin.getDataFolder(), "symbols.yml");
-
- if (!file.exists()) {
- plugin.getDataFolder().mkdirs();
- plugin.saveResource("symbols.yml", true);
- }
-
- List lines;
- try {
- lines = FileUtils.readLines(file);
- } catch (IOException e) {
- ConsoleLogger.log(Level.WARNING, "I/O error while reading symbols.yml. Was the file in use?", e);
- return;
- } catch (Exception e) {
- ConsoleLogger.log(Level.WARNING, "Unhandled exception while reading symbols.yml!", e);
- return;
- }
-
- for (String line : lines) {
-
- // Comment or empty line.
- if (line.length() == 0 || line.startsWith("#")) {
- continue;
- }
-
- if (!line.contains(":")) {
- ConsoleLogger.log(Level.WARNING, "Unable to parse a line(" + line + ") from symbols.yml: it must contain ':' to separate the placeholder and the replacement.");
- continue;
- }
-
- int indexOf = line.indexOf(':');
- String placeholder = unquote(line.substring(0, indexOf).trim());
- String replacement = StringEscapeUtils.unescapeJava(unquote(line.substring(indexOf + 1, line.length()).trim()));
+ private static Map placeholders = new HashMap<>();
+
+ public static void load(Plugin plugin) {
+ placeholders.clear();
+
+ File file = new File(plugin.getDataFolder(), "symbols.yml");
+
+ if (!file.exists()) {
+ plugin.getDataFolder().mkdirs();
+ plugin.saveResource("symbols.yml", true);
+ }
+
+ List lines;
+ try {
+ lines = FileUtils.readLines(file);
+ } catch (IOException e) {
+ ConsoleLogger.log(Level.WARNING, "I/O error while reading symbols.yml. Was the file in use?", e);
+ return;
+ } catch (Exception e) {
+ ConsoleLogger.log(Level.WARNING, "Unhandled exception while reading symbols.yml!", e);
+ return;
+ }
+
+ for (String line : lines) {
+
+ // Comment or empty line.
+ if (line.length() == 0 || line.startsWith("#")) {
+ continue;
+ }
+
+ if (!line.contains(":")) {
+ ConsoleLogger.log(Level.WARNING, "Unable to parse a line(" + line + ") from symbols.yml: it must contain ':' to separate the placeholder and the replacement.");
+ continue;
+ }
+
+ int indexOf = line.indexOf(':');
+ String placeholder = unquote(line.substring(0, indexOf).trim());
+ String replacement = StringEscapeUtils.unescapeJava(unquote(line.substring(indexOf + 1, line.length()).trim()));
- if (placeholder.isEmpty() || replacement.isEmpty()) {
- ConsoleLogger.log(Level.WARNING, "Unable to parse a line(" + line + ") from symbols.yml: the placeholder and the replacement must have both at least 1 character.");
- continue;
- }
-
- if (placeholder.length() > 30) {
- ConsoleLogger.log(Level.WARNING, "Unable to parse a line(" + line + ") from symbols.yml: the placeholder cannot be longer than 30 characters.");
- continue;
- }
-
- placeholders.put(placeholder, replacement);
- }
- }
-
-
- protected static String placeholdersToSymbols(String input) {
- for (Entry entry : placeholders.entrySet()) {
- input = input.replace(entry.getKey(), entry.getValue());
- }
- return input;
- }
-
-
- private static String unquote(String input) {
- if (input.length() < 2) {
- // Cannot be quoted.
- return input;
- }
- if (input.startsWith("'") && input.endsWith("'")) {
- return input.substring(1, input.length() - 1);
- } else if (input.startsWith("\"") && input.endsWith("\"")) {
- return input.substring(1, input.length() - 1);
- }
-
- return input;
- }
+ if (placeholder.isEmpty() || replacement.isEmpty()) {
+ ConsoleLogger.log(Level.WARNING, "Unable to parse a line(" + line + ") from symbols.yml: the placeholder and the replacement must have both at least 1 character.");
+ continue;
+ }
+
+ if (placeholder.length() > 30) {
+ ConsoleLogger.log(Level.WARNING, "Unable to parse a line(" + line + ") from symbols.yml: the placeholder cannot be longer than 30 characters.");
+ continue;
+ }
+
+ placeholders.put(placeholder, replacement);
+ }
+ }
+
+
+ protected static String placeholdersToSymbols(String input) {
+ for (Entry entry : placeholders.entrySet()) {
+ input = input.replace(entry.getKey(), entry.getValue());
+ }
+ return input;
+ }
+
+
+ private static String unquote(String input) {
+ if (input.length() < 2) {
+ // Cannot be quoted.
+ return input;
+ }
+ if (input.startsWith("'") && input.endsWith("'")) {
+ return input.substring(1, input.length() - 1);
+ } else if (input.startsWith("\"") && input.endsWith("\"")) {
+ return input.substring(1, input.length() - 1);
+ }
+
+ return input;
+ }
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/exception/InvalidFormatException.java b/config/src/main/java/me/filoghost/holographicdisplays/exception/InvalidFormatException.java
index d03f9908..85ff0df5 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/exception/InvalidFormatException.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/exception/InvalidFormatException.java
@@ -16,6 +16,6 @@ package me.filoghost.holographicdisplays.exception;
public class InvalidFormatException extends Exception {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
}
diff --git a/config/src/main/java/me/filoghost/holographicdisplays/exception/WorldNotFoundException.java b/config/src/main/java/me/filoghost/holographicdisplays/exception/WorldNotFoundException.java
index 1f0ba7cb..45d98cc2 100644
--- a/config/src/main/java/me/filoghost/holographicdisplays/exception/WorldNotFoundException.java
+++ b/config/src/main/java/me/filoghost/holographicdisplays/exception/WorldNotFoundException.java
@@ -16,10 +16,10 @@ package me.filoghost.holographicdisplays.exception;
public class WorldNotFoundException extends Exception {
- private static final long serialVersionUID = 1L;
-
- public WorldNotFoundException(String message) {
- super(message);
- }
+ private static final long serialVersionUID = 1L;
+
+ public WorldNotFoundException(String message) {
+ super(message);
+ }
}
diff --git a/example/death-holograms/pom.xml b/example/death-holograms/pom.xml
index c5622747..66b6c3bb 100644
--- a/example/death-holograms/pom.xml
+++ b/example/death-holograms/pom.xml
@@ -1,15 +1,15 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-example
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-example
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-example-deathholograms
- HolographicDisplays Example DeathHolograms
-
+ holographicdisplays-example-deathholograms
+ HolographicDisplays Example DeathHolograms
+
diff --git a/example/death-holograms/src/main/java/me/filoghost/example/deathholograms/DeathHolograms.java b/example/death-holograms/src/main/java/me/filoghost/example/deathholograms/DeathHolograms.java
index 4747e8a0..21ec7a30 100644
--- a/example/death-holograms/src/main/java/me/filoghost/example/deathholograms/DeathHolograms.java
+++ b/example/death-holograms/src/main/java/me/filoghost/example/deathholograms/DeathHolograms.java
@@ -27,28 +27,28 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class DeathHolograms extends JavaPlugin implements Listener {
-
- public void onEnable() {
-
- if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays")) {
- getLogger().severe("*** HolographicDisplays is not installed or not enabled. ***");
- getLogger().severe("*** This plugin will be disabled. ***");
- this.setEnabled(false);
- return;
- }
-
- Bukkit.getPluginManager().registerEvents(this, this);
-
- }
-
-
- @EventHandler
- public void onPlayerDeath(PlayerDeathEvent event) {
-
- Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getEyeLocation());
-
- hologram.appendTextLine(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!");
- hologram.appendTextLine(ChatColor.GRAY + "Time of death: " + new SimpleDateFormat("H:m").format(new Date()));
-
- }
+
+ public void onEnable() {
+
+ if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays")) {
+ getLogger().severe("*** HolographicDisplays is not installed or not enabled. ***");
+ getLogger().severe("*** This plugin will be disabled. ***");
+ this.setEnabled(false);
+ return;
+ }
+
+ Bukkit.getPluginManager().registerEvents(this, this);
+
+ }
+
+
+ @EventHandler
+ public void onPlayerDeath(PlayerDeathEvent event) {
+
+ Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getEyeLocation());
+
+ hologram.appendTextLine(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!");
+ hologram.appendTextLine(ChatColor.GRAY + "Time of death: " + new SimpleDateFormat("H:m").format(new Date()));
+
+ }
}
diff --git a/example/pom.xml b/example/pom.xml
index 701f6fcd..2dfb1765 100644
--- a/example/pom.xml
+++ b/example/pom.xml
@@ -1,40 +1,40 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-parent
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-parent
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-example
- HolographicDisplays Example
- pom
+ holographicdisplays-example
+ HolographicDisplays Example
+ pom
-
- death-holograms
- power-ups
-
-
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
+
+ death-holograms
+ power-ups
+
+
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
-
-
- ${project.groupId}
- holographicdisplays-api
-
-
-
- org.spigotmc
- spigot-api
-
-
+
+
+ ${project.groupId}
+ holographicdisplays-api
+
+
+
+ org.spigotmc
+ spigot-api
+
+
-
\ No newline at end of file
+
diff --git a/example/power-ups/pom.xml b/example/power-ups/pom.xml
index 8bc1bec8..a4fb3877 100644
--- a/example/power-ups/pom.xml
+++ b/example/power-ups/pom.xml
@@ -1,15 +1,15 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-example
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-example
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-example-powerups
- HolographicDisplays Example PowerUps
+ holographicdisplays-example-powerups
+ HolographicDisplays Example PowerUps
diff --git a/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java b/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java
index bf5051de..737b57f1 100644
--- a/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java
+++ b/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java
@@ -33,53 +33,53 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class PowerUps extends JavaPlugin implements Listener {
-
- @Override
- public void onEnable() {
-
- if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays")) {
- getLogger().severe("*** HolographicDisplays is not installed or not enabled. ***");
- getLogger().severe("*** This plugin will be disabled. ***");
- this.setEnabled(false);
- return;
- }
-
- Bukkit.getPluginManager().registerEvents(this, this);
-
- }
-
-
- @EventHandler
- public void onEntityDeath(EntityDeathEvent event) {
-
- if (event.getEntityType() == EntityType.ZOMBIE) {
+
+ @Override
+ public void onEnable() {
+
+ if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays")) {
+ getLogger().severe("*** HolographicDisplays is not installed or not enabled. ***");
+ getLogger().severe("*** This plugin will be disabled. ***");
+ this.setEnabled(false);
+ return;
+ }
+
+ Bukkit.getPluginManager().registerEvents(this, this);
+
+ }
+
+
+ @EventHandler
+ public void onEntityDeath(EntityDeathEvent event) {
+
+ if (event.getEntityType() == EntityType.ZOMBIE) {
- // Remove normal drops and exp.
- event.getDrops().clear();
- event.setDroppedExp(0);
-
- // Spawn the floating item with a label.
- final Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getLocation().add(0.0, 0.9, 0.0));
- hologram.appendTextLine(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp");
- ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));
-
- icon.setPickupHandler(new PickupHandler() {
-
- @Override
- public void onPickup(Player player) {
-
- // Play an effect.
- player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null);
-
- // 30 seconds of speed II.
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true);
-
- // Delete the hologram.
- hologram.delete();
-
- }
- });
-
- }
- }
+ // Remove normal drops and exp.
+ event.getDrops().clear();
+ event.setDroppedExp(0);
+
+ // Spawn the floating item with a label.
+ final Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getLocation().add(0.0, 0.9, 0.0));
+ hologram.appendTextLine(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp");
+ ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));
+
+ icon.setPickupHandler(new PickupHandler() {
+
+ @Override
+ public void onPickup(Player player) {
+
+ // Play an effect.
+ player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null);
+
+ // 30 seconds of speed II.
+ player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true);
+
+ // Delete the hologram.
+ hologram.delete();
+
+ }
+ });
+
+ }
+ }
}
diff --git a/legacy-v1/pom.xml b/legacy-v1/pom.xml
index 315fe811..d04f3768 100644
--- a/legacy-v1/pom.xml
+++ b/legacy-v1/pom.xml
@@ -1,39 +1,39 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-parent
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-parent
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-legacy-v1
- HolographicDisplays Legacy v1
+ holographicdisplays-legacy-v1
+ HolographicDisplays Legacy v1
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
-
-
- ${project.groupId}
- holographicdisplays-api
-
-
-
- ${project.groupId}
- holographicdisplays-utils
-
-
-
- org.spigotmc
- spigot-api
-
-
+
+
+ ${project.groupId}
+ holographicdisplays-api
+
+
+
+ ${project.groupId}
+ holographicdisplays-utils
+
+
+
+ org.spigotmc
+ spigot-api
+
+
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java
index 25b61489..786db9ac 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/FloatingItem.java
@@ -24,60 +24,60 @@ import org.bukkit.inventory.ItemStack;
@Deprecated
public interface FloatingItem {
- @Deprecated
- public boolean update();
+ @Deprecated
+ public boolean update();
- @Deprecated
- public void hide();
+ @Deprecated
+ public void hide();
- @Deprecated
- public void setItemStack(ItemStack itemstack);
+ @Deprecated
+ public void setItemStack(ItemStack itemstack);
- @Deprecated
- public ItemStack getItemStack();
+ @Deprecated
+ public ItemStack getItemStack();
- @Deprecated
- public Location getLocation();
+ @Deprecated
+ public Location getLocation();
- @Deprecated
- public double getX();
+ @Deprecated
+ public double getX();
- @Deprecated
- public double getY();
+ @Deprecated
+ public double getY();
- @Deprecated
- public double getZ();
+ @Deprecated
+ public double getZ();
- @Deprecated
- public World getWorld();
+ @Deprecated
+ public World getWorld();
- @Deprecated
- public void teleport(Location location);
+ @Deprecated
+ public void teleport(Location location);
- @Deprecated
- public void setTouchHandler(ItemTouchHandler handler);
+ @Deprecated
+ public void setTouchHandler(ItemTouchHandler handler);
- @Deprecated
- public ItemTouchHandler getTouchHandler();
+ @Deprecated
+ public ItemTouchHandler getTouchHandler();
- @Deprecated
- public boolean hasTouchHandler();
-
- @Deprecated
- public void setPickupHandler(PickupHandler handler);
+ @Deprecated
+ public boolean hasTouchHandler();
+
+ @Deprecated
+ public void setPickupHandler(PickupHandler handler);
- @Deprecated
- public PickupHandler getPickupHandler();
+ @Deprecated
+ public PickupHandler getPickupHandler();
- @Deprecated
- public boolean hasPickupHandler();
+ @Deprecated
+ public boolean hasPickupHandler();
- @Deprecated
- public long getCreationTimestamp();
+ @Deprecated
+ public long getCreationTimestamp();
- @Deprecated
- public void delete();
+ @Deprecated
+ public void delete();
- @Deprecated
- public boolean isDeleted();
+ @Deprecated
+ public boolean isDeleted();
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java
index c1cddd2d..f2afca4a 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/Hologram.java
@@ -23,70 +23,70 @@ import org.bukkit.World;
@Deprecated
public interface Hologram {
- @Deprecated
- public boolean update();
+ @Deprecated
+ public boolean update();
- @Deprecated
- public void hide();
-
- @Deprecated
- public void addLine(String text);
+ @Deprecated
+ public void hide();
+
+ @Deprecated
+ public void addLine(String text);
- @Deprecated
- public void removeLine(int index);
+ @Deprecated
+ public void removeLine(int index);
- @Deprecated
- public void setLine(int index, String text);
+ @Deprecated
+ public void setLine(int index, String text);
- @Deprecated
- public void insertLine(int index, String text);
+ @Deprecated
+ public void insertLine(int index, String text);
- @Deprecated
- public String[] getLines();
-
- @Deprecated
- public int getLinesLength();
-
- @Deprecated
- public void clearLines();
-
- @Deprecated
- public Location getLocation();
-
- @Deprecated
- public double getX();
-
- @Deprecated
- public double getY();
-
- @Deprecated
- public double getZ();
-
- @Deprecated
- public World getWorld();
+ @Deprecated
+ public String[] getLines();
+
+ @Deprecated
+ public int getLinesLength();
+
+ @Deprecated
+ public void clearLines();
+
+ @Deprecated
+ public Location getLocation();
+
+ @Deprecated
+ public double getX();
+
+ @Deprecated
+ public double getY();
+
+ @Deprecated
+ public double getZ();
+
+ @Deprecated
+ public World getWorld();
- @Deprecated
- public void setLocation(Location location);
-
- @Deprecated
- public void teleport(Location location);
-
- @Deprecated
- public void setTouchHandler(TouchHandler handler);
+ @Deprecated
+ public void setLocation(Location location);
+
+ @Deprecated
+ public void teleport(Location location);
+
+ @Deprecated
+ public void setTouchHandler(TouchHandler handler);
- @Deprecated
- public TouchHandler getTouchHandler();
-
- @Deprecated
- public boolean hasTouchHandler();
+ @Deprecated
+ public TouchHandler getTouchHandler();
+
+ @Deprecated
+ public boolean hasTouchHandler();
- @Deprecated
- public long getCreationTimestamp();
+ @Deprecated
+ public long getCreationTimestamp();
- @Deprecated
- public void delete();
+ @Deprecated
+ public void delete();
- @Deprecated
- public boolean isDeleted();
-
+ @Deprecated
+ public boolean isDeleted();
+
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java
index b2fa535f..022a9f6a 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/HolographicDisplaysAPI.java
@@ -40,128 +40,128 @@ import java.util.Set;
*/
@Deprecated
public class HolographicDisplaysAPI {
-
- private static Set notifiedPlugins = new HashSet<>();
-
- private static void notifyOldAPI(Plugin plugin) {
- Validator.notNull(plugin, "plugin");
-
- if (notifiedPlugins.add(plugin.getName())) {
- Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[Holographic Displays] The plugin \"" + plugin.getName() + "\" is still using the old API of Holographic Displays. "
- + "Please notify the author and ask them to update it, the old API will be removed soon.");
- }
- }
-
- @Deprecated
- public static Hologram createHologram(Plugin plugin, Location source, String... lines) {
- notifyOldAPI(plugin);
-
- validateLocation(source);
-
- me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
- for (String line : lines) {
- hologram.appendTextLine(line);
- }
- return new HologramAdapter(plugin, hologram);
- }
+
+ private static Set notifiedPlugins = new HashSet<>();
+
+ private static void notifyOldAPI(Plugin plugin) {
+ Validator.notNull(plugin, "plugin");
+
+ if (notifiedPlugins.add(plugin.getName())) {
+ Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[Holographic Displays] The plugin \"" + plugin.getName() + "\" is still using the old API of Holographic Displays. "
+ + "Please notify the author and ask them to update it, the old API will be removed soon.");
+ }
+ }
+
+ @Deprecated
+ public static Hologram createHologram(Plugin plugin, Location source, String... lines) {
+ notifyOldAPI(plugin);
+
+ validateLocation(source);
+
+ me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
+ for (String line : lines) {
+ hologram.appendTextLine(line);
+ }
+ return new HologramAdapter(plugin, hologram);
+ }
- @Deprecated
- public static FloatingItem createFloatingItem(Plugin plugin, Location source, ItemStack itemstack) {
- notifyOldAPI(plugin);
-
- validateLocation(source);
- validateItem(itemstack);
-
- me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
- ItemLine itemLine = hologram.appendItemLine(itemstack);
- return new FloatingItemAdapter(plugin, hologram, itemLine);
- }
+ @Deprecated
+ public static FloatingItem createFloatingItem(Plugin plugin, Location source, ItemStack itemstack) {
+ notifyOldAPI(plugin);
+
+ validateLocation(source);
+ validateItem(itemstack);
+
+ me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
+ ItemLine itemLine = hologram.appendItemLine(itemstack);
+ return new FloatingItemAdapter(plugin, hologram, itemLine);
+ }
- @Deprecated
- public static Hologram createIndividualHologram(Plugin plugin, Location source, Player whoCanSee, String... lines) {
- notifyOldAPI(plugin);
-
- return createIndividualHologram(plugin, source, Arrays.asList(whoCanSee), lines);
- }
-
- @Deprecated
- public static Hologram createIndividualHologram(Plugin plugin, Location source, List whoCanSee, String... lines) {
- notifyOldAPI(plugin);
-
- validateLocation(source);
-
- me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
-
- hologram.getVisibilityManager().setVisibleByDefault(false);
- if (whoCanSee != null) {
- for (Player player : whoCanSee) {
- hologram.getVisibilityManager().showTo(player);
- }
- }
-
- for (String line : lines) {
- hologram.appendTextLine(line);
- }
-
- return new HologramAdapter(plugin, hologram);
- }
-
- @Deprecated
- public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, Player whoCanSee, ItemStack itemstack) {
- notifyOldAPI(plugin);
-
- return createIndividualFloatingItem(plugin, source, Arrays.asList(whoCanSee), itemstack);
- }
-
- @Deprecated
- public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, List whoCanSee, ItemStack itemstack) {
- notifyOldAPI(plugin);
-
- validateLocation(source);
- validateItem(itemstack);
-
- me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
- ItemLine itemLine = hologram.appendItemLine(itemstack);
-
- hologram.getVisibilityManager().setVisibleByDefault(false);
- if (whoCanSee != null) {
- for (Player player : whoCanSee) {
- hologram.getVisibilityManager().showTo(player);
- }
- }
-
- return new FloatingItemAdapter(plugin, hologram, itemLine);
- }
-
- @Deprecated
- public static Hologram[] getHolograms(Plugin plugin) {
- notifyOldAPI(plugin);
-
- Collection pluginHolograms = HologramAdapter.activeHolograms.getOrDefault(plugin, Collections.emptyList());
- return pluginHolograms.toArray(new HologramAdapter[0]);
- }
-
- @Deprecated
- public static FloatingItem[] getFloatingItems(Plugin plugin) {
- notifyOldAPI(plugin);
-
- Collection pluginFloatingItems = FloatingItemAdapter.activeFloatingItems.getOrDefault(plugin, Collections.emptyList());
- return pluginFloatingItems.toArray(new FloatingItemAdapter[0]);
- }
-
- @Deprecated
- public static boolean isHologramEntity(Entity bukkitEntity) {
- return HologramsAPI.isHologramEntity(bukkitEntity);
- }
-
- private static void validateLocation(Location loc) {
- Validator.notNull(loc, "location");
- Validator.notNull(loc.getWorld(), "location's world");
- }
-
- private static void validateItem(ItemStack itemstack) {
- Validator.notNull(itemstack, "itemstack");
- Validator.isTrue(itemstack.getType() != Material.AIR, "itemstack cannot be AIR");
- }
+ @Deprecated
+ public static Hologram createIndividualHologram(Plugin plugin, Location source, Player whoCanSee, String... lines) {
+ notifyOldAPI(plugin);
+
+ return createIndividualHologram(plugin, source, Arrays.asList(whoCanSee), lines);
+ }
+
+ @Deprecated
+ public static Hologram createIndividualHologram(Plugin plugin, Location source, List whoCanSee, String... lines) {
+ notifyOldAPI(plugin);
+
+ validateLocation(source);
+
+ me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
+
+ hologram.getVisibilityManager().setVisibleByDefault(false);
+ if (whoCanSee != null) {
+ for (Player player : whoCanSee) {
+ hologram.getVisibilityManager().showTo(player);
+ }
+ }
+
+ for (String line : lines) {
+ hologram.appendTextLine(line);
+ }
+
+ return new HologramAdapter(plugin, hologram);
+ }
+
+ @Deprecated
+ public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, Player whoCanSee, ItemStack itemstack) {
+ notifyOldAPI(plugin);
+
+ return createIndividualFloatingItem(plugin, source, Arrays.asList(whoCanSee), itemstack);
+ }
+
+ @Deprecated
+ public static FloatingItem createIndividualFloatingItem(Plugin plugin, Location source, List whoCanSee, ItemStack itemstack) {
+ notifyOldAPI(plugin);
+
+ validateLocation(source);
+ validateItem(itemstack);
+
+ me.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(plugin, source);
+ ItemLine itemLine = hologram.appendItemLine(itemstack);
+
+ hologram.getVisibilityManager().setVisibleByDefault(false);
+ if (whoCanSee != null) {
+ for (Player player : whoCanSee) {
+ hologram.getVisibilityManager().showTo(player);
+ }
+ }
+
+ return new FloatingItemAdapter(plugin, hologram, itemLine);
+ }
+
+ @Deprecated
+ public static Hologram[] getHolograms(Plugin plugin) {
+ notifyOldAPI(plugin);
+
+ Collection pluginHolograms = HologramAdapter.activeHolograms.getOrDefault(plugin, Collections.emptyList());
+ return pluginHolograms.toArray(new HologramAdapter[0]);
+ }
+
+ @Deprecated
+ public static FloatingItem[] getFloatingItems(Plugin plugin) {
+ notifyOldAPI(plugin);
+
+ Collection pluginFloatingItems = FloatingItemAdapter.activeFloatingItems.getOrDefault(plugin, Collections.emptyList());
+ return pluginFloatingItems.toArray(new FloatingItemAdapter[0]);
+ }
+
+ @Deprecated
+ public static boolean isHologramEntity(Entity bukkitEntity) {
+ return HologramsAPI.isHologramEntity(bukkitEntity);
+ }
+
+ private static void validateLocation(Location loc) {
+ Validator.notNull(loc, "location");
+ Validator.notNull(loc.getWorld(), "location's world");
+ }
+
+ private static void validateItem(ItemStack itemstack) {
+ Validator.notNull(itemstack, "itemstack");
+ Validator.isTrue(itemstack.getType() != Material.AIR, "itemstack cannot be AIR");
+ }
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java
index a9e4c087..5968b3f7 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/ItemTouchHandler.java
@@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
@Deprecated
public interface ItemTouchHandler {
- @Deprecated
- public void onTouch(FloatingItem floatingItem, Player player);
-
+ @Deprecated
+ public void onTouch(FloatingItem floatingItem, Player player);
+
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java
index cbb3db51..1a359853 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/PickupHandler.java
@@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
@Deprecated
public interface PickupHandler {
- @Deprecated
- public void onPickup(FloatingItem floatingItem, Player player);
-
+ @Deprecated
+ public void onPickup(FloatingItem floatingItem, Player player);
+
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java
index f7ea94a2..ca3f2727 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/TouchHandler.java
@@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
@Deprecated
public interface TouchHandler {
- @Deprecated
- public void onTouch(Hologram hologram, Player player);
-
+ @Deprecated
+ public void onTouch(Hologram hologram, Player player);
+
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java
index 44055567..18f7386b 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/FloatingItemAdapter.java
@@ -31,130 +31,130 @@ import java.util.Map;
@SuppressWarnings("deprecation")
public class FloatingItemAdapter implements FloatingItem {
-
- public static Map> activeFloatingItems = new HashMap<>();
-
- private Plugin plugin;
- public Hologram hologram;
- private ItemLine itemLine;
- private ItemTouchHandler touchHandler;
- private PickupHandler pickupHandler;
-
- public FloatingItemAdapter(Plugin plugin, Hologram delegateHologram, ItemLine delegateItemLine) {
- this.plugin = plugin;
- this.hologram = delegateHologram;
- this.itemLine = delegateItemLine;
-
- activeFloatingItems.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this);
- }
+
+ public static Map> activeFloatingItems = new HashMap<>();
+
+ private Plugin plugin;
+ public Hologram hologram;
+ private ItemLine itemLine;
+ private ItemTouchHandler touchHandler;
+ private PickupHandler pickupHandler;
+
+ public FloatingItemAdapter(Plugin plugin, Hologram delegateHologram, ItemLine delegateItemLine) {
+ this.plugin = plugin;
+ this.hologram = delegateHologram;
+ this.itemLine = delegateItemLine;
+
+ activeFloatingItems.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this);
+ }
- @Override
- public boolean update() {
- return true;
- }
+ @Override
+ public boolean update() {
+ return true;
+ }
- @Override
- public void hide() {
-
- }
+ @Override
+ public void hide() {
+
+ }
- @Override
- public void setItemStack(ItemStack itemstack) {
- itemLine.setItemStack(itemstack);
- }
+ @Override
+ public void setItemStack(ItemStack itemstack) {
+ itemLine.setItemStack(itemstack);
+ }
- @Override
- public ItemStack getItemStack() {
- return itemLine.getItemStack();
- }
+ @Override
+ public ItemStack getItemStack() {
+ return itemLine.getItemStack();
+ }
- @Override
- public Location getLocation() {
- return hologram.getLocation();
- }
+ @Override
+ public Location getLocation() {
+ return hologram.getLocation();
+ }
- @Override
- public double getX() {
- return hologram.getX();
- }
+ @Override
+ public double getX() {
+ return hologram.getX();
+ }
- @Override
- public double getY() {
- return hologram.getY();
- }
+ @Override
+ public double getY() {
+ return hologram.getY();
+ }
- @Override
- public double getZ() {
- return hologram.getZ();
- }
+ @Override
+ public double getZ() {
+ return hologram.getZ();
+ }
- @Override
- public World getWorld() {
- return hologram.getWorld();
- }
+ @Override
+ public World getWorld() {
+ return hologram.getWorld();
+ }
- @Override
- public void teleport(Location location) {
- hologram.teleport(location);
- }
+ @Override
+ public void teleport(Location location) {
+ hologram.teleport(location);
+ }
- @Override
- public void setTouchHandler(ItemTouchHandler handler) {
- this.touchHandler = handler;
-
- if (handler != null) {
- itemLine.setTouchHandler(new ItemTouchHandlerAdapter(this, handler));
- } else {
- itemLine.setTouchHandler(null);
- }
- }
+ @Override
+ public void setTouchHandler(ItemTouchHandler handler) {
+ this.touchHandler = handler;
+
+ if (handler != null) {
+ itemLine.setTouchHandler(new ItemTouchHandlerAdapter(this, handler));
+ } else {
+ itemLine.setTouchHandler(null);
+ }
+ }
- @Override
- public ItemTouchHandler getTouchHandler() {
- return touchHandler;
- }
+ @Override
+ public ItemTouchHandler getTouchHandler() {
+ return touchHandler;
+ }
- @Override
- public boolean hasTouchHandler() {
- return touchHandler != null;
- }
+ @Override
+ public boolean hasTouchHandler() {
+ return touchHandler != null;
+ }
- @Override
- public void setPickupHandler(PickupHandler handler) {
- this.pickupHandler = handler;
-
- if (handler != null) {
- itemLine.setPickupHandler(new PickupHandlerAdapter(this, handler));
- } else {
- itemLine.setPickupHandler(null);
- }
- }
+ @Override
+ public void setPickupHandler(PickupHandler handler) {
+ this.pickupHandler = handler;
+
+ if (handler != null) {
+ itemLine.setPickupHandler(new PickupHandlerAdapter(this, handler));
+ } else {
+ itemLine.setPickupHandler(null);
+ }
+ }
- @Override
- public PickupHandler getPickupHandler() {
- return pickupHandler;
- }
+ @Override
+ public PickupHandler getPickupHandler() {
+ return pickupHandler;
+ }
- @Override
- public boolean hasPickupHandler() {
- return pickupHandler != null;
- }
+ @Override
+ public boolean hasPickupHandler() {
+ return pickupHandler != null;
+ }
- @Override
- public long getCreationTimestamp() {
- return hologram.getCreationTimestamp();
- }
+ @Override
+ public long getCreationTimestamp() {
+ return hologram.getCreationTimestamp();
+ }
- @Override
- public void delete() {
- hologram.delete();
-
- activeFloatingItems.get(plugin).remove(this);
- }
+ @Override
+ public void delete() {
+ hologram.delete();
+
+ activeFloatingItems.get(plugin).remove(this);
+ }
- @Override
- public boolean isDeleted() {
- return hologram.isDeleted();
- }
+ @Override
+ public boolean isDeleted() {
+ return hologram.isDeleted();
+ }
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java
index 65dc21c0..faa1b880 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramAdapter.java
@@ -30,172 +30,172 @@ import java.util.Map;
@SuppressWarnings("deprecation")
public class HologramAdapter implements Hologram {
-
- public static Map> activeHolograms = new HashMap<>();
-
- private Plugin plugin;
- private me.filoghost.holographicdisplays.api.Hologram hologram;
- private TouchHandler touchHandler;
-
- public HologramAdapter(Plugin plugin, me.filoghost.holographicdisplays.api.Hologram delegate) {
- this.plugin = plugin;
- this.hologram = delegate;
-
- activeHolograms.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this);
- }
-
- @Override
- @Deprecated
- public boolean update() {
- return true;
- }
+
+ public static Map> activeHolograms = new HashMap<>();
+
+ private Plugin plugin;
+ private me.filoghost.holographicdisplays.api.Hologram hologram;
+ private TouchHandler touchHandler;
+
+ public HologramAdapter(Plugin plugin, me.filoghost.holographicdisplays.api.Hologram delegate) {
+ this.plugin = plugin;
+ this.hologram = delegate;
+
+ activeHolograms.computeIfAbsent(plugin, __ -> new ArrayList<>()).add(this);
+ }
+
+ @Override
+ @Deprecated
+ public boolean update() {
+ return true;
+ }
- @Override
- @Deprecated
- public void hide() {
-
- }
+ @Override
+ @Deprecated
+ public void hide() {
+
+ }
- @Override
- @Deprecated
- public void addLine(String text) {
- hologram.appendTextLine(text);
- updateTouchHandler();
- }
+ @Override
+ @Deprecated
+ public void addLine(String text) {
+ hologram.appendTextLine(text);
+ updateTouchHandler();
+ }
- @Override
- @Deprecated
- public void setLine(int index, String text) {
- hologram.removeLine(index);
- hologram.insertTextLine(index, text);
- updateTouchHandler();
- }
+ @Override
+ @Deprecated
+ public void setLine(int index, String text) {
+ hologram.removeLine(index);
+ hologram.insertTextLine(index, text);
+ updateTouchHandler();
+ }
- @Override
- @Deprecated
- public void insertLine(int index, String text) {
- hologram.insertTextLine(index, text);
- updateTouchHandler();
- }
+ @Override
+ @Deprecated
+ public void insertLine(int index, String text) {
+ hologram.insertTextLine(index, text);
+ updateTouchHandler();
+ }
- @Override
- @Deprecated
- public String[] getLines() {
- String[] lines = new String[hologram.size()];
- for (int i = 0; i < lines.length; i++) {
- HologramLine lineObject = hologram.getLine(i);
- if (lineObject instanceof TextLine) {
- lines[i] = ((TextLine) lineObject).getText();
- } else {
- lines[i] = "";
- }
- }
- return lines;
- }
+ @Override
+ @Deprecated
+ public String[] getLines() {
+ String[] lines = new String[hologram.size()];
+ for (int i = 0; i < lines.length; i++) {
+ HologramLine lineObject = hologram.getLine(i);
+ if (lineObject instanceof TextLine) {
+ lines[i] = ((TextLine) lineObject).getText();
+ } else {
+ lines[i] = "";
+ }
+ }
+ return lines;
+ }
- @Override
- @Deprecated
- public int getLinesLength() {
- return hologram.size();
- }
+ @Override
+ @Deprecated
+ public int getLinesLength() {
+ return hologram.size();
+ }
- @Override
- @Deprecated
- public void setLocation(Location location) {
- hologram.teleport(location);
- }
+ @Override
+ @Deprecated
+ public void setLocation(Location location) {
+ hologram.teleport(location);
+ }
- @Override
- @Deprecated
- public void setTouchHandler(TouchHandler handler) {
- this.touchHandler = handler;
- updateTouchHandler();
- }
+ @Override
+ @Deprecated
+ public void setTouchHandler(TouchHandler handler) {
+ this.touchHandler = handler;
+ updateTouchHandler();
+ }
- private void updateTouchHandler() {
- for (int i = 0; i < hologram.size(); i++) {
- HologramLine line = hologram.getLine(i);
- if (!(line instanceof TouchableLine)) {
- continue;
- }
-
- TouchableLine touchableLine = (TouchableLine) line;
-
- if (touchHandler != null) {
- touchableLine.setTouchHandler(new HologramTouchHandlerAdapter(this, touchHandler));
- } else {
- touchableLine.setTouchHandler(null);
- }
- }
- }
+ private void updateTouchHandler() {
+ for (int i = 0; i < hologram.size(); i++) {
+ HologramLine line = hologram.getLine(i);
+ if (!(line instanceof TouchableLine)) {
+ continue;
+ }
+
+ TouchableLine touchableLine = (TouchableLine) line;
+
+ if (touchHandler != null) {
+ touchableLine.setTouchHandler(new HologramTouchHandlerAdapter(this, touchHandler));
+ } else {
+ touchableLine.setTouchHandler(null);
+ }
+ }
+ }
- @Override
- @Deprecated
- public TouchHandler getTouchHandler() {
- return touchHandler;
- }
+ @Override
+ @Deprecated
+ public TouchHandler getTouchHandler() {
+ return touchHandler;
+ }
- @Override
- @Deprecated
- public boolean hasTouchHandler() {
- return touchHandler != null;
- }
+ @Override
+ @Deprecated
+ public boolean hasTouchHandler() {
+ return touchHandler != null;
+ }
- @Override
- public void removeLine(int index) {
- hologram.removeLine(index);
- }
+ @Override
+ public void removeLine(int index) {
+ hologram.removeLine(index);
+ }
- @Override
- public void clearLines() {
- hologram.clearLines();
- }
+ @Override
+ public void clearLines() {
+ hologram.clearLines();
+ }
- @Override
- public Location getLocation() {
- return hologram.getLocation();
- }
+ @Override
+ public Location getLocation() {
+ return hologram.getLocation();
+ }
- @Override
- public double getX() {
- return hologram.getX();
- }
+ @Override
+ public double getX() {
+ return hologram.getX();
+ }
- @Override
- public double getY() {
- return hologram.getY();
- }
+ @Override
+ public double getY() {
+ return hologram.getY();
+ }
- @Override
- public double getZ() {
- return hologram.getZ();
- }
+ @Override
+ public double getZ() {
+ return hologram.getZ();
+ }
- @Override
- public World getWorld() {
- return hologram.getWorld();
- }
+ @Override
+ public World getWorld() {
+ return hologram.getWorld();
+ }
- @Override
- public void teleport(Location location) {
- hologram.teleport(location);
- }
+ @Override
+ public void teleport(Location location) {
+ hologram.teleport(location);
+ }
- @Override
- public long getCreationTimestamp() {
- return hologram.getCreationTimestamp();
- }
+ @Override
+ public long getCreationTimestamp() {
+ return hologram.getCreationTimestamp();
+ }
- @Override
- public void delete() {
- hologram.delete();
-
- activeHolograms.get(plugin).remove(this);
- }
+ @Override
+ public void delete() {
+ hologram.delete();
+
+ activeHolograms.get(plugin).remove(this);
+ }
- @Override
- public boolean isDeleted() {
- return hologram.isDeleted();
- }
+ @Override
+ public boolean isDeleted() {
+ return hologram.isDeleted();
+ }
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java
index 1452b423..7a85de19 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/HologramTouchHandlerAdapter.java
@@ -21,17 +21,17 @@ import org.bukkit.entity.Player;
@SuppressWarnings("deprecation")
public class HologramTouchHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.TouchHandler {
- protected TouchHandler oldHandler;
- private Hologram hologram;
-
- public HologramTouchHandlerAdapter(Hologram hologram, TouchHandler oldHandler) {
- this.hologram = hologram;
- this.oldHandler = oldHandler;
- }
-
- @Override
- public void onTouch(Player player) {
- oldHandler.onTouch(hologram, player);
- }
+ protected TouchHandler oldHandler;
+ private Hologram hologram;
+
+ public HologramTouchHandlerAdapter(Hologram hologram, TouchHandler oldHandler) {
+ this.hologram = hologram;
+ this.oldHandler = oldHandler;
+ }
+
+ @Override
+ public void onTouch(Player player) {
+ oldHandler.onTouch(hologram, player);
+ }
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java
index 3d5ea3f3..835fe3bc 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/ItemTouchHandlerAdapter.java
@@ -22,17 +22,17 @@ import org.bukkit.entity.Player;
@SuppressWarnings("deprecation")
public class ItemTouchHandlerAdapter implements TouchHandler {
- protected ItemTouchHandler oldHandler;
- private FloatingItem item;
-
- public ItemTouchHandlerAdapter(FloatingItem item, ItemTouchHandler oldHandler) {
- this.item = item;
- this.oldHandler = oldHandler;
- }
+ protected ItemTouchHandler oldHandler;
+ private FloatingItem item;
+
+ public ItemTouchHandlerAdapter(FloatingItem item, ItemTouchHandler oldHandler) {
+ this.item = item;
+ this.oldHandler = oldHandler;
+ }
- @Override
- public void onTouch(Player player) {
- oldHandler.onTouch(item, player);
- }
+ @Override
+ public void onTouch(Player player) {
+ oldHandler.onTouch(item, player);
+ }
}
diff --git a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java
index 0b176794..cfc02c91 100644
--- a/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java
+++ b/legacy-v1/src/main/java/com/gmail/filoghost/holograms/api/adapter/PickupHandlerAdapter.java
@@ -21,17 +21,17 @@ import org.bukkit.entity.Player;
@SuppressWarnings("deprecation")
public class PickupHandlerAdapter implements me.filoghost.holographicdisplays.api.handler.PickupHandler {
- public PickupHandler oldHandler;
- private FloatingItem item;
-
- public PickupHandlerAdapter(FloatingItem item, PickupHandler oldPickupHandler) {
- this.item = item;
- this.oldHandler = oldPickupHandler;
- }
-
- @Override
- public void onPickup(Player player) {
- oldHandler.onPickup(item, player);
- }
+ public PickupHandler oldHandler;
+ private FloatingItem item;
+
+ public PickupHandlerAdapter(FloatingItem item, PickupHandler oldPickupHandler) {
+ this.item = item;
+ this.oldHandler = oldPickupHandler;
+ }
+
+ @Override
+ public void onPickup(Player player) {
+ oldHandler.onPickup(item, player);
+ }
}
diff --git a/legacy-v2/pom.xml b/legacy-v2/pom.xml
index e22c8f7c..4c49410e 100644
--- a/legacy-v2/pom.xml
+++ b/legacy-v2/pom.xml
@@ -1,39 +1,39 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-parent
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-parent
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-legacy-v2
- HolographicDisplays Legacy v2
+ holographicdisplays-legacy-v2
+ HolographicDisplays Legacy v2
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
-
-
- ${project.groupId}
- holographicdisplays-api
-
+
+
+ ${project.groupId}
+ holographicdisplays-api
+
-
- ${project.groupId}
- holographicdisplays-utils
-
+
+ ${project.groupId}
+ holographicdisplays-utils
+
-
- org.spigotmc
- spigot-api
-
-
+
+ org.spigotmc
+ spigot-api
+
+
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/Hologram.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/Hologram.java
index ba2f1794..2b3ca71b 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/Hologram.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/Hologram.java
@@ -27,70 +27,70 @@ import org.bukkit.inventory.ItemStack;
@Deprecated
public interface Hologram {
- @Deprecated
- public TextLine appendTextLine(String text);
+ @Deprecated
+ public TextLine appendTextLine(String text);
- @Deprecated
- public ItemLine appendItemLine(ItemStack itemStack);
-
- @Deprecated
- public TextLine insertTextLine(int index, String text);
+ @Deprecated
+ public ItemLine appendItemLine(ItemStack itemStack);
+
+ @Deprecated
+ public TextLine insertTextLine(int index, String text);
- @Deprecated
- public ItemLine insertItemLine(int index, ItemStack itemStack);
+ @Deprecated
+ public ItemLine insertItemLine(int index, ItemStack itemStack);
- @Deprecated
- public HologramLine getLine(int index);
-
- @Deprecated
- public void removeLine(int index);
+ @Deprecated
+ public HologramLine getLine(int index);
+
+ @Deprecated
+ public void removeLine(int index);
- @Deprecated
- public void clearLines();
+ @Deprecated
+ public void clearLines();
- @Deprecated
- public int size();
+ @Deprecated
+ public int size();
- @Deprecated
- public double getHeight();
+ @Deprecated
+ public double getHeight();
- @Deprecated
- public void teleport(Location location);
-
- @Deprecated
- public void teleport(World world, double x, double y, double z);
-
- @Deprecated
- public Location getLocation();
-
- @Deprecated
- public double getX();
+ @Deprecated
+ public void teleport(Location location);
+
+ @Deprecated
+ public void teleport(World world, double x, double y, double z);
+
+ @Deprecated
+ public Location getLocation();
+
+ @Deprecated
+ public double getX();
- @Deprecated
- public double getY();
+ @Deprecated
+ public double getY();
- @Deprecated
- public double getZ();
-
- @Deprecated
- public World getWorld();
+ @Deprecated
+ public double getZ();
+
+ @Deprecated
+ public World getWorld();
- @Deprecated
- public VisibilityManager getVisibilityManager();
+ @Deprecated
+ public VisibilityManager getVisibilityManager();
- @Deprecated
- public long getCreationTimestamp();
+ @Deprecated
+ public long getCreationTimestamp();
- @Deprecated
- public boolean isAllowPlaceholders();
+ @Deprecated
+ public boolean isAllowPlaceholders();
- @Deprecated
- public void setAllowPlaceholders(boolean allowPlaceholders);
-
- @Deprecated
- public void delete();
-
- @Deprecated
- public boolean isDeleted();
-
+ @Deprecated
+ public void setAllowPlaceholders(boolean allowPlaceholders);
+
+ @Deprecated
+ public void delete();
+
+ @Deprecated
+ public boolean isDeleted();
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/HologramsAPI.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/HologramsAPI.java
index 08650445..fda6bbf7 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/HologramsAPI.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/HologramsAPI.java
@@ -28,41 +28,41 @@ import java.util.Collection;
@Deprecated
public class HologramsAPI {
- private HologramsAPI() {}
+ private HologramsAPI() {}
- @Deprecated
- public static Hologram createHologram(Plugin plugin, Location source) {
- return BackendAPI.getImplementation().createHologram(plugin, source);
- }
+ @Deprecated
+ public static Hologram createHologram(Plugin plugin, Location source) {
+ return BackendAPI.getImplementation().createHologram(plugin, source);
+ }
- @Deprecated
- public static Collection getHolograms(Plugin plugin) {
- return BackendAPI.getImplementation().getHolograms(plugin);
- }
+ @Deprecated
+ public static Collection getHolograms(Plugin plugin) {
+ return BackendAPI.getImplementation().getHolograms(plugin);
+ }
- @Deprecated
- public static boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer) {
- return BackendAPI.getImplementation().registerPlaceholder(plugin, textPlaceholder, refreshRate, replacer);
- }
-
- @Deprecated
- public static Collection getRegisteredPlaceholders(Plugin plugin) {
- return BackendAPI.getImplementation().getRegisteredPlaceholders(plugin);
- }
+ @Deprecated
+ public static boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer) {
+ return BackendAPI.getImplementation().registerPlaceholder(plugin, textPlaceholder, refreshRate, replacer);
+ }
+
+ @Deprecated
+ public static Collection getRegisteredPlaceholders(Plugin plugin) {
+ return BackendAPI.getImplementation().getRegisteredPlaceholders(plugin);
+ }
- @Deprecated
- public static boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder) {
- return BackendAPI.getImplementation().unregisterPlaceholder(plugin, textPlaceholder);
- }
-
- @Deprecated
- public static void unregisterPlaceholders(Plugin plugin) {
- BackendAPI.getImplementation().unregisterPlaceholders(plugin);
- }
+ @Deprecated
+ public static boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder) {
+ return BackendAPI.getImplementation().unregisterPlaceholder(plugin, textPlaceholder);
+ }
+
+ @Deprecated
+ public static void unregisterPlaceholders(Plugin plugin) {
+ BackendAPI.getImplementation().unregisterPlaceholders(plugin);
+ }
- @Deprecated
- public static boolean isHologramEntity(Entity bukkitEntity) {
- return BackendAPI.getImplementation().isHologramEntity(bukkitEntity);
- }
+ @Deprecated
+ public static boolean isHologramEntity(Entity bukkitEntity) {
+ return BackendAPI.getImplementation().isHologramEntity(bukkitEntity);
+ }
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/VisibilityManager.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/VisibilityManager.java
index 951dd67b..069cfd74 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/VisibilityManager.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/VisibilityManager.java
@@ -22,25 +22,25 @@ import org.bukkit.entity.Player;
@Deprecated
public interface VisibilityManager {
- @Deprecated
- public boolean isVisibleByDefault();
-
- @Deprecated
- public void setVisibleByDefault(boolean visibleByDefault);
-
- @Deprecated
- public void showTo(Player player);
-
- @Deprecated
- public void hideTo(Player player);
-
- @Deprecated
- public boolean isVisibleTo(Player player);
-
- @Deprecated
- public void resetVisibility(Player player);
-
- @Deprecated
- public void resetVisibilityAll();
-
+ @Deprecated
+ public boolean isVisibleByDefault();
+
+ @Deprecated
+ public void setVisibleByDefault(boolean visibleByDefault);
+
+ @Deprecated
+ public void showTo(Player player);
+
+ @Deprecated
+ public void hideTo(Player player);
+
+ @Deprecated
+ public boolean isVisibleTo(Player player);
+
+ @Deprecated
+ public void resetVisibility(Player player);
+
+ @Deprecated
+ public void resetVisibilityAll();
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/PickupHandler.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/PickupHandler.java
index 3097d7e6..4a072678 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/PickupHandler.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/PickupHandler.java
@@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
@Deprecated
public interface PickupHandler {
- @Deprecated
- public void onPickup(Player player);
-
+ @Deprecated
+ public void onPickup(Player player);
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/TouchHandler.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/TouchHandler.java
index 5e04d0b7..31b88d47 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/TouchHandler.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/handler/TouchHandler.java
@@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
@Deprecated
public interface TouchHandler {
- @Deprecated
- public void onTouch(Player player);
-
+ @Deprecated
+ public void onTouch(Player player);
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/internal/BackendAPI.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/internal/BackendAPI.java
index f84ac212..c85ee249 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/internal/BackendAPI.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/internal/BackendAPI.java
@@ -27,42 +27,42 @@ import java.util.Collection;
*/
@Deprecated
public abstract class BackendAPI {
-
- private static BackendAPI implementation;
+
+ private static BackendAPI implementation;
- @Deprecated
- public static void setImplementation(BackendAPI implementation) {
- BackendAPI.implementation = implementation;
- }
+ @Deprecated
+ public static void setImplementation(BackendAPI implementation) {
+ BackendAPI.implementation = implementation;
+ }
- @Deprecated
- public static BackendAPI getImplementation() {
- if (implementation == null) {
- throw new IllegalStateException("No API implementation set. Is Holographic Displays enabled?");
- }
-
- return implementation;
- }
+ @Deprecated
+ public static BackendAPI getImplementation() {
+ if (implementation == null) {
+ throw new IllegalStateException("No API implementation set. Is Holographic Displays enabled?");
+ }
+
+ return implementation;
+ }
- @Deprecated
- public abstract Hologram createHologram(Plugin plugin, Location source);
+ @Deprecated
+ public abstract Hologram createHologram(Plugin plugin, Location source);
- @Deprecated
- public abstract Collection getHolograms(Plugin plugin);
+ @Deprecated
+ public abstract Collection getHolograms(Plugin plugin);
- @Deprecated
- public abstract boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer);
+ @Deprecated
+ public abstract boolean registerPlaceholder(Plugin plugin, String textPlaceholder, double refreshRate, PlaceholderReplacer replacer);
- @Deprecated
- public abstract Collection getRegisteredPlaceholders(Plugin plugin);
+ @Deprecated
+ public abstract Collection getRegisteredPlaceholders(Plugin plugin);
- @Deprecated
- public abstract boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder);
+ @Deprecated
+ public abstract boolean unregisterPlaceholder(Plugin plugin, String textPlaceholder);
- @Deprecated
- public abstract void unregisterPlaceholders(Plugin plugin);
+ @Deprecated
+ public abstract void unregisterPlaceholders(Plugin plugin);
- @Deprecated
- public abstract boolean isHologramEntity(Entity bukkitEntity);
+ @Deprecated
+ public abstract boolean isHologramEntity(Entity bukkitEntity);
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/CollectableLine.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/CollectableLine.java
index 2e3fc12a..9f4147c9 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/CollectableLine.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/CollectableLine.java
@@ -22,10 +22,10 @@ import com.gmail.filoghost.holographicdisplays.api.handler.PickupHandler;
@Deprecated
public interface CollectableLine extends HologramLine {
- @Deprecated
- public void setPickupHandler(PickupHandler pickupHandler);
-
- @Deprecated
- public PickupHandler getPickupHandler();
-
+ @Deprecated
+ public void setPickupHandler(PickupHandler pickupHandler);
+
+ @Deprecated
+ public PickupHandler getPickupHandler();
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/HologramLine.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/HologramLine.java
index ff59b7a0..bfaf20c9 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/HologramLine.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/HologramLine.java
@@ -22,10 +22,10 @@ import com.gmail.filoghost.holographicdisplays.api.Hologram;
@Deprecated
public interface HologramLine {
- @Deprecated
- public Hologram getParent();
-
- @Deprecated
- public void removeLine();
+ @Deprecated
+ public Hologram getParent();
+
+ @Deprecated
+ public void removeLine();
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/ItemLine.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/ItemLine.java
index ae91b116..2287dce2 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/ItemLine.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/ItemLine.java
@@ -22,10 +22,10 @@ import org.bukkit.inventory.ItemStack;
@Deprecated
public interface ItemLine extends CollectableLine, TouchableLine {
- @Deprecated
- public ItemStack getItemStack();
+ @Deprecated
+ public ItemStack getItemStack();
- @Deprecated
- public void setItemStack(ItemStack itemStack);
-
+ @Deprecated
+ public void setItemStack(ItemStack itemStack);
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TextLine.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TextLine.java
index bef1460e..35e704e5 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TextLine.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TextLine.java
@@ -20,10 +20,10 @@ package com.gmail.filoghost.holographicdisplays.api.line;
@Deprecated
public interface TextLine extends TouchableLine {
- @Deprecated
- public String getText();
-
- @Deprecated
- public void setText(String text);
-
+ @Deprecated
+ public String getText();
+
+ @Deprecated
+ public void setText(String text);
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TouchableLine.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TouchableLine.java
index e9a3c81c..25a6f3cb 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TouchableLine.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/line/TouchableLine.java
@@ -22,10 +22,10 @@ import com.gmail.filoghost.holographicdisplays.api.handler.TouchHandler;
@Deprecated
public interface TouchableLine extends HologramLine {
- @Deprecated
- public void setTouchHandler(TouchHandler touchHandler);
-
- @Deprecated
- public TouchHandler getTouchHandler();
-
+ @Deprecated
+ public void setTouchHandler(TouchHandler touchHandler);
+
+ @Deprecated
+ public TouchHandler getTouchHandler();
+
}
diff --git a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java
index 72a364a4..9a74aade 100644
--- a/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java
+++ b/legacy-v2/src/main/java/com/gmail/filoghost/holographicdisplays/api/placeholder/PlaceholderReplacer.java
@@ -20,7 +20,7 @@ package com.gmail.filoghost.holographicdisplays.api.placeholder;
@Deprecated
public interface PlaceholderReplacer {
- @Deprecated
- public String update();
-
+ @Deprecated
+ public String update();
+
}
diff --git a/nms/interfaces/pom.xml b/nms/interfaces/pom.xml
index 7a15f4b0..bc9fff05 100644
--- a/nms/interfaces/pom.xml
+++ b/nms/interfaces/pom.xml
@@ -1,33 +1,33 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-nms
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-nms
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-nms-interfaces
- HolographicDisplays NMS Interfaces
+ holographicdisplays-nms-interfaces
+ HolographicDisplays NMS Interfaces
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
-
-
- ${project.groupId}
- holographicdisplays-api
-
-
-
- org.spigotmc
- spigot-api
-
-
-
\ No newline at end of file
+
+
+ ${project.groupId}
+ holographicdisplays-api
+
+
+
+ org.spigotmc
+ spigot-api
+
+
+
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ChatComponentAdapter.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ChatComponentAdapter.java
index dca1429d..0133de63 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ChatComponentAdapter.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ChatComponentAdapter.java
@@ -17,19 +17,19 @@ package me.filoghost.holographicdisplays.nms.interfaces;
import java.util.List;
public interface ChatComponentAdapter {
-
- T cast(Object chatComponentObject);
-
- String getText(T chatComponent);
-
- List getSiblings(T chatComponent);
-
- void addSibling(T chatComponent, T newSibling);
-
- default T cloneComponent(T chatComponent) {
- return cloneComponent(chatComponent, getText(chatComponent));
- }
-
- T cloneComponent(T chatComponent, String newText);
-
-}
\ No newline at end of file
+
+ T cast(Object chatComponentObject);
+
+ String getText(T chatComponent);
+
+ List getSiblings(T chatComponent);
+
+ void addSibling(T chatComponent, T newSibling);
+
+ default T cloneComponent(T chatComponent) {
+ return cloneComponent(chatComponent, getText(chatComponent));
+ }
+
+ T cloneComponent(T chatComponent, String newText);
+
+}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/CustomNameHelper.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/CustomNameHelper.java
index 34e8b4fa..116cecc6 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/CustomNameHelper.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/CustomNameHelper.java
@@ -17,64 +17,64 @@ package me.filoghost.holographicdisplays.nms.interfaces;
import java.util.List;
public class CustomNameHelper {
-
-
- public static String replaceCustomNameString(Object customNameObject, String target, String replacement) {
- String customName = (String) customNameObject;
- if (customName.contains(target)) {
- return customName.replace(target, replacement);
- } else {
- return customName;
- }
- }
-
- public static T replaceCustomNameChatComponent(ChatComponentAdapter versionAdapter, Object customNameObject, String target, String replacement) {
- // Custom name is expected to be a ChatComponentText with empty text and child components (called "siblings") that do not contain more components.
- T rootComponent = versionAdapter.cast(customNameObject);
- if (!versionAdapter.getText(rootComponent).isEmpty()) {
- throw new IllegalArgumentException("Expected root component with empty text");
- }
-
- boolean[] childrenContainingTarget = null;
- List children = versionAdapter.getSiblings(rootComponent);
- int childrenSize = children.size();
-
- for (int i = 0; i < childrenSize; i++) {
- T childComponent = versionAdapter.cast(children.get(i));
+
+
+ public static String replaceCustomNameString(Object customNameObject, String target, String replacement) {
+ String customName = (String) customNameObject;
+ if (customName.contains(target)) {
+ return customName.replace(target, replacement);
+ } else {
+ return customName;
+ }
+ }
+
+ public static T replaceCustomNameChatComponent(ChatComponentAdapter versionAdapter, Object customNameObject, String target, String replacement) {
+ // Custom name is expected to be a ChatComponentText with empty text and child components (called "siblings") that do not contain more components.
+ T rootComponent = versionAdapter.cast(customNameObject);
+ if (!versionAdapter.getText(rootComponent).isEmpty()) {
+ throw new IllegalArgumentException("Expected root component with empty text");
+ }
+
+ boolean[] childrenContainingTarget = null;
+ List children = versionAdapter.getSiblings(rootComponent);
+ int childrenSize = children.size();
+
+ for (int i = 0; i < childrenSize; i++) {
+ T childComponent = versionAdapter.cast(children.get(i));
- if (!versionAdapter.getSiblings(childComponent).isEmpty()) {
- throw new IllegalArgumentException("Expected child component without sub-nodes");
- }
-
- if (versionAdapter.getText(childComponent).contains(target)) {
- // Lazy initialization for performance, since this method can be called frequently.
- if (childrenContainingTarget == null) {
- childrenContainingTarget = new boolean[childrenSize];
- }
- childrenContainingTarget[i] = true;
- }
- }
-
- if (childrenContainingTarget == null) {
- // No match found, return original unmodified object.
- return rootComponent;
- }
-
- // Clone all the objects and apply replacements where needed.
- T clonedRoot = versionAdapter.cloneComponent(rootComponent);
- for (int i = 0; i < childrenSize; i++) {
- T childComponent = children.get(i);
-
- String newText = versionAdapter.getText(childComponent);
- if (childrenContainingTarget[i]) {
- newText = newText.replace(target, replacement);
- }
-
- T clonedChild = versionAdapter.cloneComponent(childComponent, newText);
- versionAdapter.addSibling(clonedRoot, clonedChild);
- }
-
- return clonedRoot;
- }
+ if (!versionAdapter.getSiblings(childComponent).isEmpty()) {
+ throw new IllegalArgumentException("Expected child component without sub-nodes");
+ }
+
+ if (versionAdapter.getText(childComponent).contains(target)) {
+ // Lazy initialization for performance, since this method can be called frequently.
+ if (childrenContainingTarget == null) {
+ childrenContainingTarget = new boolean[childrenSize];
+ }
+ childrenContainingTarget[i] = true;
+ }
+ }
+
+ if (childrenContainingTarget == null) {
+ // No match found, return original unmodified object.
+ return rootComponent;
+ }
+
+ // Clone all the objects and apply replacements where needed.
+ T clonedRoot = versionAdapter.cloneComponent(rootComponent);
+ for (int i = 0; i < childrenSize; i++) {
+ T childComponent = children.get(i);
+
+ String newText = versionAdapter.getText(childComponent);
+ if (childrenContainingTarget[i]) {
+ newText = newText.replace(target, replacement);
+ }
+
+ T clonedChild = versionAdapter.cloneComponent(childComponent, newText);
+ versionAdapter.addSibling(clonedRoot, clonedChild);
+ }
+
+ return clonedRoot;
+ }
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ItemPickupManager.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ItemPickupManager.java
index 4c9aa037..12f36b56 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ItemPickupManager.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/ItemPickupManager.java
@@ -20,6 +20,6 @@ import org.bukkit.entity.Player;
public interface ItemPickupManager {
- public void handleItemLinePickup(Player player, PickupHandler pickupHandler, Hologram hologram);
-
+ public void handleItemLinePickup(Player player, PickupHandler pickupHandler, Hologram hologram);
+
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/NMSManager.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/NMSManager.java
index a2041da6..ae8ae4d0 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/NMSManager.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/NMSManager.java
@@ -24,22 +24,22 @@ import org.bukkit.World;
import org.bukkit.inventory.ItemStack;
public interface NMSManager {
-
- // A method to register all the custom entities of the plugin, it may fail.
- public void setup() throws Exception;
-
- public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, HologramLine parentPiece, boolean broadcastLocationPacket);
-
- public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, ItemLine parentPiece, ItemStack stack, ItemPickupManager itemPickupManager);
-
- public NMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, HologramLine parentPiece);
-
- public boolean isNMSEntityBase(org.bukkit.entity.Entity bukkitEntity);
+
+ // A method to register all the custom entities of the plugin, it may fail.
+ public void setup() throws Exception;
+
+ public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, HologramLine parentPiece, boolean broadcastLocationPacket);
+
+ public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, ItemLine parentPiece, ItemStack stack, ItemPickupManager itemPickupManager);
+
+ public NMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, HologramLine parentPiece);
+
+ public boolean isNMSEntityBase(org.bukkit.entity.Entity bukkitEntity);
- public NMSEntityBase getNMSEntityBase(org.bukkit.entity.Entity bukkitEntity);
+ public NMSEntityBase getNMSEntityBase(org.bukkit.entity.Entity bukkitEntity);
- public NMSEntityBase getNMSEntityBaseFromID(World bukkitWorld, int entityID);
+ public NMSEntityBase getNMSEntityBaseFromID(World bukkitWorld, int entityID);
- public Object replaceCustomNameText(Object customNameObject, String target, String replacement);
+ public Object replaceCustomNameText(Object customNameObject, String target, String replacement);
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSArmorStand.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSArmorStand.java
index 96588be2..4cd9659d 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSArmorStand.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSArmorStand.java
@@ -15,8 +15,8 @@
package me.filoghost.holographicdisplays.nms.interfaces.entity;
public interface NMSArmorStand extends NMSNameable {
-
- // Sets the location through NMS and optionally broadcast an additional teleport packet containing the location.
- public void setLocationNMS(double x, double y, double z, boolean broadcastLocationPacket);
+
+ // Sets the location through NMS and optionally broadcast an additional teleport packet containing the location.
+ public void setLocationNMS(double x, double y, double z, boolean broadcastLocationPacket);
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSCanMount.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSCanMount.java
index feb8f538..cd60d6b0 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSCanMount.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSCanMount.java
@@ -15,8 +15,8 @@
package me.filoghost.holographicdisplays.nms.interfaces.entity;
public interface NMSCanMount extends NMSEntityBase {
-
- // Sets the passenger of this entity through NMS.
- public void setPassengerOfNMS(NMSEntityBase vehicleBase);
-
+
+ // Sets the passenger of this entity through NMS.
+ public void setPassengerOfNMS(NMSEntityBase vehicleBase);
+
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSEntityBase.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSEntityBase.java
index 34cdc313..74b1e157 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSEntityBase.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSEntityBase.java
@@ -20,20 +20,20 @@ import me.filoghost.holographicdisplays.api.line.HologramLine;
* An interface to represent a custom NMS entity being part of a hologram.
*/
public interface NMSEntityBase {
-
- // Returns the linked CraftHologramLine, all the entities are part of a piece. Should never be null.
- public HologramLine getHologramLine();
-
- // Returns if the entity is dead through NMS.
- public boolean isDeadNMS();
-
- // Kills the entity through NMS.
- public void killEntityNMS();
-
- // The entity ID.
- public int getIdNMS();
-
- // Returns the bukkit entity.
- public org.bukkit.entity.Entity getBukkitEntityNMS();
+
+ // Returns the linked CraftHologramLine, all the entities are part of a piece. Should never be null.
+ public HologramLine getHologramLine();
+
+ // Returns if the entity is dead through NMS.
+ public boolean isDeadNMS();
+
+ // Kills the entity through NMS.
+ public void killEntityNMS();
+
+ // The entity ID.
+ public int getIdNMS();
+
+ // Returns the bukkit entity.
+ public org.bukkit.entity.Entity getBukkitEntityNMS();
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSItem.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSItem.java
index 13b25438..26add5d6 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSItem.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSItem.java
@@ -17,17 +17,17 @@ package me.filoghost.holographicdisplays.nms.interfaces.entity;
import org.bukkit.inventory.ItemStack;
public interface NMSItem extends NMSEntityBase, NMSCanMount {
-
- // Sets the location through NMS.
- public void setLocationNMS(double x, double y, double z);
-
- // Sets the bukkit ItemStack for this item.
- public void setItemStackNMS(ItemStack stack);
-
- // Sets if this item can be picked up by players.
- public void allowPickup(boolean pickup);
-
- // The raw NMS ItemStack object.
- public Object getRawItemStack();
-
+
+ // Sets the location through NMS.
+ public void setLocationNMS(double x, double y, double z);
+
+ // Sets the bukkit ItemStack for this item.
+ public void setItemStackNMS(ItemStack stack);
+
+ // Sets if this item can be picked up by players.
+ public void allowPickup(boolean pickup);
+
+ // The raw NMS ItemStack object.
+ public Object getRawItemStack();
+
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSNameable.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSNameable.java
index b6e4c7fb..5660fb9b 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSNameable.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSNameable.java
@@ -15,14 +15,14 @@
package me.filoghost.holographicdisplays.nms.interfaces.entity;
public interface NMSNameable extends NMSEntityBase {
-
- // Sets a custom name as a String.
- public void setCustomNameNMS(String name);
-
- // Returns the custom name as a String.
- public String getCustomNameStringNMS();
+
+ // Sets a custom name as a String.
+ public void setCustomNameNMS(String name);
+
+ // Returns the custom name as a String.
+ public String getCustomNameStringNMS();
- // Returns the custom name as version-dependent NMS object (String for MC 1.12 and below, ChatComponent for MC 1.13+ a ChatComponent).
- public Object getCustomNameObjectNMS();
-
+ // Returns the custom name as version-dependent NMS object (String for MC 1.12 and below, ChatComponent for MC 1.13+ a ChatComponent).
+ public Object getCustomNameObjectNMS();
+
}
diff --git a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSSlime.java b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSSlime.java
index 38f31476..89e15592 100644
--- a/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSSlime.java
+++ b/nms/interfaces/src/main/java/me/filoghost/holographicdisplays/nms/interfaces/entity/NMSSlime.java
@@ -15,8 +15,8 @@
package me.filoghost.holographicdisplays.nms.interfaces.entity;
public interface NMSSlime extends NMSEntityBase, NMSCanMount {
-
- // Sets the location through NMS.
- public void setLocationNMS(double x, double y, double z);
-
+
+ // Sets the location through NMS.
+ public void setLocationNMS(double x, double y, double z);
+
}
diff --git a/nms/pom.xml b/nms/pom.xml
index f9887807..6f02bde7 100644
--- a/nms/pom.xml
+++ b/nms/pom.xml
@@ -1,34 +1,34 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-parent
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-parent
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-nms
- HolographicDisplays NMS
- pom
+ holographicdisplays-nms
+ HolographicDisplays NMS
+ pom
-
- interfaces
- v1_8_r2
- v1_8_r3
- v1_9_r1
- v1_9_r2
- v1_10_r1
- v1_11_r1
- v1_12_r1
- v1_13_r1
- v1_13_r2
- v1_14_r1
- v1_15_r1
- v1_16_r1
- v1_16_r2
- v1_16_r3
-
+
+ interfaces
+ v1_8_r2
+ v1_8_r3
+ v1_9_r1
+ v1_9_r2
+ v1_10_r1
+ v1_11_r1
+ v1_12_r1
+ v1_13_r1
+ v1_13_r2
+ v1_14_r1
+ v1_15_r1
+ v1_16_r1
+ v1_16_r2
+ v1_16_r3
+
diff --git a/nms/v1_10_r1/pom.xml b/nms/v1_10_r1/pom.xml
index b13deeac..4980185c 100644
--- a/nms/v1_10_r1/pom.xml
+++ b/nms/v1_10_r1/pom.xml
@@ -1,41 +1,41 @@
- 4.0.0
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
-
- me.filoghost.holographicdisplays
- holographicdisplays-nms
- 3.0.0-SNAPSHOT
-
+
+ me.filoghost.holographicdisplays
+ holographicdisplays-nms
+ 3.0.0-SNAPSHOT
+
- holographicdisplays-nms-v1_10_r1
- HolographicDisplays NMS v1_10_R1
+ holographicdisplays-nms-v1_10_r1
+ HolographicDisplays NMS v1_10_R1
-
-
- nms-repo
- https://repo.codemc.io/repository/nms/
-
-
+
+
+ nms-repo
+ https://repo.codemc.io/repository/nms/
+
+
-
-
- ${project.groupId}
- holographicdisplays-nms-interfaces
-
-
-
- ${project.groupId}
- holographicdisplays-utils
-
-
-
- org.spigotmc
- spigot
- 1.10.2-R0.1-SNAPSHOT
- provided
-
-
+
+
+ ${project.groupId}
+ holographicdisplays-nms-interfaces
+
+
+
+ ${project.groupId}
+ holographicdisplays-utils
+
+
+
+ org.spigotmc
+ spigot
+ 1.10.2-R0.1-SNAPSHOT
+ provided
+
+
-
\ No newline at end of file
+
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java
index 93f3602f..5573e233 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java
@@ -29,64 +29,64 @@ import java.util.Collection;
public class CraftNMSArmorStand extends CraftArmorStand {
- public CraftNMSArmorStand(CraftServer server, EntityNMSArmorStand entity) {
- super(server, entity);
- }
-
- // Disallow all the bukkit methods.
-
- @Override
- public void remove() {
- // Cannot be removed, this is the most important to override.
- }
+ public CraftNMSArmorStand(CraftServer server, EntityNMSArmorStand entity) {
+ super(server, entity);
+ }
+
+ // Disallow all the bukkit methods.
+
+ @Override
+ public void remove() {
+ // Cannot be removed, this is the most important to override.
+ }
- // Methods from Armor stand class
- @Override public void setArms(boolean arms) { }
- @Override public void setBasePlate(boolean basePlate) { }
- @Override public void setBodyPose(EulerAngle pose) { }
- @Override public void setBoots(ItemStack item) { }
- @Override public void setChestplate(ItemStack item) { }
- @Override public void setHeadPose(EulerAngle pose) { }
- @Override public void setHelmet(ItemStack item) { }
- @Override public void setItemInHand(ItemStack item) { }
- @Override public void setLeftArmPose(EulerAngle pose) { }
- @Override public void setLeftLegPose(EulerAngle pose) { }
- @Override public void setLeggings(ItemStack item) { }
- @Override public void setRightArmPose(EulerAngle pose) { }
- @Override public void setRightLegPose(EulerAngle pose) { }
- @Override public void setSmall(boolean small) { }
- @Override public void setVisible(boolean visible) { }
- @Override public void setMarker(boolean marker) { }
+ // Methods from Armor stand class
+ @Override public void setArms(boolean arms) { }
+ @Override public void setBasePlate(boolean basePlate) { }
+ @Override public void setBodyPose(EulerAngle pose) { }
+ @Override public void setBoots(ItemStack item) { }
+ @Override public void setChestplate(ItemStack item) { }
+ @Override public void setHeadPose(EulerAngle pose) { }
+ @Override public void setHelmet(ItemStack item) { }
+ @Override public void setItemInHand(ItemStack item) { }
+ @Override public void setLeftArmPose(EulerAngle pose) { }
+ @Override public void setLeftLegPose(EulerAngle pose) { }
+ @Override public void setLeggings(ItemStack item) { }
+ @Override public void setRightArmPose(EulerAngle pose) { }
+ @Override public void setRightLegPose(EulerAngle pose) { }
+ @Override public void setSmall(boolean small) { }
+ @Override public void setVisible(boolean visible) { }
+ @Override public void setMarker(boolean marker) { }
- // Methods from LivingEntity class
- @Override public boolean addPotionEffect(PotionEffect effect) { return false; }
- @Override public boolean addPotionEffect(PotionEffect effect, boolean param) { return false; }
- @Override public boolean addPotionEffects(Collection effects) { return false; }
- @Override public void setRemoveWhenFarAway(boolean remove) { }
- @Override public void setAI(boolean ai) { }
- @Override public void setCanPickupItems(boolean pickup) { }
- @Override public void setCollidable(boolean collidable) { }
- @Override public void setGliding(boolean gliding) { }
- @Override public boolean setLeashHolder(Entity holder) { return false; }
-
- // Methods from Entity
- @Override public void setVelocity(Vector vel) { }
- @Override public boolean teleport(Location loc) { return false; }
- @Override public boolean teleport(Entity entity) { return false; }
- @Override public boolean teleport(Location loc, TeleportCause cause) { return false; }
- @Override public boolean teleport(Entity entity, TeleportCause cause) { return false; }
- @Override public void setFireTicks(int ticks) { }
- @Override public boolean setPassenger(Entity entity) { return false; }
- @Override public boolean eject() { return false; }
- @Override public boolean leaveVehicle() { return false; }
- @Override public void playEffect(EntityEffect effect) { }
- @Override public void setCustomName(String name) { }
- @Override public void setCustomNameVisible(boolean flag) { }
- @Override public void setGlowing(boolean flag) { }
- @Override public void setGravity(boolean gravity) { }
- @Override public void setInvulnerable(boolean flag) { }
- @Override public void setMomentum(Vector value) { }
- @Override public void setSilent(boolean flag) { }
- @Override public void setTicksLived(int value) { }
-
+ // Methods from LivingEntity class
+ @Override public boolean addPotionEffect(PotionEffect effect) { return false; }
+ @Override public boolean addPotionEffect(PotionEffect effect, boolean param) { return false; }
+ @Override public boolean addPotionEffects(Collection effects) { return false; }
+ @Override public void setRemoveWhenFarAway(boolean remove) { }
+ @Override public void setAI(boolean ai) { }
+ @Override public void setCanPickupItems(boolean pickup) { }
+ @Override public void setCollidable(boolean collidable) { }
+ @Override public void setGliding(boolean gliding) { }
+ @Override public boolean setLeashHolder(Entity holder) { return false; }
+
+ // Methods from Entity
+ @Override public void setVelocity(Vector vel) { }
+ @Override public boolean teleport(Location loc) { return false; }
+ @Override public boolean teleport(Entity entity) { return false; }
+ @Override public boolean teleport(Location loc, TeleportCause cause) { return false; }
+ @Override public boolean teleport(Entity entity, TeleportCause cause) { return false; }
+ @Override public void setFireTicks(int ticks) { }
+ @Override public boolean setPassenger(Entity entity) { return false; }
+ @Override public boolean eject() { return false; }
+ @Override public boolean leaveVehicle() { return false; }
+ @Override public void playEffect(EntityEffect effect) { }
+ @Override public void setCustomName(String name) { }
+ @Override public void setCustomNameVisible(boolean flag) { }
+ @Override public void setGlowing(boolean flag) { }
+ @Override public void setGravity(boolean gravity) { }
+ @Override public void setInvulnerable(boolean flag) { }
+ @Override public void setMomentum(Vector value) { }
+ @Override public void setSilent(boolean flag) { }
+ @Override public void setTicksLived(int value) { }
+
}
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java
index 4abc4445..533ad6c2 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java
@@ -25,39 +25,39 @@ import org.bukkit.util.Vector;
public class CraftNMSItem extends CraftItem {
- public CraftNMSItem(CraftServer server, EntityNMSItem entity) {
- super(server, entity);
- }
+ public CraftNMSItem(CraftServer server, EntityNMSItem entity) {
+ super(server, entity);
+ }
- // Disallow all the bukkit methods.
-
- @Override
- public void remove() {
- // Cannot be removed, this is the most important to override.
- }
+ // Disallow all the bukkit methods.
+
+ @Override
+ public void remove() {
+ // Cannot be removed, this is the most important to override.
+ }
- // Methods from Entity
- @Override public void setVelocity(Vector vel) { }
- @Override public boolean teleport(Location loc) { return false; }
- @Override public boolean teleport(Entity entity) { return false; }
- @Override public boolean teleport(Location loc, TeleportCause cause) { return false; }
- @Override public boolean teleport(Entity entity, TeleportCause cause) { return false; }
- @Override public void setFireTicks(int ticks) { }
- @Override public boolean setPassenger(Entity entity) { return false; }
- @Override public boolean eject() { return false; }
- @Override public boolean leaveVehicle() { return false; }
- @Override public void playEffect(EntityEffect effect) { }
- @Override public void setCustomName(String name) { }
- @Override public void setCustomNameVisible(boolean flag) { }
- @Override public void setGlowing(boolean flag) { }
- @Override public void setGravity(boolean gravity) { }
- @Override public void setInvulnerable(boolean flag) { }
- @Override public void setMomentum(Vector value) { }
- @Override public void setSilent(boolean flag) { }
- @Override public void setTicksLived(int value) { }
-
- // Methods from Item
- @Override public void setItemStack(ItemStack stack) { }
- @Override public void setPickupDelay(int delay) { }
-
+ // Methods from Entity
+ @Override public void setVelocity(Vector vel) { }
+ @Override public boolean teleport(Location loc) { return false; }
+ @Override public boolean teleport(Entity entity) { return false; }
+ @Override public boolean teleport(Location loc, TeleportCause cause) { return false; }
+ @Override public boolean teleport(Entity entity, TeleportCause cause) { return false; }
+ @Override public void setFireTicks(int ticks) { }
+ @Override public boolean setPassenger(Entity entity) { return false; }
+ @Override public boolean eject() { return false; }
+ @Override public boolean leaveVehicle() { return false; }
+ @Override public void playEffect(EntityEffect effect) { }
+ @Override public void setCustomName(String name) { }
+ @Override public void setCustomNameVisible(boolean flag) { }
+ @Override public void setGlowing(boolean flag) { }
+ @Override public void setGravity(boolean gravity) { }
+ @Override public void setInvulnerable(boolean flag) { }
+ @Override public void setMomentum(Vector value) { }
+ @Override public void setSilent(boolean flag) { }
+ @Override public void setTicksLived(int value) { }
+
+ // Methods from Item
+ @Override public void setItemStack(ItemStack stack) { }
+ @Override public void setPickupDelay(int delay) { }
+
}
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java
index 6382f8f4..69a887ab 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java
@@ -27,49 +27,49 @@ import java.util.Collection;
public class CraftNMSSlime extends CraftSlime {
- public CraftNMSSlime(CraftServer server, EntityNMSSlime entity) {
- super(server, entity);
- }
-
- // Disallow all the bukkit methods.
-
- @Override
- public void remove() {
- // Cannot be removed, this is the most important to override.
- }
-
- // Methods from LivingEntity class
- @Override public boolean addPotionEffect(PotionEffect effect) { return false; }
- @Override public boolean addPotionEffect(PotionEffect effect, boolean param) { return false; }
- @Override public boolean addPotionEffects(Collection effects) { return false; }
- @Override public void setRemoveWhenFarAway(boolean remove) { }
- @Override public void setAI(boolean ai) { }
- @Override public void setCanPickupItems(boolean pickup) { }
- @Override public void setCollidable(boolean collidable) { }
- @Override public void setGliding(boolean gliding) { }
- @Override public boolean setLeashHolder(Entity holder) { return false; }
+ public CraftNMSSlime(CraftServer server, EntityNMSSlime entity) {
+ super(server, entity);
+ }
+
+ // Disallow all the bukkit methods.
+
+ @Override
+ public void remove() {
+ // Cannot be removed, this is the most important to override.
+ }
+
+ // Methods from LivingEntity class
+ @Override public boolean addPotionEffect(PotionEffect effect) { return false; }
+ @Override public boolean addPotionEffect(PotionEffect effect, boolean param) { return false; }
+ @Override public boolean addPotionEffects(Collection effects) { return false; }
+ @Override public void setRemoveWhenFarAway(boolean remove) { }
+ @Override public void setAI(boolean ai) { }
+ @Override public void setCanPickupItems(boolean pickup) { }
+ @Override public void setCollidable(boolean collidable) { }
+ @Override public void setGliding(boolean gliding) { }
+ @Override public boolean setLeashHolder(Entity holder) { return false; }
- // Methods from Entity
- @Override public void setVelocity(Vector vel) { }
- @Override public boolean teleport(Location loc) { return false; }
- @Override public boolean teleport(Entity entity) { return false; }
- @Override public boolean teleport(Location loc, TeleportCause cause) { return false; }
- @Override public boolean teleport(Entity entity, TeleportCause cause) { return false; }
- @Override public void setFireTicks(int ticks) { }
- @Override public boolean setPassenger(Entity entity) { return false; }
- @Override public boolean eject() { return false; }
- @Override public boolean leaveVehicle() { return false; }
- @Override public void playEffect(EntityEffect effect) { }
- @Override public void setCustomName(String name) { }
- @Override public void setCustomNameVisible(boolean flag) { }
- @Override public void setGlowing(boolean flag) { }
- @Override public void setGravity(boolean gravity) { }
- @Override public void setInvulnerable(boolean flag) { }
- @Override public void setMomentum(Vector value) { }
- @Override public void setSilent(boolean flag) { }
- @Override public void setTicksLived(int value) { }
+ // Methods from Entity
+ @Override public void setVelocity(Vector vel) { }
+ @Override public boolean teleport(Location loc) { return false; }
+ @Override public boolean teleport(Entity entity) { return false; }
+ @Override public boolean teleport(Location loc, TeleportCause cause) { return false; }
+ @Override public boolean teleport(Entity entity, TeleportCause cause) { return false; }
+ @Override public void setFireTicks(int ticks) { }
+ @Override public boolean setPassenger(Entity entity) { return false; }
+ @Override public boolean eject() { return false; }
+ @Override public boolean leaveVehicle() { return false; }
+ @Override public void playEffect(EntityEffect effect) { }
+ @Override public void setCustomName(String name) { }
+ @Override public void setCustomNameVisible(boolean flag) { }
+ @Override public void setGlowing(boolean flag) { }
+ @Override public void setGravity(boolean gravity) { }
+ @Override public void setInvulnerable(boolean flag) { }
+ @Override public void setMomentum(Vector value) { }
+ @Override public void setSilent(boolean flag) { }
+ @Override public void setTicksLived(int value) { }
- // Methods from Slime
- @Override public void setSize(int size) { }
-
+ // Methods from Slime
+ @Override public void setSize(int size) { }
+
}
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java
index de04f83e..59263276 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java
@@ -35,208 +35,208 @@ import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
- private HologramLine parentPiece;
- private String customName;
-
- public EntityNMSArmorStand(World world, HologramLine parentPiece) {
- super(world);
- super.setInvisible(true);
- super.setSmall(true);
- super.setArms(false);
- super.setNoGravity(true);
- super.setBasePlate(true);
- super.setMarker(true);
- super.collides = false;
- this.parentPiece = parentPiece;
- forceSetBoundingBox(new NullBoundingBox());
-
- this.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet.
- }
-
- @Override
- public void m() {
- // Disable normal ticking for this entity.
-
- // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity.
- if (this.onGround) {
- this.onGround = false;
- }
- }
-
- @Override
- public void inactiveTick() {
- // Disable normal ticking for this entity.
-
- // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity.
- if (this.onGround) {
- this.onGround = false;
- }
- }
-
- @Override
- public void b(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- }
-
- @Override
- public boolean c(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return false;
- }
+ private HologramLine parentPiece;
+ private String customName;
+
+ public EntityNMSArmorStand(World world, HologramLine parentPiece) {
+ super(world);
+ super.setInvisible(true);
+ super.setSmall(true);
+ super.setArms(false);
+ super.setNoGravity(true);
+ super.setBasePlate(true);
+ super.setMarker(true);
+ super.collides = false;
+ this.parentPiece = parentPiece;
+ forceSetBoundingBox(new NullBoundingBox());
+
+ this.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet.
+ }
+
+ @Override
+ public void m() {
+ // Disable normal ticking for this entity.
+
+ // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity.
+ if (this.onGround) {
+ this.onGround = false;
+ }
+ }
+
+ @Override
+ public void inactiveTick() {
+ // Disable normal ticking for this entity.
+
+ // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity.
+ if (this.onGround) {
+ this.onGround = false;
+ }
+ }
+
+ @Override
+ public void b(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ }
+
+ @Override
+ public boolean c(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return false;
+ }
- @Override
- public boolean d(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return false;
- }
-
- @Override
- public NBTTagCompound e(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return nbttagcompound;
- }
-
- @Override
- public void f(NBTTagCompound nbttagcompound) {
- // Do not load NBT.
- }
-
- @Override
- public void a(NBTTagCompound nbttagcompound) {
- // Do not load NBT.
- }
-
- @Override
- public boolean isInvulnerable(DamageSource source) {
- /*
- * The field Entity.invulnerable is private.
- * It's only used while saving NBTTags, but since the entity would be killed
- * on chunk unload, we prefer to override isInvulnerable().
- */
- return true;
- }
-
- @Override
- public boolean isCollidable() {
- return false;
- }
-
- @Override
- public void setCustomName(String customName) {
- // Locks the custom name.
- }
-
- @Override
- public void setCustomNameVisible(boolean visible) {
- // Locks the custom name.
- }
+ @Override
+ public boolean d(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return false;
+ }
+
+ @Override
+ public NBTTagCompound e(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return nbttagcompound;
+ }
+
+ @Override
+ public void f(NBTTagCompound nbttagcompound) {
+ // Do not load NBT.
+ }
+
+ @Override
+ public void a(NBTTagCompound nbttagcompound) {
+ // Do not load NBT.
+ }
+
+ @Override
+ public boolean isInvulnerable(DamageSource source) {
+ /*
+ * The field Entity.invulnerable is private.
+ * It's only used while saving NBTTags, but since the entity would be killed
+ * on chunk unload, we prefer to override isInvulnerable().
+ */
+ return true;
+ }
+
+ @Override
+ public boolean isCollidable() {
+ return false;
+ }
+
+ @Override
+ public void setCustomName(String customName) {
+ // Locks the custom name.
+ }
+
+ @Override
+ public void setCustomNameVisible(boolean visible) {
+ // Locks the custom name.
+ }
- @Override
- public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) {
- // Prevent stand being equipped
- return EnumInteractionResult.PASS;
- }
+ @Override
+ public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) {
+ // Prevent stand being equipped
+ return EnumInteractionResult.PASS;
+ }
- @Override
- public boolean c(int i, ItemStack item) {
- // Prevent stand being equipped
- return false;
- }
+ @Override
+ public boolean c(int i, ItemStack item) {
+ // Prevent stand being equipped
+ return false;
+ }
- @Override
- public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
- // Prevent stand being equipped
- }
-
- @Override
- public void a(AxisAlignedBB boundingBox) {
- // Do not change it!
- }
-
- public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
- super.a(boundingBox);
- }
-
- @Override
- public void a(SoundEffect soundeffect, float f, float f1) {
- // Remove sounds.
- }
-
- @Override
- public void setCustomNameNMS(String name) {
- this.customName = Utils.limitLength(name, 300);
- super.setCustomName(customName);
- super.setCustomNameVisible(customName != null && !customName.isEmpty());
- }
-
- @Override
- public String getCustomNameStringNMS() {
- return this.customName;
- }
-
- @Override
- public Object getCustomNameObjectNMS() {
- return super.getCustomName();
- }
-
- @Override
- public void die() {
- // Prevent being killed.
- }
-
- @Override
- public CraftEntity getBukkitEntity() {
- if (super.bukkitEntity == null) {
- super.bukkitEntity = new CraftNMSArmorStand(super.world.getServer(), this);
- }
- return super.bukkitEntity;
- }
-
- @Override
- public void killEntityNMS() {
- super.dead = true;
- }
-
- @Override
- public void setLocationNMS(double x, double y, double z, boolean broadcastLocationPacket) {
- super.setPosition(x, y, z);
- if (broadcastLocationPacket) {
- broadcastLocationPacketNMS();
- }
- }
-
- private void broadcastLocationPacketNMS() {
- PacketPlayOutEntityTeleport teleportPacket = new PacketPlayOutEntityTeleport(this);
-
- for (Object obj : super.world.players) {
- if (obj instanceof EntityPlayer) {
- EntityPlayer nmsPlayer = (EntityPlayer) obj;
+ @Override
+ public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
+ // Prevent stand being equipped
+ }
+
+ @Override
+ public void a(AxisAlignedBB boundingBox) {
+ // Do not change it!
+ }
+
+ public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
+ super.a(boundingBox);
+ }
+
+ @Override
+ public void a(SoundEffect soundeffect, float f, float f1) {
+ // Remove sounds.
+ }
+
+ @Override
+ public void setCustomNameNMS(String name) {
+ this.customName = Utils.limitLength(name, 300);
+ super.setCustomName(customName);
+ super.setCustomNameVisible(customName != null && !customName.isEmpty());
+ }
+
+ @Override
+ public String getCustomNameStringNMS() {
+ return this.customName;
+ }
+
+ @Override
+ public Object getCustomNameObjectNMS() {
+ return super.getCustomName();
+ }
+
+ @Override
+ public void die() {
+ // Prevent being killed.
+ }
+
+ @Override
+ public CraftEntity getBukkitEntity() {
+ if (super.bukkitEntity == null) {
+ super.bukkitEntity = new CraftNMSArmorStand(super.world.getServer(), this);
+ }
+ return super.bukkitEntity;
+ }
+
+ @Override
+ public void killEntityNMS() {
+ super.dead = true;
+ }
+
+ @Override
+ public void setLocationNMS(double x, double y, double z, boolean broadcastLocationPacket) {
+ super.setPosition(x, y, z);
+ if (broadcastLocationPacket) {
+ broadcastLocationPacketNMS();
+ }
+ }
+
+ private void broadcastLocationPacketNMS() {
+ PacketPlayOutEntityTeleport teleportPacket = new PacketPlayOutEntityTeleport(this);
+
+ for (Object obj : super.world.players) {
+ if (obj instanceof EntityPlayer) {
+ EntityPlayer nmsPlayer = (EntityPlayer) obj;
- double distanceSquared = Utils.square(nmsPlayer.locX - super.locX) + Utils.square(nmsPlayer.locZ - super.locZ);
- if (distanceSquared < 8192 && nmsPlayer.playerConnection != null) {
- nmsPlayer.playerConnection.sendPacket(teleportPacket);
- }
- }
- }
- }
+ double distanceSquared = Utils.square(nmsPlayer.locX - super.locX) + Utils.square(nmsPlayer.locZ - super.locZ);
+ if (distanceSquared < 8192 && nmsPlayer.playerConnection != null) {
+ nmsPlayer.playerConnection.sendPacket(teleportPacket);
+ }
+ }
+ }
+ }
- @Override
- public boolean isDeadNMS() {
- return super.dead;
- }
-
- @Override
- public int getIdNMS() {
- return super.getId();
- }
+ @Override
+ public boolean isDeadNMS() {
+ return super.dead;
+ }
+
+ @Override
+ public int getIdNMS() {
+ return super.getId();
+ }
- @Override
- public HologramLine getHologramLine() {
- return parentPiece;
- }
-
- @Override
- public org.bukkit.entity.Entity getBukkitEntityNMS() {
- return getBukkitEntity();
- }
+ @Override
+ public HologramLine getHologramLine() {
+ return parentPiece;
+ }
+
+ @Override
+ public org.bukkit.entity.Entity getBukkitEntityNMS() {
+ return getBukkitEntity();
+ }
}
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java
index d621ba47..2f40c618 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java
@@ -41,230 +41,230 @@ import org.bukkit.entity.Player;
import java.util.logging.Level;
public class EntityNMSItem extends EntityItem implements NMSItem {
-
- private static final ReflectField VEHICLE_FIELD = new ReflectField<>(Entity.class, "au");
-
- private ItemLine parentPiece;
- private ItemPickupManager itemPickupManager;
-
- private int resendMountPacketTicks;
-
- public EntityNMSItem(World world, ItemLine piece, ItemPickupManager itemPickupManager) {
- super(world);
- super.pickupDelay = Integer.MAX_VALUE;
- this.parentPiece = piece;
- this.itemPickupManager = itemPickupManager;
- }
-
- @Override
- public void m() {
- // Disable normal ticking for this entity.
-
- // So it won't get removed.
- ticksLived = 0;
-
- if (resendMountPacketTicks++ > 20) {
- resendMountPacketTicks = 0;
-
- if (bB() != null) {
- // Send a packet near to "remind" players that the item is riding the armor stand (Spigot bug or client bug)
- PacketPlayOutMount mountPacket = new PacketPlayOutMount(bB());
-
- for (Object obj : super.world.players) {
- if (obj instanceof EntityPlayer) {
- EntityPlayer nmsPlayer = (EntityPlayer) obj;
-
- double distanceSquared = Utils.square(nmsPlayer.locX - super.locX) + Utils.square(nmsPlayer.locZ - super.locZ);
- if (distanceSquared < 1024 && nmsPlayer.playerConnection != null) {
- nmsPlayer.playerConnection.sendPacket(mountPacket);
- }
- }
- }
- }
- }
- }
-
- @Override
- public void inactiveTick() {
- // Disable normal ticking for this entity.
-
- // So it won't get removed.
- ticksLived = 0;
- }
-
- // Method called when a player is near.
- @Override
- public void d(EntityHuman human) {
-
- if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
- // Too low or too high, it's a bit weird.
- return;
- }
-
- if (parentPiece.getPickupHandler() != null && human instanceof EntityPlayer) {
- itemPickupManager.handleItemLinePickup((Player) human.getBukkitEntity(), parentPiece.getPickupHandler(), parentPiece.getParent());
- // It is never added to the inventory.
- }
- }
-
- @Override
- public void b(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- }
-
- @Override
- public boolean c(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return false;
- }
+
+ private static final ReflectField VEHICLE_FIELD = new ReflectField<>(Entity.class, "au");
+
+ private ItemLine parentPiece;
+ private ItemPickupManager itemPickupManager;
+
+ private int resendMountPacketTicks;
+
+ public EntityNMSItem(World world, ItemLine piece, ItemPickupManager itemPickupManager) {
+ super(world);
+ super.pickupDelay = Integer.MAX_VALUE;
+ this.parentPiece = piece;
+ this.itemPickupManager = itemPickupManager;
+ }
+
+ @Override
+ public void m() {
+ // Disable normal ticking for this entity.
+
+ // So it won't get removed.
+ ticksLived = 0;
+
+ if (resendMountPacketTicks++ > 20) {
+ resendMountPacketTicks = 0;
+
+ if (bB() != null) {
+ // Send a packet near to "remind" players that the item is riding the armor stand (Spigot bug or client bug)
+ PacketPlayOutMount mountPacket = new PacketPlayOutMount(bB());
+
+ for (Object obj : super.world.players) {
+ if (obj instanceof EntityPlayer) {
+ EntityPlayer nmsPlayer = (EntityPlayer) obj;
+
+ double distanceSquared = Utils.square(nmsPlayer.locX - super.locX) + Utils.square(nmsPlayer.locZ - super.locZ);
+ if (distanceSquared < 1024 && nmsPlayer.playerConnection != null) {
+ nmsPlayer.playerConnection.sendPacket(mountPacket);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void inactiveTick() {
+ // Disable normal ticking for this entity.
+
+ // So it won't get removed.
+ ticksLived = 0;
+ }
+
+ // Method called when a player is near.
+ @Override
+ public void d(EntityHuman human) {
+
+ if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
+ // Too low or too high, it's a bit weird.
+ return;
+ }
+
+ if (parentPiece.getPickupHandler() != null && human instanceof EntityPlayer) {
+ itemPickupManager.handleItemLinePickup((Player) human.getBukkitEntity(), parentPiece.getPickupHandler(), parentPiece.getParent());
+ // It is never added to the inventory.
+ }
+ }
+
+ @Override
+ public void b(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ }
+
+ @Override
+ public boolean c(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return false;
+ }
- @Override
- public boolean d(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return false;
- }
-
- @Override
- public NBTTagCompound e(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return nbttagcompound;
- }
-
- @Override
- public void f(NBTTagCompound nbttagcompound) {
- // Do not load NBT.
- }
-
- @Override
- public void a(NBTTagCompound nbttagcompound) {
- // Do not load NBT.
- }
-
- @Override
- public boolean isInvulnerable(DamageSource source) {
- /*
- * The field Entity.invulnerable is private.
- * It's only used while saving NBTTags, but since the entity would be killed
- * on chunk unload, we prefer to override isInvulnerable().
- */
- return true;
- }
-
- @Override
- public boolean isCollidable() {
- return false;
- }
-
- @Override
- public void die() {
- // Prevent being killed.
- }
-
- @Override
- public boolean isAlive() {
- // This override prevents items from being picked up by hoppers.
- // Should have no side effects.
- return false;
- }
+ @Override
+ public boolean d(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return false;
+ }
+
+ @Override
+ public NBTTagCompound e(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return nbttagcompound;
+ }
+
+ @Override
+ public void f(NBTTagCompound nbttagcompound) {
+ // Do not load NBT.
+ }
+
+ @Override
+ public void a(NBTTagCompound nbttagcompound) {
+ // Do not load NBT.
+ }
+
+ @Override
+ public boolean isInvulnerable(DamageSource source) {
+ /*
+ * The field Entity.invulnerable is private.
+ * It's only used while saving NBTTags, but since the entity would be killed
+ * on chunk unload, we prefer to override isInvulnerable().
+ */
+ return true;
+ }
+
+ @Override
+ public boolean isCollidable() {
+ return false;
+ }
+
+ @Override
+ public void die() {
+ // Prevent being killed.
+ }
+
+ @Override
+ public boolean isAlive() {
+ // This override prevents items from being picked up by hoppers.
+ // Should have no side effects.
+ return false;
+ }
- @Override
- public CraftEntity getBukkitEntity() {
- if (super.bukkitEntity == null) {
- super.bukkitEntity = new CraftNMSItem(super.world.getServer(), this);
- }
- return super.bukkitEntity;
- }
+ @Override
+ public CraftEntity getBukkitEntity() {
+ if (super.bukkitEntity == null) {
+ super.bukkitEntity = new CraftNMSItem(super.world.getServer(), this);
+ }
+ return super.bukkitEntity;
+ }
- @Override
- public boolean isDeadNMS() {
- return super.dead;
- }
-
- @Override
- public void killEntityNMS() {
- super.dead = true;
- }
-
- @Override
- public void setLocationNMS(double x, double y, double z) {
- super.setPosition(x, y, z);
- }
+ @Override
+ public boolean isDeadNMS() {
+ return super.dead;
+ }
+
+ @Override
+ public void killEntityNMS() {
+ super.dead = true;
+ }
+
+ @Override
+ public void setLocationNMS(double x, double y, double z) {
+ super.setPosition(x, y, z);
+ }
- @Override
- public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
- ItemStack newItem = CraftItemStack.asNMSCopy(stack);
-
- if (newItem == null) {
- newItem = new ItemStack(Blocks.BEDROCK);
- }
-
- if (newItem.getTag() == null) {
- newItem.setTag(new NBTTagCompound());
- }
- NBTTagCompound display = newItem.getTag().getCompound("display");
-
- if (!newItem.getTag().hasKey("display")) {
- newItem.getTag().set("display", display);
- }
-
- NBTTagList tagList = new NBTTagList();
- tagList.add(new NBTTagString(ItemUtils.ANTISTACK_LORE)); // Antistack lore
- display.set("Lore", tagList);
-
- setItemStack(newItem);
- }
-
- @Override
- public int getIdNMS() {
- return super.getId();
- }
-
- @Override
- public ItemLine getHologramLine() {
- return parentPiece;
- }
-
- @Override
- public void allowPickup(boolean pickup) {
- if (pickup) {
- super.pickupDelay = 0;
- } else {
- super.pickupDelay = Integer.MAX_VALUE;
- }
- }
-
- @Override
- public org.bukkit.entity.Entity getBukkitEntityNMS() {
- return getBukkitEntity();
- }
-
- @Override
- public void setPassengerOfNMS(NMSEntityBase vehicleBase) {
- if (vehicleBase == null || !(vehicleBase instanceof Entity)) {
- // It should never dismount
- return;
- }
-
- Entity entity = (Entity) vehicleBase;
+ @Override
+ public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
+ ItemStack newItem = CraftItemStack.asNMSCopy(stack);
+
+ if (newItem == null) {
+ newItem = new ItemStack(Blocks.BEDROCK);
+ }
+
+ if (newItem.getTag() == null) {
+ newItem.setTag(new NBTTagCompound());
+ }
+ NBTTagCompound display = newItem.getTag().getCompound("display");
+
+ if (!newItem.getTag().hasKey("display")) {
+ newItem.getTag().set("display", display);
+ }
+
+ NBTTagList tagList = new NBTTagList();
+ tagList.add(new NBTTagString(ItemUtils.ANTISTACK_LORE)); // Antistack lore
+ display.set("Lore", tagList);
+
+ setItemStack(newItem);
+ }
+
+ @Override
+ public int getIdNMS() {
+ return super.getId();
+ }
+
+ @Override
+ public ItemLine getHologramLine() {
+ return parentPiece;
+ }
+
+ @Override
+ public void allowPickup(boolean pickup) {
+ if (pickup) {
+ super.pickupDelay = 0;
+ } else {
+ super.pickupDelay = Integer.MAX_VALUE;
+ }
+ }
+
+ @Override
+ public org.bukkit.entity.Entity getBukkitEntityNMS() {
+ return getBukkitEntity();
+ }
+
+ @Override
+ public void setPassengerOfNMS(NMSEntityBase vehicleBase) {
+ if (vehicleBase == null || !(vehicleBase instanceof Entity)) {
+ // It should never dismount
+ return;
+ }
+
+ Entity entity = (Entity) vehicleBase;
- try {
- if (super.bB() != null) {
- Entity oldVehicle = super.bB();
- VEHICLE_FIELD.set(this, null);
- oldVehicle.passengers.remove(this);
- }
+ try {
+ if (super.bB() != null) {
+ Entity oldVehicle = super.bB();
+ VEHICLE_FIELD.set(this, null);
+ oldVehicle.passengers.remove(this);
+ }
- VEHICLE_FIELD.set(this, entity);
- entity.passengers.clear();
- entity.passengers.add(this);
+ VEHICLE_FIELD.set(this, entity);
+ entity.passengers.clear();
+ entity.passengers.add(this);
- } catch (Throwable t) {
- ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
- }
- }
+ } catch (Throwable t) {
+ ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
+ }
+ }
- @Override
- public Object getRawItemStack() {
- return super.getItemStack();
- }
+ @Override
+ public Object getRawItemStack() {
+ return super.getItemStack();
+ }
}
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java
index e2c1715f..0e310ab1 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java
@@ -37,208 +37,208 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
import java.util.logging.Level;
public class EntityNMSSlime extends EntitySlime implements NMSSlime {
-
- private static final ReflectField VEHICLE_FIELD = new ReflectField<>(Entity.class, "au");
+
+ private static final ReflectField VEHICLE_FIELD = new ReflectField<>(Entity.class, "au");
- private HologramLine parentPiece;
-
- private int resendMountPacketTicks;
-
- public EntityNMSSlime(World world, HologramLine parentPiece) {
- super(world);
- super.persistent = true;
- super.collides = false;
- a(0.0F, 0.0F);
- setSize(1);
- setInvisible(true);
- this.parentPiece = parentPiece;
- forceSetBoundingBox(new NullBoundingBox());
- }
-
- @Override
- public void m() {
- // Disable normal ticking for this entity.
-
- // So it won't get removed.
- ticksLived = 0;
-
- if (resendMountPacketTicks++ > 20) {
- resendMountPacketTicks = 0;
+ private HologramLine parentPiece;
+
+ private int resendMountPacketTicks;
+
+ public EntityNMSSlime(World world, HologramLine parentPiece) {
+ super(world);
+ super.persistent = true;
+ super.collides = false;
+ a(0.0F, 0.0F);
+ setSize(1);
+ setInvisible(true);
+ this.parentPiece = parentPiece;
+ forceSetBoundingBox(new NullBoundingBox());
+ }
+
+ @Override
+ public void m() {
+ // Disable normal ticking for this entity.
+
+ // So it won't get removed.
+ ticksLived = 0;
+
+ if (resendMountPacketTicks++ > 20) {
+ resendMountPacketTicks = 0;
- if (bB() != null) {
- // Send a packet near to "remind" players that the slime is riding the armor stand (Spigot bug or client bug)
- PacketPlayOutMount mountPacket = new PacketPlayOutMount(bB());
-
- for (Object obj : super.world.players) {
- if (obj instanceof EntityPlayer) {
- EntityPlayer nmsPlayer = (EntityPlayer) obj;
-
- double distanceSquared = Utils.square(nmsPlayer.locX - super.locX) + Utils.square(nmsPlayer.locZ - super.locZ);
- if (distanceSquared < 1024 && nmsPlayer.playerConnection != null) {
- nmsPlayer.playerConnection.sendPacket(mountPacket);
- }
- }
- }
- }
- }
- }
-
- @Override
- public void inactiveTick() {
- // Disable normal ticking for this entity.
-
- // So it won't get removed.
- ticksLived = 0;
- }
-
- @Override
- public void a(AxisAlignedBB boundingBox) {
- // Do not change it!
- }
-
- public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
- super.a(boundingBox);
- }
-
- @Override
- public void b(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- }
-
- @Override
- public boolean c(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return false;
- }
+ if (bB() != null) {
+ // Send a packet near to "remind" players that the slime is riding the armor stand (Spigot bug or client bug)
+ PacketPlayOutMount mountPacket = new PacketPlayOutMount(bB());
+
+ for (Object obj : super.world.players) {
+ if (obj instanceof EntityPlayer) {
+ EntityPlayer nmsPlayer = (EntityPlayer) obj;
+
+ double distanceSquared = Utils.square(nmsPlayer.locX - super.locX) + Utils.square(nmsPlayer.locZ - super.locZ);
+ if (distanceSquared < 1024 && nmsPlayer.playerConnection != null) {
+ nmsPlayer.playerConnection.sendPacket(mountPacket);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void inactiveTick() {
+ // Disable normal ticking for this entity.
+
+ // So it won't get removed.
+ ticksLived = 0;
+ }
+
+ @Override
+ public void a(AxisAlignedBB boundingBox) {
+ // Do not change it!
+ }
+
+ public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
+ super.a(boundingBox);
+ }
+
+ @Override
+ public void b(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ }
+
+ @Override
+ public boolean c(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return false;
+ }
- @Override
- public boolean d(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return false;
- }
-
- @Override
- public NBTTagCompound e(NBTTagCompound nbttagcompound) {
- // Do not save NBT.
- return nbttagcompound;
- }
-
- @Override
- public void f(NBTTagCompound nbttagcompound) {
- // Do not load NBT.
- }
-
- @Override
- public void a(NBTTagCompound nbttagcompound) {
- // Do not load NBT.
- }
-
- @Override
- public boolean damageEntity(DamageSource damageSource, float amount) {
- if (damageSource instanceof EntityDamageSource) {
- EntityDamageSource entityDamageSource = (EntityDamageSource) damageSource;
- if (entityDamageSource.getEntity() instanceof EntityPlayer) {
- Bukkit.getPluginManager().callEvent(new PlayerInteractEntityEvent(((EntityPlayer) entityDamageSource.getEntity()).getBukkitEntity(), getBukkitEntity())); // Bukkit takes care of the exceptions
- }
- }
- return false;
- }
-
- @Override
- public boolean isInvulnerable(DamageSource source) {
- /*
- * The field Entity.invulnerable is private.
- * It's only used while saving NBTTags, but since the entity would be killed
- * on chunk unload, we prefer to override isInvulnerable().
- */
- return true;
- }
-
- @Override
- public boolean isCollidable() {
- return false;
- }
+ @Override
+ public boolean d(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return false;
+ }
+
+ @Override
+ public NBTTagCompound e(NBTTagCompound nbttagcompound) {
+ // Do not save NBT.
+ return nbttagcompound;
+ }
+
+ @Override
+ public void f(NBTTagCompound nbttagcompound) {
+ // Do not load NBT.
+ }
+
+ @Override
+ public void a(NBTTagCompound nbttagcompound) {
+ // Do not load NBT.
+ }
+
+ @Override
+ public boolean damageEntity(DamageSource damageSource, float amount) {
+ if (damageSource instanceof EntityDamageSource) {
+ EntityDamageSource entityDamageSource = (EntityDamageSource) damageSource;
+ if (entityDamageSource.getEntity() instanceof EntityPlayer) {
+ Bukkit.getPluginManager().callEvent(new PlayerInteractEntityEvent(((EntityPlayer) entityDamageSource.getEntity()).getBukkitEntity(), getBukkitEntity())); // Bukkit takes care of the exceptions
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isInvulnerable(DamageSource source) {
+ /*
+ * The field Entity.invulnerable is private.
+ * It's only used while saving NBTTags, but since the entity would be killed
+ * on chunk unload, we prefer to override isInvulnerable().
+ */
+ return true;
+ }
+
+ @Override
+ public boolean isCollidable() {
+ return false;
+ }
- @Override
- public void setCustomName(String customName) {
- // Locks the custom name.
- }
-
- @Override
- public void setCustomNameVisible(boolean visible) {
- // Locks the custom name.
- }
-
- @Override
- public void a(SoundEffect soundeffect, float f, float f1) {
- // Remove sounds.
- }
-
- @Override
- public void die() {
- // Prevent being killed.
- }
-
- @Override
- public CraftEntity getBukkitEntity() {
- if (super.bukkitEntity == null) {
- super.bukkitEntity = new CraftNMSSlime(super.world.getServer(), this);
- }
- return super.bukkitEntity;
- }
+ @Override
+ public void setCustomName(String customName) {
+ // Locks the custom name.
+ }
+
+ @Override
+ public void setCustomNameVisible(boolean visible) {
+ // Locks the custom name.
+ }
+
+ @Override
+ public void a(SoundEffect soundeffect, float f, float f1) {
+ // Remove sounds.
+ }
+
+ @Override
+ public void die() {
+ // Prevent being killed.
+ }
+
+ @Override
+ public CraftEntity getBukkitEntity() {
+ if (super.bukkitEntity == null) {
+ super.bukkitEntity = new CraftNMSSlime(super.world.getServer(), this);
+ }
+ return super.bukkitEntity;
+ }
- @Override
- public boolean isDeadNMS() {
- return super.dead;
- }
-
- @Override
- public void killEntityNMS() {
- super.dead = true;
- }
-
- @Override
- public void setLocationNMS(double x, double y, double z) {
- super.setPosition(x, y, z);
- }
-
- @Override
- public int getIdNMS() {
- return super.getId();
- }
-
- @Override
- public HologramLine getHologramLine() {
- return parentPiece;
- }
+ @Override
+ public boolean isDeadNMS() {
+ return super.dead;
+ }
+
+ @Override
+ public void killEntityNMS() {
+ super.dead = true;
+ }
+
+ @Override
+ public void setLocationNMS(double x, double y, double z) {
+ super.setPosition(x, y, z);
+ }
+
+ @Override
+ public int getIdNMS() {
+ return super.getId();
+ }
+
+ @Override
+ public HologramLine getHologramLine() {
+ return parentPiece;
+ }
- @Override
- public org.bukkit.entity.Entity getBukkitEntityNMS() {
- return getBukkitEntity();
- }
-
- @Override
- public void setPassengerOfNMS(NMSEntityBase vehicleBase) {
- if (vehicleBase == null || !(vehicleBase instanceof Entity)) {
- // It should never dismount
- return;
- }
-
- Entity entity = (Entity) vehicleBase;
-
- try {
- if (super.bB() != null) {
- Entity oldVehicle = super.bB();
- VEHICLE_FIELD.set(this, null);
- oldVehicle.passengers.remove(this);
- }
+ @Override
+ public org.bukkit.entity.Entity getBukkitEntityNMS() {
+ return getBukkitEntity();
+ }
+
+ @Override
+ public void setPassengerOfNMS(NMSEntityBase vehicleBase) {
+ if (vehicleBase == null || !(vehicleBase instanceof Entity)) {
+ // It should never dismount
+ return;
+ }
+
+ Entity entity = (Entity) vehicleBase;
+
+ try {
+ if (super.bB() != null) {
+ Entity oldVehicle = super.bB();
+ VEHICLE_FIELD.set(this, null);
+ oldVehicle.passengers.remove(this);
+ }
- VEHICLE_FIELD.set(this, entity);
- entity.passengers.clear();
- entity.passengers.add(this);
+ VEHICLE_FIELD.set(this, entity);
+ entity.passengers.clear();
+ entity.passengers.add(this);
- } catch (Throwable t) {
- ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
- }
- }
+ } catch (Throwable t) {
+ ConsoleLogger.logDebug(Level.SEVERE, "Couldn't set passenger", t);
+ }
+ }
}
diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/NmsManagerImpl.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/NmsManagerImpl.java
index 32f1abf9..a2e8d6db 100644
--- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/NmsManagerImpl.java
+++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/NmsManagerImpl.java
@@ -39,69 +39,69 @@ import java.lang.reflect.Method;
import java.util.Map;
public class NmsManagerImpl implements NMSManager {
-
- private static final ReflectField