Simple Shulker Preview

Simple Shulker Preview

17.2k Downloads

[Feature]: Display item: at least Х (X is user-defined)

Aprekot opened this issue · 5 comments

commented

Request Description

Could you add an option to display an item that has at least user specified amount, else dont display any item.

Please add this to version 1.18.2 if you can

Images

No response

Fabric Version

No response

Additional Context

No response

commented

Good idea, I'll probably add it into the next release.

I'm hoping to add bundle support in the next release too, so I'm aiming for the next release to be around when 1.20 drops (for all current supported MC versions).

commented

Fantastic to hear! I'll make sure to roll out these changes to all currently supported versions of MC once everything is ready (probably around 1.20 release).

commented

Hi! Thank you for taking the time to do this. That's exactly what I wanted.

commented

Here we go! Let me know your thoughts, and if this provides the functionality you were after (even if it's implemented slightly differently)!

Implementation
I've added a couple of stack size options that will address this request as well as provide scalability for other config options.

There are two options implemented in 2.4.0 (not yet released).

  • minimum stack size: The minimum stack size required to render an item
  • minimum stack count: The minimum number of stacks required to render an item

These are multiplied together to determine if an item is actually rendered or not. Examples:

  • Stack size = 64, stack count = 2: Requires a minimum of 128 before it will be rendered, either as whole stacks or split up.
  • Stack size = 64, stack count = 27: Item will only be rendered if the shulker box is completely full with a single item.

Implementation Quirk
Display option = FIRST
Min size = 32, min count = 1 -> minimum number of items required = 32

Stacks in a shulker box, in order:

  • Dirt: 16
  • Sand: 48
  • Dirt: 24

Although dirt (16+24=40) comes first in the shulker and meets the minimum number, sand will be displayed. This is because it is meets the number requirement in slot 2, whereas dirt meets that requirement upon hitting slot 3.

commented

Hiya @Aprekot ,
The update is live! Feel free to download the latest 1.18.2 version - it's only available on GitHub though, so make sure to read the change notes.