[1.18 Feature request] Use different block IDs for the machines
jamesjimmy88 opened this issue ยท 4 comments
First of all, I want to say that have no idea if this would be as simple as adding a couple extra checks or if it would be a massive undertaking, but I guess asking won't hurt.
As it is right now, all the machines are basically the same tile entity but with a different nbt; this means that they can be /reload-ed easily but at the same time it means that any other mod that places blocks won't behave correctly with them (attempting to place custom machines with Building Gadgets, Effortless Building or Create's Schematicannon results in the placement of dummies/nbt-less machines). This could be fixed by having every machine be a separate tile entity; obviously this means that /reload-ing them wouldn't be possible anymore, but maybe it could be circumvented by having an additional separate config/json file where the only thing you do is define the machines' IDs that you want to create. This way it would be possible to register all the machines by reading that file during the block registration phase (or whatever that is, I'm not a modder) and still be able to /reload their individual configuration files after the game loaded. The current file structure would also remain the same as it is right now - the only difference is that the machines' json files would have to have the same name as the IDs defined in the new config file in order to work.
I'm more than okay with that; as I said, I have an extremely limited idea on how things work under the hood. I honestly didn't even think that it was possible to fix this interaction issue on your end.
To be honest, it would be easier and probaably better to just find why these mods place dummy machines and fix that instead.
I just looked at effortless building and that's something that can be fixed easily (on my end), pretty sure that it's something similar for building gadgets and create.
About giving different block ID per machines you summed it up very well.
There are a few problems about using a config (or any file) to create and register new blocks :
- Still prevent /reload when new machines are added.
- Confuse users more, not aiming at anyone but if I tell pack makers they have to make 2 files instead of 1, I'm pretty sure I will get twice more "it don't work" reports.
- THE big problem, both clients and server MUST have the exact same file or else the player won't be able to join the server due to block registry mismatch.
Also, even if that's not really forbidden, using a file to conditionally register things (not only blocks) is not recommended and not supported by forge peoples (because of the 3rd problem I mentionned).
So for these reasons I must reject this request. I will see what I can do to make building mods able to place custom machines without nuking their nbt.
Well, that's fixed at least for Effortless Building and Building Gadgets, just the preview show the default machine model instead of the appearance defined in the machine json... but I can't do much about that. At least it place the correct machine instead of a Dummy.
About Create cannon, from what I can see I can't fix it without making CM depends on create (and that's a no) or doing some dark magic (I don't like it either).
Best you can do is add custommachinery:custom_machine_block
(the machine block ID) to the create:safe_nbt
block tag and the canon will be able to place machines, but this copy ALL the nbt of the machine copied by schematic including inventory, energy stored etc...
So this would allow duplication so I don't really recommend it.
If one day I make an addon to CM and Create I will fix this bug, but for now it will stay :(