-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] Make machines save state when harvested #1576
Comments
Yes it be nice to keep molds, shapes, integrated circuits. Notes about persisting machine covers and orientation: Currently, machine front is determined when placing. This is absolutely ok to stay as-is. |
Okay, good point. Just be aware you'd lose them if you toss the machine in an arc furnace or macerator without removing those items first, or if you for some reason decide to take a pickaxe to the machine instead of a wrench.
This could be tricky to implement, especially considering that covers on pipes and cables (which have no obvious "front") are handled by the same code, but I'll look into it. Also, related to the above, saving item inventory would also affect item pipes (at least by default, I might be able to add special conditions for that), so breaking a clogged item pipe would no longer work to drop the contents. |
Battery slot is a good place to persist. Makes me think that if machine had dedicated configuration slot for circuits, molds, shapes, blades... you'd only persist this one and the battery slot. A good GUI place for a configuration slot would be atop of the progress indicator. A configuration slot would exclusively accept configuration items, with input slot blacklisting configuration items to maintain backward compatibility with existing automation setups; where the configuration item is piped-in and out alongside input items. |
There is already code for saving and loading the entire machine inventory (presumably triggered when the chunk unloads/loads), I'd just have to copy that part to the function called when the machine is harvested, and remove the code that drops the contents on the ground. Persisting specific inventory slots and not others would actually be more difficult. As far as piping the configuration item both in and out of a dedicated slot, how would it stay in there long enough for the recipe to work? The recipes could be changed to "consume" the configuration item and put it an output slot when finished, but then it would be a pain to have to move it back to the input slot when not using some form of automation. Wait, here's an idea I just came up with: what if piping in a configuration item pushed any existing one into the output (if there's room)? Sort of outside the scope of the current suggestion, but wouldn't really need a new dedicated slot. |
You would not be able to remove the configuration item. |
Thinking about this "dedicated slot for configuration items" idea more, it might be more hassle to implement than it's worth:
|
Originally suggested by leagris in #1544
Looking at the changelog, https://mechaenetia.com/changelog/#Changelog I think you are slightly mistaken about the motivation:
Admittedly, the item pipe system can alternately be cleared by connecting a chest. I'm not sure about essentia containers and tubes.
As far as making the tilemachine NBT data persisted on harvest, the framework is already there:
GT5-Unofficial/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
Line 1249 in 77a3c95
It's just that most GT tile entities don't do anything yet with that "setItemNBT" method. A lot can be copied from the "saveNBTData" method, but there are a few details that probably shouldn't be saved when harvested:
The text was updated successfully, but these errors were encountered: