Jade ๐Ÿ”

Jade ๐Ÿ”

93M Downloads

[Plugin] Hidding Container Items in the Tooltip

Corgam opened this issue ยท 2 comments

commented

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

commented

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);
}
commented

Thank you, works exactly as I wanted! :)