Skip to content

Commit

Permalink
fix 1.21.1 builds forge and neoforge
Browse files Browse the repository at this point in the history
  • Loading branch information
blackd committed Sep 11, 2024
1 parent 8ef128e commit c66b8ad
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,14 @@ fun Project.fabricCommonDependency(minecraft_version: Any,
"modImplementation"("net.fabricmc:fabric-loader:$loader_version")
"modImplementation"("net.fabricmc.fabric-api:fabric-api:$fabric_api_version")

"modApi"("dev.isxander:yet-another-config-lib:$yacl_version")
"modApi"("dev.isxander:controlify:$controlify_version")
"modApi"("dev.isxander:yet-another-config-lib:$yacl_version") {
exclude("maven.modrinth")
exclude(module = "reeses-sodium-options")
}
"modApi"("dev.isxander:controlify:$controlify_version") {
exclude("maven.modrinth")
exclude(module = "reeses-sodium-options")
}
modmenu_version?.let {
"modApi"("com.terraformersmc:modmenu:$modmenu_version")
}
Expand Down Expand Up @@ -219,6 +225,7 @@ fun Project.forgeCommonDependency(minecraft_version: Any,

"implementation"("thedarkcolour:kotlinforforge:$kotlin_for_forge_version") {
this.isChanging = true
exclude("cpw.mods")
}

/*
Expand Down Expand Up @@ -269,18 +276,40 @@ fun Project.neoForgeCommonDependency(minecraft_version: Any,
controlify_version: Any? = null) {


configurations.all {
resolutionStrategy {
force("org.ow2.asm:asm-analysis:9.7")
force("org.ow2.asm:asm-util:9.7")
// force("org.anti_ad.mc:libIPN-$libIPN_version")
}
}

dependencies {


"implementation"("net.neoforged:neoforge:${loader_version}")

"implementation"("dev.isxander:yet-another-config-lib:$yacl_version")
"implementation"("dev.isxander:controlify:$controlify_version")
"implementation"("dev.isxander:yet-another-config-lib:$yacl_version") {
exclude("maven.modrinth")
exclude("org.quiltmc.parsers")
exclude("org.quiltmc.*")
exclude(module = "reeses-sodium-options")
exclude("thedarkcolour")
exclude("org.jetbrains.kotlin")
}

"implementation"("dev.isxander:controlify:$controlify_version") {
exclude("maven.modrinth")
exclude("org.quiltmc.parsers")
exclude("org.quiltmc.*")
exclude(module = "reeses-sodium-options")
}


"implementation"("thedarkcolour:kotlinforforge-neoforge:${kotlin_for_forge_version}") {
this.isChanging = true
exclude("net.neoforged.fancymodloader")

}

"compileOnly"("org.anti_ad.mc:libIPN-$libIPN_version:dev") {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ipnext.docs=https://github.com/PolyhedralDev/Terra/wiki
ipnext.license=AGPL-3

# Gradle stuff
org.gradle.jvmargs=-Xmx16732M -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx52768M -Dfile.encoding=UTF-8
org.gradle.vfs.watch=true
kapt.use.worker.api=true
#kapt.include.compile.classpath=true
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-8.10-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 10 additions & 14 deletions platforms/fabric-1.21/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ import org.anti_ad.mc.ipnext.buildsrc.registerMinimizeJarTask
import org.anti_ad.mc.ipnext.buildsrc.loom_version
import proguard.gradle.ProGuardTask

val supported_minecraft_versions = mapOf(MODRINTH to listOf("1.21"),
CURSEFORGE to listOf("1.21"))
val supported_minecraft_versions = mapOf(MODRINTH to listOf("1.21", "1.21.1"),
CURSEFORGE to listOf("1.21", "1.21.1"))
val mod_loader = "fabric"
val mod_version = project.version.toString()
val minecraft_version = "1.21"
val minecraft_version_string = "1.21"
val mappings_version = "1.21+build.2"
val loader_version = "0.15.11"
val minecraft_version = "1.21.1"
val minecraft_version_string = "1.21.1"
val mappings_version = "1.21.1+build.3"
val loader_version = "0.16.3"
val modmenu_version = "11.0.0-beta.1"
val fabric_api_version = "0.100.8+1.21"
val fabric_api_version = "0.103.0+1.21.1"
val mod_artefact_version = project.ext["mod_artefact_version"]
val libIPN_version = "${project.name}:${project.ext["libIPN_version"]}"
val carpet_core_version = "1.21-pre3-1.4.146+v240605"
Expand Down Expand Up @@ -129,22 +129,18 @@ dependencies {
modImplementation("info.journeymap:journeymap-api-common:2.0.0-1.20.2-SNAPSHOT")
modImplementation("info.journeymap:journeymap-api:2.0+1.20-fabric-SNAPSHOT")
*/

/*
modImplementation("curse.maven:configured-457570:5441234")
modImplementation("curse.maven:just-enough-professions-jep-417645:5539089")
modImplementation("curse.maven:jei-238222:5598509")

*/
modImplementation("curse.maven:packed-up-backpacks-361867:5547057")
modImplementation("curse.maven:supermartijn642s-config-lib-438332:5546988")
modImplementation("curse.maven:supermartijn642s-core-lib-454372:5546972")



modImplementation("com.teamresourceful.resourcefullib:resourcefullib-fabric-1.21:3.0.9")

modImplementation(group = "earth.terrarium.chipped", name = "chipped-fabric-1.21", version = "4.0.0")


}

tasks.named("compileKotlin") {
Expand Down
19 changes: 12 additions & 7 deletions platforms/forge-1.21/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ import org.anti_ad.mc.ipnext.buildsrc.platformsCommonConfig
import org.anti_ad.mc.ipnext.buildsrc.registerMinimizeJarTask
import proguard.gradle.ProGuardTask

val supported_minecraft_versions = listOf("1.21")
val supported_minecraft_versions = listOf("1.21", "1.21.1")
val mod_loader = "forge"
val mod_version = project.version
val minecraft_version = "1.21"
val minecraft_version_string = "1.21"
val forge_version = "51.0.18"
val minecraft_version = "1.21.1"
val minecraft_version_string = "1.21.1"
val forge_version = "52.0.10"
val mod_artefact_version = project.ext["mod_artefact_version"]
val kotlin_for_forge_version = "5.3.0"
val kotlin_for_forge_version = "5.5.0"
val mappingsMap = mapOf("channel" to "official",
"version" to "1.21")
"version" to "1.21.1")
val libIPN_version = "${project.name}:${project.ext["libIPN_version"]}"

logger.lifecycle("""
Expand Down Expand Up @@ -96,6 +96,8 @@ plugins {
id("com.matthewprenger.cursegradle")
id("com.modrinth.minotaur")
id("io.github.goooler.shadow")
// id("net.minecraftforge.gradle")
// id("org.spongepowered.mixin")
}

configureCommon()
Expand All @@ -119,7 +121,10 @@ repositories {
}
}
gradlePluginPortal()

maven {
name = "kotlinforforge"
url = uri("https://thedarkcolour.github.io/KotlinForForge/")
}
}

val fg: DependencyManagementExtension = project.extensions["fg"] as DependencyManagementExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import org.anti_ad.mc.ipnext.Log
import org.anti_ad.mc.ipnext.ModInfo
import org.anti_ad.mc.ipnext.event.ClientInitHandler.register


@Mod(ModInfo.MOD_ID)
class IPNForgeModInit {

Expand All @@ -45,4 +44,6 @@ class IPNForgeModInit {
}

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ import org.anti_ad.mc.ipnext.init as inventoryProfilesInit
class KotlinClientInit: Runnable {

override fun run() {
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest::class.java) {
IExtensionPoint.DisplayTest({ ModLoadingContext.get().activeContainer.modInfo.version.toString() }) {

thedarkcolour.kotlinforforge.forge.LOADING_CONTEXT.registerExtensionPoint(IExtensionPoint.DisplayTest::class.java) {
IExtensionPoint.DisplayTest({ thedarkcolour.kotlinforforge.forge.LOADING_CONTEXT.container.modInfo.version.toString() }) {
_: String?, _: Boolean? -> true
}
}

MinecraftForge.EVENT_BUS.register(ForgeEventHandler())

ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory::class.java) {
thedarkcolour.kotlinforforge.forge.LOADING_CONTEXT.registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory::class.java) {
ConfigScreenHandler.ConfigScreenFactory { _: Minecraft?, _: net.minecraft.client.gui.screens.Screen? -> ConfigScreen() }
}
inventoryProfilesInit()
Expand Down
33 changes: 20 additions & 13 deletions platforms/neoforge-1.21/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ import org.anti_ad.mc.ipnext.buildsrc.platformsCommonConfig
import org.anti_ad.mc.ipnext.buildsrc.registerMinimizeJarTask
import proguard.gradle.ProGuardTask

val supported_minecraft_versions = listOf("1.21")
val supported_minecraft_versions = listOf("1.21", "1.21.1")
val mod_loader = "neoforge"
val mod_version = project.version
val minecraft_version = "1.21"
val minecraft_version_string = "1.21"
val forge_version = "21.0.147"
val minecraft_version = "1.21.1"
val minecraft_version_string = "1.21.1"
val forge_version = "21.1.50"
val mod_artefact_version = project.ext["mod_artefact_version"]
val kotlin_for_forge_version = "5.3.0"
val kotlin_for_forge_version = "5.5.0"
val mappingsMap = mapOf("channel" to "official",
"version" to "1.21")
"version" to "1.21.1")
val libIPN_version = "${project.name}:${project.ext["libIPN_version"]}"
val controlify_version = "2.0.0-beta.14+1.21-neoforge"
val yacl_version = "3.5.0+1.21-neoforge"
Expand Down Expand Up @@ -85,7 +85,8 @@ plugins {
kotlin("jvm")
kotlin("plugin.serialization")
java
idea
id("idea")
id("eclipse")
`maven-publish`
antlr
signing
Expand Down Expand Up @@ -116,12 +117,10 @@ repositories {
}
}
gradlePluginPortal()
/*
maven {
name = "kotlinforforge"
url = uri("https://thedarkcolour.github.io/KotlinForForge/")
}
*/
}


Expand All @@ -139,10 +138,18 @@ configurations {
dependencies {
//api(fg.deobf("org.anti_ad.mc:libIPN-$libIPN_version"))
//api("org.anti_ad.mc:libIPN-$libIPN_version")
runtimeOnly( "curse.maven:athena-841890:5431579")
runtimeOnly("curse.maven:resourcefullib-570073:5483169")
compileOnly("curse.maven:chipped-456956:5506938")
compileOnly("curse.maven:easy-villagers-400514:4584220")
runtimeOnly( "curse.maven:athena-841890:5431579")
runtimeOnly("curse.maven:resourcefullib-570073:5483169")
compileOnly("curse.maven:chipped-456956:5506938")
compileOnly("curse.maven:easy-villagers-400514:4584220")
/*
implementation("org.ow2.asm:asm-analysis:9.5") {
version {
strictly("9.5")
}
}
*/

}

tasks.named("compileKotlin") {
Expand Down
12 changes: 0 additions & 12 deletions platforms/neoforge-1.21/runClient.launch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -323,20 +323,7 @@ object LockSlotsHandler: InventoryOverlay {
return
}
if (clicked) {
val line = MouseTracer.asLine
val topLeft = screen.`(containerBounds)`.topLeft - Size(1,
1)
for ((invSlot, slotTopLeft) in slotLocations) {
if ((mode == 0) == (invSlot !in lockedInvSlotsStoredValue)
&& line.intersects(Rectangle(topLeft + slotTopLeft,
Size(18,
18)))) {
if (mode == 0)
lockedInvSlotsStoredValue.add(invSlot)
else
lockedInvSlotsStoredValue.remove(invSlot)
}
}
processSwipe(lockedInvSlotsStoredValue, screen, mode)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ object AutoRefillHandler: InventoryOverlay {
val foregroundSprite: Sprite
get() = Sprite(TEXTURE, Rectangle(8, 8, 32, 32)).right(1).down(2)

val disabledSlots: MutableList<Int> = mutableListOf()
val disabledSlots: MutableSet<Int> = mutableSetOf()

private inline val pressingDropKey: Boolean
get() = Vanilla.mc().`(options)`.`(keyDrop)`.`(isPressed)`
Expand Down Expand Up @@ -202,20 +202,7 @@ object AutoRefillHandler: InventoryOverlay {
return
}
if (clicked) {
val line = MouseTracer.asLine
val topLeft = screen.`(containerBounds)`.topLeft - Size(1,
1)
for ((invSlot, slotTopLeft) in slotLocations) {
if ((mode == 0) == (invSlot !in disabledSlots)
&& line.intersects(Rectangle(topLeft + slotTopLeft,
Size(18,
18)))) {
if (mode == 0)
disabledSlots.add(invSlot)
else
disabledSlots.remove(invSlot)
}
}
processSwipe(disabledSlots, screen, mode)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
package org.anti_ad.mc.ipnext.gui.base


import org.anti_ad.mc.alias.client.gui.screen.ingame.ContainerScreen
import org.anti_ad.mc.common.gui.NativeContext
import org.anti_ad.mc.common.math2d.Point
import org.anti_ad.mc.common.math2d.Rectangle
import org.anti_ad.mc.common.math2d.Size
import org.anti_ad.mc.common.math2d.intersects

import org.anti_ad.mc.common.vanilla.render.glue.IdentifierHolder
import org.anti_ad.mc.common.vanilla.render.glue.Sprite

import org.anti_ad.mc.ipnext.event.MouseTracer
import org.anti_ad.mc.ipnext.ingame.`(containerBounds)`

interface InventoryOverlay {

Expand Down Expand Up @@ -71,6 +75,24 @@ interface InventoryOverlay {
postRender(context)
}

fun processSwipe(slotList: MutableSet<Int>, screen: ContainerScreen<*>, mode: Int) {
val line = MouseTracer.asLine
val topLeft = screen.`(containerBounds)`.topLeft - Size(1, 1)
for ((invSlot, slotTopLeft) in slotLocations) {
if ((mode == 0) == (invSlot !in slotList)
&& line.intersects(Rectangle(topLeft + slotTopLeft,
Size(18,
18)))) {
if (mode == 0) {
slotList.add(invSlot)
}
else {
slotList.remove(invSlot)
}
}
}
}

fun postRender(context: NativeContext)
fun drawForeground(context: NativeContext)
fun drawConfig(context: NativeContext)
Expand Down
Loading

0 comments on commit c66b8ad

Please sign in to comment.