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

[Plugin] Hidding Container Items in the Tooltip #322

Closed
1 task
Corgam opened this issue Oct 20, 2023 · 2 comments
Closed
1 task

[Plugin] Hidding Container Items in the Tooltip #322

Corgam opened this issue Oct 20, 2023 · 2 comments

Comments

@Corgam
Copy link

Corgam commented Oct 20, 2023

Mod loader

Forge

Minecraft version

1.20.1

Mod version

11.6.3

Modloader version

Forge 47.1.0

Modpack info

No response

If bug:

  • Can you reproduce this issue with relevant mods only?

If bug: The latest.log file

No response

Issue description

Hi, I am currently implementing the Jade compatibility in my mod,
and I was wondering if it is possible to hide the container's contents inside the Tooltip. I don't want them to render twice :)

Untitled

@Snownee
Copy link
Owner

Snownee commented Oct 21, 2023

You can implement an IServerExtensionProvider:

public class HideItemsProvider implements IServerExtensionProvider<HopperBlockEntity, ItemStack> {

	public static final ResourceLocation UID = new ResourceLocation("debug:hide_items");

	@Override
	public ResourceLocation getUid() {
		return UID;
	}

	@Override
	@Nullable
	public List<ViewGroup<ItemStack>> getGroups(ServerPlayer player, ServerLevel world, HopperBlockEntity target, boolean showDetails) {
		return List.of();
	}

}

and register it:

@Override
public void register(IWailaCommonRegistration registration) {
	registration.registerItemStorage(new HideItemsProvider(), HopperBlockEntity.class);
}

@Snownee Snownee closed this as completed Oct 21, 2023
@Corgam
Copy link
Author

Corgam commented Oct 21, 2023

Thank you, works exactly as I wanted! :)

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

No branches or pull requests

2 participants