ECS Part 14 | The Bag#2989
Conversation
|
Ahhh! i already have an ECS14 , not pushed tho |
HEy! all ECS parts are related to the big chunky #2652 ! notice for example how PlayerComponent is not part of the ECS series: #2889 even though its ECS related, because it's not 2652 related! Or PVP #2890 is also not part of the series, even though it is ECS related! because its not 2652 related! all ECS parts are intended to be related to 2652 If you could have handled a 4k PR i would have put all ECS parts into this one PR so name change requested! |
|
Also: please include screenshots when adding something visual |
|
|
||
| user.spawnPos = playerData.get(?Vec3d, "playerSpawnPos", null); | ||
|
|
||
| if (main.entity.components.@"cubyz:bag".server.get(user.id) == null) { |
There was a problem hiding this comment.
could you move this into initPlayer?
to make it more consistent with the other player related components (@"cubyz:model")
or do it the other way around, having the default model loaded where the bag is loaded,
Maybe this is a pattern that will occur so often, that it would make sense to have some kind of general main.entity.server.initNewPlayer functionality.
| }; | ||
|
|
||
| const TakeFromPlayerBag = struct { // MARK: TakeFromPlayerBag | ||
| dest: InventoryAndSlot, |
There was a problem hiding this comment.
Can you maybe use here the Inventories as the destinations, with a putItemsInto.
Currently this does not change really anything but would stop us from later needing to refactor this if needed.
I also thought maybe we want shift clicking in general to have the hand as a fallback?
|
|
||
| const topItem = self.inventory.peek(0); | ||
| const shouldRenderStackSizeText = topItem.item.stackSize() > 1; | ||
| if (shouldRenderStackSizeText) { |
There was a problem hiding this comment.
from here a lot is just copy from itemslot. I know they have key differences but maybe we want to generlize something here? Like a itemStackInformation we can render on top?
Since it exists now, I decided to put the relevant stuff into the ECS and following the pattern: Anything remotely related to the ECS gets the ECS label and number in the title :P
Remaining work:
fixes #73