Skip to content

DimensionalDevelopment/Rift-MDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Rift mod

This is a minimal Rift project. The only use of it is to be copied to start a new project.

Requirements:

  • OpenJDK 8. Currently Minecraft doesn't support Java 9 and above.

Gradle tasks

  • Development:

    ./gradlew setupDecompWorkspace [eclipse,idea]

    After this, import in your IDE as Gradle project.

  • Build:

    ./gradlew build

Getting started

Important files in MDK:

src / main / java /      # code 

src / main / resources / 
        riftmod.json     # what classes to instantiate and call 
        pack.mcmeta      # resource pack description
        assets / modid / # blockstates/, sounds/, textures/, etc 

run /                    # dev env runs here; screenshots/, mods/, etc 

build /                  # build files 
        libs /           # compiled archives 

build.gradle             # how to build & dependencies 

From there, you'll probably want to change a few things:
  • build.gradle

    /* rest omitted */
    group 'example' // your root package, e.g. 'org.dimdev.halflogs'
    version '1.0'
    archivesBaseName = 'Example'
  • src/main/resources/riftmod.json

    {
        "id": "example",
        "name": "Example",
        "authors": [
            "ExampleAuthor"
        ],
        "listeners": [
            "example.ExampleListener"
        ]
    } 

    To load listener only on specific side or to change loading order:

    {
        "listeners": [{
            "class": "example.ExampleListener",
            "side": "client",
            "priority": 10
        }]
    }

    Inner classes require $ instead of ., e.g. example.Example$InnerClass.

  • pack.mcmeta

    {
        "pack": {
            "pack_format": 4,
            "description": "Example"
        }
    }

    This description is shown at Select Resource Packs screen. If mod doesn't have any resources, you can safely delete this file.

Tips

  • Changing src/main/java to src and src/main/resources to resources:

    sourceSets {
        main {
            java.srcDirs = ['src']
            resources.srcDirs = ['resources']
        }
    }
  • Running Server under Eclipse:
    Open Launch Configurations, select yourmod_client, switch to Arguments tab, change program arguments from ...Client... to ...Server...:

    --tweakClass org.dimdev.riftloader.launch.RiftLoaderServerTweaker
    

About

Minimal Rift project structure

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages