Repository navigation
Recipe Expansion - #3370
Recipe Expansion#3370
Conversation
|
also i fixed the leak |
acec446 to
b0132cd
Compare
|
oops my bad i leftover some stuff from the crafting table pr when i split this apart |
|
removed all of the random changes |
| } | ||
| writer.writeVarInt(usize, self.craftingTags.len); | ||
| for (self.craftingTags) |tag| { | ||
| writer.writeEnum(Tag, tag); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
how does writing a enum work with base item index then?
is that properly synced with the server or always has the same order?
There was a problem hiding this comment.
Item indices have a palette that gets sent over on world loading
There was a problem hiding this comment.
ok i have changed it to a writeSliceWithSize
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>
…into crafting-tags
…andom tags to the server
|
Please test in the game if crafting still works |
|
alright i have fixed the recipie thing |
|
|
||
| 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); |
There was a problem hiding this comment.
This actually is needed, otherwise a client can crash the server by sending a very large count.
There was a problem hiding this comment.
ahhh ok i see why then
| defer craftingTagTypes.deinit(main.stackAllocator); | ||
|
|
||
| while (craftingTagTypes.items.len < tagCount) { | ||
| std.log.debug("running {}", .{tagCount}); |
There was a problem hiding this comment.
Please remove the debug print
This pr adds crafting tags to all recipies (by default they all have .handCraftable)
Used by #3590
to add a crafting table