Skip to content

Commit

Permalink
Formatting and spelling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
d0by1 committed Nov 18, 2023
1 parent 5056316 commit 899a299
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* This class is responsible for managing the visibility of the hologram
* for certain players. It is able to show/hide the hologram for specific
* players and to automatically update the visibility according to the
* holograms settings.
* hologram's settings.
* <p>
* To modify the visibility of the hologram for a specific player, use
* {@link #setPlayerVisibility(Player, Visibility)} or {@link #resetPlayerVisibility(Player)}.
Expand All @@ -44,7 +44,7 @@
public interface HologramVisibilityManager {

/**
* Set the default visibility of the hologram. This is the visibility that is used for
* Set the default visibility of the hologram. This is the visibility used for
* players that don't have a custom visibility setting.
*
* @param visibility The default visibility of the hologram.
Expand All @@ -54,7 +54,7 @@ public interface HologramVisibilityManager {
void setDefaultVisibility(@NonNull Visibility visibility);

/**
* Get the default visibility of the hologram. This is the visibility that is used for
* Get the default visibility of the hologram. This is the visibility used for
* players that don't have a custom visibility setting.
*
* @return The default visibility of the hologram.
Expand Down Expand Up @@ -102,7 +102,7 @@ default void resetPlayerVisibility(@NonNull Player player) {

/**
* Get the visibility of the hologram for the given player. Player visibility
* is always prioritized over the default visibility and the hologram will
* is always prioritized over the default visibility, and the hologram will
* always be visible for the player if their visibility is set to visible.
*
* @param player The player to get the visibility for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public void tick() {
return;
}

if (this.positionManager.isLocationBound()
|| this.settings.isRotateHorizontal()
|| this.settings.isRotateVertical()
if (this.positionManager.isLocationBound() ||
this.settings.isRotateHorizontal() ||
this.settings.isRotateVertical()
) {
recalculate();
}
Expand Down Expand Up @@ -351,7 +351,8 @@ public void clearPages() {
}

/**
* Shift the player page indexes in visibility manager by the given amount at the given index.
* Shift the player page indexes in visibility manager
* by the given amount at the given index.
*
* @param index The index to start shifting from.
* @param shift The amount to shift by.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* line entities in a hologram.
* <p>
* Entity IDs provided by this class are shared between all pages of a hologram.
* This means that if you have a hologram with 3 lines and 2 pages, the entity
* This means that if you have a hologram with three lines and two pages, the entity
* ids for the first line on the first page and the first line on the second page
* will be the same. This makes it possible to use the same entity for the same
* line on different pages and prevent flickering caused by entity removal and
Expand All @@ -51,8 +51,10 @@ public CoreHologramEntityIDManager(@NonNull NMSAdapter nmsAdapter) {
* Returns the entity id for the line entity at the given index on the given
* line.
* <p>
* Each line can have multiple entities. For example, an item line has 2
* entities - the item and the armor stand. This method returns the entity id
* Each line can have multiple entities.
* For example, an item line has two
* entities - the item and the armor stand.
* This method returns the entity id
* for the entity at the given index.
*
* @param lineIndex The index of the line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void updateContents() {
}

/**
* Set the page that is currently selected by the given player.
* Set the page currently selected by the given player.
*
* @param player The player to set the page for.
* @param page The page to set.
Expand Down Expand Up @@ -257,7 +257,7 @@ public Set<Player> getAllowedPlayers() {
}

/**
* Get the page that is currently selected by the given player.
* Get the page currently selected by the given player.
*
* @param player The player to get the page for.
* @return The page that is currently selected by the given player.
Expand All @@ -281,7 +281,7 @@ private Optional<CoreHologramPage<?>> getPageObject(@NonNull Player player) {
}

/**
* Get the page that is currently selected by the given player.
* Get the page currently selected by the given player.
*
* @param player The player to get the page for.
* @return The page that is currently selected by the given player. If the player
Expand Down Expand Up @@ -327,9 +327,12 @@ public Collection<CoreHologramView> getViews() {
}

/**
* Get the visibility settings of players. The key is the UUID of the player and the value
* is the visibility setting of the player. If the player is not in the map, the default
* visibility setting is used. (See {@link #isVisibleByDefault()})
* Get the visibility settings of players.
* The key is the UUID of the player, and the value
* is the visibility setting of the player.
* If the player is not in the map, the default
* visibility setting is used.
* (See {@link #isVisibleByDefault()})
*
* @return The visibility settings of players.
* @see Visibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void setContent(@NonNull String content) {

this.rawContent = content;

// Conversion to the new renderer is handled by the content parsers
// The content parsers handle conversion to the new renderer
this.plugin.getContentParserManager().parse(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

import eu.decentsoftware.holograms.DecentHolograms;
import eu.decentsoftware.holograms.api.hologram.HologramLineType;
import eu.decentsoftware.holograms.core.CoreHologram;
import eu.decentsoftware.holograms.core.CoreHologramEntityIDManager;
import eu.decentsoftware.holograms.core.CoreHologramPage;
import eu.decentsoftware.holograms.core.line.CoreHologramLine;
import eu.decentsoftware.holograms.nms.NMSAdapter;
import lombok.NonNull;
Expand Down Expand Up @@ -59,7 +61,9 @@ public void destroy() {
* @return The set of players.
*/
protected Set<Player> getViewerPlayers() {
return this.parent.getParent().getParent().getVisibilityManager().getViewersAsPlayers(this.parent);
CoreHologramPage<?> parentPage = this.parent.getParent();
CoreHologram<?> parentHologram = parentPage.getParent();
return parentHologram.getVisibilityManager().getViewersAsPlayers(this.parent);
}

/**
Expand All @@ -69,7 +73,9 @@ protected Set<Player> getViewerPlayers() {
* @return The entity ID.
*/
protected int getEntityId(int entityIndex) {
CoreHologramEntityIDManager entityIDManager = this.parent.getParent().getParent().getEntityIDManager();
CoreHologramPage<?> parentPage = this.parent.getParent();
CoreHologram<?> parentHologram = parentPage.getParent();
CoreHologramEntityIDManager entityIDManager = parentHologram.getEntityIDManager();
return entityIDManager.getEntityId(parent.getIndex(), entityIndex);
}

Expand Down

0 comments on commit 899a299

Please sign in to comment.