Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
Daniel Rojas Rodriguez edited this page May 11, 2022 · 2 revisions

SFSMod

Description

This is the main class of mods, use this to tell the modloader which class of your mod is the main class. Also, it stores a lot of information about your mod and useful functions for modloader and you.

Events

There are not events for this class.

Properties

Name Description
ModFolder Get folder where is store this mod
ModId Get Mod ID This ID is used to identify each mod. There cannot be two mods with the same ID
Name Get mod name
Author Get who creates this mod
ModLoderVersion Get what min version of modloader this mod needs
Version Get mod version
Description Get a description about what this mod does
Dependencies Get the list of mods you need to run.
Assets Get the assets used for this mod.

Public Methods

void loadAssets();

This method loads assets from the mod folder. This method is only used for modloader to load your assets.


virtual void early_load();

This method is called before Base's components are fully initialized allowing for hooking in their initialization.


abstract void load();

This method is called for modloader to start your mod


abstract void unload();

This method is called for modloader to remove your mod.

Implementation Example

// My Main mod class
public class MyMod: SFSMod
{

  //                 ModID, Mod Name, Author, Mod Loader, Mod Version
  public MyMod() : base("myID","My Mod", "Me", "1.3.x", "v1.0.0")
  {
  }

  public override void early_load()
  {
    // do stuff here
  }

  public override void load()
  {
    // do stuff here
  }

  public override void unload()
  {
    // do stuff here
  }
}

Attachments

Mod loading flowchart

Imgur