Rosepad Modding

From Alphaver Wiki
Jump to navigation Jump to search

Rosepad is a modified Client and Server for Alpha 1.0.16.05_13 Lilypad QA, that provides a custom modding API called RML[1] (Rosepad Mod Library). The following guides will help you in making your own mod using the Gradle build system.

Environment preparation

Prerequisites

  1. Java Development Kit version 8
  2. IntelliJ IDEA or Eclipse IDE
  3. Knowledge of Java programming language
  4. Gradle[2] installation

Installation

  1. Create a new folder for your mod
  2. In the folder run gradle init
  3. Choose a basic installation with Groovy
  4. Modify the following files:

build.gradle

plugins {
    id 'java-library' //to allow the use of api() Gradle function
} 

repositories {
    // Use Maven Central for resolving RML dependencies.
    mavenCentral()
    maven {
        urls 'https://jitpack.io'
    }
}

dependencies {
    api 'com.github.RosepadMC:RML:-SNAPSHOT'
} 

settings.gradle

// This goes after the rootProject.name line
include 'RML'

src/main/resources/mod.toml

name = "Example mod"
id[3] = "examplemod"
description = "An example RML mod"
author = "dev0"
version = "1.0.0"
url = "https://example.org"

[main]
both[4] = "examplemod.ExampleMod"

[dependencies][5]
minecraft[6] = "1.1.0.7-dev"

Modding

NOTE: RML is not complete yet. Due to that, this section will provide several simple tips on RML rather than guide you on how to make a mod

  • The main class of your mod should extend RosepadMod.
  • Any interaction with game's content should be made via the static fields and methods of class Game.
  • Block, Item, Entity and Material classes are inline classes of their respective registries.
  • Any registry when trying to get an object from it, will throw NoSuchElementException if such object does not exist in the registry.
  • If you want to add/tweak mod loader logic, extend RosepadLoaderExtension.

Footnotes

  1. RML's GitHub page
  2. https://gradle.org/
  3. Mod ID should not have spaces
  4. This defines the main class of the mod. Replace both with client or server to define the main class for a certain environment
  5. Dependencies are defined in a format of modid = "version"
  6. This defines the version of Rosepad the user must have to run the mod. Currently RML is implemented only in 1.1.0.7 developer builds of Rosepad.