Rearrange methods

This commit is contained in:
filoghost 2021-08-26 15:19:25 +02:00
parent 11abb356d6
commit 8a9642d7fc
2 changed files with 21 additions and 21 deletions

View File

@ -26,6 +26,14 @@ public interface Hologram {
*/
@NotNull HologramLines lines();
/**
* Returns the {@link VisibilitySettings} of this hologram.
*
* @return the VisibilitySettings of this hologram
* @since 1
*/
@NotNull VisibilitySettings getVisibilitySettings();
/**
* Returns the current position.
*
@ -72,14 +80,6 @@ public interface Hologram {
*/
void setPosition(@NotNull Location location);
/**
* Returns the {@link VisibilitySettings} of this hologram.
*
* @return the VisibilitySettings of this hologram
* @since 1
*/
@NotNull VisibilitySettings getVisibilitySettings();
/**
* Checks if the hologram will track and replace placeholders.
* This is false by default.

View File

@ -18,7 +18,7 @@ public class APIHologram extends BaseHologram implements Hologram {
private final APIHologramLines lines;
private final Plugin plugin;
private final APIHologramManager apiHologramManager;
private final APIHologramManager hologramManager;
private final DefaultVisibilitySettings visibilitySettings;
private boolean allowPlaceholders;
@ -26,13 +26,13 @@ public class APIHologram extends BaseHologram implements Hologram {
protected APIHologram(
ImmutablePosition position,
Plugin plugin,
APIHologramManager apiHologramManager,
APIHologramManager hologramManager,
LineTrackerManager lineTrackerManager) {
super(position, lineTrackerManager);
Preconditions.notNull(plugin, "plugin");
this.lines = new APIHologramLines(this);
this.plugin = plugin;
this.apiHologramManager = apiHologramManager;
this.hologramManager = hologramManager;
this.visibilitySettings = new DefaultVisibilitySettings();
}
@ -42,8 +42,13 @@ public class APIHologram extends BaseHologram implements Hologram {
}
@Override
public Plugin getCreatorPlugin() {
return plugin;
public @NotNull DefaultVisibilitySettings getVisibilitySettings() {
return visibilitySettings;
}
@Override
public boolean isAllowPlaceholders() {
return allowPlaceholders;
}
@Override
@ -61,8 +66,8 @@ public class APIHologram extends BaseHologram implements Hologram {
}
@Override
public boolean isAllowPlaceholders() {
return allowPlaceholders;
public Plugin getCreatorPlugin() {
return plugin;
}
@Override
@ -70,14 +75,9 @@ public class APIHologram extends BaseHologram implements Hologram {
return visibilitySettings.isVisibleTo(player);
}
@Override
public @NotNull DefaultVisibilitySettings getVisibilitySettings() {
return visibilitySettings;
}
@Override
public void delete() {
apiHologramManager.deleteHologram(this);
hologramManager.deleteHologram(this);
}
}