An addition for Create 6 for Minecraft 1.20.1 and 1.21.1.
This mod aims to improve or expand several areas related to logistics with the Create mod.
Additions
Promise Limits (Factory Gauge Improvement)
We've all been there. You set up a new factory gauge, and request 100 stacks of whatever, only to find out that your production facility can't keep up and Create tried sending 1,000 packages worth of ingredients and now everything is awful.
Promise Limits are here to help. When configuring a factory gauge, you can now set a limit for how many promises it can have open at once. This allows you to, for example, limit it to only waiting for at most a stack of something at a time.
Your factory's logistics grid will thank you.
Additional Stock (Restocker Gauge Improvement)
Restockers are pretty cool, but something I don't like about them is how they stock to a specific value and as soon as so much as a single cobblestone is missing, they'll request the exact number needed to reach that value again. This can be a bit silly and wasteful. As such, additional stock! Say, for example, you have a Restocker that's set to keep one stack of cobblestone on hand. With this, you can tell the Restocker to request 8 additional stacks of items whenever the available quantity falls under the requested level (1 stack). Then, say the number of cobblestone in storage drops to 32. Half of a stack. Instead of requesting 32 cobblestone to get back up to one stack, it'll request 544 cobblestone. That's the missing 32, and 8 more stacks. Kind of like a Threshold Switch, but for restocking. And with a somewhat clunkier UI because of how the Restocker works.
Regular Expressions (Package Address Improvement)
Globs are nice, but sometimes they just lack a little something, right? Well, go
ahead and use regex if you dare. No, really. You can now. Just start your address
pattern with regex: (case-insensitive) and the rest of it will be treated as a
regular expression.
Cash Register (New Block, Stock Ticker-Like)
A new block that serves as an alternative to the Stock Ticker. Cash Registers are meant for use in shops specifically. They feature UIs for extracting items rather than right-clicking like the Stock Ticker. Additionally, they track all sales made through them in a Sales Ledger. Plus, they look neat!
As a little bonus, you can take the Sale Ledger out of a Cash Register and click a Stock Keeper with it to quickly select all the items you sold. Good for restocking your shop, if you're doing that manually. (This works just like a clipboard list of items for a Schematicannon.)
Package Accelerator (New Block, Packagers Go Zoom)
An auxiliary block to accompany Packagers, this block uses stress units to speed up the Packager in front of it. I use Sophisticated Storage for bulk storage of items, and as the system has grown, having a single packager has presented a bottleneck for sending items out. This is my solution, allowing packages to be sent out much quicker but at a cost.
Package Accelerators require at least 30 RPM to function.
Package Editor (New Block, Rename Packages)
A new package handling block. The Package Editor is similar to a Re-Packager, but rather than combining packages from the same order, it allows you to edit the addresses of packages using rules. Rules are input by either placing a sign next to the Package Editor, or by attaching a clipboard to the side of the Package Editor. Clipboards are recommended.
When writing rules for a Package Editor, the first line is the pattern to
match and the second line is the text to replace the match with. For example,
say you have packages being routed into a warehouse with the prefix Ware1-
and a full package name might be Ware1-Floor2-Storage. What if you want to
chop off the Ware1- once the package gets to your warehouse? That's easy,
just send the packages through a Package Editor with this pattern and a
blank replacement line:
Ware1-
The Package Editor will search each package name for Ware1- at the start,
and if it finds it, replace it with nothing. You could also write that like this:
Ware1-{*}
$1
So what's going on there? The Package Editor treats anything inside { and } as
a capture group. In other words, that text is saved and can be referenced in your
replacement text by adding a $ followed one you want. You can also use regular
expressions, of course, if you want to do something more advanced than globs
allow for.
Finally, there are two special behaviors you can manage if you're using a clipboard:
- If you check the box next to the pattern line, the pattern will be interpreted as case-insensitive.
- If you check the box next to the replacement line, then the Package Editor will stop after this rule (assuming this rule matched). You could use this, for example, to make a catch-all rule that sends packages to some Lost & Found if it doesn't match any other rules.
Train Network Monitor Peripheral (New Block, CC: Tweaked Only)
You know what's cool? Trains. You know what's cooler? Having some big cool wall of data about your trains. Arrivals, departures, the status of trains. And trains are pretty important for logistics, too. The Train Network Monitor is a single block that allows you to look up live data for any station and any train on a given train network. This includes everything the normal Train Station peripheral gives you, and additional events for train arrivals and departures. You can also see how many packages are in the system, and the status of every postbox attached to the various train stations.
If you're feeling particularly adventurous, you can enable optional features for viewing more details about train inventories and for read-write access to remote trains and stations. Want to update schedules on the fly using a computer? Be my guest. However, this is disabled by default because it seems a bit too unbalanced to me.
Short and Tall Seats (New Block, Basically... Seats?)
Err, seats aren't logistics? Whatever do you mean? You can, erm... sit on them, and—okay, fine. These are a bit out of scope for 'Additional Logistics', but there's a good reason we've added seats! Aesthetics, of course.
Depending on what kind of mob you choose for your Stock Keeper, the default seat isn't always at a good height for whatever build you're doing. As such, we've added Short Seats and Tall Seats. Short Seats are 2/16ths of a block tall, while Tall Seats are 14/16ths of a block tall. (Normal Seats are, of course, 8/16ths or 1/2 of a block tall.)
Lazy Shafts (New Block, Basically Shafts)
I know what you're thinking. This isn't logistics either. And Create has had shafts for years. Get it together, Khloe. But this is important, I promise. Lazy Shafts are my attempt at creating lag friendly shafts. Basically, normal shafts have a block entity for each individual block, right? These try to avoid that when possible. As long as you have more than two Lazy Shafts in a row, you're going to be coming out ahead on block entities. If you use a lot of shafts, and I mean a lot, then replacing them with these might help your server performance.
Flexible Lazy Shafts (New Block, Basically Gearboxes + Lazy Shafts + ???)
There are Flexible Lazy Shafts too. These are like Lazy Shafts, but they can connect in any direction. Not just that, but they have configurable sides. Just use your wrench on a side to expose a shaft. Use your wrench again to reverse the direction.
Just be careful when connecting things. Due to how they're connected in code, sometimes Create ends up breaking an inconvenient Flexible Lazy Shaft if there's a problem with incompatible rotations.
Did I mention Lazy Shafts, Flexible Lazy Shafts, and Lazy Cogs can be encased? They support Andesite Casing, Brass Casing, Copper Casing, Industrial Iron Block, and Weathered Iron Block. (Yes, I want to implement Train Casing, but it's actually a bit weird to do for some weird technical reasons, at least if I want the connected textures to work properly. It's coming Eventually™.)
Improvements
Address Matcher Optimization
Create's package address matching is just a little slow and unoptimized. This can be fine, but it can also cause issues when using Create with other mods. We're here to address the problem with a couple easy changes:
-
Cache the compiled matchers. Every package address is compiled into a regular expression when performing package matching. This involves first parsing the glob into regex, and then compiling the regex into a Java Pattern. All we have to do is cache that.
-
There are technically two caches because of how the internals of the package address system works, so I'm counting it as two things. But really, just caching was enough to make things work better in a doomsday scenario my SMP server saw recently thanks to Sophisticated Storage handling packages with package filters.
Regular Expressions (Safety)
I'm actually aware there was already another mod that let you do regex with package addresses, but when we tried that in our SMP the server was crashed by a player almost immediately. Regular expressions can actually be fairly dangerous, so I've included a few basic things that should hopefully stop someone from at least accidentally killing a server with them. Namely:
- Star Height Limit. Did you know the regular expression
(a+)+is dangerous? It's because of something called catastrophic backtracking, and the Java regular expression library is vulnerable to it. They're not impossible to write by accident for that matter. We check the star height of all regular expressions and prevent them from running if they're problematic. - Repetition Limit. It's not quite as bad, but if you try to match, say, 1000 of something in a row, the performance can start to drag. That should never come up for package addresses in the first place, so we put a protection on.
- No Backreferences. A backreference in regular expressions allows you to say "match this thing that was already matched", which can be useful, but it's also likely irrelevant for package addresses and it can be slow. They're disallowed by default.
We also make sure to test every regular expression at the moment it's parsed through
Create's Glob.toRegexPattern method, even though this doesn't normally compile the
expression, just convert it from a glob to regex. This is important because it's
implied that all regular expressions returned from this method should compile without
any errors.
Longer Frogport Names
Regular expressions tend to be a bit... bigger than globs, which could be a problem for frogs. As such, we've increased the maximum name length of frogports and postboxes to 100. ... it's a good thing you can copy and paste.
Let Your Stock Keepers Remain Seated
Let me set a scene for you. You're at a honey shop. The stock keeper is a bee. You get a shopping list and you're ready to check out, so you click on the stock keeper and-- oh no! You clicked the seat instead! You just sat down, and the bee took to the skies with newfound freedom. You don't have a lead. How are you supposed to get a bee back on a seat? Flying mobs are the worst.
This is a simple change. If you click on a seat occupied by a stock keeper, nothing will happen. If you need to dislodge the stock keeper, you can break the seat or the stock ticker. But at least you won't do it by accident.
All Versions
+ Add Versionother stuff. Here are some much needed fixes for a few things.
### Fixed
- Incompatibility with other mods that patch a Create method used for determining
- Incompatibility with Create: Factory Logistics causing purchases to not send items.
use the currency conversion system.
- Issue where regular expression validation issues could leak exceptions and cause crashes
- Issue causing dedicated servers to crash during startup on 1.20.1.
- Issue where moving a derailed train causes an exception, potentially crashing the game.
### Changed
- The ComputerCraft peripheral for Cash Registers now extends from the Stock Ticker peripheral, reducing duplicate code and ensuring future feature parity.
### Known Issues
- Create: Factory Logistics causes the Cash Register to not send out packages when attempting to make a purchase, despite the cash register taking the user's payment. This bug must be fixed by Create: Factory Logistics.
- Issue with the factory gauge UI crashing on Minecraft 1.20.1 due to a misconfigured mixin. No update is required for 1.21.1.
- Issue where Encased Flexible Shafts would not properly update their state when a neighboring Lazy Shaft is updated.
- Possible crash when calculating automatic currencies when certain mods are installed that add crates / compressed forms of items, causing values to exceed the maximum value of a signed 32-bit integer.
### Changed
- Update the collision shape for Cash Registers to more accurately reflect the block model's shape.
- Support for Minecraft 1.20.1. This is the first such release, and likely it has some bugs so please report any issues you encounter.
- Note:** This build supports Create 6.0.7. For Create 6.0.6, please use version 1.3.0.
### Changed
- Update to Create 6.0.7.
- Note:** This build supports Create 6.0.6. For Create 6.0.7, please use version 1.4.0 or later.
### Added
- Restockers now have an Additional Items field that can be used to request
stock level and a restock is triggered.
- Train Network Monitor, a new CC: Tweaked peripheral that can be used to
network, and receive events when trains arrive at or depart from stations.
- Cash Registers now support automatic currency conversion. This means that,
Diamond Block in your inventory, it will take the Diamond Block and give
you eight Diamonds in change. This feature automatically discovers crafting
2x2 or 3x3 crafting recipes for converting items up, and also supports a
data asset for adding other currencies, such as the cogs from Numismatics.
- Chinese translation. Thanks to yision1 on GitHub!
- An API is now exposed to CC: Tweaked computers for processing package
require("createadditionallogistics.package_addresses").It can be used to convert Create's glob syntax to regular expressions, and
to determine if two provided addresses match.
### Changed
- The Cash Register, when used as a CC: Tweaked peripheral, now emits a
sale
- The Package Editor, when used as a CC: Tweaked peripheral, now emits a
package_readdressed event when a package is processed.- The address input field for Package Filters, Stock Keepers, Factory Gauges,
match the change made to Frogport and Postboxes.
- When changing the rotation of a Flexible Lazy Shaft, particles can now appear
### Fixed
- Encased Lazy Shafts causing an error when used in schematics due to a missing
- Encasing / unencasing Lazy Shafts causing a network update that can, in
- Flexible Shafts not being placed with correct side configurations by schematics.
<details>
<summary>Changes Since 1.3.0-alpha.2</summary>
### Added
- Chinese translation. Thanks to yision1 on GitHub!
- An API is exposed to CC: Tweaked computers for processing package addresses, available by requiring
createadditionallogistics.package_addresses. It can be used to convert Create's glob syntax into regular expressions, and to check if one address matches another.
### Changed
- When a Cash Register receives a payment, it will attempt to reconcile any contained currencies into the least items. For example, if a Cash Register contains 9 Diamonds, it will convert them to 1 Diamond Block.
- The tool-tip when viewing a Cash Register's contents is now currency-aware.
- The tool-tip when hovering over a Stock Keeper to complete a purchase is now currency-aware.
- When changing the rotation of a Flexible Lazy Shaft, particles can now appear to show which direction the side is rotating.
- The Train Network Monitor now has a custom appearance.
- The Train Network Monitor now emits
train_arrivalandtrain_departureevents to connected computers.
### Fixed
- Clients being unable to connect to a server with a placed Train Network Monitor if they haven't first opened a singleplayer world and placed one.
- The Train Network Monitor not having an accessible recipe.
- Issue where events would not be emitted to all computers correctly in some situations.
- Issue where a Restocker's input widget for Additional Stock would scroll incorrectly when the maximum stack size for the item being requested is 1.
</details>
<summary>Changes since 1.3.0-alpha.1</summary>
### Added
- Configuration option for disabling the Additional Stock feature if desired.
- Potentially final behavior for the Train Network Monitor Peripheral. It has configuration options to control its ability to view inventories of trains and write data remotely, both of which are disabled by default.
### Fixed
- Encased Flexible Shafts not working with schematics due to a missing block property. This should have been in the last alpha, but I forgot to include it because I was working on other schematic issues regarding Flexible Shafts.
- Flexible Shafts not maintaining correct side configuration when placed via schematic.
- Flexible Shafts not rotating correctly when placed via schematic.
- Shopping Lists not handling currency conversion properly.
- Shopping List tool-tips not handling it correctly if a currency formatter returned a null value.
</details>
<summary>Alpha Changes</summary>
Hey there! I'm flagging this one as an alpha for now because of the nature of the Restocker modification. While I don't think anything will go wrong, I'd like to get a little real world testing done to make sure.
Additionally, the currency conversion feature of Cash Registers is fairly involved and I want to use it a bit on my SMP before I declare it stable.
Finally, the Train Network Monitor peripheral is fairly early while I figure out what precisely I want to do with it. The end goal is a CC: Tweaked peripheral for monitoring a cargo / mail delivery network.
I expect to have at least one more alpha before this comes out in Release, so thank you for your patience. And please, let me know what you think! Suggestions are welcome in the issue tracker, not just bugs.
## Added
- Restockers now have an Additional Items field that can be used to request
stock level and a restock is triggered.
- Train Network Monitor (WIP), a new CC: Tweaked peripheral that can be used to
network. This is a work-in-progress block and currently has no recipe.
- Cash Registers now support automatic currency conversion. This means that,
Diamond Block in your inventory, it will take the Diamond Block and give
you eight Diamonds in change. This feature automatically discovers crafting
2x2 or 3x3 crafting recipes for converting items up, and also supports a
data asset for adding other currencies, such as the cogs from Numismatics. (I'll probably be adding more direct support for Numismatics though, to support bank cards.)
## Changed
- The Cash Register, when used as a CC: Tweaked peripheral, now emits a
sale
- The Package Editor, when used as a CC: Tweaked peripheral, now emits a
package_readdressed event when a package is processed.- The address input field for Package Filters, Stock Keepers, Factory Gauges,
match the change made to Frogport and Postboxes.
## Fixed
- Encased Lazy Shafts causing an error when used in schematics due to a missing
- Encasing / unencasing Lazy Shafts causing a network update that can, in
## Known Issues
- When a Cash Register receives payment, it's currently a bit too stupid and may perform currency conversion when it doesn't need to.
</details>
- Potential server crash when entities are seated on contraptions in an
- The Lazy Shaft system, comprised of Lazy Shafts, Flexible Lazy Shafts, Lazy Cogwheels, and Lazy Large Cogwheels.
### Fixed
- Blaze Burners not working as stock keepers with Cash Registers.
- Position of entities on Short and Tall Seats when those seats are part of a contraption.
- Rendering of the Cash Register in the Cash Register's menu.
> **Note:** 1.2.5 is the first public release of 1.2 due to taking a bit of time to ensure the new Lazy Shafts feature is as bug free as I can manage. As such, this is a condensed changelog. The full details of what changed between minor patches is available on GitHub.
- ComputerCraft Support for Cash Registers, Package Editors, and Sales Ledgers.
### Fixed
- Cash Registers not dropping their Sales Ledger when broken.