From 5de079917e985776801c46ad97c3854580daa1f5 Mon Sep 17 00:00:00 2001 From: filoghost Date: Thu, 26 Aug 2021 19:31:15 +0200 Subject: [PATCH] Rename method --- .../holographicdisplays/api/hologram/Hologram.java | 2 +- .../filoghost/example/deathholograms/DeathHolograms.java | 4 ++-- .../main/java/me/filoghost/example/powerups/PowerUps.java | 4 ++-- .../holographicdisplays/plugin/HolographicDisplays.java | 4 ++-- .../plugin/api/current/APIHologram.java | 2 +- .../holographicdisplays/plugin/api/v2/V2Hologram.java | 2 +- .../holographicdisplays/plugin/api/v2/V2HologramLine.java | 2 +- .../plugin/commands/subs/AddLineCommand.java | 2 +- .../plugin/commands/subs/CopyCommand.java | 4 ++-- .../plugin/commands/subs/CreateCommand.java | 2 +- .../plugin/commands/subs/InfoCommand.java | 2 +- .../plugin/commands/subs/InsertLineCommand.java | 4 ++-- .../plugin/commands/subs/ReadImageCommand.java | 4 ++-- .../plugin/commands/subs/ReadTextCommand.java | 2 +- .../plugin/commands/subs/RemoveLineCommand.java | 4 ++-- .../plugin/commands/subs/SetLineCommand.java | 4 ++-- .../holographicdisplays/plugin/config/HologramConfig.java | 4 ++-- .../holographicdisplays/plugin/format/DisplayFormat.java | 2 +- .../plugin/hologram/base/BaseHologram.java | 8 ++++---- .../plugin/internal/hologram/InternalHologram.java | 2 +- 20 files changed, 32 insertions(+), 32 deletions(-) diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/hologram/Hologram.java b/api/src/main/java/me/filoghost/holographicdisplays/api/hologram/Hologram.java index 74231f72..77805ef3 100644 --- a/api/src/main/java/me/filoghost/holographicdisplays/api/hologram/Hologram.java +++ b/api/src/main/java/me/filoghost/holographicdisplays/api/hologram/Hologram.java @@ -24,7 +24,7 @@ public interface Hologram { * * @since 1 */ - @NotNull HologramLines lines(); + @NotNull HologramLines getLines(); /** * Returns the {@link VisibilitySettings} of this hologram. 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 82416b47..47fa09b8 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 @@ -41,8 +41,8 @@ public class DeathHolograms extends JavaPlugin implements Listener { public void onPlayerDeath(PlayerDeathEvent event) { Hologram hologram = holographicDisplaysAPI.createHologram(event.getEntity().getEyeLocation()); - hologram.lines().appendText(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!"); - hologram.lines().appendText(ChatColor.GRAY + "Time of death: " + TIME_FORMATTER.format(Instant.now())); + hologram.getLines().appendText(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!"); + hologram.getLines().appendText(ChatColor.GRAY + "Time of death: " + TIME_FORMATTER.format(Instant.now())); } } 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 14b07912..69f0b9d1 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 @@ -49,8 +49,8 @@ public class PowerUps extends JavaPlugin implements Listener { // Spawn the floating item with a label Hologram hologram = holographicDisplaysAPI.createHologram(event.getEntity().getLocation().add(0.0, 0.9, 0.0)); - hologram.lines().appendText(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp"); - ItemHologramLine itemLine = hologram.lines().appendItem(new ItemStack(Material.SUGAR)); + hologram.getLines().appendText(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp"); + ItemHologramLine itemLine = hologram.getLines().appendItem(new ItemStack(Material.SUGAR)); itemLine.setPickupListener((Player player) -> { // Play an effect diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/HolographicDisplays.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/HolographicDisplays.java index 72f5a105..bfc0ba11 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/HolographicDisplays.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/HolographicDisplays.java @@ -177,10 +177,10 @@ public class HolographicDisplays extends FCommonsPlugin { hologramDatabase.createHolograms(internalHologramManager, errorCollector); for (APIHologram hologram : apiHologramManager.getHolograms()) { - hologram.lines().updatePositions(); + hologram.getLines().updatePositions(); } for (V2Hologram hologram : v2HologramManager.getHolograms()) { - hologram.lines().updatePositions(); + hologram.getLines().updatePositions(); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/APIHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/APIHologram.java index 4243809d..25c104e6 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/APIHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/APIHologram.java @@ -37,7 +37,7 @@ public class APIHologram extends BaseHologram implements Hologram { } @Override - public @NotNull APIHologramLines lines() { + public @NotNull APIHologramLines getLines() { return lines; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2Hologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2Hologram.java index 1aee5c43..0feec520 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2Hologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2Hologram.java @@ -44,7 +44,7 @@ public class V2Hologram extends BaseHologram implements Hologram { } @Override - public BaseHologramLines lines() { + public BaseHologramLines getLines() { return lines; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2HologramLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2HologramLine.java index dcfc4f4c..c45f150e 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2HologramLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/v2/V2HologramLine.java @@ -16,7 +16,7 @@ public interface V2HologramLine extends HologramLine, EditableHologramLine { @Override default void removeLine() { - getParent().lines().remove(this); + getParent().getLines().remove(this); } default Plugin getCreatorPlugin() { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/AddLineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/AddLineCommand.java index 538371b6..233be75c 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/AddLineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/AddLineCommand.java @@ -38,7 +38,7 @@ public class AddLineCommand extends LineEditingCommand implements QuickEditComma InternalHologramLine line = hologramEditor.parseHologramLine(hologram, serializedLine); - hologram.lines().add(line); + hologram.getLines().add(line); hologramEditor.saveChanges(hologram, ChangeType.EDIT_LINES); sender.sendMessage(ColorScheme.PRIMARY + "Line added."); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CopyCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CopyCommand.java index 0efeb203..df382bcd 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CopyCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CopyCommand.java @@ -37,11 +37,11 @@ public class CopyCommand extends HologramSubCommand { InternalHologram toHologram = hologramEditor.getExistingHologram(args[1]); List clonedLines = new ArrayList<>(); - for (InternalHologramLine line : fromHologram.lines()) { + for (InternalHologramLine line : fromHologram.getLines()) { clonedLines.add(hologramEditor.parseHologramLine(toHologram, line.getSerializedConfigValue())); } - toHologram.lines().setAll(clonedLines); + toHologram.getLines().setAll(clonedLines); hologramEditor.saveChanges(toHologram, ChangeType.EDIT_LINES); sender.sendMessage(ColorScheme.PRIMARY + "Lines of hologram \"" + fromHologram.getName() + "\"" diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CreateCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CreateCommand.java index c9304ffa..6719fef9 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CreateCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/CreateCommand.java @@ -67,7 +67,7 @@ public class CreateCommand extends HologramSubCommand { line = hologram.createTextLine(defaultText, defaultText.replace(ChatColor.COLOR_CHAR, '&')); } - hologram.lines().add(line); + hologram.getLines().add(line); hologramEditor.saveChanges(hologram, ChangeType.CREATE); hologramEditor.teleportLookingDown(player, player.getLocation()); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InfoCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InfoCommand.java index 9436b48c..f90971a9 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InfoCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InfoCommand.java @@ -37,7 +37,7 @@ public class InfoCommand extends LineEditingCommand implements QuickEditCommand DisplayFormat.sendTitle(sender, "Lines of the hologram \"" + hologram.getName() + "\""); int index = 0; - for (InternalHologramLine line : hologram.lines()) { + for (InternalHologramLine line : hologram.getLines()) { index++; sender.sendMessage(ColorScheme.SECONDARY_BOLD + index + ColorScheme.SECONDARY_DARK + ". " + ColorScheme.SECONDARY + line.getSerializedConfigValue()); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InsertLineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InsertLineCommand.java index c6f0ade6..a25ea40d 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InsertLineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/InsertLineCommand.java @@ -41,14 +41,14 @@ public class InsertLineCommand extends LineEditingCommand implements QuickEditCo int insertAfterIndex = CommandValidate.parseInteger(args[1]); String serializedLine = Strings.joinFrom(" ", args, 2); - int oldLinesAmount = hologram.lines().size(); + int oldLinesAmount = hologram.getLines().size(); CommandValidate.check(insertAfterIndex >= 0 && insertAfterIndex <= oldLinesAmount, "The line number must be between 0 and " + oldLinesAmount + "."); InternalHologramLine line = hologramEditor.parseHologramLine(hologram, serializedLine); - hologram.lines().insert(insertAfterIndex, line); + hologram.getLines().insert(insertAfterIndex, line); hologramEditor.saveChanges(hologram, ChangeType.EDIT_LINES); if (insertAfterIndex == 0) { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadImageCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadImageCommand.java index e5e51102..8d767200 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadImageCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadImageCommand.java @@ -114,9 +114,9 @@ public class ReadImageCommand extends LineEditingCommand { } if (!append) { - hologram.lines().clear(); + hologram.getLines().clear(); } - hologram.lines().addAll(newLines); + hologram.getLines().addAll(newLines); hologramEditor.saveChanges(hologram, ChangeType.EDIT_LINES); if (append) { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadTextCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadTextCommand.java index 5aede6eb..1470aaef 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadTextCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/ReadTextCommand.java @@ -85,7 +85,7 @@ public class ReadTextCommand extends LineEditingCommand { } } - hologram.lines().setAll(newLines); + hologram.getLines().setAll(newLines); hologramEditor.saveChanges(hologram, ChangeType.EDIT_LINES); if (FileUtils.hasFileExtension(fileToRead, "jpg", "png", "jpeg", "gif")) { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/RemoveLineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/RemoveLineCommand.java index 83ce1436..9d6ffb3a 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/RemoveLineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/RemoveLineCommand.java @@ -35,7 +35,7 @@ public class RemoveLineCommand extends LineEditingCommand implements QuickEditCo InternalHologram hologram = hologramEditor.getExistingHologram(args[0]); int lineNumber = CommandValidate.parseInteger(args[1]); - int linesAmount = hologram.lines().size(); + int linesAmount = hologram.getLines().size(); CommandValidate.check(lineNumber >= 1 && lineNumber <= linesAmount, "The line number must be between 1 and " + linesAmount + "."); @@ -44,7 +44,7 @@ public class RemoveLineCommand extends LineEditingCommand implements QuickEditCo CommandValidate.check(linesAmount >= 2, "A hologram must always have at least 1 line. If you want to delete it, use /" + context.getRootLabel() + " delete."); - hologram.lines().remove(index); + hologram.getLines().remove(index); hologramEditor.saveChanges(hologram, ChangeType.EDIT_LINES); sender.sendMessage(ColorScheme.PRIMARY + "Line " + lineNumber + " removed."); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/SetLineCommand.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/SetLineCommand.java index 26e31e63..6bdece61 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/SetLineCommand.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/commands/subs/SetLineCommand.java @@ -38,7 +38,7 @@ public class SetLineCommand extends LineEditingCommand implements QuickEditComma String serializedLine = Strings.joinFrom(" ", args, 2); int lineNumber = CommandValidate.parseInteger(args[1]); - int linesAmount = hologram.lines().size(); + int linesAmount = hologram.getLines().size(); CommandValidate.check(lineNumber >= 1 && lineNumber <= linesAmount, "The line number must be between 1 and " + linesAmount + "."); @@ -46,7 +46,7 @@ public class SetLineCommand extends LineEditingCommand implements QuickEditComma InternalHologramLine line = hologramEditor.parseHologramLine(hologram, serializedLine); - hologram.lines().set(index, line); + hologram.getLines().set(index, line); hologramEditor.saveChanges(hologram, ChangeType.EDIT_LINES); sender.sendMessage(ColorScheme.PRIMARY + "Line " + lineNumber + " changed."); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/config/HologramConfig.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/config/HologramConfig.java index a9153ecc..0463408c 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/config/HologramConfig.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/config/HologramConfig.java @@ -30,7 +30,7 @@ public class HologramConfig { public HologramConfig(InternalHologram hologram) { this.name = hologram.getName(); this.serializedLines = new ArrayList<>(); - for (InternalHologramLine line : hologram.lines()) { + for (InternalHologramLine line : hologram.getLines()) { serializedLines.add(line.getSerializedConfigValue()); } @@ -70,7 +70,7 @@ public class HologramConfig { } } - hologram.lines().addAll(lines); + hologram.getLines().addAll(lines); } private ImmutablePosition parsePosition() throws HologramLoadException { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/format/DisplayFormat.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/format/DisplayFormat.java index 65755b72..f5864eef 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/format/DisplayFormat.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/format/DisplayFormat.java @@ -89,7 +89,7 @@ public class DisplayFormat { public static void sendHologramSummary(CommandSender sender, InternalHologram hologram, boolean showWorld) { ImmutablePosition position = hologram.getPosition(); sender.sendMessage(ColorScheme.SECONDARY_DARK + "- " + ColorScheme.SECONDARY_BOLD + hologram.getName() - + ColorScheme.SECONDARY_DARK + " (" + hologram.lines().size() + " lines) at " + + ColorScheme.SECONDARY_DARK + " (" + hologram.getLines().size() + " lines) at " + (showWorld ? "world: \"" + position.getWorldName() + "\", " : "") + "x: " + position.getBlockX() + ", " + "y: " + position.getBlockY() + ", " diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologram.java index 8f4de8e6..cd07defe 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologram.java @@ -26,7 +26,7 @@ public abstract class BaseHologram extends BaseHologramComponent { this.lineTrackerManager = lineTrackerManager; } - public abstract BaseHologramLines lines(); + public abstract BaseHologramLines getLines(); protected abstract boolean isVisibleTo(Player player); @@ -39,7 +39,7 @@ public abstract class BaseHologram extends BaseHologramComponent { @Override public final void setDeleted() { super.setDeleted(); - lines().setDeleted(); + getLines().setDeleted(); } public @NotNull ImmutablePosition getPosition() { @@ -71,7 +71,7 @@ public abstract class BaseHologram extends BaseHologramComponent { checkNotDeleted(); position.set(worldName, x, y, z); - lines().updatePositions(); + getLines().updatePositions(); } protected void onWorldLoad(World world) { @@ -98,7 +98,7 @@ public abstract class BaseHologram extends BaseHologramComponent { public String toString() { return "Hologram{" + "position=" + position - + ", lines=" + lines() + + ", lines=" + getLines() + ", deleted=" + isDeleted() + "}"; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/internal/hologram/InternalHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/internal/hologram/InternalHologram.java index 745bad9f..e6a33abd 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/internal/hologram/InternalHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/internal/hologram/InternalHologram.java @@ -26,7 +26,7 @@ public class InternalHologram extends BaseHologram { } @Override - public BaseHologramLines lines() { + public BaseHologramLines getLines() { return lines; }