Add chests#1739
Conversation
This encourages making the wrong design decisions
I don't understand this one. How can the player reach a chest that far away? |
|
The player can move while the chest is open. (gravity) |
|
Just make it so the player can only access a chest from a limited range. |
That is a very not "just" a feature. |
|
Yeah, that would be another 5 week project :P |
|
Okay, then it should boot the player out of the chest UI. |
|
Yep, you have named exactly the hard part :P |
|
How big should chests be, and what are the dimensions of their slots? |
Does this cause problems with multiplayer if someone breaks a chest while you are using it? |
|
Yeah, right that falls into the same category. |
…hunk containing a chest
… happen when the inventory is broken)
|
If anyone wants to review the code, now is the chance |
|
I will, but I need 1-2h before I can sit to PC |
|
Alright, so (1) if you use When you do (1) and then leave world you get a crash: thread 35976 panic: reached unreachable code
C:\Users\argma\dev\Cubyz4\src\chunk.zig:414:15: 0x7ff7303e8d2d in decreaseRefCount (Cubyzig_zcu.obj)
self.deinit();
^
C:\Users\argma\dev\Cubyz4\src\server\server.zig:444:14: 0x7ff73043ce6f in start (Cubyzig_zcu.obj)
defer deinit();
^
C:\Users\argma\dev\Cubyz4\compiler\zig\lib\std\Thread.zig:623:30: 0x7ff7303c1467 in entryFn (Cubyzig_zcu.obj)
return callFn(f, self.fn_args);There is no other special effects when you restart the game and replace the stone with the chest again, the chest it empty. Probably an issue material? |
| const inv = &inventories.items[@intFromEnum(invId)]; | ||
| for(inv.inv._items) |*itemStack| { | ||
| if(itemStack.amount == 0) continue; | ||
| main.server.world.?.drop( |
There was a problem hiding this comment.
IMO the way items drop need some more love, now they just drop to the ground within volume of the chest, but that is probably a separate issue material, if you do agree it could be improved.
There was a problem hiding this comment.
Well, how would you suggest to do it instead?
And yeah, that's definitely a separate issue.
|
Eh, I kind of red through it, but I am to exhausted after work to focus enough to actually understand implications of crucial parts of the code. If you are willing to wait until Saturday for me to be able to think, I can review it then, its unlikely I will be less exhausted before. If you are confident that the code is OK, then I don't want to block this PR anymore, it mostly seems fine, considering that there are children issues listing known limitations of the implementation. |
|
About worldedit, it seems that it doesn't remove the block entity properly.
Yeah I'm confident that it works, but I'll do some more testing just to be sure. |
…y mutex on blueprint pasting, this is needed for the chests right now.
|
I'm not really happy with the fix, but it works for now. I definitely need to redesign how the inventory system interacts with block updates at some point. It really is too involved for now. |
Progress:
→ it becomes uninteractible
Make it close the inventory on the client side→ Close block inventories when going out of range #1740 Make block inventories close when the underlying block is broken #1741check if there is any legacy chest loading codefixes #1060