1.21.9/10 support

This commit is contained in:
Axionize committed 2025-11-13 03:04:35 -05:00
1 parent cc6e38c7f2
commit c6df9f029a
8 files changed
+45 -25

No files matched your search

+2 -1
View File
@@ -214,11 +214,12 @@ jobs:
fabric
game-versions: |
1.21.4
1.21.5
1.21.6
1.21.7
1.21.8
1.21.9
1.21.10
retry-attempts: 2
retry-delay: 10000
+28 -9
View File
@@ -3,7 +3,30 @@ import java.io.ByteArrayOutputStream
plugins {
id("java")
id("com.gradleup.shadow") version "8.3.3" apply false
id("fabric-loom") version "1.10.5" apply false
id("fabric-loom") version "1.11.8" apply false
}
fun getGitCommitHash(project: Project): String? {
// Only try to get the hash if the .git directory exists
if (!project.file(".git").isDirectory) {
return null
}
return try {
val process = ProcessBuilder("git", "rev-parse", "--short", "HEAD")
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.PIPE)
.start()
process.waitFor(5, TimeUnit.SECONDS)
if (process.exitValue() == 0) {
process.inputStream.bufferedReader().readText().trim().takeIf { it.isNotEmpty() }
} else {
null
}
} catch (e: Exception) {
null
}
}
val fullVersion = "1.3.5"
@@ -23,14 +46,10 @@ allprojects {
if (!snapshot) {
return ""
}
var commitHash = ""
if (includeHash && file(".git").isDirectory) {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
commitHash = "+${stdout.toString().trim()}"
val commitHash = if (includeHash) {
getGitCommitHash(project)?.let { "+$it" } ?: ""
} else {
""
}
return "$commitHash-SNAPSHOT"
}
+3 -3
View File
@@ -40,11 +40,11 @@ dependencies {
shadeThisThing(implementation("org.kohsuke:github-api:1.326")!!)
if (shadePE) {
shadeThisThing(implementation("com.github.retrooper:packetevents-spigot:2.9.5-SNAPSHOT")!!)
shadeThisThing(implementation("com.github.retrooper:packetevents-spigot:2.10.1-SNAPSHOT")!!)
} else {
compileOnly("com.github.retrooper:packetevents-spigot:2.9.5-SNAPSHOT")
compileOnly("com.github.retrooper:packetevents-spigot:2.10.1-SNAPSHOT")
}
shadeThisThing(implementation("org.incendo:cloud-paper:2.0.0-beta.10")!!)
shadeThisThing(implementation("org.incendo:cloud-paper:2.0.0-beta.13")!!)
shadeThisThing(implementation("org.incendo:cloud-core:2.0.0")!!)
// Required for 1.14.4 support because gson is too old to have JosnParser.parseString()
+2 -2
View File
@@ -13,9 +13,9 @@ dependencies {
// Shaded in or bundled by platform-specific code
if (shadePE) {
implementation("com.github.retrooper:packetevents-api:2.9.5-SNAPSHOT")
implementation("com.github.retrooper:packetevents-api:2.10.1-SNAPSHOT")
} else {
compileOnly("com.github.retrooper:packetevents-api:2.9.5-SNAPSHOT")
compileOnly("com.github.retrooper:packetevents-api:2.10.1-SNAPSHOT")
}
implementation("org.yaml:snakeyaml:2.0")
+4 -4
View File
@@ -39,8 +39,8 @@ dependencies {
modImplementation(fabricApi.module("fabric-events-interaction-v0", "${rootProject.property("fabric_version")}"))
include(modImplementation("me.lucko:fabric-permissions-api:0.3.1")!!)
include(modImplementation("com.github.retrooper:packetevents-fabric:2.9.5-SNAPSHOT")!!)
include(modImplementation("org.incendo:cloud-fabric:2.0.0-beta.10")!!)
include(modImplementation("com.github.retrooper:packetevents-fabric:2.10.1-SNAPSHOT")!!)
include(modImplementation("org.incendo:cloud-fabric:2.0.0-beta.13")!!)
include(implementation("org.incendo:cloud-minecraft-extras:2.0.0-beta.10")!!)
include(implementation("org.yaml:snakeyaml:2.0")!!)
@@ -70,8 +70,8 @@ tasks.processResources {
filesMatching("fabric.mod.json") {
expand(
"version" to project.version,
"minecraft_version" to rootProject.property("minecraft_version"),
"loader_version" to rootProject.property("loader_version")
"minecraft_version" to rootProject.property("minecraft_version")!!,
"loader_version" to rootProject.property("loader_version")!!
)
}
}
@@ -91,7 +91,7 @@ public class FabricPlayer implements PlatformPlayer {
@Override
public PlatformWorld getWorld() {
return new FabricWorld(fabricPlayer.getWorld());
return new FabricWorld(fabricPlayer.getEntityWorld());
}
@Override
@@ -117,7 +117,7 @@ public class FabricPlayer implements PlatformPlayer {
@Override
public int getMainHandKnockbackLevel() {
RegistryEntry<Enchantment> knockbackEntry = fabricPlayer.getWorld().getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT).getOrThrow(Enchantments.KNOCKBACK);
RegistryEntry<Enchantment> knockbackEntry = fabricPlayer.getEntityWorld().getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT).getOrThrow(Enchantments.KNOCKBACK);
return EnchantmentHelper.getLevel(knockbackEntry, fabricPlayer.getMainHandStack());
}
@@ -29,7 +29,7 @@ public class CustomUpdateIntervals {
for (Entity entity : level.iterateEntities()) {
String entityType = entity.getType().getRegistryEntry().getIdAsString();
if (entityIntervals.containsKey(entityType)) {
ServerChunkLoadingManager.EntityTracker serverEntity = ((ServerChunkManager) entity.getWorld().getChunkManager()).chunkLoadingManager.entityTrackers.get(entity.getId());
ServerChunkLoadingManager.EntityTracker serverEntity = ((ServerChunkManager) entity.getEntityWorld().getChunkManager()).chunkLoadingManager.entityTrackers.get(entity.getId());
if (serverEntity != null) {
((UpdateIntervalAccessor) serverEntity).setUpdateInterval(entityIntervals.get(entityType));
}
+3 -3
View File
@@ -4,8 +4,8 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.6
yarn_mappings=1.21.6+build.1:v2
minecraft_version=1.21.10
yarn_mappings=1.21.10+build.2:v2
loader_version=0.16.13
# Mod Properties
@@ -14,6 +14,6 @@ archives_base_name=knockbacksync
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.128.1+1.21.6
fabric_version=0.138.3+1.21.10
githubRepo=CASELOAD7000/knockback-sync