Skip to content

Commit

Permalink
feat: update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 committed Dec 30, 2023
1 parent 1e19607 commit fd0c01f
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 49 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Update to support NeoForge. 1.20.4 will come later in the week :)

1.20.4 support with no further API changes.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@

JamLib is the platform-agnostic, Architectury based library used in all of our mods.

### A Note on Versions

As I undertake the process of updating all of my mods to support Forge, JamLib versions will be a bit confusing.

- Using Forge? Use the latest version.
- Using Fabric and a mod that doesn't yet have a Forge version? Use `V0.6.2`.

## Features

- [x] Config using JSON5
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ tasks.publish {
dependsOn("fabric:publishUnified")
dependsOn("quilt:publishUnified")
dependsOn("forge:publishUnified")
dependsOn("neoforge:publishUnified")
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void init() {
)
);

ConfigEntryList list = new ConfigEntryList(this.minecraft, this.width, this.height, 32, this.height - 32, 25);
ConfigEntryList list = new ConfigEntryList(this.minecraft, this.width, this.height - 64, 32, 25);

if (this.entries.size() == 0) {
for (Field field : this.manager.getConfigClass().getDeclaredFields()) {
Expand Down Expand Up @@ -523,8 +523,8 @@ private static Type fromField(Field field) {
}

private class ConfigEntryList extends SelectionList {
public ConfigEntryList(Minecraft minecraft, int i, int j, int k, int l, int m) {
super(minecraft, i, j, k, l, m);
public ConfigEntryList(Minecraft minecraft, int width, int height, int y, int itemHeight) {
super(minecraft, width, height, y, itemHeight);
}

protected void addEntry(GuiEntry entry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected void init() {

this.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, button -> Objects.requireNonNull(this.minecraft).setScreen(this.parent)).pos(this.width / 2 - 75, this.height - 28).size(150, 20).build());

ConfigSelectionList list = new ConfigSelectionList(this.minecraft, this.width, this.height, 32, this.height - 32, 25);
ConfigSelectionList list = new ConfigSelectionList(this.minecraft, this.width, this.height - 64, 32, 25);
ConfigManager.MANAGERS.values().stream().filter(m -> m.getModId().equals(this.modId)).forEach(list::addEntry);
this.addRenderableWidget(list);
}
Expand All @@ -59,8 +59,8 @@ public void renderBackground(GuiGraphics graphics, int i, int j, float f) {
}

private static class ConfigSelectionList extends SelectionList {
public ConfigSelectionList(Minecraft minecraft, int i, int j, int k, int l, int m) {
super(minecraft, i, j, k, l, m);
public ConfigSelectionList(Minecraft minecraft, int width, int height, int y, int itemHeight) {
super(minecraft, width, height, y, itemHeight);
}

private void addEntry(ConfigManager<?> manager) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,28 @@

@ApiStatus.Internal
public class SelectionList extends ContainerObjectSelectionList<SelectionListEntry> {
public SelectionList(Minecraft minecraft, int i, int j, int k, int l, int m) {
super(minecraft, i, j, k, l, m);
public SelectionList(Minecraft minecraft, int width, int height, int y, int itemHeight) {
super(minecraft, width, height, y, itemHeight);
this.centerListVertically = false;
}
//
// @Override
// public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
// super.render(graphics, mouseX, mouseY, delta);
// SelectionListEntry hovered = this.getHoveredEntry(mouseX, mouseY);
//
// if (hovered != null) {
// if (hovered.getTooltip() != null) {
// graphics.renderTooltip(Minecraft.getInstance().font, hovered.getTooltip(), mouseX, mouseY);
// }
// }
// }


@Override
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.render(graphics, mouseX, mouseY, delta);
public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
super.renderWidget(graphics, mouseX, mouseY, delta);

SelectionListEntry hovered = this.getHoveredEntry(mouseX, mouseY);

if (hovered != null) {
Expand Down
6 changes: 2 additions & 4 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
"jamlib.mixins.json"
],
"depends": {
"fabricloader": ">=0.14",
"fabric": "*",
"minecraft": ">=1.20",
"java": ">=17",
"architectury": ">=9.1.12"
"minecraft": ">=1.20.4",
"architectury": ">=11.0.9"
}
}
2 changes: 0 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K
curseforge {
token = System.getenv("CURSEFORGE_API_KEY")
id = "623764"
gameLoaders.add("NeoForge")
}

modrinth {
token = System.getenv("MODRINTH_API_KEY")
id = "IYY9Siz8"
gameLoaders.add("neoforge")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ side = "BOTH"
[[dependencies.jamlib]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20,1.21)"
versionRange = "[1.20.4,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.jamlib]]
modId = "architectury"
mandatory = true
versionRange = "[9.1.12,)"
versionRange = "[11.0.9,)"
ordering = "AFTER"
side = "BOTH"
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.parallel=true
version=1.0.3+1.20.2
minecraft_version=1.20.2
branch=1.20.2
version=1.0.3+1.20.4
minecraft_version=1.20.4
branch=main
group=io.github.jamalam360
mod_name=JamLib
mod_id=jamlib
Expand Down
14 changes: 7 additions & 7 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[versions]
# https://modrinth.com/mod/architectury-api/versions
architectury = "10.0.17"
architectury = "11.0.9"

# https://files.minecraftforge.net/net/minecraftforge/forge/
forge = "1.20.2-48.0.33"
forge = "1.20.4-49.0.12"

# https://neoforged.net/
neoforge = "20.2.86"
# https://projects.neoforged.net/neoforged/neoforge
neoforge = "20.4.69-beta"

# https://fabricmc.net/develop
fabric-loader = "0.14.23"
fabric-api = "0.90.4+1.20.2"
fabric-loader = "0.15.3"
fabric-api = "0.92.0+1.20.4"

# https://lambdaurora.dev/tools/import_quilt.html
quilt-loader = "0.21.1"
quilted-fabric-api = "7.4.0+0.90.0-1.20.1"

# https://modrinth.com/mod/modmenu/versions
modmenu = "8.0.0"
modmenu = "9.0.0"

# https://github.com/falkreon/Jankson/releases/latest
jankson = "1.2.3"
Expand Down
2 changes: 1 addition & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K
publishing {
publications {
mavenForge(MavenPublication) {
artifactId = rootProject.archivesBaseName + "-forge"
artifactId = rootProject.archivesBaseName + "-neoforge"
from components.java
}
}
Expand Down
12 changes: 6 additions & 6 deletions neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ config = "jamlib.neoforge.mixins.json"

[[dependencies.jamlib]]
modId = "neoforge"
mandatory = true
versionRange = "[20.2,)"
type = "required"
versionRange = "[20.4,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.jamlib]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.2,)"
type = "required"
versionRange = "[1.20.4,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.jamlib]]
modId = "architectury"
mandatory = true
versionRange = "[9.1.12,)"
type = "required"
versionRange = "[11.0.9,)"
ordering = "AFTER"
side = "BOTH"
4 changes: 2 additions & 2 deletions quilt/src/main/resources/quilt.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
},
{
"id": "minecraft",
"version": ">=1.20.1"
"version": ">=1.20.4"
},
{
"id": "architectury",
"version": ">=9.1.12"
"version": ">=11.0.9"
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions testmod-neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ Test Mod for JamLib

[[dependencies.testmod]]
modId = "neoforge"
mandatory = true
type = "required"
versionRange = "[20.2,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.testmod]]
modId = "minecraft"
mandatory = true
type = "required"
versionRange = "[1.20.2,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.testmod]]
modId = "architectury"
mandatory = true
type = "required"
versionRange = "[9.1.12,)"
ordering = "AFTER"
side = "BOTH"

0 comments on commit fd0c01f

Please sign in to comment.