Skip to content

Commit

Permalink
Fix missing params, returns, and throws for javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
IanTapply22 committed Feb 4, 2025
1 parent d006617 commit e8edcb8
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
* <p>
* The permission is formatted as "wynncraft.command.[command_name]" for simplicity.
* Additionally, you can also assign required permission to also be a rank permission
* <p>
*/
@Getter
public enum CommandPermission {
/**
* An example permission for a command to be used
*/
EXAMPLE("wynncraft.command.example");

private final String permission;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import com.iantapply.wynncraft.command.WynncraftCommand;
import org.bukkit.command.CommandSender;

/**
* A command used to change the rank tag that appears in chat
*/
public class ChangeTagCommand extends WynncraftCommand {
@Override
public String name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import com.iantapply.wynncraft.Wynncraft;

/**
* Handles staging all cosmetic related commands to the command core registry
*/
public class CosmeticCommandsCore {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

import java.util.ArrayList;

/**
* A command that opens the legacy gold coins menu that can be used to redeem items
* with the old currency used before September 2016.
*/
public class BuyCommand extends WynncraftCommand {
@Override
public String name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import com.iantapply.wynncraft.command.WynncraftCommand;
import org.bukkit.command.CommandSender;

/**
* A command used to claim a thrown ingredient bomb
*/
public class ClaimIngredientBombCommand extends WynncraftCommand {
@Override
public String name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import com.iantapply.wynncraft.command.WynncraftCommand;
import org.bukkit.command.CommandSender;

/**
* A command used to claim a thrown item bomb
*/
public class ClaimItemBombCommand extends WynncraftCommand {
@Override
public String name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

import java.util.ArrayList;

/**
* A command that opens the character selector menu that cna be used to change
* to a different character/profile
*/
public class ClassCommand extends WynncraftCommand {
@Override
public String name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public Connection connection() {
*
* @param silent Whether the database should be connected to silently not displaying
* non-fatal logged outputs.
* @return The connection that is used to interact with the DB. This will stay alive
*/
public Connection connect(boolean silent) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public static void finishQueryWithoutResult(PreparedStatement queryStatement) {
* Finishes a query by executing the statement and closing it
* @param queryStatement The statement to finish
* @return The result of the query. An empty array if there is an SQL error that occurs
*
* @throws SQLException Throws an SQL exception if it can't execute the query because of a DB issue or SQL issue
*/
public static String[] finishQuery(PreparedStatement queryStatement) throws SQLException {
ResultSet resultSet = queryStatement.executeQuery();
Expand Down Expand Up @@ -344,6 +346,8 @@ public static void dropTable(Connection connection, String table) throws SQLExce
* @param connection The database connection
* @param table The name of the table to check for existence
* @return A boolean indicating if the table exists. Returns false upon SQL error.
*
* @throws SQLException Throws an SQL exception if it can't execute the query because of a DB issue or SQL issue
*/
public static boolean checkTableExists(Connection connection, String table) throws SQLException {
// Use database metadata to check for the table's existence
Expand Down Expand Up @@ -422,6 +426,8 @@ public static void createColumn(Connection connection, String table, String colu
* @param table The name of the table that the column appears in
* @param column The name of the column to search for
* @return Whether the column exists as a boolean. Returns false upon SQL error
*
* @throws SQLException Throws an SQL exception if it can't execute the query because of a DB issue or SQL issue
*/
public static boolean checkColumnExists(Connection connection, String table, String column) throws SQLException {
String query = "SELECT COUNT(*) FROM information_schema.columns " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ default String migratedVersion() {

/**
* Migrates the model on a table and creates the columns by default
*
* @param init Whether this is the initial round of migration and will migrate the model
*/
default void migrate(boolean init) {
if (init) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/iantapply/wynncraft/gui/WynncraftGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public WynncraftEvent triggerEvent() {
/**
* Starts the GUI updater to update the GUI every 20 ticks
* This should be executed upon the opening of the GUI
*
* @param plugin The plugin instance that will have the task time schedules thread attached to it
*/
public void startUpdater(JavaPlugin plugin) {
this.updater = Bukkit.getScheduler().runTaskTimer(plugin, this::update, 0, 20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* An example class to represent how a premade border item can be created
*/
public class BlackGlassPaneBorder {

/**
* The item to add to the border
* @param slot The slot to add the border item to
* @return The item that will fill the selected slot
*/
public static GUIClickableItem getItem(int slot) {
return new GUIClickableItem() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* An example class to represent how a premade filler item can be created
*/
public class CookieFillerItem {

/**
* The item to add as a filler
* @param slot The slot to add the filler item to
* @return The item that will fill the selected slot
*/
public static GUIClickableItem getItem(int slot) {
return new GUIClickableItem() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public GUIClickableItem fillerItem(int slot) {
return CookieFillerItem.getItem(slot);
}

/**
* The item to add to the border
* @param slot The slot to add the border item to
* @return The item that will fill the selected slot
*/
@Override
public GUIClickableItem borderItem(int slot) {
return BlackGlassPaneBorder.getItem(slot);
Expand Down Expand Up @@ -84,7 +89,7 @@ public WynncraftItem getItem() {
/**
* Determines what happens when the GUI is closed
*
* @param player
* @param player The player that closed the GUI
*/
@Override
public void onClose(Player player) {
Expand All @@ -94,7 +99,7 @@ public void onClose(Player player) {
/**
* Determines what happens when the GUI is opened
*
* @param player
* @param player The player that opened the GUI
*/
@Override
public void open(Player player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ public WynncraftItem getFinalizedItem() {

/**
* Helper functions to add and remove item from arrays
* @param range The positive effect range object that contains lore, NBT data, and other visual elements
*/

public void addPositiveEffectRange(PositiveRange range) {
this.positiveEffectRanges.add(range);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*
* @author : $Author: brian $
* @version : $Revision: 1.1 $
* <p>
* <hr><p><a href="http://www.mbari.org">
* The Monterey Bay Aquarium Research Institute (MBARI)</a> provides this
* documentation and code &quot;as is&quot;, with no warranty, express or
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/iantapply/wynncraft/npc/NPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ default void despawn() {}
/**
* What should be done when the player interacts with the NPC
* This is usually starting dialogue or a new quest
*
* @param player The player that executed the interaction
*/
void onInteract(Player player);

Expand Down Expand Up @@ -101,6 +103,7 @@ default ArrayList<Dialogue> dialogues() {
/**
* Starts the dialogue sequence for the player when they interact with the NPC
* @param player The player to start the dialogue for
* @param plugin The plugin instance to run the task scheduler on
*/
default void startDialogue(Player player, Plugin plugin) {
// Play the dialogues in order and for the length specified in seconds after the one before it is done
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.iantapply.wynncraft.rank.benefits;

public class ChampionBenefits implements RankBenefit {
}
/**
* Contains the benefits that are bundled with the champion tier rank
*/
public class ChampionBenefits implements RankBenefit { }

0 comments on commit e8edcb8

Please sign in to comment.