Skip to content
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

Copying TIS-3D machines with a schematicannon results in unresponsive blackened casings #154

Open
AnFazer opened this issue Jan 19, 2022 · 3 comments
Labels

Comments

@AnFazer
Copy link

AnFazer commented Jan 19, 2022

Version
1.16, TIS Forge 1.6.8+30

What happened
I've tried to replicate a working TIS-3D contraption with the help of a Create's Schematicannon, and found that the resulting Casings had inert black squares in place of where the modules used to be, which don't react to touch and disappear if the casing is manually given another module.

What's odder, doing the same without a Schematicannon, just by inserting the Create-created (sorry for tautology) schematic into the world in creative mode, resulted in a seemingly perfect replica that even had its internal state intact - i.e. displays still had previous text, execution modules were doing just what they were doing before, etc.

The machine in question is shown on screenshot and basically just copies data from one terminal to the other, 10 symbols at a time, through the execution module attached to a moving arm. I'm working around the bugged rotation for now, but really hope you could make a fix for that soon. Though that's irrelevant to the issue, sorry. ^^'

What I expected to happen
Casings either copied perfectly, or simply looking pristine as if just placed into the world, instead of being corrupted like this.

Additional thought
I'm not sure whether the issue is on Create's side or TIS-3D side; but, given that I've never noticed such issues with Schematicannon with other mods before and that casings themselves behave oddly (black, don't react to touch), it seems obvious that TIS-3D at least missing some checks that should've prevented such behavior, therefore the issue itself might be on its side.

Thank you for your great work!!! <3

Attached screenshot (schematicannon'd schematic on the left, schematipasted schematic on the right): 2022-01-19_16 52 25

@fnuecke
Copy link
Member

fnuecke commented Apr 16, 2022

Interesting. I'm guessing that this has to do with modules internally being items in the inventory that is the casing. So in creative I'm guessing inventory contents get copied, in non-creative they don't (to avoid item dupe issues, possibly).

The black faces may then stem from copied NBT state which was based on the last inventory state... I'll have to look into it.

@fnuecke fnuecke added the bug label Apr 16, 2022
@zack-emmert
Copy link

The IMO best way to fix this issue is to have the computer casing block entity implement the following two interfaces from Create:

  1. com.simibubi.create.foundation.utility.IPartialSafeNBT
  2. com.simibubi.create.content.schematics.requirement.ISpecialBlockEntityItemRequirement

In the implementation for IPartialSafeNBT, simply write out the NBT data for the modules stored in the casing, and the in ISpecialBlockEntityItemRequirement, return an ItemRequirement with ItemUseType.CONSUME and a list of ItemStacks corresponding to each of the stored modules in the casing.

The simplest example implementation of these interfaces that I could find is Create's CopycatBlockEntity here.

@zack-emmert
Copy link

I've implemented a near-perfect solution using some semi-cursed mixins as part of TIS-Create. It's not released yet, but it's 99% functional. I'll update here when the feature is released on CF/Modrinth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants