Skip to content

Recipe Expansion - #3370

Merged
IntegratedQuantum merged 64 commits into
PixelGuys:masterfrom
Crepestrom:crafting-table
Oct 22, 2026
Merged

IntegratedQuantum merged 64 commits into
PixelGuys:masterfrom
Crepestrom:crafting-table

Conversation

@Crepestrom

@Crepestrom Crepestrom commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

This pr adds crafting tags to all recipies (by default they all have .handCraftable)

Used by #3590
to add a crafting table

@Crepestrom
Crepestrom marked this pull request as ready for review July 16, 2026 20:26
@Wunka Wunka moved this to Low Priority in PRs to review Jul 17, 2026
@Crepestrom
Crepestrom marked this pull request as draft July 25, 2026 16:12
@Crepestrom

Copy link
Copy Markdown
Contributor Author

also i fixed the leak
i just didnt understand when different allocators leak and what they look like when they leak

@Crepestrom

Copy link
Copy Markdown
Contributor Author

oops my bad i leftover some stuff from the crafting table pr when i split this apart

@Crepestrom

Copy link
Copy Markdown
Contributor Author

removed all of the random changes

Comment thread src/items/recipes.zig Resolved
Comment thread src/items/recipes.zig Resolved
Comment thread src/items/recipes.zig Resolved
Comment thread src/items/recipes.zig Resolved
Comment thread src/items.zig Resolved
Comment thread src/items.zig Outdated
}
writer.writeVarInt(usize, self.craftingTags.len);
for (self.craftingTags) |tag| {
writer.writeEnum(Tag, tag);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not work, the enum values are not part of a palette and thus may not be stable across different devices and different. You must store them as strings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how does writing a enum work with base item index then?
is that properly synced with the server or always has the same order?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Item indices have a palette that gets sent over on world loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok i have changed it to a writeSliceWithSize

Comment thread src/items.zig Resolved
Crepestrom and others added 10 commits October 21, 2026 10:17
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
@IntegratedQuantum

Copy link
Copy Markdown
Member

Please test in the game if crafting still works

@Crepestrom

Copy link
Copy Markdown
Contributor Author

alright i have fixed the recipie thing

Comment thread src/items.zig Outdated

const tagCount = try reader.readVarInt(usize);
var craftingTagTypes: main.List(Tag) = .initCapacity(main.stackAllocator, @min(256, tagCount));
var craftingTagTypes: main.List(Tag) = .initCapacity(main.stackAllocator, tagCount);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This actually is needed, otherwise a client can crash the server by sending a very large count.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ahhh ok i see why then

Comment thread src/items.zig Outdated
defer craftingTagTypes.deinit(main.stackAllocator);

while (craftingTagTypes.items.len < tagCount) {
std.log.debug("running {}", .{tagCount});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove the debug print

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

gone

@IntegratedQuantum
IntegratedQuantum merged commit 077fe5a into PixelGuys:master Oct 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants