rejuvena / collate

tModLoader ModCompile alternative with extra features.
https://tomat.dev/projects/terraria/rejuvena/collate
GNU General Public License v2.0
7 stars 3 forks source link

[Feature] Create Dummy Class Under Appropriate Namespace #2

Closed steviegt6 closed 2 years ago

steviegt6 commented 2 years ago

We should not need to do this: https://github.com/rejuvena/collate/blob/master/src/Rejuvena.Collate.ExampleMod/Rejuvena.Collate.ExampleMod.csproj#L15

tModLoader requires that at least one loadable (as in JIT-able, not ILoadable-implementing), as per https://github.com/tModLoader/tModLoader/blob/58794a48d27a7d2babb7760dd33cbcfe5068305f/patches/tModLoader/Terraria/ModLoader/Core/AssemblyManager.cs#L213. A fix manually implemented by a modder looks like this: image

It is incredibly simple to replicate this fix with a simple post-compilation patch. We should do that.

Tabizzz commented 2 years ago

is it possible to do that if in my mod I don't have a class in the namespace of the mod, collate add the dummy automatically?, like creating the class in the obj directory

steviegt6 commented 2 years ago

is it possible to do that if in my mod I don't have a class in the namespace of the mod, collate add the dummy automatically?, like creating the class in the obj directory

That is what this issue proposes (not creating any files tho, just editing the type into the assembly).

steviegt6 commented 2 years ago

Implemented in 480b2af7f30dd4483d174b5f4a134b2aab802277.