From bd93dc1cd61c6d346517f41e61d0c6ea471e6a1d Mon Sep 17 00:00:00 2001 From: koka Date: Sat, 29 Aug 2026 13:17:50 +0200 Subject: [PATCH] =?UTF-8?q?feat(iliketomoveit):=20acc=C3=A9l=C3=A9rer=20le?= =?UTF-8?q?=20Happy=20Ghast=20mont=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 +++++ build.gradle | 2 +- gradle.properties | 2 +- iliketomoveit/build.gradle | 23 +++++++++++----- .../iliketomoveit/mixin/HappyGhastMixin.java | 19 +++++++++++++ .../transport/HappyGhastCruiseSpeed.java | 15 +++++++++++ .../src/main/resources/fabric.mod.json | 3 +++ .../main/resources/iliketomoveit.mixins.json | 11 ++++++++ .../transport/HappyGhastCruiseSpeedSmoke.java | 27 +++++++++++++++++++ 9 files changed, 101 insertions(+), 8 deletions(-) create mode 100644 iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/mixin/HappyGhastMixin.java create mode 100644 iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeed.java create mode 100644 iliketomoveit/src/main/resources/iliketomoveit.mixins.json create mode 100644 iliketomoveit/src/test/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeedSmoke.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a79915..85c97aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ Ce journal suit les **versions du modpack**. Lorsqu'un seul module change, sa ve - Depuis `26.2.0-alpha.6`, le pack et les modules ont des versions indépendantes. I Like To Move It et Only Fun deviennent les cinquième et sixième modules actifs dans l'alpha 46. - Les versions ci-dessous ont été reconstituées à partir des JAR archivés, des packs locaux et du code source actuel. Les dates n'étant pas enregistrées de manière fiable, elles ne sont pas inventées. +## Non distribué + +Module modifié : **I Like To Move It `0.0.0-alpha.15`**. Le pack distribué reste en `26.2.0-alpha.209` jusqu’à la prochaine release. + +- double la vitesse de croisière du Happy Ghast lorsqu’un joueur le pilote, sans accélérer ses déplacements autonomes ; +- conserve les données v3 et le protocole réseau 5, sans migration de sauvegarde ni nouvel ID. + ## `26.2.0-alpha.209` Module modifié : **It's Alive `0.0.0-alpha.34`**. Les neuf autres modules conservent leur version issue de l’alpha.208. diff --git a/build.gradle b/build.gradle index bf9a2d0..c05ce20 100644 --- a/build.gradle +++ b/build.gradle @@ -4590,7 +4590,7 @@ tasks.register("verifyWaystoneShopCulinaryAlpha202Release") { if (rootProject.pack_version != "26.2.0-alpha.209" || rootProject.anotherworld_version != "0.0.0-alpha.55" || rootProject.itsalive_version != "0.0.0-alpha.34" - || rootProject.iliketomoveit_version != "0.0.0-alpha.14" + || rootProject.iliketomoveit_version != "0.0.0-alpha.15" || rootProject.sanctuary_version != "0.0.0-alpha.117" || migration.source?.pack_version != "26.2.0-alpha.201" || migration.source?.modules != [ diff --git a/gradle.properties b/gradle.properties index 18286e0..fbbae34 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,7 @@ ouch_version=0.0.0-alpha.9 ouch_lifecycle=active masterkey_version=0.0.0-alpha.8 masterkey_lifecycle=active -iliketomoveit_version=0.0.0-alpha.14 +iliketomoveit_version=0.0.0-alpha.15 iliketomoveit_lifecycle=active onlyfun_version=0.0.0-alpha.20 onlyfun_lifecycle=active diff --git a/iliketomoveit/build.gradle b/iliketomoveit/build.gradle index 1bdebb1..89b5761 100644 --- a/iliketomoveit/build.gradle +++ b/iliketomoveit/build.gradle @@ -16,6 +16,14 @@ tasks.register("waystoneElevatorRulesSmoke", JavaExec) { dependsOn tasks.named("testClasses") } +tasks.register("happyGhastCruiseSpeedSmoke", JavaExec) { + group = "verification" + description = "Checks the rider-only Happy Ghast cruise-speed multiplier." + classpath = sourceSets.test.runtimeClasspath + mainClass = "fr.koka99cab.sanctuary26.iliketomoveit.transport.HappyGhastCruiseSpeedSmoke" + dependsOn tasks.named("testClasses") +} + tasks.named("test") { // Runtime contracts are executable smoke tasks, not JUnit engine tests. failOnNoDiscoveredTests = false @@ -168,6 +176,7 @@ tasks.register("verifyGrappling") { "data/iliketomoveit/loot_table/blocks/pulley_head.json", "data/spiderman/loot_table/blocks/pulley_head.json", "data/minecraft/tags/block/needs_stone_tool.json", + "iliketomoveit.mixins.json", "iliketomoveit.client.mixins.json" ] def missingResources = requiredResources.findAll { !file("src/main/resources/${it}").isFile() } @@ -184,10 +193,11 @@ tasks.register("verifyGrappling") { } def manifest = new JsonSlurper().parse(file("src/main/resources/fabric.mod.json")) - if (!manifest.mixins?.any { it.config == "iliketomoveit.client.mixins.json" && it.environment == "client" } + if (!manifest.mixins?.any { it.config == "iliketomoveit.mixins.json" } + || !manifest.mixins?.any { it.config == "iliketomoveit.client.mixins.json" && it.environment == "client" } || manifest.custom?.sanctuary26?.data_version != 3 || manifest.custom?.sanctuary26?.network_protocol != 5) { - throw new GradleException("Grappling must keep I Like To Move It aggregate data v3/protocol 5 and register its client mixin") + throw new GradleException("I Like To Move It must keep aggregate data v3/protocol 5 and register its common/client mixins") } ["fr_fr", "en_us", "ru_ru"].each { language -> def translations = new JsonSlurper().parse(file("src/main/resources/assets/iliketomoveit/lang/${language}.json")) @@ -295,7 +305,7 @@ tasks.register("verifyPortals") { } def atlasCavernsMigration = new JsonSlurper().parse(rootProject.file( "pack/migrations/26.2.0-alpha.149-atlas-caverns-to-alpha.150.json")) - if (project.version.toString() != "0.0.0-alpha.14" + if (project.version.toString() != "0.0.0-alpha.15" || atlasCavernsMigration.target?.pack_version != "26.2.0-alpha.150" || atlasCavernsMigration.target?.modules?.iliketomoveit != "0.0.0-alpha.9" || atlasCavernsMigration.portals?.active_routes != [ @@ -331,7 +341,7 @@ tasks.register("verifySilverAircraft") { def manifest = new JsonSlurper().parse(file("src/main/resources/fabric.mod.json")) def migration = new JsonSlurper().parse(rootProject.file( "pack/migrations/26.2.0-alpha.184-silver-engineering-to-alpha.185.json")) - if (project.version.toString() != "0.0.0-alpha.14" + if (project.version.toString() != "0.0.0-alpha.15" || recipe.pattern != ["PGP", "GCG", "PBP"] || recipe.key != [B: "anotherworld:silver_block", C: "anotherworld:aircraft_cockpit", G: "anotherworld:silver_gear", P: "anotherworld:silver_plate"] @@ -360,7 +370,7 @@ tasks.register("verifyGrapplePrediction") { def payload = file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/network/GrappleStatePayload.java").text def controller = file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/grapple/GrappleController.java").text def prediction = file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/client/grapple/ClientGrapplePrediction.java").text - if (project.version.toString() != "0.0.0-alpha.14" + if (project.version.toString() != "0.0.0-alpha.15" || migration.target?.modules?.iliketomoveit != "0.0.0-alpha.13" || migration.grappling?.owner_prediction_payload != "iliketomoveit:s2c/grapple_state" || migration.compatibility?.iliketomoveit_source_network_protocol != 4 @@ -392,7 +402,7 @@ tasks.register("verifyWaystoneDescendingRelease") { "src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/waystone/WaystoneElevatorRules.java").text def teleportation = file( "src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/network/WaystoneTeleportation.java").text - if (project.version.toString() != "0.0.0-alpha.14" + if (project.version.toString() != "0.0.0-alpha.15" || migration.target?.modules?.iliketomoveit != "0.0.0-alpha.14" || migration.waystone_elevator?.undiscovered_downward_destination_allowed != true || migration.waystone_elevator?.destination_discovered_after_arrival != true @@ -411,6 +421,7 @@ tasks.register("verifyWaystoneDescendingRelease") { tasks.named("check") { dependsOn tasks.named("grapplePhysicsSmoke") dependsOn tasks.named("waystoneElevatorRulesSmoke") + dependsOn tasks.named("happyGhastCruiseSpeedSmoke") dependsOn tasks.named("verifyWaystones") dependsOn tasks.named("verifyGrappling") dependsOn tasks.named("verifyGrapplePrediction") diff --git a/iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/mixin/HappyGhastMixin.java b/iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/mixin/HappyGhastMixin.java new file mode 100644 index 0000000..ad92c27 --- /dev/null +++ b/iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/mixin/HappyGhastMixin.java @@ -0,0 +1,19 @@ +package fr.koka99cab.sanctuary26.iliketomoveit.mixin; + +import fr.koka99cab.sanctuary26.iliketomoveit.transport.HappyGhastCruiseSpeed; +import net.minecraft.world.entity.animal.happyghast.HappyGhast; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.phys.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(HappyGhast.class) +public abstract class HappyGhastMixin { + @Inject(method = "getRiddenInput", at = @At("RETURN"), cancellable = true) + private void iliketomoveit$boostCruiseSpeed(Player rider, Vec3 input, + CallbackInfoReturnable callback) { + callback.setReturnValue(HappyGhastCruiseSpeed.boost(callback.getReturnValue())); + } +} diff --git a/iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeed.java b/iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeed.java new file mode 100644 index 0000000..96a4da0 --- /dev/null +++ b/iliketomoveit/src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeed.java @@ -0,0 +1,15 @@ +package fr.koka99cab.sanctuary26.iliketomoveit.transport; + +import net.minecraft.world.phys.Vec3; + +/** Keeps the Happy Ghast ride practical without changing its autonomous movement. */ +public final class HappyGhastCruiseSpeed { + public static final double RIDER_INPUT_MULTIPLIER = 2.0D; + + private HappyGhastCruiseSpeed() { + } + + public static Vec3 boost(Vec3 vanillaInput) { + return vanillaInput.scale(RIDER_INPUT_MULTIPLIER); + } +} diff --git a/iliketomoveit/src/main/resources/fabric.mod.json b/iliketomoveit/src/main/resources/fabric.mod.json index 41a7cff..57c1cee 100644 --- a/iliketomoveit/src/main/resources/fabric.mod.json +++ b/iliketomoveit/src/main/resources/fabric.mod.json @@ -19,6 +19,9 @@ ] }, "mixins": [ + { + "config": "iliketomoveit.mixins.json" + }, { "config": "iliketomoveit.client.mixins.json", "environment": "client" diff --git a/iliketomoveit/src/main/resources/iliketomoveit.mixins.json b/iliketomoveit/src/main/resources/iliketomoveit.mixins.json new file mode 100644 index 0000000..3974ac0 --- /dev/null +++ b/iliketomoveit/src/main/resources/iliketomoveit.mixins.json @@ -0,0 +1,11 @@ +{ + "required": true, + "package": "fr.koka99cab.sanctuary26.iliketomoveit.mixin", + "compatibilityLevel": "JAVA_25", + "mixins": [ + "HappyGhastMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/iliketomoveit/src/test/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeedSmoke.java b/iliketomoveit/src/test/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeedSmoke.java new file mode 100644 index 0000000..5efdda8 --- /dev/null +++ b/iliketomoveit/src/test/java/fr/koka99cab/sanctuary26/iliketomoveit/transport/HappyGhastCruiseSpeedSmoke.java @@ -0,0 +1,27 @@ +package fr.koka99cab.sanctuary26.iliketomoveit.transport; + +import net.minecraft.world.phys.Vec3; + +/** Regression checks for the rider-only Happy Ghast cruise multiplier. */ +public final class HappyGhastCruiseSpeedSmoke { + private HappyGhastCruiseSpeedSmoke() { + } + + public static void main(String[] args) { + Vec3 vanillaInput = new Vec3(-0.195D, 0.0975D, 0.195D); + Vec3 boosted = HappyGhastCruiseSpeed.boost(vanillaInput); + + assertNear(boosted.x, -0.39D, "sideways input"); + assertNear(boosted.y, 0.195D, "vertical input"); + assertNear(boosted.z, 0.39D, "forward input"); + if (!HappyGhastCruiseSpeed.boost(Vec3.ZERO).equals(Vec3.ZERO)) { + throw new IllegalStateException("Idle Happy Ghasts must remain idle"); + } + } + + private static void assertNear(double actual, double expected, String label) { + if (Math.abs(actual - expected) > 1.0E-12D) { + throw new IllegalStateException(label + ": expected " + expected + ", got " + actual); + } + } +} -- 2.54.0