TeamPneumatic / pnc-repressurized

A port of PneumaticCraft to MC1.12+
Other
119 stars 47 forks source link

add support for custom PCBs #1315

Closed RemagOfficial closed 1 week ago

RemagOfficial commented 1 week ago

The machines for making PCBs are hardcoded to only accept the vanilla empty PCB not any item that is an instance of the EmptyPCBItem class

RemagOfficial commented 1 week ago

currently the UV light box works fine but the etching tank doesnt accept the custom items

RemagOfficial commented 1 week ago

https://github.com/RemagOfficial/PNC-Extra-PCBs my mod with the custom PCBs for testing if needed

desht commented 1 week ago

OK, I can see what you're doing here and the concept is fine. But I really don't like the resource location substitution stuff - it's very brittle and also pretty ugly.

I had a thought though - what about just adding a couple of methods to ItemEmptyPCB - getSuccessItem() and getFailedItem()? Then in your empty PCB subclass, you can just override those to return the items (or possibly item stacks) as appropriate. Much cleaner.

If you're happy with that, I'll make the necessary changes to ItemEmptyPCB and the etching tank block entity to support that.

RemagOfficial commented 1 week ago

I don't care how it's done as long as the inputs and outputs are customisable, the way I've done it has been enough to test my addon and since each PCB type already needs it's own empty PCB class it'd be easy to use your method

desht commented 1 week ago

OK, I've just pushed a change which makes this PR unnecessary. Once it's built, you can depend on the 6.0.16 dev build from Maven, and override the getSuccessItem() and getFailedItem() methods in EmptyPCBItem. And that should be all you need to do.

Oh, and make sure you specify a minimum version of 6.0.16 in your PNC dependency in mods.toml.

RemagOfficial commented 1 week ago

👍

desht commented 1 week ago

https://modmaven.dev/me/desht/pneumaticcraft/pneumaticcraft-repressurized/6.0.16+mc1.20.1-SNAPSHOT/ available for testing

If this is working well for you, I'll do a 6.0.16 release.

RemagOfficial commented 1 week ago

https://modmaven.dev/me/desht/pneumaticcraft/pneumaticcraft-repressurized/6.0.16+mc1.20.1-SNAPSHOT/ available for testing

If this is working well for you, I'll do a 6.0.16 release.

yeah it works

RemagOfficial commented 2 days ago

any update on that 6.0.16 release?

desht commented 2 days ago

Yeah, sorry, been a bit busy IRL. Will try to get a release out this week.