working emote test
This commit is contained in:
@@ -19,6 +19,10 @@ dependencies {
|
|||||||
|
|
||||||
modApi "dev.felnull:special-model-loader:1.4.0+pre.1"
|
modApi "dev.felnull:special-model-loader:1.4.0+pre.1"
|
||||||
include "dev.felnull:special-model-loader:1.4.0+pre.1"
|
include "dev.felnull:special-model-loader:1.4.0+pre.1"
|
||||||
|
|
||||||
|
include modImplementation("dev.kosmx.player-anim:player-animation-lib-fabric:${project.player_anim}")
|
||||||
|
//You might want bendy-lib. playerAnimator will wrap it.
|
||||||
|
// include modRuntimeOnly("io.github.kosmx.bendy-lib:bendy-lib-fabric:${project.bendylib_version}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +32,11 @@ repositories {
|
|||||||
name = "FelNull Maven"
|
name = "FelNull Maven"
|
||||||
url = "https://maven.felnull.dev"
|
url = "https://maven.felnull.dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maven {
|
||||||
|
name "KosmX's maven"
|
||||||
|
url 'https://maven.kosmx.dev/'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ fabric_version=0.114.0+1.21.4
|
|||||||
mod_version = 0.0.2-beta1
|
mod_version = 0.0.2-beta1
|
||||||
maven_group = org.saturnclient
|
maven_group = org.saturnclient
|
||||||
archives_base_name = saturnclient
|
archives_base_name = saturnclient
|
||||||
|
|
||||||
|
player_anim = 2.0.3+1.21.4
|
||||||
@@ -3,12 +3,16 @@ package org.saturnclient.saturnclient.event;
|
|||||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||||
import net.minecraft.client.option.KeyBinding;
|
import net.minecraft.client.option.KeyBinding;
|
||||||
// import net.minecraft.client.option.Perspective;
|
|
||||||
import net.minecraft.client.util.InputUtil;
|
import net.minecraft.client.util.InputUtil;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
// import org.saturnclient.modules.mods.FreeLook;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.ui2.screens.ShiftMenu;
|
import org.saturnclient.ui2.screens.ShiftMenu;
|
||||||
// import org.saturnclient.saturnclient.menus.SaturnMenu;
|
|
||||||
|
import dev.kosmx.playerAnim.api.layered.AnimationStack;
|
||||||
|
import dev.kosmx.playerAnim.minecraftApi.PlayerAnimationAccess;
|
||||||
|
import dev.kosmx.playerAnim.minecraftApi.PlayerAnimationRegistry;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,55 +25,38 @@ public class KeyInputHandler {
|
|||||||
private static final int DEFAULT_MENU_KEY = GLFW.GLFW_KEY_RIGHT_SHIFT;
|
private static final int DEFAULT_MENU_KEY = GLFW.GLFW_KEY_RIGHT_SHIFT;
|
||||||
private static KeyBinding mainMenuKeyBinding;
|
private static KeyBinding mainMenuKeyBinding;
|
||||||
|
|
||||||
// private static final String FREELOOK_KEY_ID = "key.saturnclient.freelook";
|
private static final String FREELOOK_KEY_ID = "key.saturnclient.emote";
|
||||||
// private static final int FREELOOK_KEY = GLFW.GLFW_KEY_M;
|
private static final int FREELOOK_KEY = GLFW.GLFW_KEY_B;
|
||||||
// private static KeyBinding freelookKeyBinding;
|
private static KeyBinding freelookKeyBinding;
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers all keybindings and their associated event handlers.
|
|
||||||
* Should be called during mod initialization.
|
|
||||||
*/
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
// Register the main menu key binding
|
|
||||||
mainMenuKeyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
mainMenuKeyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
MAIN_MENU_KEY_ID,
|
MAIN_MENU_KEY_ID,
|
||||||
InputUtil.Type.KEYSYM,
|
InputUtil.Type.KEYSYM,
|
||||||
DEFAULT_MENU_KEY,
|
DEFAULT_MENU_KEY,
|
||||||
KEY_CATEGORY));
|
KEY_CATEGORY));
|
||||||
|
|
||||||
// freelookKeyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
freelookKeyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
// FREELOOK_KEY_ID,
|
FREELOOK_KEY_ID,
|
||||||
// InputUtil.Type.KEYSYM,
|
InputUtil.Type.KEYSYM,
|
||||||
// FREELOOK_KEY,
|
FREELOOK_KEY,
|
||||||
// KEY_CATEGORY));
|
KEY_CATEGORY));
|
||||||
|
|
||||||
// Register the event handler for the main menu key
|
// Register the event handler for the main menu key
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||||
if (mainMenuKeyBinding.wasPressed()) {
|
if (mainMenuKeyBinding.wasPressed()) {
|
||||||
client.setScreen(new ShiftMenu());
|
client.setScreen(new ShiftMenu());
|
||||||
}
|
}
|
||||||
// else if (freelookKeyBinding.wasPressed() && FreeLook.enabled.value && FreeLook.toggle.value) {
|
|
||||||
// FreeLook.isFreeLooking = !FreeLook.isFreeLooking;
|
if (SaturnClient.client.player != null && SaturnClient.client.player.isSneaking()) {
|
||||||
// if (FreeLook.isFreeLooking) {
|
AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(SaturnClient.client.player);
|
||||||
// FreeLook.lastPerspective = client.options.getPerspective();
|
animationStack.removeLayer(1000);
|
||||||
// client.options.setPerspective(Perspective.THIRD_PERSON_BACK);
|
}
|
||||||
// } else if (FreeLook.lastPerspective != null) {
|
|
||||||
// client.options.setPerspective(FreeLook.lastPerspective);
|
if (freelookKeyBinding.wasPressed()) {
|
||||||
// FreeLook.lastPerspective = null;
|
AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(SaturnClient.client.player);
|
||||||
// }
|
animationStack.addAnimLayer(1000, PlayerAnimationRegistry.getAnimation(Identifier.of("saturnclient", "backflip")).playAnimation());
|
||||||
// } else if (FreeLook.enabled.value && !FreeLook.toggle.value) {
|
}
|
||||||
// if (freelookKeyBinding.isPressed()) {
|
|
||||||
// if (!FreeLook.isFreeLooking) {
|
|
||||||
// FreeLook.lastPerspective = client.options.getPerspective();
|
|
||||||
// client.options.setPerspective(Perspective.THIRD_PERSON_BACK);
|
|
||||||
// FreeLook.isFreeLooking = true;
|
|
||||||
// }
|
|
||||||
// } else if (FreeLook.isFreeLooking && FreeLook.lastPerspective != null) {
|
|
||||||
// client.options.setPerspective(FreeLook.lastPerspective);
|
|
||||||
// FreeLook.isFreeLooking = false;
|
|
||||||
// FreeLook.lastPerspective = null;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user