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

Toolbelt #2493

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

Toolbelt #2493

wants to merge 88 commits into from

Conversation

M-W-K
Copy link
Contributor

@M-W-K M-W-K commented Jun 5, 2024

What

Toolbelt

Implementation Details

Pain and suffering

Outcome

Less inventory clogging with excessive numbers of tools

Potential Compatibility Issues

There was an incidental refactor of some GT recipe classes, but I don't expect problems from it.
A lot of changes have been made inside the tool API, but none of it should be breaking.

@M-W-K M-W-K requested a review from a team as a code owner June 5, 2024 04:35
@ALongStringOfNumbers ALongStringOfNumbers added the type: feature New feature or request label Jun 9, 2024
Copy link
Contributor

@ghzdude ghzdude left a comment

Choose a reason for hiding this comment

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

a few things

src/main/java/gregtech/api/items/toolitem/ToolHelper.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/items/toolitem/ToolHelper.java Outdated Show resolved Hide resolved
src/main/java/gregtech/common/ToolEventHandlers.java Outdated Show resolved Hide resolved
M-W-K added 3 commits November 9, 2024 15:22
# Conflicts:
#	src/main/java/gregtech/api/items/toolitem/ItemGTToolbelt.java
Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

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

I don't see a reason for now passing in the stack for the various IToolBehavior methods. In 2 of the three methods, the stack parameter is not used at all in the implementors. In the third, you can retrieve the stack from the players held item. The third method already handles the toolbelt because it directly calls getBehaviorTag on the stack retrieved from the player's hand.

src/main/java/gregtech/asm/hooks/OreIngredientHooks.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/items/IDyeableItem.java Outdated Show resolved Hide resolved
itemstack.setCount(1);

if (dyeable.hasColor(itemstack1)) {
int l = dyeable.getColor(itemstack);
Copy link
Contributor

Choose a reason for hiding this comment

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

We do have our own DyeUtil#determineDyeColor, if that would help cleanup this mess

Copy link
Contributor

@ghzdude ghzdude left a comment

Choose a reason for hiding this comment

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

i noticed that when you "finish" crafting with the toolbelt (shift-clicking the crafting output), the selected item gets deselected, not sure if intended. otherwise, a few other things i noticed.

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

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

When adjusting the AOE size in the drill GUI, if you are at the max AOE the displayed AOE number will flicker higher and then go back to the max number. Same with the minimums.

Also when opening the AOE GUI, the JEI search bar shinks to match the size of the GUI, do you know of any way to prevent this? (This is something JEI does I believe, don't know if they have an opt out)

The toolbelt, when no tools are selected, uses regular right click to open the GUI. However, other tools, such as the drill, use shift + rclick to open the GUI. We should move the toolbelt to use that as well, for consistency.

When the toolbelt is dyed, a tooltip could be added to the belt, something like, "Dyed: (color)"

When crafting an item with the toolbelt (Was using the hatch switch recipe with a screwdriver in the toolbelt), after completing the craft, the toolbelt does not render the selected item any more until it is removed from the crafting grid

When crafting with the toolbelt, the toolbelt sometimes does not use the selected item for the craft. Eg, I have a toolbelt with a wrench and a screwdriver, and when making a machine hull the recipe completes when the screwdiver is the selected item. Or this may be the result of a broken feature, as when removing the toolbelt from the crafting screen (No craft peformed), the toolbelt updates to show the wrench as the active item. So the issue would be that the toolbelt does not update visually when placed into the crafting table.

I don't really like the selected slot being able to be set to -1, as I would prefer to have a selected slot at all times.

src/main/java/gregtech/api/items/IDyeableItem.java Outdated Show resolved Hide resolved
src/main/java/gregtech/api/items/toolitem/IGTTool.java Outdated Show resolved Hide resolved
ToolStackHandler handler = getHandler(stack);
if (slot < 0 || slot >= handler.getSlots())
handler.selectedSlot = -1;
else handler.selectedSlot = slot;
Copy link
Contributor

Choose a reason for hiding this comment

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

This also needs to send a tool update packet

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

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

https://pastebin.com/RvC9r6kT Crash when crafting an LV machine casing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants