Compare commits
2 Commits
1.20-neofo
...
1.21
Author | SHA1 | Date | |
---|---|---|---|
03166c25dd | |||
40ba1ba66a |
@@ -3,7 +3,7 @@ package com.author.examplemod;
|
|||||||
import com.author.examplemod.platform.IPlatformHelper;
|
import com.author.examplemod.platform.IPlatformHelper;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.food.FoodProperties;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.TooltipFlag;
|
import net.minecraft.world.item.TooltipFlag;
|
||||||
@@ -20,14 +20,9 @@ public class ExampleModCommon {
|
|||||||
// This method serves as a hook to modify item tooltips. The vanilla game
|
// This method serves as a hook to modify item tooltips. The vanilla game
|
||||||
// has no mechanism to load tooltip listeners so this must be registered
|
// has no mechanism to load tooltip listeners so this must be registered
|
||||||
// by a mod loader like Forge or Fabric.
|
// by a mod loader like Forge or Fabric.
|
||||||
public static void onItemTooltip(ItemStack stack, TooltipFlag context, List<Component> tooltip) {
|
public static void onItemTooltip(ItemStack stack, Item.TooltipContext context, TooltipFlag flag, List<Component> tooltip) {
|
||||||
if (!stack.isEmpty()) {
|
if (!stack.isEmpty()) {
|
||||||
final FoodProperties food = stack.getItem().getFoodProperties();
|
tooltip.add(Component.literal("Hey you!"));
|
||||||
|
|
||||||
if (food != null) {
|
|
||||||
tooltip.add(Component.literal("Nutrition: " + food.getNutrition()));
|
|
||||||
tooltip.add(Component.literal("Saturation: " + food.getSaturationModifier()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14",
|
"fabricloader": ">=0.14",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "1.20.x",
|
"minecraft": ">=1.21",
|
||||||
"java": ">=17"
|
"java": ">=21"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -41,7 +41,7 @@ processResources {
|
|||||||
from project(":Common").sourceSets.main.resources
|
from project(":Common").sourceSets.main.resources
|
||||||
def buildProps = project.properties.clone()
|
def buildProps = project.properties.clone()
|
||||||
|
|
||||||
filesMatching("META-INF/mods.toml") {
|
filesMatching("META-INF/neoforge.mods.toml") {
|
||||||
expand buildProps
|
expand buildProps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,6 @@ public class ExampleModForge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onItemTooltip(ItemTooltipEvent event) {
|
private void onItemTooltip(ItemTooltipEvent event) {
|
||||||
ExampleModCommon.onItemTooltip(event.getItemStack(), event.getFlags(), event.getToolTip());
|
ExampleModCommon.onItemTooltip(event.getItemStack(), event.getContext(), event.getFlags(), event.getToolTip());
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,14 +1,14 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[1,)"
|
loaderVersion="[1,)"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
issueTrackerURL="https://github.com/minecraftforge/"
|
issueTrackerURL="https://github.com/neoforged/"
|
||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId="${mod_id}"
|
modId="${mod_id}"
|
||||||
version="${version}"
|
version="${version}"
|
||||||
displayName="${mod_name}"
|
displayName="${mod_name}"
|
||||||
#updateJSONURL="https://change.me.example.invalid/updates.json"
|
#updateJSONURL="https://change.me.example.invalid/updates.json"
|
||||||
displayURL="https://minecraftforge.net"
|
displayURL="https://neoforged.net"
|
||||||
logoFile="assets/examplemod/icon.png"
|
logoFile="assets/examplemod/icon.png"
|
||||||
credits="Thanks for this example mod goes to Java"
|
credits="Thanks for this example mod goes to Java"
|
||||||
authors="${mod_author}"
|
authors="${mod_author}"
|
||||||
@@ -22,14 +22,14 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
|
|||||||
|
|
||||||
[[dependencies.${mod_id}]]
|
[[dependencies.${mod_id}]]
|
||||||
modId="neoforge"
|
modId="neoforge"
|
||||||
mandatory=true
|
type="required"
|
||||||
versionRange="[20.2,)"
|
versionRange="[21.0.0-beta,)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
|
|
||||||
[[dependencies.${mod_id}]]
|
[[dependencies.${mod_id}]]
|
||||||
modId="minecraft"
|
modId="minecraft"
|
||||||
mandatory=true
|
type="required"
|
||||||
versionRange="[1.20.2,1.21)"
|
versionRange="[1.21,1.21.1)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
10
build.gradle
10
build.gradle
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id "xyz.wagyourtail.unimined" version "1.1.0-SNAPSHOT" apply false
|
id "xyz.wagyourtail.unimined" version "1.2.9" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit in gradle.properties
|
// Edit in gradle.properties
|
||||||
@@ -15,8 +15,8 @@ subprojects {
|
|||||||
group = rootProject.group
|
group = rootProject.group
|
||||||
version = rootProject.version
|
version = rootProject.version
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
|
|
||||||
// Add your maven repositories here
|
// Add your maven repositories here
|
||||||
repositories {
|
repositories {
|
||||||
@@ -73,10 +73,10 @@ subprojects {
|
|||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
it.options.encoding = 'UTF-8'
|
it.options.encoding = 'UTF-8'
|
||||||
it.options.release = 17
|
it.options.release = 21
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(GenerateModuleMetadata) {
|
tasks.withType(GenerateModuleMetadata).configureEach {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,14 +10,14 @@ mod_id=examplemod
|
|||||||
mod_name=ExampleMod
|
mod_name=ExampleMod
|
||||||
|
|
||||||
# Shared
|
# Shared
|
||||||
minecraft_version=1.20.2
|
minecraft_version=1.21
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
fabric_loader=0.14.24
|
fabric_loader=0.15.11
|
||||||
fabric_api=0.90.7+1.20.2
|
fabric_api=0.102.0+1.21
|
||||||
|
|
||||||
# NeoForged
|
# NeoForge
|
||||||
neoforge_version=64-beta
|
neoforge_version=167
|
||||||
|
|
||||||
# Gradle Options
|
# Gradle Options
|
||||||
org.gradle.jvmargs=-Xmx3G
|
org.gradle.jvmargs=-Xmx3G
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Sun Nov 05 19:31:04 SAST 2023
|
#Sun Nov 05 19:31:04 SAST 2023
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
BIN
output.lzma
BIN
output.lzma
Binary file not shown.
@@ -40,7 +40,7 @@ This project is powered by [Unimined](https://github.com/unimined/unimined), and
|
|||||||
9) `description` -> Your mod description
|
9) `description` -> Your mod description
|
||||||
11) `versionRange` -> `[neoforgeVersionCode,)` and `[1.20.2,)` (Replace with the minecraft versions your mod supports)
|
11) `versionRange` -> `[neoforgeVersionCode,)` and `[1.20.2,)` (Replace with the minecraft versions your mod supports)
|
||||||
|
|
||||||
6) If your default JVM/JDK is not Java 17 you will encounter an error when opening the project. This error is fixed by going to File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVMand changing the value to a valid Java 17 JVM. You will also need to set the Project SDK to Java 17. This can be done by going to File > Project Structure > Project SDK. Once both have been set open the Gradle tab in IDEA and click the refresh button to reload the project.
|
6) If your default JVM/JDK is not Java 21 you will encounter an error when opening the project. This error is fixed by going to File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM and changing the value to a valid Java 21 JVM. You will also need to set the Project SDK to Java 21. This can be done by going to File > Project Structure > Project SDK. Once both have been set open the Gradle tab in IDEA and click the refresh button to reload the project.
|
||||||
7) Replace the contents of `LICENSE` with your mod license
|
7) Replace the contents of `LICENSE` with your mod license
|
||||||
8) Replace the contents of `readme.md` with your mod readme
|
8) Replace the contents of `readme.md` with your mod readme
|
||||||
|
|
||||||
|
@@ -13,7 +13,4 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'fdd-xplat'
|
rootProject.name = 'fdd-xplat'
|
||||||
include 'Common'
|
include('Common', 'Fabric', 'NeoForge')
|
||||||
include 'Fabric'
|
|
||||||
include 'NeoForge'
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user