Skip to content

Conversation

@sqlerrorthing
Copy link
Contributor

@sqlerrorthing sqlerrorthing commented Mar 28, 2025

all new icons was taken from svgrepo.com

closes #5937
closes #3764

Images

image

@sqlerrorthing sqlerrorthing marked this pull request as draft March 28, 2025 09:10
@sqlerrorthing
Copy link
Contributor Author

i need help to implement [InventoryPresetsValue] to [ModuleInventoryCleaner]

@sqlerrorthing sqlerrorthing marked this pull request as ready for review March 31, 2025 08:12
@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Mar 31, 2025

I think I've implemented it, but I'm sure the old inv manager & chest stealer code needs to be cleaned up.

@superblaubeere27 superblaubeere27 self-requested a review March 31, 2025 21:46
Copy link
Contributor

@superblaubeere27 superblaubeere27 left a comment

Choose a reason for hiding this comment

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

Great. This will be a great and long awaited addition to the client!

Frontend

The UI looks promising. I think there are still some problems with the current iteration of the design. In order to reduce configuration breaking changes we should also add other planned configuration features in this update.

Note that the following ideas are not specific instructions! As long as you address the problems you can use your own designs and ideas.

What behavior should the user expect from this configuration?
image
Why would the user add multiple presets at once? If you want the user to be able to between presets, then there should be an option to select an active preset.

The "throws" menu does not represent the real world complexity yet. The users often want to select how many items of a specific type they want to have or want to configure to throw out everything above a certain threshold.
image
This is my suggested UI. It is a list of rules. The higher the rule, the higher the priority (could be indicated by numbers). The 'I's are items. The slider on the left could be used to move rules around and change their priority. There can be multiple items in a single group. Since that might be ambiguous one could consider adding an option like group (all counts of all items in that group are compared against the limit) vs. each (the given constraints are applied per item). The slider on the right selects what number items should be kept at minimum and when it should start throwing items out, regardless of other rules. This may also just be a slider with a single value since both settings are pretty similar.

The item selection could also profit from some more customizability. Currently only one item or item type can be assigned to a specific item slot. There are common situations where you need more though. For example if you want to ignite another player you would probably have preferences like lava bucket > flint and steel > firecharge. Or sometimes some items have similar functions (like eggs or snowballs).
asdfj
Therefore I propose this design. Again, there are prioritized rules (from top to bottom). If a higher rule cannot be satisfied, the lower will apply (for example this will try to fill the slot with an ender pearl, if that is not possible, it will try to fill it with a rod, eggs or snowballs. If that is again not possible, it will fill the slot with blocks). Additionally the user can select multiple specific items per group. If the user selects an item group, they cannot add additional items to that group though (for example you cannot have a rule that states "blocks or enderpearls"). Pressing "+" would bring the user to the next dialog.

The dialog to edit such a rule could look like this:
ghjghj
I removed the "common items" category because I think it is distracting while offering not much benefit. I added radio boxes to show the user that they have to decide between selecting specific items and item categories.

As I said, those proposals are just suggestions.

Backend

I think that some major changes to the current Inventory Cleaner backend will be necessary. And I also see that your implementation tries to address this and I know that you probably invested some time and effort into making this. Nevertheless, there are some severe issues:

  1. The Inventory Cleaner now doesn't manage armor waste management anymore
  2. The inventory cleaner is much less flexible now
  3. The current item rating system is used in many modules. There is no point in having two seperate rating systems with the same code.
  4. The current inv cleaner system has planning and execution separated. This is a feature which should be preserved.
  5. The InventoryCleaner module had that name for quite some time now. Renaming it will confuse users even though there is an alias.
  6. Never change a running system. The current backend is designed with something like this in mind. Only a few changes would be required to change this to support your and all of my proposed configuration changes.

I could do the necessary changes in the current implementation to make the configuration work if you want.

Summary

The backend code will not make it into the final patch. The frontend code is good work. You proofed that you know how to create UIs, so I know that you will be able to bring this configuration to perfection ;D

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 1, 2025

why can a user add multiple presets at once

because there is a merging functionality, the final decision on where each item will be in the inventory is taken into account based on the items that are in the inventory.

Example

the more important the preset, the lower its index

if the most important preset is in the first slot blocks
and in the second slot there is, for example, an apple
but at the time of sorting there is not a single block that can be put in the first slot, but there is an apple
then the apple will be put in the first slot.
that is why there is the possibility of several presets, to make the settings more flexible.


I think it's better to leave the system when the selection of the active preset will happen automatically based on the current items in the inventory directly. Perhaps, it can confuse new users the first time, but they should learn about it just once (for example, record a tutorial on how to make presets) and then they will have a lot of opportunities for customization.

in my opinion, it would be better to record a video on how to set up a preset, and if there are no presets in the settings, then add a button that will be a link to the video with the settings.

@sqlerrorthing
Copy link
Contributor Author

I removed the "common items" category because I think it is distracting while offering not much benefit. I added radio boxes to show the user that they have to decide between selecting specific items and item categories.

I don't like radio buttons, the names better reflect the essence and say choose one of two.

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 1, 2025

I could do the necessary changes in the current implementation to make the configuration work if you want.

@superblaubeere27 I will try to take into account your wishes in the very setup and implementation of the frontend in particular, but yes, I need help in implementing the backend, I will be very grateful if you help me

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 1, 2025

upd: The Limit replaced by Max
upd: The Create new limit replated by Create a new limit

@superblaubeere27 i think i implemented what you wanted
so far only on the frontend, and corrected the backend, these changes in inventoryCleaner are not implemented at all.

image
in this case, if there are more than two stacks of blocks in the inventory, the extra ones will have to be thrown away
also, if there are more than 32 eggs OR snowballs (taken together, that is, their total amount in the inventory), then as many will be thrown out as are needed so that there are EITHER 32 eggs OR snowballs in total for the ENTIRE inventory.

but this requires implementation directly in the inventory manager & chest stealer itself
I can't do it because I don't understand how it works.

@sqlerrorthing
Copy link
Contributor Author

item selector now:
image

@superblaubeere27
Copy link
Contributor

why can a user add multiple presets at once

because there is a merging functionality, the final decision on where each item will be in the inventory is taken into account based on the items that are in the inventory.

ok, so that is the same idea of allowing multiple choices for a single hotbar slot. I find this behavior quite unintuitive though. When I saw it for the first time and you asked me what multiple presets do then this behavior wouldn't have been in my first guesses.

Is that functionality equivalent with giving the user multiple choices per item?

Perhaps, it can confuse new users the first time, but they should learn about it just once (for example, record a tutorial on how to make presets)

“A user interface is like a joke. If you have to explain it, it’s not that good”. — Martin Leblanc

“If you find an element of your interface requires instructions, then you need to redesign it.” — Dan Rubin

I don't like radio buttons, the names better reflect the essence and say choose one of two.

That's ok as long as the user understands that they can only select either specific items or item categories.

I need help in implementing the backend, I will be very grateful if you help me

I will implement every feature this PR needs from the CleanupPlanGenerator in another PR.

@superblaubeere27 i think i implemented what you wanted so far only on the frontend, and corrected the backend, these changes in inventoryCleaner are not implemented at all.

image in this case, if there are more than two stacks of blocks in the inventory, the extra ones will have to be thrown away also, if there are more than 32 eggs OR snowballs (taken together, that is, their total amount in the inventory), then as many will be thrown out as are needed so that there are EITHER 32 eggs OR snowballs in total for the ENTIRE inventory.

Looks great 👍🏻

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 1, 2025

I will implement every feature this PR needs from the CleanupPlanGenerator in another PR.

I'm looking forward to it.

Please take this into account:

Hotbar:

  1. if NonePresetItem then there should be nothing in this slot
  2. if AnyPresetItem then ignore the slot

Limits:

if AnyPresetItem then all items will be taken into account and will be taken into account in calculations.

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 1, 2025

Is that functionality equivalent with giving the user multiple choices per item?

maybe.. yes, but I have absolutely no idea how... it can be designed
you gave me your idea, but after looking at it I couldn't figure out how and where to put it, if you give me a bigger description of your idea, what it will look like, then I will listen to you

“A user interface is like a joke. If you have to explain it, it’s not that good”. — Martin Leblanc
“If you find an element of your interface requires instructions, then you need to redesign it.” — Dan Rubin

I am not a designer and will never position myself as a web developer. It literally gives me nothing.

@sqlerrorthing
Copy link
Contributor Author

I am not a designer and will never position myself as a web developer. It literally gives me nothing.

also i'm from Russia, i don't even know them indirectly.
fuck putin. i also hate that i was born at this time, in this country, in this world

@sqlerrorthing
Copy link
Contributor Author

ok, so that is the same idea of allowing multiple choices for a single hotbar slot. I find this behavior quite unintuitive though. When I saw it for the first time and you asked me what multiple presets do then this behavior wouldn't have been in my first guesses.

I thought up your idea and how to implement it, yes, it is still worth abandoning the system with multiple presets (which are dynamically combined at the sorting stage). simply adding the ability to select several candidates for a particular slot.

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 2, 2025

upd: my implementation in InventoryCleaner was also removed (but I didn't change the name back)

image
image
sqlerrorthing#18

Candidates priority:

a - above, d - below

a b
c d

the number in slot 4 (in the candidate preview) is limited to 9, i.e. +9 is the maximum that can be displayed in the preview (otherwise the ui may just leave.)

@sqlerrorthing
Copy link
Contributor Author

sqlerrorthing commented Apr 2, 2025

I think the frontend part is completely ready, waiting for news from @superblaubeere27.
for now I'll document the code in the backend (documented)

@sqlerrorthing sqlerrorthing changed the title feat: InventoryPresets feat: InventoryPreset for InventoryManager Apr 2, 2025
@superblaubeere27
Copy link
Contributor

I have implemented it on a local branch. I will merge it soon.

@sqlerrorthing
Copy link
Contributor Author

I have implemented it on a local branch. I will merge it soon.

good 👍

@sqlerrorthing
Copy link
Contributor Author

@superblaubeere27 well how are things there?

@superblaubeere27
Copy link
Contributor

I pushed my changes. I don't know why it does not work yet. Can you try to debug the frontend?

@sqlerrorthing
Copy link
Contributor Author

I pushed my changes. I don't know why it does not work yet. Can you try to debug the frontend?

maybe okay. but. please, revert yr changes & create pull request on my repo

@superblaubeere27
Copy link
Contributor

Why?

@sqlerrorthing
Copy link
Contributor Author

well then if it already works then I think it's not necessary anymore.

sorry, but I don't have time for this at all, next weekend I'll do it again.

@sqlerrorthing
Copy link
Contributor Author

i dont like these icons on commit 2adae94

@superblaubeere27
Copy link
Contributor

i dont like these icons on commit 2adae94

For context, these icons:

image

@sqlerrorthing
Copy link
Contributor Author

@SenkJu, whats up?

@SenkJu
Copy link
Contributor

SenkJu commented May 1, 2025

Sorry, I have not forgotten about this pull request. I am unfortunately still very busy and reviewing and possibly refactoring 3000 lines of code will take a while. I will try to get to it as soon as possible.

@sqlerrorthing
Copy link
Contributor Author

@SenkJu sorry for the ping, but r u still very busy?

@SenkJu
Copy link
Contributor

SenkJu commented May 11, 2025

I have started working on it. Please refrain from pushing any further adjustments until I am done refactoring.

@sqlerrorthing
Copy link
Contributor Author

whats new?

@vardenixxxas
Copy link

@SenkJu left us 😔

@superblaubeere27
Copy link
Contributor

😞✊🏻

@sqlerrorthing
Copy link
Contributor Author

is @SenkJu died?

@SuicidalEeper
Copy link

is @SenkJu died?

He does that a lot

@1zun4
Copy link
Member

1zun4 commented Jun 10, 2025

No, this is still planned to be worked on by @SenkJu. While the Kotlin side looks fine to me, the Svelte side does not seem to be up to standard, and @SenkJu has stated that the Svelte code needs to be rewritten. He is working on it, but he is taking his time to do it properly - he just doesn't communicate much on GitHub, preferring to do so on our private Discord server.

@MukjepScarlet
Copy link
Contributor

Conflicts
see #6854 #6852

  1. Remove usage of class SwordItem/MiningToolItem/AxeItem and all other tools
  2. Remove usage of class ArmorItem
  3. Remove usage of player.inventory.armor. Use Slots.Armor for the client player

@MukjepScarlet
Copy link
Contributor

// Tools
val ItemStack.isSword
get() = this.isIn(ItemTags.SWORDS)
val ItemStack.isPickaxe
get() = this.isIn(ItemTags.PICKAXES)
val ItemStack.isAxe
get() = this.isIn(ItemTags.AXES)
val ItemStack.isShovel
get() = this.isIn(ItemTags.SHOVELS)
val ItemStack.isHoe
get() = this.isIn(ItemTags.HOES)
/**
* Replacement of 1.21.4 `MiningToolItem`
*/
val ItemStack.isMiningTool
get() = isAxe || isPickaxe || isShovel || isHoe
// Armors
val ItemStack.isFootArmor
get() = this.isIn(ItemTags.FOOT_ARMOR)
val ItemStack.isLegArmor
get() = this.isIn(ItemTags.LEG_ARMOR)
val ItemStack.isChestArmor
get() = this.isIn(ItemTags.CHEST_ARMOR)
val ItemStack.isHeadArmor
get() = this.isIn(ItemTags.HEAD_ARMOR)
val ItemStack.isPlayerArmor
get() = isFootArmor || isLegArmor || isChestArmor || isHeadArmor

@MukjepScarlet
Copy link
Contributor

Who wanna continue this?

@sqlerrorthing
Copy link
Contributor Author

no 😭

  1. idk how fix backend
  2. where is the issues that @SenkJu told need to be resolved

@sqlerrorthing
Copy link
Contributor Author

@MukjepScarlet added the Theme label on Sep 26

there is no only theme changes

@MukjepScarlet
Copy link
Contributor

MukjepScarlet commented Dec 16, 2025

idk how fix backend

Start a new branch after #7402

Move the changed files to the new branch. And split them into multiple PRs if possible.

@MukjepScarlet
Copy link
Contributor

I decide to continue this (probably)

@MukjepScarlet MukjepScarlet force-pushed the feat/inventory-manager-such-as-cloudflare-rules branch 2 times, most recently from 655b164 to 2cd0235 Compare January 14, 2026 13:56
@MukjepScarlet MukjepScarlet force-pushed the feat/inventory-manager-such-as-cloudflare-rules branch from 2cd0235 to f599161 Compare January 14, 2026 14:02
@sqlerrorthing
Copy link
Contributor Author

thank you cuz i wanna to close it

@MukjepScarlet
Copy link
Contributor

Maybe I need to cherrypick or redesign, too many conflicts

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Inventory Manager such as... Cloudflare rules Making inv cleaner be less messier

8 participants