Replace player-animation-lib with the Saturn emote library
- Every version depends on org.saturnclient:emotes-fabric
(${emotes_version}+<mc>, bundled). playEmote plays Saturn's emotes
through it, and sneaking stops your own emote and tells the server.
Emotes now work on 1.21.6+ too, where player-animation-lib was
commented out.
- Removed every player-animation-lib and bendy-lib reference: the KoSmX
repository, the dependencies, the player_anim properties, and the old
(partly commented out) code in SaturnProviderImpl and KeyInputHandler.
- Build: Loom 1.15 -> 1.17.21 (the emotes jar is built with 1.17 and
older Loom refuses it), Gradle 9.3 -> 9.8 (needed by Loom 1.17), and
sourceSets moved out of the dependencies block in the root build.gradle,
which Gradle 9.8 rejects.
- common: points at the emote-library branch (saturnclientmc/common#5).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+8
-25
@@ -11,6 +11,7 @@ import net.minecraft.text.Text;
|
||||
import org.saturnclient.common.provider.SaturnProvider;
|
||||
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||
import org.saturnclient.common.ref.game.MinecraftClientRef;
|
||||
import org.saturnclient.cosmetics.Emotes;
|
||||
import org.saturnclient.impl.cosmetics.utils.IdentifierUtils;
|
||||
import org.saturnclient.saturnclient.SaturnClient;
|
||||
|
||||
@@ -22,31 +23,13 @@ public class SaturnProviderImpl implements SaturnProvider {
|
||||
|
||||
@Override
|
||||
public void playEmote(UUID fromPlayerUuid, String emoteIdOrNull) {
|
||||
// if (SaturnClient.client == null || SaturnClient.client.world == null) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// for (AbstractClientPlayerEntity player : SaturnClient.client.world.getPlayers()) {
|
||||
// if (!player.getUuid().equals(fromPlayerUuid)) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(player);
|
||||
|
||||
// if (emoteIdOrNull != null && !emoteIdOrNull.isEmpty()) {
|
||||
// if (animationStack.isActive() && animationStack.getPriority() == 1000) {
|
||||
// animationStack.removeLayer(1000);
|
||||
// }
|
||||
// animationStack.addAnimLayer(1000,
|
||||
// PlayerAnimationRegistry
|
||||
// .getAnimation(Identifier.of("saturnclient", emoteIdOrNull))
|
||||
// .playAnimation());
|
||||
// } else {
|
||||
// animationStack.removeLayer(1000);
|
||||
// }
|
||||
|
||||
// break;
|
||||
// }
|
||||
if (fromPlayerUuid == null) {
|
||||
return;
|
||||
}
|
||||
// An empty or unknown ID stops whatever the player is playing.
|
||||
Emotes.get(emoteIdOrNull == null ? "" : emoteIdOrNull).ifPresentOrElse(
|
||||
emote -> org.saturnclient.emotes.fabric.Emotes.play(fromPlayerUuid, emote.animation()),
|
||||
() -> org.saturnclient.emotes.fabric.Emotes.stop(fromPlayerUuid));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-9
@@ -8,12 +8,11 @@ import net.minecraft.client.util.InputUtil;
|
||||
import org.saturnclient.config.Config;
|
||||
import org.saturnclient.saturnclient.SaturnClient;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.client.ServiceClient;
|
||||
import org.saturnclient.emotes.fabric.Emotes;
|
||||
import org.saturnclient.ui.screens.EmoteWheel;
|
||||
import org.saturnclient.ui.screens.ShiftMenu;
|
||||
|
||||
// import dev.kosmx.playerAnim.api.layered.AnimationStack;
|
||||
// import dev.kosmx.playerAnim.minecraftApi.PlayerAnimationAccess;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
/**
|
||||
@@ -44,12 +43,11 @@ public class KeyInputHandler {
|
||||
Providers.saturn.getClient().setScreen(new EmoteWheel());
|
||||
}
|
||||
|
||||
if (SaturnClient.client.player != null && SaturnClient.client.player.isSneaking()) {
|
||||
// AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(SaturnClient.client.player);
|
||||
// if (animationStack.isActive() && animationStack.getPriority() == 1000) {
|
||||
// animationStack.removeLayer(1000);
|
||||
// ServiceClient.emote("");
|
||||
// }
|
||||
// Sneaking cancels your own emote, for everyone.
|
||||
if (SaturnClient.client.player != null && SaturnClient.client.player.isSneaking()
|
||||
&& Emotes.playing(SaturnClient.client.player.getUuid()).isPresent()) {
|
||||
Emotes.stop(SaturnClient.client.player.getUuid());
|
||||
ServiceClient.emote("");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user