Class MixinModPlatform

java.lang.Object
net.dillon.dillonlib.platform.mixinsafe.MixinModPlatform
All Implemented Interfaces:
Loadable
Direct Known Subclasses:
MixinFabricPlatformImpl

public abstract class MixinModPlatform extends Object implements Loadable
A separate service loader for mixin-safe classes and plugins, to prevent unknown and unexpected crashes when reading other Minecraft files during game initialization and checking mixins. This class should only be used within mixin plugins to ensure stability.
Since:
1.0
See Also:
  • Constructor Details

    • MixinModPlatform

      public MixinModPlatform()
  • Method Details

    • modId

      public abstract String modId()
      Specified by:
      modId in interface Loadable
      Returns:
      the mod id for this platform. Should return your mod id from your common mod class.
    • isModLoaded

      public boolean isModLoaded(ModReference mod)
      Returns:
      if a mod is loaded on a specific platform. You can use this in MixinPluginUtils, or anywhere else, but call FabricPlatforms or (Neo)ForgePlatforms to get the correct return value of this method!
    • shouldApplyFactories

      public boolean shouldApplyFactories()
      Specifies if factories should be applied. If any instance of MixinModPlatform returns true here, unless a mixin is manually disabled, factories will be applied.
      Returns:
      false by default because not all of Dillon's mods use factories. This returns false by default as a safety feature in order to prevent mod incompatibility with other mods when factories aren't even being used. You must override this to return true if you plan on using net.dillon.dillonlib.factorys!
    • shouldApplyFullBright

      public boolean shouldApplyFullBright()
      Returns:
      if full bright settings should be applied. This allows for full bright in your mod if you wish to add it.