Skip to content

Commit

Permalink
Spelling and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
d0by1 committed Dec 28, 2023
1 parent faa524d commit d919a77
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 39 deletions.
24 changes: 12 additions & 12 deletions src/main/java/eu/decentsoftware/holograms/api/DHAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import java.util.List;

/**
* A simple access point to the DecentHolograms API. Using this class
* you can easily manipulate with holograms and their contents.
* A simple access point to the DecentHolograms API.
* Using this class, you can manipulate with holograms and their contents.
*
* @author d0by
* @since 2.0.12
Expand Down Expand Up @@ -411,7 +411,7 @@ public static HologramLine addHologramLine(HologramPage page, ItemStack item) th
}

/**
* Add a new line into hologram page.
* Add a new line into the hologram page.
*
* @param page The page.
* @param content New lines content.
Expand All @@ -432,7 +432,7 @@ public static HologramLine addHologramLine(HologramPage page, String content) th
* @param lineIndex Index of the new line.
* @param material Material for new item line content.
* @return The new line.
* @throws IllegalArgumentException If hologram or material is null or the indexes are invalid.
* @throws IllegalArgumentException If the hologram or material is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(Hologram hologram, int lineIndex, Material material) throws IllegalArgumentException {
Validate.notNull(material);
Expand All @@ -446,7 +446,7 @@ public static HologramLine insertHologramLine(Hologram hologram, int lineIndex,
* @param lineIndex Index of the new line.
* @param item ItemStack for new item line content.
* @return The new line.
* @throws IllegalArgumentException If hologram or item is null or the indexes are invalid.
* @throws IllegalArgumentException If the hologram or item is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(Hologram hologram, int lineIndex, ItemStack item) throws IllegalArgumentException {
Validate.notNull(item);
Expand Down Expand Up @@ -474,7 +474,7 @@ public static HologramLine insertHologramLine(Hologram hologram, int lineIndex,
* @param lineIndex Index of the new line.
* @param material Material for the new line content.
* @return The new line.
* @throws IllegalArgumentException If hologram or material is null or the indexes are invalid.
* @throws IllegalArgumentException If the hologram or material is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(Hologram hologram, int pageIndex, int lineIndex, Material material) throws IllegalArgumentException {
Validate.notNull(material);
Expand All @@ -489,7 +489,7 @@ public static HologramLine insertHologramLine(Hologram hologram, int pageIndex,
* @param lineIndex Index of the new line.
* @param item ItemStack for the new line content.
* @return The new line.
* @throws IllegalArgumentException If hologram or item is null or the indexes are invalid.
* @throws IllegalArgumentException If the hologram or item is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(Hologram hologram, int pageIndex, int lineIndex, ItemStack item) throws IllegalArgumentException {
Validate.notNull(item);
Expand Down Expand Up @@ -522,7 +522,7 @@ public static HologramLine insertHologramLine(Hologram hologram, int pageIndex,
* @param index Index of the new line.
* @param material Material as new line content.
* @return The new line.
* @throws IllegalArgumentException If page or material is null or the indexes are invalid.
* @throws IllegalArgumentException If the page or material is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(HologramPage page, int index, Material material) throws IllegalArgumentException {
Validate.notNull(material);
Expand All @@ -536,7 +536,7 @@ public static HologramLine insertHologramLine(HologramPage page, int index, Mate
* @param index Index of the new line.
* @param item ItemStack as new line content.
* @return The new line.
* @throws IllegalArgumentException If page or item is null or the indexes are invalid.
* @throws IllegalArgumentException If the page or item is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(HologramPage page, int index, ItemStack item) throws IllegalArgumentException {
Validate.notNull(item);
Expand All @@ -550,7 +550,7 @@ public static HologramLine insertHologramLine(HologramPage page, int index, Item
* @param index Index of the new line.
* @param content New lines content.
* @return The new line.
* @throws IllegalArgumentException If page or content is null or the indexes are invalid.
* @throws IllegalArgumentException If the page or content is null or the indexes are invalid.
*/
public static HologramLine insertHologramLine(HologramPage page, int index, String content) throws IllegalArgumentException {
HologramLine oldLine = page.getLine(index);
Expand Down Expand Up @@ -609,7 +609,7 @@ public static void setHologramLine(HologramLine line, String content) throws Ill
// Set the new content
line.setContent(content);

// If the new type is the same as the previous type, just update.
// If the new type is the same as the previous type, update.
if ((prevType == HologramLineType.TEXT || prevType == HologramLineType.HEAD || prevType == HologramLineType.SMALLHEAD) && prevType == line.getType()) {
line.update();
}
Expand Down Expand Up @@ -835,7 +835,7 @@ public static void setHologramLines(Hologram hologram, List<String> lines) throw
* @param hologram The hologram.
* @param pageIndex The page.
* @param lines The new lines.
* @throws IllegalArgumentException If hologram or lines is null.
* @throws IllegalArgumentException If hologram or lines are null.
*/
public static void setHologramLines(Hologram hologram, int pageIndex, List<String> lines) throws IllegalArgumentException {
Validate.notNull(hologram);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class CustomTextAnimation extends TextAnimation {

private static final DecentHolograms DECENT_HOLOGRAMS = DecentHologramsAPI.get();
private final @NonNull List<String> steps;
private final List<String> steps;

public CustomTextAnimation(@NonNull String name, int speed, int pause, @NonNull List<String> steps) {
super(name, speed, pause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public interface CommandBase {
CommandBase getSubCommand(String name);

/**
* Get names of all sub commands.
* Get the names of all sub commands.
*
* @return names of all sub commands.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static Hologram fromFile(final @NotNull String filePath) throws LocationP
protected final Lock lock = new ReentrantLock();

/**
* This object server as a mutex for all visibility related operations.
* This object server as a mutex for all visibility-related operations.
* <p>
* For example, when we want to hide a hologram, that's already being
* updated on another thread, we would need to wait for the update to
Expand Down Expand Up @@ -392,7 +392,7 @@ public void setFacing(float facing) {

super.setFacing(facing);

// Update the facing for all lines, that don't already have a different facing set.
// Update the facing for all lines, that don't yet have a different facing set.
// We want to keep the hologram facing working as a "default" value, but we don't want
// it to override custom line facing.
for (HologramPage page : this.pages) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public String toString() {
* <p>
* This method also parses the content and updates the line.
* <p>
* NOTE: The new content can be null but if it is, it will be
* NOTE: The new content can be null, but if it is, it will be
* replaced with an empty string. It is recommended to not use
* null as content.
*
Expand Down Expand Up @@ -346,9 +346,9 @@ private String parsePlaceholders(@NotNull String string, @NonNull Player player,
if (papi) {
string = PAPI.setPlaceholders(player, string);
if (string == null) {
// Some PlacehoderAPI placeholders might be replaced with null, so if the line content
// Some PlaceholderAPI placeholders might be replaced with null, so if the line content
// is just a single placeholder, there is a possibility that the line will be null. So,
// if that happens, just replace the null with an empty string.
// if that happens, replace the null with an empty string.
string = "";
}
}
Expand All @@ -370,7 +370,7 @@ private String parseCustomReplacements() {
* Check if the given player has the permission to see this line, if any.
*
* @param player The player.
* @return True if the player has the permission to see this line, false otherwise.
* @return True, if the player has the permission to see this line, false otherwise.
*/
public boolean hasPermission(@NonNull Player player) {
return permission == null || permission.isEmpty() || player.hasPermission(permission);
Expand All @@ -381,7 +381,7 @@ public boolean hasPermission(@NonNull Player player) {
* if the player has the permission to see this line and if they are in the display
* range. Then it updates the visibility accordingly.
*
* @param player The player to update visbility for.
* @param player The player to update visibility for.
*/
public void updateVisibility(@NonNull Player player) {
if (isVisible(player) && !(hasPermission(player) && isInDisplayRange(player))) {
Expand Down Expand Up @@ -530,7 +530,7 @@ public boolean isInDisplayRange(@NonNull Player player) {

@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isInUpdateRange(@NonNull Player player) {
return parent == null || parent.getParent().isInDisplayRange(player);
return parent == null || parent.getParent().isInUpdateRange(player);
}

public double getOffsetX() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class HologramManager extends Ticked {
private final Set<HologramLine> temporaryLines = ConcurrentHashMap.newKeySet();

/**
* Map of holograms to load, when their respective world loads.
* Map of holograms to load when their respective world loads.
* <p>
* There were issues with world management plugins loading worlds
* after holograms. Due to that, holograms in these worlds were skipped
Expand All @@ -48,7 +48,7 @@ public HologramManager(DecentHolograms decentHolograms) {
this.decentHolograms = decentHolograms;
this.register();

S.async(this::reload); // Reload when worlds are ready
S.async(this::reload); // Reload when the worlds are ready
}

@Override
Expand Down Expand Up @@ -89,11 +89,11 @@ public void updateVisibility(@NonNull Player player, @NonNull Hologram hologram)
}

/**
* Spawn a temporary line that is going to disappear after the given duration.
* Spawn a temporary line going to disappear after the given duration.
*
* @param location Location of the line.
* @param content Content of the line.
* @param duration Duration to disappear after. (in ticks)
* @param duration Duration to disappear after. (In ticks)
* @return The Hologram Line.
*/
public HologramLine spawnTemporaryHologramLine(@NonNull Location location, String content, long duration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void executeActions(@NonNull Player player, @NonNull ClickType clickType)
String actionData = action.getData();
if (actionName.contains("_PAGE") && actionData == null) {
action.setData(getParent().getName());
} else if (actionName.equals("PAGE") && actionData != null && actionData.matches("[\\d]+")) {
} else if (actionName.equals("PAGE") && actionData != null && actionData.matches("\\d+")) {
action.setData(getParent().getName() + ":" + actionData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public Set<UUID> getViewers() {
}

/**
* Get List of all players that currently see this hologram.
* Get the List of all players that currently see this hologram.
*
* @return List of all players that currently see this hologram.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static int randomInt(int min, int max) {
}

/**
* @return Random float between 0 and 1
* @return Random float between zero and one.
*/
public static float randomFloat() {
return ThreadLocalRandom.current().nextFloat();
Expand Down Expand Up @@ -190,7 +190,7 @@ private static int parseInt(String string) {
/**
* Check whether the given plugin is enabled.
*
* @param name The plugins name.
* @param name The plugin's name.
* @return The boolean.
*/
public static boolean isPluginEnabled(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DExecutor {
/**
* Initialize DExecutor. This method will set up ExecutorService for DecentHolograms.
*
* @param threads Amount of threads to use.
* @param threads Number of threads to use.
*/
public static void init(int threads) {
if (!initialized) {
Expand Down Expand Up @@ -94,8 +94,8 @@ public static void execute(@NonNull Runnable runnable) {
service.execute(runnable);
}

private final @NonNull ExecutorService executor;
private final @NonNull DList<CompletableFuture<Void>> running;
private final ExecutorService executor;
private final DList<CompletableFuture<Void>> running;

DExecutor(@NonNull ExecutorService executor, int estimate) {
this.executor = executor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
*/
public class GradientPattern implements Pattern {

private static final java.util.regex.Pattern PATTERN = java.util.regex.Pattern.compile("[<{]#([A-Fa-f0-9]{6})[}>](((?![<{]#[A-Fa-f0-9]{6}[}>]).)*)[<{]/#([A-Fa-f0-9]{6})[}>]");
private static final java.util.regex.Pattern PATTERN = java.util.regex.Pattern.compile(
"[<{]#([A-Fa-f0-9]{6})[}>](((?![<{]#[A-Fa-f0-9]{6}[}>]).)*)[<{]/#([A-Fa-f0-9]{6})[}>]"
);

/**
* Applies a gradient pattern to the provided String.
* Output might be the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
* @return The new String with an applied pattern
*/
public String process(String string) {
Matcher matcher = PATTERN.matcher(string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface Pattern {
* Output might be the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
* @return The new String with an applied pattern
*/
String process(String string);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class RainbowPattern implements Pattern {
* Output might be the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
* @return The new String with an applied pattern
*/
public String process(String string) {
Matcher matcher = pattern.matcher(string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SolidPattern implements Pattern {
* Output might be the same as the input if this pattern is not present.
*
* @param string The String to which this pattern should be applied to
* @return The new String with applied pattern
* @return The new String with an applied pattern
*/
public String process(String string) {
Matcher matcher = PATTERN.matcher(string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.bukkit.event.HandlerList;

/**
* This event is called after DecentHolograms plugin is reloaded.
* This event is called after the DecentHolograms plugin is reloaded.
*
* @author d0by
* @since 2.7.8
Expand Down

0 comments on commit d919a77

Please sign in to comment.