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 98d0d804..35edaff9 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 @@ -77,11 +77,11 @@ public class APIHologram extends BaseHologram implements Hologr } private APITextLine createTextLine(String text) { - return new APITextLine(this, getNMSManager(), text); + return new APITextLine(this, text); } private APIItemLine createItemLine(ItemStack itemStack) { - return new APIItemLine(this, getNMSManager(), itemStack); + return new APIItemLine(this, itemStack); } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIItemLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIItemLine.java index 136107c3..2b353494 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIItemLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APIItemLine.java @@ -1,7 +1,6 @@ package me.filoghost.holographicdisplays.object.api; import me.filoghost.holographicdisplays.api.line.ItemLine; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.object.base.BaseItemLine; import org.bukkit.inventory.ItemStack; @@ -9,8 +8,8 @@ public class APIItemLine extends BaseItemLine implements ItemLine, APIHologramLi private final APIHologram parent; - public APIItemLine(APIHologram parent, NMSManager nmsManager, ItemStack itemStack) { - super(parent, nmsManager, itemStack); + public APIItemLine(APIHologram parent, ItemStack itemStack) { + super(parent, itemStack); this.parent = parent; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APITextLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APITextLine.java index 2fb8e730..ed5dc940 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APITextLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/api/APITextLine.java @@ -1,15 +1,14 @@ package me.filoghost.holographicdisplays.object.api; import me.filoghost.holographicdisplays.api.line.TextLine; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.object.base.BaseTextLine; public class APITextLine extends BaseTextLine implements TextLine, APIHologramLine { private final APIHologram parent; - public APITextLine(APIHologram parent, NMSManager nmsManager, String text) { - super(parent, nmsManager, text); + public APITextLine(APIHologram parent, String text) { + super(parent, text); this.parent = parent; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramLine.java index e33d22a1..d9d84930 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramLine.java @@ -15,15 +15,13 @@ import org.bukkit.World; public abstract class BaseHologramLine extends BaseHologramComponent implements StandardHologramLine { - private final StandardHologram hologram; - private final NMSManager nmsManager; + private final BaseHologram hologram; private boolean isSpawned; - protected BaseHologramLine(StandardHologram hologram, NMSManager nmsManager) { + protected BaseHologramLine(BaseHologram hologram) { Preconditions.notNull(hologram, "parent hologram"); this.hologram = hologram; - this.nmsManager = nmsManager; } @Override @@ -32,7 +30,7 @@ public abstract class BaseHologramLine extends BaseHologramComponent implements } protected final NMSManager getNMSManager() { - return nmsManager; + return hologram.getNMSManager(); } @Override 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 567d10a0..6f0592ad 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 @@ -8,9 +8,7 @@ package me.filoghost.holographicdisplays.object.base; import me.filoghost.fcommons.Preconditions; import me.filoghost.fcommons.logging.Log; import me.filoghost.holographicdisplays.api.handler.PickupHandler; -import me.filoghost.holographicdisplays.core.hologram.StandardHologram; import me.filoghost.holographicdisplays.core.hologram.StandardItemLine; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.core.nms.SpawnFailedException; import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand; import me.filoghost.holographicdisplays.core.nms.entity.NMSItem; @@ -28,8 +26,8 @@ public abstract class BaseItemLine extends BaseTouchableLine implements Standard private NMSArmorStand itemVehicleEntity; private PickupHandler pickupHandler; - public BaseItemLine(StandardHologram hologram, NMSManager nmsManager, ItemStack itemStack) { - super(hologram, nmsManager); + public BaseItemLine(BaseHologram hologram, ItemStack itemStack) { + super(hologram); setItemStack(itemStack); } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTextLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTextLine.java index da09a485..ed92d9bb 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTextLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTextLine.java @@ -5,9 +5,7 @@ */ package me.filoghost.holographicdisplays.object.base; -import me.filoghost.holographicdisplays.core.hologram.StandardHologram; import me.filoghost.holographicdisplays.core.hologram.StandardTextLine; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.core.nms.SpawnFailedException; import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand; import me.filoghost.holographicdisplays.core.placeholder.RelativePlaceholder; @@ -23,8 +21,8 @@ public abstract class BaseTextLine extends BaseTouchableLine implements Standard private String text; private NMSArmorStand textEntity; - public BaseTextLine(StandardHologram hologram, NMSManager nmsManager, String text) { - super(hologram, nmsManager); + public BaseTextLine(BaseHologram hologram, String text) { + super(hologram); this.relativePlaceholders = new ArrayList<>(); setText(text); } 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 7af9413c..81509de6 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 @@ -8,9 +8,7 @@ package me.filoghost.holographicdisplays.object.base; import me.filoghost.fcommons.logging.Log; import me.filoghost.holographicdisplays.api.handler.TouchHandler; import me.filoghost.holographicdisplays.core.DebugLogger; -import me.filoghost.holographicdisplays.core.hologram.StandardHologram; import me.filoghost.holographicdisplays.core.hologram.StandardTouchableLine; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.core.nms.SpawnFailedException; import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand; import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime; @@ -37,8 +35,8 @@ public abstract class BaseTouchableLine extends BaseHologramLine implements Stan private NMSArmorStand slimeVehicleEntity; - protected BaseTouchableLine(StandardHologram hologram, NMSManager nmsManager) { - super(hologram, nmsManager); + protected BaseTouchableLine(BaseHologram hologram) { + super(hologram); } @Override 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 1a414210..15278d7b 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 @@ -23,11 +23,11 @@ public class InternalHologram extends BaseHologram { } public InternalTextLine createTextLine(String text, String serializedConfigValue) { - return new InternalTextLine(this, getNMSManager(), text, serializedConfigValue); + return new InternalTextLine(this, text, serializedConfigValue); } public InternalItemLine createItemLine(ItemStack icon, String serializedConfigValue) { - return new InternalItemLine(this, getNMSManager(), icon, serializedConfigValue); + return new InternalItemLine(this, icon, serializedConfigValue); } public String getName() { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalItemLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalItemLine.java index 1295c287..80cb79b8 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalItemLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalItemLine.java @@ -5,8 +5,6 @@ */ package me.filoghost.holographicdisplays.object.internal; -import me.filoghost.holographicdisplays.core.hologram.StandardHologram; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.object.base.BaseItemLine; import org.bukkit.inventory.ItemStack; @@ -14,8 +12,8 @@ public class InternalItemLine extends BaseItemLine implements InternalHologramLi private final String serializedConfigValue; - protected InternalItemLine(StandardHologram hologram, NMSManager nmsManager, ItemStack itemStack, String serializedConfigValue) { - super(hologram, nmsManager, itemStack); + protected InternalItemLine(InternalHologram hologram, ItemStack itemStack, String serializedConfigValue) { + super(hologram, itemStack); this.serializedConfigValue = serializedConfigValue; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalTextLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalTextLine.java index b202bb9b..3b63c98d 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalTextLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/internal/InternalTextLine.java @@ -5,16 +5,14 @@ */ package me.filoghost.holographicdisplays.object.internal; -import me.filoghost.holographicdisplays.core.hologram.StandardHologram; -import me.filoghost.holographicdisplays.core.nms.NMSManager; import me.filoghost.holographicdisplays.object.base.BaseTextLine; public class InternalTextLine extends BaseTextLine implements InternalHologramLine { private final String serializedConfigValue; - protected InternalTextLine(StandardHologram hologram, NMSManager nmsManager, String text, String serializedConfigValue) { - super(hologram, nmsManager, text); + protected InternalTextLine(InternalHologram hologram, String text, String serializedConfigValue) { + super(hologram, text); this.serializedConfigValue = serializedConfigValue; }