Skip to content

Commit

Permalink
implement feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
IchHabeHunger54 committed Dec 6, 2023
1 parent abfb7af commit 9e9f74c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
13 changes: 7 additions & 6 deletions docs/gettingstarted/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Make sure you are using a 64-bit JVM. One way of checking is to run `java -versi

Edit the `gradle.properties` file to customize how your mod is built (e.g. mod id, mod version, etc.).

:::warning
Only edit the `build.gradle` and `settings.gradle` files if you know what you are doing. All basic properties can be set via `gradle.properties`.
:::

All properties are explained as comments inside the `gradle.properties`, the most important ones will be listed here as well:

- `minecraft_version` and `neo_version` specify the Minecraft and NeoForge version used by your project, respectively. Change these appropriately if you want to update Minecraft or NeoForge.
Expand All @@ -55,6 +51,7 @@ The group id should be set to your [top-level package][packaging], which should
| Email | example@gmail.com | `com.gmail.example` |

```text
// In your gradle.properties file
mod_group_id=com.example
```

Expand All @@ -71,6 +68,10 @@ com

There are several other configuration options available. A few of these are explained via comments in the `build.gradle` files. For full documentation, see the [NeoGradle documentation][neogradle].

:::warning
Only edit the `build.gradle` and `settings.gradle` files if you know what you are doing. All basic properties can be set via `gradle.properties`.
:::

## Building and Testing Your Mod

To build your mod, run `gradlew build`. This will output a file in `build/libs` with the name `<archivesBaseName>-<version>.jar`, by default. This file can be placed in the `mods` folder of a NeoForge-enabled Minecraft setup, or uploaded to a mod distribution platform.
Expand All @@ -81,7 +82,7 @@ To run your mod in a test environment, you can either use the generated run conf

If you are running a dedicated server, whether through the run configuration or `gradlew runServer`, the server will shut down immediately. You will need to accept the Minecraft EULA by editing the `eula.txt` file in the run directory.

Once accepted, the server will load and become available under `localhost` (or `127.0.0.1`). However, you will still not able to join, because the server will be put into online mode by default, which requires authentication (which the Dev player does not have). To fix this, stop your server again and set the `online-mode` property in the `server.properties` file to `false`. Now, start your server, and you should be able to connect.
Once accepted, the server will load and become available under `localhost` (or `127.0.0.1` by default). However, you will still not able to join, because the server will be put into online mode by default, which requires authentication (which the Dev player does not have). To fix this, stop your server again and set the `online-mode` property in the `server.properties` file to `false`. Now, start your server, and you should be able to connect.

:::tip
You should always test your mod in a dedicated server environment. This includes [client-only mods][client], as these should not do anything when loaded on the server.
Expand All @@ -93,7 +94,7 @@ You should always test your mod in a dedicated server environment. This includes
[git]: https://www.git-scm.com/
[github]: https://github.com/
[intellij]: https://www.jetbrains.com/idea/
[jdk]: https://learn.microsoft.com/en-us/java/openjdk/download
[jdk]: https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-17
[jei]: https://www.curseforge.com/minecraft/mc-mods/jei
[mdk]: https://github.com/neoforged/MDK
[mvr]: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
Expand Down
15 changes: 8 additions & 7 deletions docs/gettingstarted/modfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ modId = "examplemod2"
| `modId` | string | **mandatory** | The unique identifier representing this mod. The id must match `^[a-z][a-z0-9_]{1,63}$` (a string 2-64 characters; starts with a lowercase letter; made up of lowercase letters, numbers, or underscores). | `modId="examplemod"` |
| `namespace` | string | value of `modId` | An override namespace for the mod. The namespace much match `^[a-z][a-z0-9_.-]{1,63}$` (a string 2-64 characters; starts with a lowercase letter; made up of lowercase letters, numbers, underscores, dots, or dashes). Currently unused. | `namespace="example"` |
| `version` | string | `"1"` | The version of the mod, preferably in a [variation of Maven versioning][versioning]. When set to `${file.jarVersion}`, it will be replaced with the value of the `Implementation-Version` property in the JAR's manifest (displays as `0.0NONE` in a development environment). | `version="1.20.2-1.0.0"` |
| `displayName` | string | value of `modId` | The display name of the mod. Used when representing the mod on a screen (e.g., mod list, mod mismatch). | `displayName"Example Mod"` |
| `displayName` | string | value of `modId` | The display name of the mod. Used when representing the mod on a screen (e.g., mod list, mod mismatch). | `displayName="Example Mod"` |
| `description` | string | `'''MISSING DESCRIPTION'''` | The description of the mod shown in the mod list screen. It is recommended to use a [multiline literal string][multiline]. | `description='''This is an example.'''` |
| `logoFile` | string | *nothing* | The name and extension of an image file used on the mods list screen. The logo must be in the root of the JAR or directly in the root of the source set (e.g. `src/main/resources` for the main source set). | `logoFile="example_logo.png"` |
| `logoBlur` | boolean | `true` | Whether to use `GL_LINEAR*` (true) or `GL_NEAREST*` (false) to render the `logoFile`. In simpler terms, this means whether the logo should be blurred or not when trying to scale the logo. | `logoBlur=false` |
| `updateJSONURL` | string | *nothing* | A URL to a JSON used by the [update checker][update] to make sure the mod you are playing is the latest version. | `updateJSONURL="https://example.github.io/update_checker.json"` |
| `features` | table | `{}` | See [features]. | `features={java_version="17"}` |
| `features` | table | `{}` | See [features]. | `features={java_version="[17,)"}` |
| `modproperties` | table | `{}` | A table of key/values associated with this mod. Unused by NeoForge, but is mainly for use by mods. | `modproperties={example="value"}` |
| `modUrl` | string | *nothing* | A URL to the download page of the mod. Currently unused. | `modUrl="https://neoforged.net/"` |
| `credits` | string | *nothing* | Credits and acknowledges for the mod shown on the mod list screen. | `credits="The person over here and there."` |
Expand All @@ -70,9 +70,10 @@ modId = "examplemod2"

The features system allows mods to demand that certain settings, software, or hardware are available when loading the system. When a feature is not satisfied, mod loading will fail, informing the user about the requirement. Currently, NeoForge provides the following features:

| Feature | Description | Example |
|:--------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------:|:----------|
| `java_version` | The acceptable version range of the Java version, expressed as a [Maven Version Range][mvr]. This should be the supported version used by Minecraft. | `"[17,)"` |
| Feature | Description | Example |
|:---------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------|
| `java_version` | The acceptable version range of the Java version, expressed as a [Maven Version Range][mvr]. This should be the supported version used by Minecraft. | `features={java_version="[17,)"}` |
| `openGLVersion` | The acceptable version range of the OpenGL version, expressed as a [Maven Version Range][mvr]. Minecraft requires OpenGL 3.2 or newer. If you want to require a newer OpenGL version, you can do so here. | `features={openGLVersion="[4.6,)"}` |

### Dependency Configurations

Expand All @@ -82,7 +83,7 @@ Mods can specify their dependencies, which are checked by NeoForge before loadin
|:---------------|:-------:|:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------|
| `modId` | string | **mandatory** | The identifier of the mod added as a dependency. | `modId="jei"` |
| `mandatory` | boolean | **mandatory** | Whether the game should crash when this dependency is not met. | `mandatory=true` |
| `versionRange` | string | `""` | The acceptable version range of the language loader, expressed as a [Maven Version Range][mvr]. An empty string matches any version. | `"versionRange=[1, 2)"` |
| `versionRange` | string | `""` | The acceptable version range of the language loader, expressed as a [Maven Version Range][mvr]. An empty string matches any version. | `versionRange="[1, 2)"` |
| `ordering` | string | `"NONE"` | Defines if the mod must load before (`"BEFORE"`) or after (`"AFTER"`) this dependency. If the ordering does not matter, return `"NONE"` | `ordering="AFTER"` |
| `side` | string | `"BOTH"` | The [physical side][dist] the dependency must be present on: `"CLIENT"`, `"SERVER"`, or `"BOTH"`. | `side="CLIENT"` |
| `referralUrl` | string | *nothing* | A URL to the download page of the dependency. Currently unused. | `referralUrl="https://library.example.com/"` |
Expand All @@ -103,7 +104,7 @@ Now that the `mods.toml` is filled out, we need to provide an entrypoint for the
```java
@Mod("examplemod") // Must match a mod id in the mods.toml
public class Example {
public Example() {
public Example(IEventBus modBus) { // The parameter is the mod-specific event bus, needed e.g. for registration and events
// Initialize logic here
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/gettingstarted/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Minecraft has used `1` as the major version since 2011, when Minecraft 1.0 was i

Snapshots deviate from the standard semver scheme. They are labeled as `YYwWWa`, where `YY` represents the last two digits of the year (e.g. `23`) and `WW` represents the week of that year (e.g. `01`). So for example, snapshot `23w01a` is the snapshot released in the first week of 2023.

The `a` suffix exists for occasions where two snapshots get released in the same week (where the second snapshot would then be named something like `23w01b`). Mojang has occasionally used this in the past. The alternative suffix has also been used for snapshots like `20w14infinite`, [2020's infinite dimensions April Fool's joke][infinite].
The `a` suffix exists for occasions where two snapshots get released in the same week (where the second snapshot would then be named something like `23w01b`). Mojang has occasionally used this in the past. The alternative suffix has also been used for snapshots like `20w14infinite`, which was the [2020 infinite dimensions April Fool's joke][infinite].

### Pre-releases and release candidates

Expand Down

1 comment on commit 9e9f74c

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: 9e9f74cc52a05caf81bcb56c2bd61d6275eb4adc
Status: ✅ Deploy successful!
Preview URL: https://b73e1a96.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-28.neoforged-docs-previews.pages.dev

Please sign in to comment.