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 fea3d02e..04401674 100644 --- a/api/src/main/java/me/filoghost/holographicdisplays/api/Hologram.java +++ b/api/src/main/java/me/filoghost/holographicdisplays/api/Hologram.java @@ -103,7 +103,7 @@ public interface Hologram { * @return the amount of lines * @since 1 */ - int size(); + int getLineCount(); /** diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/hologram/StandardHologram.java b/core/src/main/java/me/filoghost/holographicdisplays/core/hologram/StandardHologram.java index d440d9ca..4d47fc2d 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/hologram/StandardHologram.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/hologram/StandardHologram.java @@ -26,9 +26,9 @@ public interface StandardHologram { List getLines(); - int getLinesAmount(); + int getLineCount(); - Plugin getOwnerPlugin(); + Plugin getCreatorPlugin(); boolean isVisibleTo(Player player); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/DebugCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/DebugCommand.java index 4de3229a..0e954cb1 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/DebugCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/DebugCommand.java @@ -66,7 +66,7 @@ public class DebugCommand extends HologramSubCommand { for (Entry entry : hologramsDebugInfo.entrySet()) { StandardHologram hologram = entry.getKey(); HologramDebugInfo debugInfo = entry.getValue(); - sender.sendMessage(Colors.PRIMARY_SHADOW + "- '" + hologram.toFormattedString() + "': " + hologram.getLinesAmount() + " lines, " + sender.sendMessage(Colors.PRIMARY_SHADOW + "- '" + hologram.toFormattedString() + "': " + hologram.getLineCount() + " lines, " + debugInfo.getTotalEntities() + " entities (" + debugInfo.aliveEntities + " alive, " + debugInfo.deadEntities + " dead)"); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/InsertlineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/InsertlineCommand.java index 84d38d03..a310b803 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/InsertlineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/InsertlineCommand.java @@ -47,9 +47,9 @@ public class InsertlineCommand extends LineEditingCommand implements QuickEditCo int insertAfterIndex = CommandValidate.parseInteger(args[1]); String serializedLine = Strings.joinFrom(" ", args, 2); - int oldLinesAmount = hologram.getLinesAmount(); + int oldLinesAmount = hologram.getLineCount(); - CommandValidate.check(insertAfterIndex >= 0 && insertAfterIndex <= oldLinesAmount, "The number must be between 0 and " + hologram.getLinesAmount() + "(amount of lines of the hologram)."); + CommandValidate.check(insertAfterIndex >= 0 && insertAfterIndex <= oldLinesAmount, "The number must be between 0 and " + hologram.getLineCount() + "(amount of lines of the hologram)."); InternalHologramLine line = HologramCommandValidate.parseHologramLine(hologram, serializedLine); hologram.insertLine(insertAfterIndex, line); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/ListCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/ListCommand.java index bcd3f7d9..0d12a23f 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/ListCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/ListCommand.java @@ -58,7 +58,7 @@ public class ListCommand extends HologramSubCommand { + " " + Colors.SECONDARY_SHADOW + "at x: " + (int) hologram.getX() + ", y: " + (int) hologram.getY() + ", z: " + (int) hologram.getZ() - + " (lines: " + hologram.getLinesAmount() + ", world: \"" + hologram.getWorld().getName() + "\")"); + + " (lines: " + hologram.getLineCount() + ", world: \"" + hologram.getWorld().getName() + "\")"); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/NearCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/NearCommand.java index 4ef6224e..89fe98a7 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/NearCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/NearCommand.java @@ -53,7 +53,7 @@ public class NearCommand extends HologramSubCommand { Messages.sendTitle(player, "Near holograms"); for (InternalHologram nearHologram : nearHolograms) { - player.sendMessage(Colors.SECONDARY_SHADOW + "- " + Colors.SECONDARY + Colors.BOLD + nearHologram.getName() + " " + Colors.SECONDARY_SHADOW + "at x: " + (int) nearHologram.getX() + ", y: " + (int) nearHologram.getY() + ", z: " + (int) nearHologram.getZ() + " (lines: " + nearHologram.getLinesAmount() + ")"); + player.sendMessage(Colors.SECONDARY_SHADOW + "- " + Colors.SECONDARY + Colors.BOLD + nearHologram.getName() + " " + Colors.SECONDARY_SHADOW + "at x: " + (int) nearHologram.getX() + ", y: " + (int) nearHologram.getY() + ", z: " + (int) nearHologram.getZ() + " (lines: " + nearHologram.getLineCount() + ")"); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/RemovelineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/RemovelineCommand.java index 2724b981..e3b7a528 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/RemovelineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/RemovelineCommand.java @@ -41,10 +41,10 @@ public class RemovelineCommand extends LineEditingCommand implements QuickEditCo int lineNumber = CommandValidate.parseInteger(args[1]); - CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLinesAmount(), "The line number must be between 1 and " + hologram.getLinesAmount() + "."); + CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLineCount(), "The line number must be between 1 and " + hologram.getLineCount() + "."); int index = lineNumber - 1; - CommandValidate.check(hologram.getLinesAmount() > 1, "The hologram should have at least 1 line. If you want to delete it, use /" + context.getRootLabel() + " delete."); + CommandValidate.check(hologram.getLineCount() > 1, "The hologram should have at least 1 line. If you want to delete it, use /" + context.getRootLabel() + " delete."); hologram.removeLine(index); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/SetlineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/SetlineCommand.java index 2d9301d0..d9f94145 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/SetlineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/commands/subs/SetlineCommand.java @@ -43,7 +43,7 @@ public class SetlineCommand extends LineEditingCommand implements QuickEditComma String serializedLine = Strings.joinFrom(" ", args, 2); int lineNumber = CommandValidate.parseInteger(args[1]); - CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLinesAmount(), "The line number must be between 1 and " + hologram.getLinesAmount() + "."); + CommandValidate.check(lineNumber >= 1 && lineNumber <= hologram.getLineCount(), "The line number must be between 1 and " + hologram.getLineCount() + "."); int index = lineNumber - 1; InternalHologramLine line = HologramCommandValidate.parseHologramLine(hologram, serializedLine); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramAdapter.java b/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramAdapter.java index 9679651a..2084f531 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramAdapter.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramAdapter.java @@ -61,7 +61,7 @@ public class V2HologramAdapter implements Hologram { @Override public int size() { - return newHologram.size(); + return newHologram.getLineCount(); } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramsAPIProvider.java b/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramsAPIProvider.java index ced4400a..5eb62179 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramsAPIProvider.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/legacy/api/v2/V2HologramsAPIProvider.java @@ -52,7 +52,7 @@ public class V2HologramsAPIProvider extends HologramsAPIProvider { List ownedHolograms = new ArrayList<>(); for (APIHologram hologram : apiHologramManager.getHolograms()) { - if (hologram.getOwnerPlugin().equals(plugin)) { + if (hologram.getCreatorPlugin().equals(plugin)) { ownedHolograms.add(hologram.getV2Adapter()); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologram.java index bec16fa6..a5bb9800 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologram.java @@ -40,7 +40,7 @@ public class APIHologram extends BaseHologram implements Hologr } @Override - public Plugin getOwnerPlugin() { + public Plugin getCreatorPlugin() { return plugin; } @@ -89,11 +89,6 @@ public class APIHologram extends BaseHologram implements Hologr return getLines().get(index); } - @Override - public int size() { - return getLinesAmount(); - } - @Override public void setAllowPlaceholders(boolean allowPlaceholders) { if (this.allowPlaceholders == allowPlaceholders) { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologramManager.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologramManager.java index 2695cdf9..12f9f241 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologramManager.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIHologramManager.java @@ -37,7 +37,7 @@ public class APIHologramManager extends BaseHologramManager { List ownedHolograms = new ArrayList<>(); for (APIHologram hologram : getHolograms()) { - if (hologram.getOwnerPlugin().equals(plugin)) { + if (hologram.getCreatorPlugin().equals(plugin)) { ownedHolograms.add(hologram); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologram.java index b03368ff..190ca47b 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologram.java @@ -129,7 +129,7 @@ public abstract class BaseHologram extends BaseH } @Override - public int getLinesAmount() { + public int getLineCount() { return lines.size(); } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseItemLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseItemLine.java index 45c20753..4091e1db 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseItemLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseItemLine.java @@ -40,7 +40,7 @@ public abstract class BaseItemLine extends BaseTouchableLine implements Standard try { pickupHandler.onPickup(player); } catch (Throwable t) { - Log.warning("The plugin " + getHologram().getOwnerPlugin().getName() + " generated an exception" + Log.warning("The plugin " + getHologram().getCreatorPlugin().getName() + " generated an exception" + " when the player " + player.getName() + " picked up an item from a hologram.", t); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java index 75b6c805..0084dbcc 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java @@ -56,7 +56,7 @@ public abstract class BaseTouchableLine extends BaseHologramLine implements Stan try { touchHandler.onTouch(player); } catch (Throwable t) { - Log.warning("The plugin " + getHologram().getOwnerPlugin().getName() + " generated an exception" + Log.warning("The plugin " + getHologram().getCreatorPlugin().getName() + " generated an exception" + " when the player " + player.getName() + " touched a hologram.", t); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalHologram.java index 200fbcc5..789ee797 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalHologram.java @@ -36,7 +36,7 @@ public class InternalHologram extends BaseHologram { } @Override - public Plugin getOwnerPlugin() { + public Plugin getCreatorPlugin() { return HolographicDisplays.getInstance(); }