-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Adds Groovyscript support for crafting #325
Conversation
Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
….java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
…tion.java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
….java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
…tion.java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
…tion.java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
…tion.java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
…tion.java Co-authored-by: Desoroxxx <desoroxxx@gmail.com>
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
@coderabbitai review |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (24)
- build.gradle (1 hunks)
- src/main/java/com/paneedah/mwc/MWC.java (2 hunks)
- src/main/java/com/paneedah/mwc/groovyscript/MWCGroovyPlugin.java (1 hunks)
- src/main/java/com/paneedah/mwc/groovyscript/recipes/GSCrafting.java (1 hunks)
- src/main/java/com/paneedah/mwc/groovyscript/script/CraftingStation.java (1 hunks)
- src/main/java/com/paneedah/mwc/init/MWCRecipes.java (2 hunks)
- src/main/java/com/paneedah/mwc/items/equipment/carryable/ItemCarryable.java (1 hunks)
- src/main/java/com/paneedah/mwc/network/handlers/WorkbenchServerMessageHandler.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/CustomArmor.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/HighIQSpawnEgg.java (2 hunks)
- src/main/java/com/paneedah/weaponlib/ItemAttachment.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/ItemVest.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/Weapon.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/command/MainCommand.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/config/BalancePackManager.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/CraftingEntry.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/CraftingRegistry.java (5 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/IModernCrafting.java (2 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/ammopress/GUIContainerAmmoPress.java (2 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/base/GUIContainerStation.java (5 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/base/TileEntityStation.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/workbench/GUIContainerWorkbench.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/crafting/workbench/TileEntityWorkbench.java (1 hunks)
- src/main/java/com/paneedah/weaponlib/grenade/ItemGrenade.java (1 hunks)
Files skipped from review due to trivial changes (1)
- src/main/java/com/paneedah/weaponlib/config/BalancePackManager.java
Additional comments: 3
src/main/java/com/paneedah/weaponlib/crafting/workbench/GUIContainerWorkbench.java (1)
- 200-204: The change in method calls from
getSelectedCraftingPiece().getItem()
togetSelectedCraftingPiece().getItem().getItem()
is consistent with the PR's objective to modify thegetItem
method's return type fromItem
toItemStack
. However, ensure that thegetSelectedCraftingPiece().getItem()
method itself correctly returns anItemStack
and not another wrapper that would require further unwrapping.src/main/java/com/paneedah/weaponlib/crafting/workbench/TileEntityWorkbench.java (1)
- 130-132: The change to pass
this.craftingTarget.getItem()
directly toaddStackToInventoryRange
suggests that the method signature foraddStackToInventoryRange
has been updated to accept anItem
instead of anItemStack
. Verify that theaddStackToInventoryRange
method has been appropriately modified to handle anItem
as its parameter and that this change is consistent across all usages of the method.src/main/java/com/paneedah/weaponlib/grenade/ItemGrenade.java (1)
- 50-51: The change in the
getItem
method's return type fromItem
toItemStack
is consistent with the PR's objective. Ensure that all usages of thegetItem
method within theItemGrenade
class and any other classes that interact withItemGrenade
objects are updated to handle anItemStack
return type.
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.
Missed some important things in previous reviews but apart from that looking ready to merge
src/main/java/com/paneedah/mwc/groovyscript/recipes/GSCrafting.java
Outdated
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/IModernCrafting.java
Outdated
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/IModernCrafting.java
Outdated
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/IModernCrafting.java
Outdated
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/config/BalancePackManager.java
Outdated
Show resolved
Hide resolved
src/main/java/com/paneedah/mwc/items/equipment/carryable/ItemCarryable.java
Outdated
Show resolved
Hide resolved
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
src/main/java/com/paneedah/weaponlib/crafting/base/GUIContainerStation.java
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/base/GUIContainerStation.java
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/base/GUIContainerStation.java
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/base/GUIContainerStation.java
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/base/TileEntityStation.java
Show resolved
Hide resolved
src/main/java/com/paneedah/weaponlib/crafting/base/TileEntityStation.java
Show resolved
Hide resolved
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 1 findings(s) 🚩
- Improving Code Health: 8 findings(s) ✅
- Affected Hotspots: 0 files(s) 🔥
Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene
🚩 Declining Code Health (highest to lowest):
- Primitive Obsession CraftingEntry.java
✅ Improving Code Health:
- Complex Method GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Overall Code Complexity MainCommand.java
- Overall Code Complexity GUIContainerStation.java
- Deep, Nested Complexity TileEntityStation.java: update
- Deep, Nested Complexity GUIContainerStation.java: drawGuiContainerBackgroundLayer
- Complex Method GUIContainerStation.java: drawTooltips
- Complex Method TileEntityStation.java: update
- Bumpy Road Ahead MainCommand.java: showRecipe
📝 Description
This PR Adds Groovyscript support for crafting such as ammo press and workbench.
🎯 Goals
❌ Non Goals
🚦 Testing
use following example script on Postinit Script of Groovyscript (E.G: run/groovy/postinit/main.groovy)
this script should do 3 things:
Test video to prove that this PR doesn't break anything even if Groovyscript isn't present in runtime:
2023-12-19.20-49-10_1.mp4
⏮️ Backwards Compatibility
Exisiting JSON Recipe system is not replaced. since it should not cause issue with any existing modpack that utilizes the JSON for their costom recipes.
📚 Related Issues & Documents
N/A
🖼️ Screenshots/Recordings
📖 Added to documentation?
😄 [optional] What gif best describes this PR or how it makes you feel?
N/A
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Refactor
Documentation
Chores