Skip to content

Conversation

Liquidize
Copy link

@Liquidize Liquidize commented Jul 24, 2025

This is a quick, slightly messy fix for #7598.

It changes how the station pushes packages to the trains cargo. Two new schedule conditions have been added "Retrieve Package" and "Deliver Package".

If the train is utilizing a schedule (e.g: not player controlled), when it stops at a station packages will not be automatically taken from the postboxes. This will only happen if "Fetch Package" destination instruction is used, or if the current destination entry has the new condition "Retrieve Package". In either case the filter is respected so it will not transfer packages to the train that do not match. Multiple "Retrieve Package" conditions can be used to stack package filters, in case * is too extreme.

Similarly a "Deliver Package" condition has been added, and when a train stops at a destination, it will only off load packages if the condition is present, or if deliver package instruction was used.

If the train is player controlled, the original functionality is used, as in it will eat all packages and deliver matching packages.

This can probably be done more optimally, but I really wanted it fixed for my own use and figured there's no harm in sharing it.

Slightly hacky fix for trains eating all packages in a post box, by requiring a condition be met to get the package or deliver the package.
…livery check.

Fixed leaving mail transfer early when checking if delivering packages.
Minor optimization via storing the results of needing to deliver and package filters so we aren't checking for every carriage.
@VoidLeech VoidLeech added pr type: fix PR fixes a bug pr type: feature PR adds a new feature or changes an existing feature pr status: wrong target PR is targeting the wrong branch labels Aug 3, 2025
Copy link
Contributor

github-actions bot commented Aug 3, 2025

@Liquidize, this pull request is targeting the wrong branch. Pull requests should target the branch corresponding to the earliest supported Minecraft version unless the changes are specific to code that only exists for a newer Minecraft version. Please change the target branch, resolve any merge conflicts, and leave a message here so we can continue with the process of reviewing and merging this pull request. Thanks!

"create.schedule.condition.redstone_link.unpowered": "Not powered",
"create.schedule.condition.redstone_link_off": "Link Off",
"create.schedule.condition.redstone_link_on": "Link On",
"create.schedule.condition.retrieve_package": "Retrieve Packages",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Changes to localization should be left to crowdin.
Also, why does this lang change remove lines that aren't removed from the default/interface file? Are they no longer used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr status: wrong target PR is targeting the wrong branch pr type: feature PR adds a new feature or changes an existing feature pr type: fix PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants