The Forge ModContainer has a function Object ModContainer.getMod() which returns the instance of the forge mod class (annotated by @Mod()), this feature is widely used. However, in current version of Patchwork, we don't have any method to get that instance.
We should make net/patchworkmc/api/ForgeInitializer.onForgeInitialize return that instance: Changing void onForgeInitialize(); to Object onForgeInitialize().
The Forge ModContainer has a function
Object ModContainer.getMod()
which returns the instance of the forge mod class (annotated by@Mod()
), this feature is widely used. However, in current version of Patchwork, we don't have any method to get that instance.We should make
net/patchworkmc/api/ForgeInitializer.onForgeInitialize
return that instance: Changingvoid onForgeInitialize();
toObject onForgeInitialize()
.This feature is required by Patchwork-API PR: https://github.com/PatchworkMC/patchwork-api/pull/87
The Patchwork-API dispatcher needs to call this method to store the mod instance: https://github.com/rikka0w0/patchwork-api/blob/1e18e1218c9030f3a903b088c67e66f5dbbf0829/patchwork-fml/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java#L62