Skip to content

Commit

Permalink
bump unimined, mixinextras, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Jul 14, 2024
1 parent 1ec286c commit 8e31e94
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 28 deletions.
36 changes: 20 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import java.util.*

plugins {
id("java")
id("idea")
id("xyz.wagyourtail.unimined")
id("xyz.wagyourtail.unimined.expect-platform")
id("com.github.johnrengelman.shadow")
Expand All @@ -32,6 +33,8 @@ allprojects {
targetCompatibility = JavaVersion.VERSION_17
}

idea.module.setDownloadSources(true)

repositories {
mavenCentral {
content {
Expand Down Expand Up @@ -153,10 +156,7 @@ subprojects {
relocate("dev.rdh.createunlimited", "dev.rdh.createunlimited.${project.name}")
}

val mcProvider = unimined.minecrafts[sourceSets["main"]]

val remapShadowJar = tasks.register("remapShadowJar", RemapJarTaskImpl::class.java, mcProvider)
remapShadowJar.configure {
tasks.register<RemapJarTaskImpl>("remapShadowJar", unimined.minecrafts[sourceSets["main"]]).configure {
dependsOn("shadowJar")
inputFile.set(tasks.shadowJar.get().archiveFile)
archiveClassifier = platform
Expand All @@ -178,7 +178,7 @@ unimined.minecraft {

runs {
config("client") {
launchClasspath
jvmArgs("-Xms4G", "-Xmx4G")
}
}
}
Expand Down Expand Up @@ -221,19 +221,23 @@ fun setup() {
println("Build #$buildNumber")
}
println()
println("Current branch: ${git.currentBranch()}")
println("Current commit: ${git.hash()}")
if(git.isDirty()) {
var changes = git.getUncommitedChanges().split("\n").toMutableList()
val maxChanges = 10
if(changes.size > maxChanges) {
changes = changes.subList(0, maxChanges)
changes.add("... and ${changes.size - maxChanges} more")
}
if(git.exists()) {
println("Current branch: ${git.currentBranch()}")
println("Current commit: ${git.hash()}")
if (git.isDirty()) {
var changes = git.getUncommitedChanges().split("\n").toMutableList()
val maxChanges = 10
if (changes.size > maxChanges) {
changes = changes.subList(0, maxChanges)
changes.add("... and ${changes.size - maxChanges} more")
}

changes.replaceAll { " - $it" }
changes.replaceAll { " - $it" }

println("Uncommitted changes:\n${changes.joinToString("\n")}")
println("Uncommitted changes:\n${changes.joinToString("\n")}")
}
} else {
println("No git repository")
}
println()

Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/git.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ val Project.git
get() = Git(rootProject.rootDir)

class Git(val repository: File) {
fun exists() = repository.resolve(".git").isDirectory

// does the current git repository have uncommitted changes?
fun isDirty() = git("status", "--porcelain").isNotBlank()

Expand Down
4 changes: 2 additions & 2 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ unimined.minecraft {
}

runs.config("client") {
jvmArgs.addAll(listOf(
jvmArgs(
"-Dmixin.env.remapRefMap=true",
"-Dmixin.env.refMapRemappingFile=${(mcPatcher as ForgeLikeMinecraftTransformer).srgToMCPAsSRG}"
))
)
}
}

Expand Down
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ strip_lvts = true
mixin.debug = true

# gradle plugin versions
unimined_version = 1.2.6
expectplatform_version = 1.0.2
unimined_version = 1.3.2
expectplatform_version = 1.0.3
forgix_version = 1.2.9
shadow_version = 8.1.1

Expand All @@ -25,7 +25,6 @@ archives_base_name = createunlimited

# common dependencies
fabric_version = 0.15.11
manifold_version = 2024.1.15
mixin_extras_version = 0.3.5
asm_version = 9.7
arch_injectables_version = 1.0.13
manifold_version = 2024.1.20
mixin_extras_version = 0.4.0
asm_version = 9.7
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,41 @@
public abstract class ExtendoGripItemMixin {

@Dynamic
@PlatformOnly(PlatformOnly.FABRIC)
@ModifyExpressionValue(method = {
"holdingExtendoGripIncreasesRange(Lnet/minecraft/world/entity/LivingEntity;)V",
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/nbt/CompoundTag;)V",
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;"))
@PlatformOnly(PlatformOnly.FABRIC)
private static Supplier<Multimap<Attribute, AttributeModifier>> modifySingleFabric(Supplier<?> original) {
return cu$singleRange();
}

@Dynamic
@PlatformOnly(PlatformOnly.FORGE)
@ModifyExpressionValue(method = {
"holdingExtendoGripIncreasesRange(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V",
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V"
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;"))
@PlatformOnly(PlatformOnly.FORGE)
private static Supplier<Multimap<Attribute, AttributeModifier>> modifySingleForge(Supplier<?> original) {
return cu$singleRange();
}

@Dynamic
@PlatformOnly(PlatformOnly.FABRIC)
@ModifyExpressionValue(method = {
"holdingExtendoGripIncreasesRange(Lnet/minecraft/world/entity/LivingEntity;)V",
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/nbt/CompoundTag;)V",
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;"))
@PlatformOnly(PlatformOnly.FABRIC)
private static Supplier<Multimap<Attribute, AttributeModifier>> modifyDoubleFabric(Supplier<?> original) {
return cu$doubleRange();
}

@Dynamic
@PlatformOnly(PlatformOnly.FORGE)
@ModifyExpressionValue(method = {
"holdingExtendoGripIncreasesRange(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V",
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V"
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;"))
@PlatformOnly(PlatformOnly.FORGE)
private static Supplier<Multimap<Attribute, AttributeModifier>> modifyDoubleForge(Supplier<?> original) {
return cu$doubleRange();
}
Expand Down

0 comments on commit 8e31e94

Please sign in to comment.