Skip to content

Conversation

@Intybyte
Copy link
Member

Fixes #490
Fixes #489

@Intybyte Intybyte marked this pull request as ready for review December 18, 2025 15:30
@Intybyte Intybyte changed the title Convert to VirtualInventory Vacuum hopper enhancement Dec 20, 2025
@Intybyte
Copy link
Member Author

Intybyte commented Dec 20, 2025

requires pylonmc/pylon-core#529

@Seggan
Copy link
Member

Seggan commented Dec 20, 2025

requires pylonmc/pylon-core#529

Just use the [ref:xyz] in the title so the CI will understand

@Seggan
Copy link
Member

Seggan commented Dec 20, 2025

I would personally put this off until we have a proper multi-inventoriy serialization system

@Intybyte
Copy link
Member Author

requires pylonmc/pylon-core#529

Just use the [ref:xyz] in the title so the CI will understand

oh alr

@Intybyte Intybyte changed the title Vacuum hopper enhancement [ref:vaan/task/vacuum-hopper-enhancement] Vacuum hopper enhancement Dec 20, 2025
Copy link
Contributor

@LordIdra LordIdra left a comment

Choose a reason for hiding this comment

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

Should use PylonGuiBlock here

@Intybyte
Copy link
Member Author

Should use PylonGuiBlock here

Waiting once multi inv is a thing

# Conflicts:
#	src/main/java/io/github/pylonmc/pylon/base/content/machines/simple/VacuumHopper.java
#	src/main/resources/lang/en.yml
Copy link
Contributor

@LordIdra LordIdra left a comment

Choose a reason for hiding this comment

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

Sorry to be a pain here, but I would suggest changing the way the GUI is laid out here. If you have a look at how the cargo filter works on the even-more-cargo-blocks branch, I think something similar would work well for this PR.

Essentially, the way it works is just making the filter a virtual inventory and embedding it into the GUI instead of having a whole separate 'settings' GUI. (The blacklist/whitelist button can go in the same GUI, no need for a different one). This is easier for the player since they can see everything at once rather than having to click another button to get more detail, but also will simplify the code a lot because you don't have to deal with nested inventories which is nice :)

Another thought: It seems that according to the invui inventory docs (https://docs.xenondevs.xyz/invui/inventory/) you can actually embed a vanilla inventory into a invui one. I think it would be worth doing this so you can avoid having to add all the extra manual hopper logic.

Comment on lines +74 to +75
public static final UpdateReason HOPPER = new UpdateReason() {};
public static final UpdateReason VACUUM = new UpdateReason() {};
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use MachineUpdateReason instead of these 2 now

public VacuumHopper(@NotNull Block block, @NotNull BlockCreateContext context) {
super(block, context);

this.inventory = new VirtualInventory(5);
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to manually store inventories when using PylonGuiBlock

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

Successfully merging this pull request may close these issues.

Change vacuum hopper to use virtual inventory instead of hopper Allow setting a filter for vacuum hoppers

4 participants