-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Added PlayerEvent.ItemSmithingEvent
#1693
base: 1.21.x
Are you sure you want to change the base?
Conversation
|
Executed ``` Run gradlew genPatches to generate patch-files from the patched sources Run gradlew applyAllFormatting to automatically format sources Check correct formatting with gradlew spotlessCheck ```
For when anyone reads this PR I followed the steps in CONTRIBUTING.md But when i execute
It Modifies more files then what i intend with my PR and it breaks? |
In your case, you likely:
What you're seeing is the result of having your source files (which the patch files are based off) not being in sync with your patch files. Whenever you update your local repository's main branch ( |
To fix the issue, you can either:
|
Thank you for explaining! I will resolve this issue as soon as possible. |
* Resolved the issue
I have resolved the issue using:
Thank you very much for helping me so quickly. |
@@ -406,6 +406,37 @@ public Container getInventory() { | |||
} | |||
} | |||
|
|||
public static class ItemSmithingEvent extends PlayerEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see some documentation on this class. Most of our events should have a javadoc explaining:
- What the event's purpose is (e.g. "An event for when a player smiths an item")
- When the event is fired (e.g. "After awarding used recipes, but before resizing the stacks")
- Where the event is fired (e.g. on the logical server, client, both)
- Which bus it's fired on (e.g. the game bus)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, i will see to this asap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been completely resolved!
I will not close this conversation since i do not want to hide it before it has been confirmed by a Maintainer
* `ItemSmeltedEvent` * `ItemCraftedEvent` * ItemSmithingEvent` Using the Comment styling discussed in #neoforge-github (Discord) I also Commented the Methods within the Classes and renamed the parameters that were misleading
this.craftMatrix = craftMatrix; | ||
} | ||
|
||
/** | ||
* {@return the item that was crafted (ex. Diamond sword)} | ||
*/ | ||
public ItemStack getCrafting() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Method name, and the same method from the ItemSmeltedEvent
are misleading.
I recommend renaming them to getResult
or getCrafted
(for the ItemSmeltedEvent
, getSmelted
) since they return the result, and not the matrix/item that is being smelted.
Since this is a Breaking Change i was requested in the Discord to make a comment about it
Also, small detail The Label 1.21.3 should be modified to 1.21.4 since this PR is now Up to Date with the latest commits within the 1.21.x branch |
This PR allows users to create an event solely related to the Smithing Table, This will allow developers to retrieve information like the Template used, the main item and the addition.
Currently there is no event that triggers when a user crafts something using the smithing table.
With this PR we will have that event which will allow developers to have more freedom when developing features around the Smithing Table.
Adds #1569.
In addition to the new Event i have also created comments for the
ItemSmeltedEvent
andItemCraftedEvent
including the methods within these classes.I have also renamed the Parameters inside those events to clear them up.