Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeLevel capabilities not implemented #110

Open
2 tasks done
uecasm opened this issue Jan 19, 2025 · 2 comments · May be fixed by #113
Open
2 tasks done

FakeLevel capabilities not implemented #110

uecasm opened this issue Jan 19, 2025 · 2 comments · May be fixed by #113
Labels
Bug Something isn't working

Comments

@uecasm
Copy link
Contributor

uecasm commented Jan 19, 2025

Is there an existing issue for this?

  • I have searched the existing issues.

Are you using the latest BlockUI Version?

  • I am running the latest beta/release version of BlockUI for my Minecraft version.
    I am also running the latest versions of other mods that are part of my problem.

Minecraft Version

1.21

BlockUI Version

1.0.192-1.21.1-snapshot

Current Behavior

Capabilities are not implemented in FakeLevel.

@Override
@Nullable
public <T, C> T getCapability(BlockCapability<T, C> cap, BlockPos pos, C context)
{
// Noop
return null;
}
@Override
@Nullable
public <T, C> T getCapability(BlockCapability<T, C> cap,
BlockPos pos,
@Nullable BlockState state,
@Nullable BlockEntity blockEntity,
C context)
{
// Noop
return null;
}

Expected Behavior

Structurize expects that they are, in order to produce the correct resource list from a block that is not a Container but does have an IItemHandler capability (i.e. most modded storage blocks, including MineColonies racks).

Reproduction Steps

  1. Place a rack with some items.
  2. Scan it with Structurize.
  3. With MineColonies loaded, build and Assign to Builder.
  4. Observe that only the rack is listed in the required items.
  5. When the builder builds it, it contains the items anyway.

Logs

n/a

Anything else?

This is not an issue in 1.20 because that doesn't use FakeLevel, and some common cases are read directly from NBT instead of querying item handlers, both of which were changed in 1.21.

Footer


Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.
@uecasm uecasm added the Bug Something isn't working label Jan 19, 2025
@Nightenom
Copy link
Member

I mean I haven't done caps back then because the fakelevel should be as immutable as possible, but feel free to provide some kind of PR enabling them. Impl note: impl should be in fakeLevel, other classes like fakeChunk should redirect back to fakeLevel

@someaddons
Copy link

tbf most inventories have the capability on the blockentity not on the block itself, those redirects are mostly a neoforge thing to support block capabilities. We could directly query the blockentity's capability in most cases

@Nightenom Nightenom linked a pull request Jan 24, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants