Open shedaniel opened 3 years ago
How would this work for libraries that are not compiled using architectury? Would they have to use the platform implementations from impl.fabric/forge
instead of the common API?
Expect platform fields would be useful too
An annotation for excluding or including a method in common from being an expect platform method in the class?
Even better, the implementation classes could be subclasses of the common class and the overridden methods in the implementation classes could just be the implementation methods so all you would have to do is replace the object creation statements with the appropriate implementation class. The inheritance stuff would take care of the methods. You would also need to enforce somehow that the common class is used in common module and the implementation class is used in implementation module (the common still gets replaced with the implementation in common module)
@Witherking25
as long as common gets replaced in implementation module, everything would work with that as common can't see the impl...
tho, I just use ServiceLoader at this point...
How would this work for libraries that are not compiled using architectury? Would they have to use the platform implementations from
impl.fabric/forge
instead of the common API?as long as common gets replaced in implementation module, everything would work with that as common can't see the impl...
If you use common class in a fabric only mod it won’t work same thing for forge only mod You must use the platform specific class
Accept classes in @ExpectPlatform, may be confusing. Library Common:
Library Fabric:
Library Forge:
Using the library in Common:
Using the library in Fabric / Forge: