Skip to content

Dump button, dumps the grid to linked inventory#228

Open
ChromaPIE wants to merge 2 commits intoGTNewHorizons:masterfrom
ChromaPIE:dumpbutton
Open

Dump button, dumps the grid to linked inventory#228
ChromaPIE wants to merge 2 commits intoGTNewHorizons:masterfrom
ChromaPIE:dumpbutton

Conversation

@ChromaPIE
Copy link

@ChromaPIE ChromaPIE commented Nov 23, 2025

图片

A button on Crafting Station's UI, sweeps stuff in the grid into the adjacent inventory

WARNING

100% vibe coded & verified. See it as an issue if the impletation is shit.

Copy link

@Ruling-0 Ruling-0 left a comment

Choose a reason for hiding this comment

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

Sorry for the long review delay! Just a couple code quality things I think should be addressed.

Comment on lines +442 to +448
for (int i = 1; i < 10; i++) {
ItemStack stack = craftMatrix.getStackInSlot(i - 1);
if (stack != null && stack.stackSize > 0) {
if (mergeItemStack(stack, 46, 46 + logic.slotCount, false)) {
craftMatrix.setInventorySlotContents(i - 1, stack.stackSize > 0 ? stack : null);
}
}
Copy link

Choose a reason for hiding this comment

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

Ranging i from 1 to 9 to then only ever reference it as i - 1 is silly. It should iterate 0 to 8 and just be referenced as i.

for (int i = 1; i < 10; i++) {
ItemStack stack = craftMatrix.getStackInSlot(i - 1);
if (stack != null && stack.stackSize > 0) {
if (mergeItemStack(stack, 46, 46 + logic.slotCount, false)) {
Copy link

Choose a reason for hiding this comment

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

I get it's done a bit in this file, but this use of 46 as a magic number is hard to follow. I don't think this file warrants a refactor, but you should comment here that 46 is the index corresponding to the first slot in an attached inventory.

@Ranzuu
Copy link

Ranzuu commented Feb 14, 2026

Please make this a texture, not hardcoded graphic. At least something like this, 10x10 to match the bogo sorter icons.

Button
10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments