Fix Framed Blocks conflict when other mods are present#91
Fix Framed Blocks conflict when other mods are present#91seancrain wants to merge 1 commit intoaurilisdev:1.21.1from
Conversation
|
Does this also affect 1.20.1? |
|
I believe it might, I will have to check. I noticed it with my own mod, YogMod. Any block that was iron lost the ability to be placed as a Framed Block, but it also lost the ability to have signs placed on it. Non-vanilla glass was also affected in the same way, but it also became non-solid in that you could walk straight through it. I think the way it was defined was altering the block information itself and thus any block from another mod was affected, but vanilla was not. It was very strange: I could not get it to happen by itself, it always needed a combination of mods to make it happen, so it wasn't easy to track down. Nevertheless, I will investigate 1.20.1 when I get home and let you know. I will also test Modular Forcefields (I have been using the other version for now, but think I'd prefer them being all interconnected) and let you know if it is affected to. Nevertheless, it's a simple fix, so you may want to add it to 1.20.1 as well anyway if the VoltaicMaterials class is there too. |
|
I can confirm this issue does not seem to affect 1.20.1. |
|
My issue with this is that the materials in that class are not the same as the default MC ones that are being used in the blocks everywhere. I will have to see if that class (VoltaicMaterials) is even being used for anything else or if it is just deprecated. Edit: It is not being used anywhere. Therefore i am pretty sure that most of the materials there are wrong! (and that the VoltaicMaterials class is a junk file that should've been removed at this point) |
|
Also, do any of those mods then alter the default block properties of Metals, TNT, glass or the others? Since, why would it break if not? Doesn't create use the default mc properties at all? Because i have a feeling that alot of mods will do so. Therefore, if the issue is that i shouldn't be copying the default mc properties, then that seems weird :O Btw, why do you mean by "aFullCopy(" in "aFullCopy(Blocks.IRON_BLOCK) " |
|
I do not believe that they do, which is why it was so weird and confusing to chase this down. I mistyped it, it's not aFullCopy, it's ofFullCopy. It's the 1.21.1 method that allows you to add a block to a mod that takes all the properties of another, effectively replacing the earlier Properties.of() method used in Forge on 1.20.1 and earlier. I attempted various methods to correct it but it seems that Voltaic's registration is doing something to make any other modded block using that registration to have problems. I figure it's likely that if you had a block using another type, such as gold, any block defined using ofFullCopy(Blocks.GOLD_BLOCK) would have the same issue. It's just iron, TNT, and glass were the ones Voltaic and the other mods happened to be using. The only way I found so far was to remove the Blocks.NAME from the super() as well as the block registration, and VoltaicMaterials happened to be used. Then again, it's possible that adding ofFullCopy() in those spots might fix the issue as well. Right now, since it doesn't use ofFullCopy(), I think the way it is defined at the moment is actually altering the original block's properties. It's fine on its own, but when other mods attempt to copy the vanilla block, they don't get the correct property sets because Voltaic has altered them. The super class is also referencing the vanilla blocks directly instead of importing the properties from the block registration, which I think is causing problems in the other mod registrations. I have not tested this yet, but if you rewrite a line like this: To be: public static final DeferredBlock BLOCK_STEELSCAFFOLDING = BLOCKS.register("steelscaffold", That should fix the problem without breaking anything. I would have to look at and adjust it based on the changes you have in your BlockScaffold (I am not in a position to test it right now), but this should work without causing the block interference issues the existing code does. |
|
Yeah i was thinking about that but didnt think it could be changing the default properties since i havent seen any issues or talk about this so far. However, it makes perfect sense. Could you make an issue about this here on the Voltaic page? That way i remember it when i get time to fix it for all of the mods :) Thank you so much for noticing it and helping in such detail :D |
|
I can certainly do that when I get the chance to. If you like, I can even update my pull requests for each mod and fix it there so you can import it directly. I already have the development environments so it shouldn't take too long to do. It'll probably be in a few hours or so though, I won't be back at my PC until then. |
|
Okay, so I think I will go the submitting an issue path. After looking through it, if you do want to switch to the other registration, you may have to alter just a bit more. I'm afraid I might break something because I'm not well-versed in how your mod is designed internally and don't want to break anything. I will submit an issue, but what I would suggest is this: go ahead and use the VoltaicMaterials as I have done for there for now, as it does work, and make sure those entries match the properties listed for the reference blocks in the vanilla Blocks class. At a later stage, you can go through and completely modernize it. |
When installed alongside Bad Packets, CraftedCore, and Create, any block that is set up in its registration using aFullCopy(Blocks.IRON_BLOCK) definition from any other mod is unable to be used as a texture for a Framed Block from the Framed Blocks mod if Voltaic or any of the other mods are installed. It also seems to affect glass and TNT.
I have fixed this by changing the super(Blocks.IRON_BLOCK) as well as the GLASS, TNT, and WHITE_WOOL entries to use the VoltaicMaterials.materialName() methods instead. This fixes the issue. It doesn't look like Modular Forcefields uses the super(Blocks.NAME) anywhere so I have not submitted a fix for it.