Giter Club home page Giter Club logo

basemod's Introduction

BaseMod

BaseMod is a project to ease the process of creating a new Minecraft mod, with the ForgeGradle system.

Prerequisites

The use of ForgeGradle requires the Java Development Kit to be installed.

Using the project

Using BaseMod to set up your own ForgeGradle project, is done in the following steps

  1. Copy
  2. Edit build.gradle
  3. Edit gradle.properties
  4. Generate project
  5. Code
  6. Build
  7. Running Minecraft

Steps

Copy

Copying the repository can be done in two ways:

  • Follow the GitHub instructions for duplicating a repository.
    You can then download, and use this repository as your working directory.

  • Click Download ZIP in the right side of the repository page, to download a zipped version of this repository.
    This can then be unzipped to a working directory, and be used as the base for your mod.

build.gradle

This file contains the configuration for gradle to build and package the mod to a jar file. The whole file is written in groovy, a programming lanaguage, so practically anything is possible in this file.

First read the build.gradle and try to understand it. If you cannot, don't worry: all of the hard work is done for you.

Edit the build.gradle file to fit the needs for your mod. In most cases this only requires the change of the group and archivesBaseName variables.

For more specialized mods, you may need to refer to ForgeGradle documentation.

gradle.properties

This file sets out some variables which are accessible in the build.gradle script such as mcversion and mcversion. The reason they are stored in this file is because they tend to change much more often than the other items in build.gradle.

You should edit these variables to fit the needs of your mod.

Generate project

Generate workspace

Note: You can run the following commands without the w at the end if you already have gradle installed.
Add ./ to the front of the command on OSX and *NIX systems. For example: ./gradlew instead of gradlew

To generate the Forge workspace which is used to code in, you will need to run one of the following commands:

gradlew setupDevWorkspace

Sets up the workspace without decompiling the Minecraft class files, allowing you to compile and run your mod, but not see the Minecraft sources.

gradlew setupDecompWorkspace

Sets up the workspace, and decompiles Minecraft, allowing you to refer to the decompiled Minecraft sources as you code.

Generate project files

To generate the project used by IntelliJ IDEA or Eclipse use one of these commands:

gradlew idea
gradlew eclipse

These commands can be run at once, such as:

gradlew setupDecompWorkspace idea

Code

You should now be ready to code your mod!

Build

To build the mod, run the command:

gradlew build

This will place the compiled jar files inside the <project directory>/build/libs directory.

The -sources.jar file contains the source code for the mod. The -deobf.jar file contains the deobfuscated code which is useful to other developers. The .jar file without a specifier is the file that should be installed by others.

If this is not the first time you are building the mod, or you experience that any files are not correctly updated, you may want to run the clean command, such as:

gradlew clean

This can also be chained as:

gradlew clean build

Running Minecraft

If you want to run minecraft to test the mod, you can use either the run commands in your IDE (reccomended) or use gradle.

To run the client using gradle:

gradlew runClient

To run the server using gradle:

gradlew runServer

basemod's People

Contributors

rx14 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rx14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.