Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Farming Progression #1350

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

8SIXSect
Copy link
Contributor

@8SIXSect 8SIXSect commented Dec 3, 2024

Describe your changes

Just the barebones system:

  • When planting a crop, it yields low experience
  • When harvesting a crop, it yields high experience
  • When bonemealing a crop, it yields low experience BUT when the crop is fully harvested, it only yields low experience (pretty much a tradeoff)
  • There's no consequence to bonemealing Pumpkin/Melon stems since they only grow from random game ticks

Stuff that needs work:

  • Full Rake support
  • Berry Bush rework with custom events
  • Leaderboards (you can get pretty creative with this so I'll leave it to Mykindos)
  • Farming Perks!!!
  • Bee Hives

Link to issue (if applicable)

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested my changes.

Copy link

sonarqubecloud bot commented Dec 4, 2024

@8SIXSect 8SIXSect requested a review from Mykindos January 24, 2025 09:18
@Mykindos Mykindos requested a review from Copilot March 1, 2025 12:34

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Mykindos Mykindos force-pushed the fm_progression_start branch from 66ba42f to 3a8d95d Compare March 1, 2025 12:34
@Mykindos Mykindos requested a review from Copilot March 1, 2025 12:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR introduces the barebones implementation for the Farming progression system. Key changes include adding a new farming command, menu interface, and multiple event listeners/handlers to account for planting, harvesting, and bonemealing crops, as well as persisting crop interactions in the database.

Reviewed Changes

File Description
progression/src/main/java/me/mykindos/betterpvp/progression/profession/farming/commands/FarmingCommand.java Adds the farming command functionality
progression/src/main/java/me/mykindos/betterpvp/progression/profession/skill/builds/menu/buttons/FarmingProfessionMenu.java Introduces the farming menu for the profession
progression/src/main/java/me/mykindos/betterpvp/progression/profession/farming/listener/FarmingListener.java Implements event listeners for crop interactions
progression/src/main/java/me/mykindos/betterpvp/progression/profession/farming/listener/FarmingActionType.java Defines action types for farming interactions
progression/src/main/java/me/mykindos/betterpvp/progression/profession/farming/FarmingHandler.java Manages experience granting and crop interaction processing
progression/src/main/java/me/mykindos/betterpvp/progression/profession/farming/repository/FarmingRepository.java Persists crop interaction data to the database
progression/src/main/resources/configs/config.yml Configures experience values and cooldowns for farming
progression/src/main/java/me/mykindos/betterpvp/progression/profession/ProfessionHandler.java Updates common utility methods for profession handlers
progression/src/main/java/me/mykindos/betterpvp/progression/profession/woodcutting/WoodcuttingHandler.java Removes duplicate method code

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

progression/src/main/java/me/mykindos/betterpvp/progression/profession/farming/listener/FarmingListener.java:88

  • [nitpick] Consider rephrasing the comment to remove informal language; for example, use 'Probably unreachable return statement' rather than 'but who knows'.
if (!(clickedBlockData instanceof Ageable blockAsAgeable)) return;  // Probably unreachable return stmt but who knows

Comment on lines +35 to +36
if (args.length != 0) return;

Copy link
Preview

Copilot AI Mar 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When extra arguments are provided to the Farming command, there is no feedback to the player. Consider sending a usage message to guide the user.

Suggested change
if (args.length != 0) return;
if (args.length != 0) {
player.sendMessage("Usage: /farming");
return;
}

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Comment on lines +123 to +124
if (cropMaterial == null) continue;

Copy link
Preview

Copilot AI Mar 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknown material keys in the configuration are silently ignored; consider logging a warning when Material.getMaterial returns null to aid in diagnosing configuration errors.

Suggested change
if (cropMaterial == null) continue;
if (cropMaterial == null) {
log.warn("Unknown material key in configuration: " + materialAsKey).submit();
continue;
}

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link

sonarqubecloud bot commented Mar 1, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Intake
Development

Successfully merging this pull request may close these issues.

2 participants