Skip to content

Commit 47bdadf

Browse files
CopilotBenCodez
andcommitted
Fix all 16 javadoc warnings in VoteParty.java
Co-authored-by: BenCodez <17074231+BenCodez@users.noreply.github.com>
1 parent 10842a8 commit 47bdadf

1 file changed

Lines changed: 83 additions & 0 deletions

File tree

  • VotingPlugin/src/main/java/com/bencodez/votingplugin/specialrewards/voteparty

‎VotingPlugin/src/main/java/com/bencodez/votingplugin/specialrewards/voteparty/VoteParty.java‎

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,20 @@ public class VoteParty implements Listener {
3636

3737
private VotingPluginMain plugin;
3838

39+
/**
40+
* Constructs a new VoteParty.
41+
*
42+
* @param plugin the main plugin instance
43+
*/
3944
public VoteParty(VotingPluginMain plugin) {
4045
this.plugin = plugin;
4146
}
4247

48+
/**
49+
* Adds a vote total for the user.
50+
*
51+
* @param user the voting plugin user
52+
*/
4353
public void addTotal(VotingPluginUser user) {
4454
setTotalVotes(getTotalVotes() + 1);
4555
user.setVotePartyVotes(user.getVotePartyVotes() + 1);
@@ -63,6 +73,12 @@ public void addVotePlayer(VotingPluginUser user) {
6373
}
6474
}
6575

76+
/**
77+
* Checks if vote party requirements are met and triggers if appropriate.
78+
*
79+
* @param user the voting plugin user
80+
* @param forceBungee whether to force Bungee processing
81+
*/
6682
public void check(VotingPluginUser user, boolean forceBungee) {
6783
if (getTotalVotes() < getVotesRequired()) {
6884
plugin.extraDebug("Not enough votes for vote party: " + getTotalVotes() + " / " + getVotesRequired());
@@ -104,6 +120,11 @@ public void check(VotingPluginUser user, boolean forceBungee) {
104120

105121
}
106122

123+
/**
124+
* Checks and sends vote reminders if requirements are met.
125+
*
126+
* @param user the voting plugin user
127+
*/
107128
public void checkVoteReminder(VotingPluginUser user) {
108129
if (!user.isVanished()) {
109130
int neededVotes = getNeededVotes();
@@ -162,6 +183,11 @@ public int getNeededVotes() {
162183
return neededVotes;
163184
}
164185

186+
/**
187+
* Gets a random player name from voted users.
188+
*
189+
* @return random player name or "No Player" if none available
190+
*/
165191
public String getRandomPlayerName() {
166192
ArrayList<String> allPlayers = new ArrayList<>();
167193
for (Player players : Bukkit.getOnlinePlayers()) {
@@ -196,6 +222,11 @@ public List<String> getVotedUsers() {
196222
return new ArrayList<>();
197223
}
198224

225+
/**
226+
* Gets the number of votes required for the vote party.
227+
*
228+
* @return votes required including extra requirements
229+
*/
199230
public int getVotesRequired() {
200231
int required = plugin.getSpecialRewardsConfig().getVotePartyVotesRequired();
201232
int extra = plugin.getServerData().getVotePartyExtraRequired();
@@ -205,6 +236,12 @@ public int getVotesRequired() {
205236
return required;
206237
}
207238

239+
/**
240+
* Gives vote party reward to a user.
241+
*
242+
* @param user the voting plugin user
243+
* @param useBungee whether to use Bungee processing
244+
*/
208245
public void giveReward(VotingPluginUser user, boolean useBungee) {
209246
if (plugin.getSpecialRewardsConfig().getVotePartyUserVotesRequired() > 0) {
210247
if (user.getVotePartyVotes() < plugin.getSpecialRewardsConfig().getVotePartyUserVotesRequired()) {
@@ -214,6 +251,13 @@ public void giveReward(VotingPluginUser user, boolean useBungee) {
214251
giveReward(user, user.isOnline(), useBungee);
215252
}
216253

254+
/**
255+
* Gives vote party reward to a user with online status.
256+
*
257+
* @param user the voting plugin user
258+
* @param online whether the user is online
259+
* @param useBungee whether to use Bungee processing
260+
*/
217261
public void giveReward(VotingPluginUser user, boolean online, boolean useBungee) {
218262
new RewardBuilder(plugin.getSpecialRewardsConfig().getData(),
219263
plugin.getSpecialRewardsConfig().getVotePartyRewardsPath()).setOnline(online)
@@ -222,6 +266,12 @@ public void giveReward(VotingPluginUser user, boolean online, boolean useBungee)
222266
.setServer(useBungee).send(user);
223267
}
224268

269+
/**
270+
* Gives rewards to all eligible players for the vote party.
271+
*
272+
* @param orgUser the original voting user who triggered the party
273+
* @param forceBungee whether to force Bungee processing
274+
*/
225275
public void giveRewards(VotingPluginUser orgUser, boolean forceBungee) {
226276
MiscUtils.getInstance().broadcast(plugin.getSpecialRewardsConfig().getVotePartyBroadcast());
227277

@@ -307,13 +357,23 @@ public void run() {
307357
reset(false);
308358
}
309359

360+
/**
361+
* Handles day change events to reset vote party if configured.
362+
*
363+
* @param event the day change event
364+
*/
310365
@EventHandler
311366
public void onDayChange(DayChangeEvent event) {
312367
if (plugin.getSpecialRewardsConfig().isVotePartyResetEachDay()) {
313368
reset(true);
314369
}
315370
}
316371

372+
/**
373+
* Handles month change events to reset vote party if configured.
374+
*
375+
* @param event the month change event
376+
*/
317377
@EventHandler
318378
public void onMonthChange(MonthChangeEvent event) {
319379
if (plugin.getSpecialRewardsConfig().isVotePartyResetMonthly()) {
@@ -325,6 +385,11 @@ public void onMonthChange(MonthChangeEvent event) {
325385
}
326386
}
327387

388+
/**
389+
* Handles week change events to reset vote party if configured.
390+
*
391+
* @param event the week change event
392+
*/
328393
@EventHandler
329394
public void onWeekChange(WeekChangeEvent event) {
330395
if (plugin.getSpecialRewardsConfig().isVotePartyResetWeekly()) {
@@ -336,10 +401,18 @@ public void onWeekChange(WeekChangeEvent event) {
336401
}
337402
}
338403

404+
/**
405+
* Registers this class as an event listener.
406+
*/
339407
public void register() {
340408
plugin.getServer().getPluginManager().registerEvents(this, plugin);
341409
}
342410

411+
/**
412+
* Resets the vote party state.
413+
*
414+
* @param override whether to override total votes to zero
415+
*/
343416
public void reset(boolean override) {
344417
if (override) {
345418
setTotalVotes(0);
@@ -349,6 +422,9 @@ public void reset(boolean override) {
349422

350423
}
351424

425+
/**
426+
* Resets the vote party count for all users.
427+
*/
352428
public void resetVotePartyCount() {
353429
plugin.getUserManager().removeAllKeyValues("VotePartyVotes", DataType.INTEGER);
354430
}
@@ -373,6 +449,13 @@ public void setVotedUsers(List<String> value) {
373449
plugin.getServerData().saveData();
374450
}
375451

452+
/**
453+
* Processes a vote for the vote party system.
454+
*
455+
* @param user the voting plugin user
456+
* @param realVote whether this is a real vote
457+
* @param forceBungee whether to force Bungee processing
458+
*/
376459
public synchronized void vote(VotingPluginUser user, boolean realVote, boolean forceBungee) {
377460
if (plugin.getSpecialRewardsConfig().isVotePartyEnabled()) {
378461
if (plugin.getSpecialRewardsConfig().isVotePartyCountFakeVotes() || realVote) {

0 commit comments

Comments
 (0)