From d8891796cd411df9109e28e630d05ea294a015a1 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 5 May 2024 21:28:04 -0700 Subject: [PATCH] JavaDoc fixes and fix for Particle enums --- .../bentobox/api/commands/CompositeCommand.java | 2 +- .../api/commands/island/team/IslandTeamGUI.java | 1 - .../java/world/bentobox/bentobox/api/user/User.java | 12 +++++------- .../bentobox/bentobox/database/objects/Island.java | 6 +++--- .../bentobox/database/objects/TeamInvite.java | 2 +- .../bentobox/bentobox/managers/IslandsManager.java | 4 ++-- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java index 57081bac1..383f5bab2 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java @@ -520,11 +520,11 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi /** * Convenience method to check if a user has a team. + * Consider checking the island itself {@link Island#inTeam(UUID)} * * @param world - the world to check * @param user - the User * @return true if player is in a team - * @see Consider checking the island itself {@link Island#inTeam(UUID)} */ protected boolean inTeam(World world, User user) { return plugin.getIslands().inTeam(world, user.getUniqueId()); diff --git a/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamGUI.java b/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamGUI.java index 602fa2881..c85ed76f8 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamGUI.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamGUI.java @@ -528,7 +528,6 @@ public class IslandTeamGUI { /** * Creates text to describe the status of the player - * @param user2 user asking to see the status * @param offlineMember member of the team * @return string */ diff --git a/src/main/java/world/bentobox/bentobox/api/user/User.java b/src/main/java/world/bentobox/bentobox/api/user/User.java index d91d402fe..41e9601ea 100644 --- a/src/main/java/world/bentobox/bentobox/api/user/User.java +++ b/src/main/java/world/bentobox/bentobox/api/user/User.java @@ -65,7 +65,8 @@ public class User implements MetaDataAble { private static final Map> VALIDATION_CHECK; static { Map> v = new EnumMap<>(Particle.class); - v.put(Particle.DUST, Particle.DustOptions.class); + v.put(Enums.getIfPresent(Particle.class, "DUST") + .or(Enums.getIfPresent(Particle.class, "REDSTONE").or(Particle.FLAME)), Particle.DustOptions.class); v.put(Particle.ITEM, ItemStack.class); v.put(Particle.ITEM_COBWEB, ItemStack.class); v.put(Particle.FALLING_DUST, BlockData.class); @@ -713,8 +714,7 @@ public class User implements MetaDataAble { * server's view distance. * * @param particle Particle to display. - * @param dustOptions Particle.DustOptions for the particle to display. Cannot - * be null when particle is {@link Particle#REDSTONE}. + * @param dustOptions Particle.DustOptions for the particle to display. * @param x X coordinate of the particle to display. * @param y Y coordinate of the particle to display. * @param z Z coordinate of the particle to display. @@ -749,8 +749,7 @@ public class User implements MetaDataAble { * server's view distance. Compatibility method for older usages. * * @param particle Particle to display. - * @param dustOptions Particle.DustOptions for the particle to display. Cannot - * be null when particle is {@link Particle#REDSTONE}. + * @param dustOptions Particle.DustOptions for the particle to display. * @param x X coordinate of the particle to display. * @param y Y coordinate of the particle to display. * @param z Z coordinate of the particle to display. @@ -764,8 +763,7 @@ public class User implements MetaDataAble { * server's view distance. * * @param particle Particle to display. - * @param dustOptions Particle.DustOptions for the particle to display. Cannot - * be null when particle is {@link Particle#REDSTONE}. + * @param dustOptions Particle.DustOptions for the particle to display. * @param x X coordinate of the particle to display. * @param y Y coordinate of the particle to display. * @param z Z coordinate of the particle to display. diff --git a/src/main/java/world/bentobox/bentobox/database/objects/Island.java b/src/main/java/world/bentobox/bentobox/database/objects/Island.java index 2be8fa824..2f19c9ff2 100644 --- a/src/main/java/world/bentobox/bentobox/database/objects/Island.java +++ b/src/main/java/world/bentobox/bentobox/database/objects/Island.java @@ -1055,7 +1055,6 @@ public class Island implements DataObject, MetaDataAble { * @param flag - flag * @param value - Use RanksManager settings, e.g. RanksManager.MEMBER * @param doSubflags - whether to set subflags - * @return true if this causes a flag change */ public void setFlag(Flag flag, int value, boolean doSubflags) { if (flags.containsKey(flag.getID()) && flags.get(flag.getID()) != value) { @@ -1219,7 +1218,7 @@ public class Island implements DataObject, MetaDataAble { * the {@link world.bentobox.bentobox.api.events.island.IslandRankChangeEvent}. * * @param uuid UUID of the player - * @param rank rank value + * @param newRank rank value * @since 1.1 */ public void setRank(@Nullable UUID uuid, int newRank) { @@ -2019,7 +2018,8 @@ public class Island implements DataObject, MetaDataAble { } /** - * @param primary the primary to set + * Set this island to be the primary for this user + * @param userID user UUID */ public void setPrimary(UUID userID) { if (getPrimaries().add(userID)) { diff --git a/src/main/java/world/bentobox/bentobox/database/objects/TeamInvite.java b/src/main/java/world/bentobox/bentobox/database/objects/TeamInvite.java index 70634fc4b..0988a0424 100644 --- a/src/main/java/world/bentobox/bentobox/database/objects/TeamInvite.java +++ b/src/main/java/world/bentobox/bentobox/database/objects/TeamInvite.java @@ -35,7 +35,7 @@ public class TeamInvite implements DataObject { * @param type - invitation type, e.g., coop, team, trust * @param inviter - UUID of inviter * @param invitee - UUID of invitee - * @param island - the unique ID of the island this invite is for + * @param islandID - the unique ID of the island this invite is for */ public TeamInvite(Type type, UUID inviter, UUID invitee, String islandID) { this.type = type; diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java index f1741721f..ad2efdba5 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java @@ -145,7 +145,7 @@ public class IslandsManager { /** * Used only for testing. Sets the database to a mock database. * - * @param handler - handler + * @param h - handler */ public void setHandler(@NonNull Database h) { handler = h; @@ -1518,11 +1518,11 @@ public class IslandsManager { /** * Checks if a player is in any team in this world. Note that the player may have * multiple islands in the world, any one of which may have a team. + * Consider checking the island itself {@link Island#inTeam(UUID)} * * @param world - world * @param playerUUID - player's UUID * @return true if in team, false if not - * @see Consider checking the island itself {@link Island#inTeam(UUID)} */ public boolean inTeam(World world, @NonNull UUID playerUUID) { return this.islandCache.getIslands(world, playerUUID).stream()