refactor: made jobs code more consistent, added ItemProcessingJobEvent for external usage#1490
Conversation
…t for external usage
Summary of ChangesHello @antessial, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing code consistency and maintainability within the job system. It introduces a new event class to serve as a common base for item-processing jobs, thereby abstracting shared logic and reducing redundancy. Additionally, it refactors weather and time manipulation jobs to use more standardized and efficient methods, leading to a cleaner and more unified codebase for spirit job functionalities. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a good refactoring effort to improve code consistency and reduce duplication. The introduction of ItemProcessingJobEvent to consolidate similar event classes is a great change. The weather and time job classes are also simplified.
However, I've found a critical bug in the new time calculation logic that would cause incorrect behavior for some rituals. I've also pointed out a minor issue regarding file formatting conventions. Please see the detailed comments for suggestions.
…eTimeJob.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…/ItemProcessingJobEvent.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| public static class CrusherJobEvent extends EntityEvent { | ||
| private ItemStack input; | ||
| private ItemStack result; | ||
| public static class CrusherJobEvent extends ItemProcessingJobEvent { |
There was a problem hiding this comment.
Is there a benefit of each spirit having a different subclass?
There was a problem hiding this comment.
Everything can just throw the same event and consumers(like ocultas) will only need to catch a single event which makes it quite easy. Maybe we can add job type field instead.
There was a problem hiding this comment.
I don't think there's much benefit, but I thought of backward compatibility in case other mods, such as Ars Ocultas, depend on these events
There was a problem hiding this comment.
It should be fine for me. I can create a fix and release it immediately. not sure if there are other consumers though
|
@antessial is this ready to merge from your point of view? |
I'd merge this as-is, just in case there are other consumers |
For now yes. |
No description provided.