Compare commits
2
Commits
8794f3fb65
...
c92abd4401
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c92abd4401 | ||
|
|
9d0fe6fb6b |
@@ -22,8 +22,10 @@ A player emote library for Saturn Client, with limb bending.
|
|||||||
- `tools/emotecraft/convert.py`: converts Emotecraft's binary `.emotecraft` files to Emotecraft JSON
|
- `tools/emotecraft/convert.py`: converts Emotecraft's binary `.emotecraft` files to Emotecraft JSON
|
||||||
(standard-library Python).
|
(standard-library Python).
|
||||||
|
|
||||||
Supported versions: 1.21.4 to 1.21.11, the same range as Saturn Client. Each version's Fabric API
|
Supported versions: 1.21.4 to 1.21.11, 26.1 (and its hotfixes), 26.2 and 26.3. Each version's
|
||||||
version is set in `stonecutter.properties.toml`. The code uses Mojang mappings.
|
Fabric API version is set in `stonecutter.properties.toml`. The code uses Mojang mappings, which
|
||||||
|
26.1+ ships as its own names, so `loom-back-compat` applies the remapping Loom for 1.21.x and the
|
||||||
|
plain one for 26.x. 26.x builds need Java 25; Gradle downloads it when it isn't installed.
|
||||||
|
|
||||||
## Using it
|
## Using it
|
||||||
|
|
||||||
@@ -114,8 +116,8 @@ version whose code is uncommented in `src/`. Switch versions with the Stonecutte
|
|||||||
or the `Set active project to <v>` Gradle task. Run `Reset active project` before committing, so
|
or the `Set active project to <v>` Gradle task. Run `Reset active project` before committing, so
|
||||||
the tree is committed with `vcsVersion` (1.21.11) active.
|
the tree is committed with `vcsVersion` (1.21.11) active.
|
||||||
|
|
||||||
Loom 1.18 needs a Java 25 JVM to run Gradle, so the build is pinned to Loom 1.17 until the
|
Loom 1.18 needs a Java 25 JVM to run Gradle, so the build is pinned to Loom 1.17, which builds
|
||||||
toolchain moves. Minecraft 26.x will need that upgrade.
|
26.x as well (with a Java 25 toolchain for those versions only).
|
||||||
|
|
||||||
## Publishing
|
## Publishing
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -22,7 +22,8 @@ val testmod: SourceSet = sourceSets.create("testmod") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
createRemapConfigurations(testmod)
|
// The testmod's mod* configurations; 26.1+ has nothing to remap, and loomx aliases them there.
|
||||||
|
if (!loomx.isUnobfuscated) createRemapConfigurations(testmod)
|
||||||
|
|
||||||
mods {
|
mods {
|
||||||
register("saturn_emotes") { sourceSet(sourceSets.main.get()) }
|
register("saturn_emotes") { sourceSet(sourceSets.main.get()) }
|
||||||
|
|||||||
+3
-1
@@ -9,6 +9,8 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
// Downloads the Java toolchain a version needs (Java 25 for 26.1+) when it isn't installed.
|
||||||
|
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||||
id("dev.kikugie.stonecutter") version "0.9.8"
|
id("dev.kikugie.stonecutter") version "0.9.8"
|
||||||
// Picks the right Loom variant per Minecraft version (remapping for 1.21.x, plain for 26.1+).
|
// Picks the right Loom variant per Minecraft version (remapping for 1.21.x, plain for 26.1+).
|
||||||
id("dev.kikugie.loom-back-compat") version "0.4.2"
|
id("dev.kikugie.loom-back-compat") version "0.4.2"
|
||||||
@@ -17,7 +19,7 @@ plugins {
|
|||||||
stonecutter {
|
stonecutter {
|
||||||
create(rootProject) {
|
create(rootProject) {
|
||||||
// Same range as Saturn Client. Per-version dependencies live in stonecutter.properties.toml.
|
// Same range as Saturn Client. Per-version dependencies live in stonecutter.properties.toml.
|
||||||
versions("1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10", "1.21.11")
|
versions("1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10", "1.21.11", "26.1", "26.2", "26.3")
|
||||||
vcsVersion = "1.21.11"
|
vcsVersion = "1.21.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ public final class BendTransforms {
|
|||||||
bend.bendPoint(0, y, 0, center);
|
bend.bendPoint(0, y, 0, center);
|
||||||
Vec3 axis = bend.axis();
|
Vec3 axis = bend.axis();
|
||||||
poseStack.translate(center[0] / 16, center[1] / 16, center[2] / 16);
|
poseStack.translate(center[0] / 16, center[1] / 16, center[2] / 16);
|
||||||
poseStack.mulPose(new Quaternionf().rotationAxis(bend.angleAt(y), axis.x(), axis.y(), axis.z()));
|
Quaternionf rotation = new Quaternionf().rotationAxis(bend.angleAt(y), axis.x(), axis.y(), axis.z());
|
||||||
|
//? if >=26.3 {
|
||||||
|
/*poseStack.rotate(rotation);
|
||||||
|
*///?} else
|
||||||
|
poseStack.mulPose(rotation);
|
||||||
poseStack.translate(0, -y / 16, 0);
|
poseStack.translate(0, -y / 16, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
|||||||
/** Client-side entry point: which player is playing which animation. */
|
/** Client-side entry point: which player is playing which animation. */
|
||||||
public final class Emotes implements ClientModInitializer {
|
public final class Emotes implements ClientModInitializer {
|
||||||
public static final String MOD_ID = "saturn_emotes";
|
public static final String MOD_ID = "saturn_emotes";
|
||||||
public static final String VERSION = /*$ mod_version*/ "0.1.1";
|
public static final String VERSION = /*$ mod_version*/ "0.1.2";
|
||||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||||
|
|
||||||
private static final EmoteRegistry REGISTRY = new EmoteRegistry();
|
private static final EmoteRegistry REGISTRY = new EmoteRegistry();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import net.fabricmc.fabric.api.client.gametest.v1.FabricClientGameTest;
|
|||||||
import net.fabricmc.fabric.api.client.gametest.v1.context.ClientGameTestContext;
|
import net.fabricmc.fabric.api.client.gametest.v1.context.ClientGameTestContext;
|
||||||
import net.fabricmc.fabric.api.client.gametest.v1.context.TestSingleplayerContext;
|
import net.fabricmc.fabric.api.client.gametest.v1.context.TestSingleplayerContext;
|
||||||
import net.minecraft.client.CameraType;
|
import net.minecraft.client.CameraType;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Screenshots each test animation at set points, from the front, the side and behind.
|
* Screenshots each test animation at set points, from the front, the side and behind.
|
||||||
@@ -50,9 +51,14 @@ public final class EmotesGameTest implements FabricClientGameTest {
|
|||||||
@Override
|
@Override
|
||||||
public void runTest(ClientGameTestContext context) {
|
public void runTest(ClientGameTestContext context) {
|
||||||
try (TestSingleplayerContext singleplayer = context.worldBuilder().create()) {
|
try (TestSingleplayerContext singleplayer = context.worldBuilder().create()) {
|
||||||
|
//? if >=26.2 {
|
||||||
|
/*singleplayer.getConnection().waitForChunksRender();
|
||||||
|
*///?} else if >=26.1 {
|
||||||
|
/*singleplayer.getClientLevel().waitForChunksRender();
|
||||||
|
*///?} else
|
||||||
singleplayer.getClientWorld().waitForChunksRender();
|
singleplayer.getClientWorld().waitForChunksRender();
|
||||||
context.runOnClient(client -> {
|
context.runOnClient(client -> {
|
||||||
client.options.hideGui = true;
|
setHudHidden(client, true);
|
||||||
client.options.setCameraType(CameraType.THIRD_PERSON_FRONT);
|
client.options.setCameraType(CameraType.THIRD_PERSON_FRONT);
|
||||||
});
|
});
|
||||||
context.waitTicks(20);
|
context.waitTicks(20);
|
||||||
@@ -80,7 +86,7 @@ public final class EmotesGameTest implements FabricClientGameTest {
|
|||||||
singleplayer.getServer().runCommand("clear @a");
|
singleplayer.getServer().runCommand("clear @a");
|
||||||
context.waitTicks(2);
|
context.waitTicks(2);
|
||||||
context.runOnClient(client -> {
|
context.runOnClient(client -> {
|
||||||
client.options.hideGui = false;
|
setHudHidden(client, false);
|
||||||
client.options.setCameraType(CameraType.FIRST_PERSON);
|
client.options.setCameraType(CameraType.FIRST_PERSON);
|
||||||
});
|
});
|
||||||
// Give the hand time to come back up after the item change.
|
// Give the hand time to come back up after the item change.
|
||||||
@@ -88,11 +94,21 @@ public final class EmotesGameTest implements FabricClientGameTest {
|
|||||||
context.takeScreenshot(MINECRAFT + "-hold-firstperson");
|
context.takeScreenshot(MINECRAFT + "-hold-firstperson");
|
||||||
context.runOnClient(client -> {
|
context.runOnClient(client -> {
|
||||||
Emotes.stop(client.player.getUUID());
|
Emotes.stop(client.player.getUUID());
|
||||||
client.options.hideGui = true;
|
setHudHidden(client, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void setHudHidden(Minecraft client, boolean hidden) {
|
||||||
|
// From 26.2 the HUD can only be toggled.
|
||||||
|
//? if >=26.2 {
|
||||||
|
/*if (client.gui.hud.isHidden() != hidden) {
|
||||||
|
client.gui.hud.toggle();
|
||||||
|
}
|
||||||
|
*///?} else
|
||||||
|
client.options.hideGui = hidden;
|
||||||
|
}
|
||||||
|
|
||||||
/** Turns the body (not the camera) by {@code turn} degrees, then takes a screenshot. */
|
/** Turns the body (not the camera) by {@code turn} degrees, then takes a screenshot. */
|
||||||
private static void screenshot(ClientGameTestContext context, String name, float turn) {
|
private static void screenshot(ClientGameTestContext context, String name, float turn) {
|
||||||
context.runOnClient(client -> {
|
context.runOnClient(client -> {
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
package org.saturnclient.emotes.testmod;
|
package org.saturnclient.emotes.testmod;
|
||||||
|
|
||||||
|
//? if >=26.1 {
|
||||||
|
/*import static net.fabricmc.fabric.api.client.command.v2.ClientCommands.argument;
|
||||||
|
import static net.fabricmc.fabric.api.client.command.v2.ClientCommands.literal;
|
||||||
|
*///?} else {
|
||||||
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
|
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
|
||||||
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
|
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
|
||||||
|
//?}
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
mod.id = "saturn_emotes"
|
mod.id = "saturn_emotes"
|
||||||
mod.name = "Saturn Emotes"
|
mod.name = "Saturn Emotes"
|
||||||
mod.group = "org.saturnclient"
|
mod.group = "org.saturnclient"
|
||||||
mod.version = "0.1.1"
|
mod.version = "0.1.2"
|
||||||
|
|
||||||
deps.fabric_loader = "0.19.5"
|
deps.fabric_loader = "0.19.5"
|
||||||
loomx.loom_version = "1.17.21"
|
loomx.loom_version = "1.17.21"
|
||||||
@@ -38,3 +38,16 @@ deps.fabric_api = "0.138.4+1.21.10"
|
|||||||
["1.21.11"]
|
["1.21.11"]
|
||||||
mod.mc_compat = "1.21.11"
|
mod.mc_compat = "1.21.11"
|
||||||
deps.fabric_api = "0.141.6+1.21.11"
|
deps.fabric_api = "0.141.6+1.21.11"
|
||||||
|
|
||||||
|
# Built against 26.1 and allowed on its hotfixes (26.1.1, 26.1.2).
|
||||||
|
["26.1"]
|
||||||
|
mod.mc_compat = "~26.1"
|
||||||
|
deps.fabric_api = "0.145.1+26.1"
|
||||||
|
|
||||||
|
["26.2"]
|
||||||
|
mod.mc_compat = "26.2"
|
||||||
|
deps.fabric_api = "0.161.0+26.2"
|
||||||
|
|
||||||
|
["26.3"]
|
||||||
|
mod.mc_compat = "26.3"
|
||||||
|
deps.fabric_api = "0.161.0+26.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user