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 06129732..20d86d9e 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,7 +37,7 @@ public class CopyCommand extends HologramSubCommand { InternalHologram toHologram = hologramEditor.getHologram(args[1]); List clonedLines = new ArrayList<>(); - for (InternalHologramLine line : fromHologram.getLines().getAll()) { + for (InternalHologramLine line : fromHologram.getLines()) { clonedLines.add(hologramEditor.parseHologramLine(toHologram, line.getSerializedConfigValue())); } 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 f7b68b7a..50895292 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 @@ -38,7 +38,7 @@ public class InfoCommand extends LineEditingCommand implements QuickEditCommand DisplayFormat.sendTitle(sender, "Lines of the hologram '" + hologram.getName() + "'"); int index = 0; - for (InternalHologramLine line : hologram.getLines().getAll()) { + for (InternalHologramLine line : hologram.getLines()) { index++; sender.sendMessage(ColorScheme.SECONDARY_BOLD + index + ColorScheme.SECONDARY_DARKER + ". " + ColorScheme.SECONDARY + line.getSerializedConfigValue()); 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 4dfbb772..bc709c0c 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.getLines().getAll()) { + for (InternalHologramLine line : hologram.getLines()) { serializedLines.add(line.getSerializedConfigValue()); } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/api/APIHologram.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/api/APIHologram.java index 28cd9b9a..29850fd9 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/api/APIHologram.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/api/APIHologram.java @@ -133,7 +133,7 @@ public class APIHologram extends BaseHologram implements Hologram { } this.allowPlaceholders = allowPlaceholders; - for (APIHologramLine line : lines.getAll()) { + for (APIHologramLine line : lines) { line.setChanged(); } } @@ -156,7 +156,7 @@ public class APIHologram extends BaseHologram implements Hologram { double height = 0.0; - for (APIHologramLine line : lines.getAll()) { + for (APIHologramLine line : lines) { height += line.getHeight(); } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologramLines.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologramLines.java index 481d70e9..adeaeebf 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologramLines.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseHologramLines.java @@ -12,7 +12,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -public class BaseHologramLines { +public class BaseHologramLines implements Iterable { private final BaseHologram hologram; private final List lines; @@ -24,6 +24,11 @@ public class BaseHologramLines { this.unmodifiableLinesView = Collections.unmodifiableList(lines); } + @Override + public Iterator iterator() { + return unmodifiableLinesView.iterator(); + } + public int size() { return lines.size(); } @@ -32,10 +37,6 @@ public class BaseHologramLines { return lines.isEmpty(); } - public List getAll() { - return unmodifiableLinesView; - } - public T get(int index) { return lines.get(index); }