feat(iliketomoveit): accélérer le Happy Ghast monté (#61) #69

Merged
koka merged 1 commits from feature/happy-ghast-cruise-speed into main 2026-08-29 12:02:52 +00:00
9 changed files with 101 additions and 8 deletions
+7
View File
@@ -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 lorsquun 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 lalpha.208.
+1 -1
View File
@@ -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 != [
+1 -1
View File
@@ -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
+17 -6
View File
@@ -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")
@@ -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<Vec3> callback) {
callback.setReturnValue(HappyGhastCruiseSpeed.boost(callback.getReturnValue()));
}
}
@@ -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);
}
}
@@ -19,6 +19,9 @@
]
},
"mixins": [
{
"config": "iliketomoveit.mixins.json"
},
{
"config": "iliketomoveit.client.mixins.json",
"environment": "client"
@@ -0,0 +1,11 @@
{
"required": true,
"package": "fr.koka99cab.sanctuary26.iliketomoveit.mixin",
"compatibilityLevel": "JAVA_25",
"mixins": [
"HappyGhastMixin"
],
"injectors": {
"defaultRequire": 1
}
}
@@ -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);
}
}
}