Skip to content

ECS Part 14 | The Bag#2989

Open
IntegratedQuantum wants to merge 4 commits intoPixelGuys:masterfrom
IntegratedQuantum:bag
Open

ECS Part 14 | The Bag#2989
IntegratedQuantum wants to merge 4 commits intoPixelGuys:masterfrom
IntegratedQuantum:bag

Conversation

@IntegratedQuantum
Copy link
Copy Markdown
Member

@IntegratedQuantum IntegratedQuantum commented Apr 27, 2026

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:

  • make an issue for the missing inventory actions (right clicking, shift clicking)
  • display the capacity

fixes #73

@tillpp
Copy link
Copy Markdown
Contributor

tillpp commented Apr 27, 2026

Ahhh! i already have an ECS14 , not pushed tho

@tillpp
Copy link
Copy Markdown
Contributor

tillpp commented Apr 27, 2026

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!

HEy! all ECS parts are related to the big chunky #2652 !
A complete misunderstanding what the label stands for!

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!

@tillpp
Copy link
Copy Markdown
Contributor

tillpp commented Apr 27, 2026

Also: please include screenshots when adding something visual

Comment thread src/server/world.zig

user.spawnPos = playerData.get(?Vec3d, "playerSpawnPos", null);

if (main.entity.components.@"cubyz:bag".server.get(user.id) == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@Wunka Wunka left a comment

Choose a reason for hiding this comment

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

Just a small thing so we don't need to rewrite this later.

Comment thread src/sync.zig
};

const TakeFromPlayerBag = struct { // MARK: TakeFromPlayerBag
dest: InventoryAndSlot,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Contributor

@Wunka Wunka Apr 28, 2026

Choose a reason for hiding this comment

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

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?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inventory Enhancement: The Bag

3 participants