Skip to content

Commit 80cf429

Browse files
committed
Release 0.3.0 with basic YSM compatibility
1 parent f9d1273 commit 80cf429

3 files changed

Lines changed: 23 additions & 4 deletions

File tree

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ mod_name=One Kick
5050
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
5151
mod_license=MIT
5252
# The mod version. See https://semver.org/
53-
mod_version=1.20.1-0.2.0
53+
mod_version=1.20.1-0.3.0
5454
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
5555
# This should match the base package used for the mod sources.
5656
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

‎publish/changelog-0.3.0.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- Player-facing changes for the shared 0.3.0 release. -->
2+
# 0.3.0-CHANGELOG
3+
4+
# FIX
5+
6+
+ Added basic compatibility with Yes Steve Model (YSM). First-person kick animations are hidden while YSM is installed; YSM model animations are not supported.

‎src/main/java/net/lostpatrol/onekick/client/FirstPersonKickRenderer.java‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** Renders One Kick's first-person leg with an optional standard CPM right-leg bridge. */
1+
/** Renders the optional CPM or vanilla first-person leg, suppressed when YSM is installed. */
22
package net.lostpatrol.onekick.client;
33

44
import com.mojang.blaze3d.vertex.PoseStack;
@@ -23,16 +23,23 @@
2323
import net.minecraftforge.fml.ModList;
2424

2525
final class FirstPersonKickRenderer {
26+
// YSM owns custom player geometry; suppress all One Kick first-person leg paths.
27+
private static final String YSM_MOD_ID = "yes_steve_model";
28+
// Optional CPM integration identifier.
2629
private static final String CPM_MOD_ID = "cpm";
30+
// Hide the upper five pixels of the vanilla leg in first person.
2731
private static final int VISIBLE_LEG_START = 5;
32+
// Omit the bottom face to retain the established first-person silhouette.
2833
private static final Set<Direction> VISIBLE_FACES =
2934
EnumSet.complementOf(EnumSet.of(Direction.DOWN));
30-
private static ModelPart leg;
31-
private static ModelPart pants;
35+
private static ModelPart leg; // Baked vanilla leg geometry.
36+
private static ModelPart pants; // Baked outer skin layer.
3237

38+
/** Prevents instantiation of the shared renderer. */
3339
private FirstPersonKickRenderer() {
3440
}
3541

42+
/** Bakes the vanilla fallback leg and its outer skin layer. */
3643
static void initialize() {
3744
MeshDefinition mesh = new MeshDefinition();
3845
PartDefinition root = mesh.getRoot();
@@ -51,7 +58,12 @@ static void initialize() {
5158
pants = baked.getChild("pants");
5259
}
5360

61+
/** Returns true only when a leg was drawn, allowing the caller to hide the right hand. */
5462
static boolean render(RenderHandEvent event) {
63+
// Return before CPM and vanilla rendering; false also preserves normal hand rendering.
64+
if (ModList.get().isLoaded(YSM_MOD_ID)) {
65+
return false;
66+
}
5567
Minecraft minecraft = Minecraft.getInstance();
5668
AbstractClientPlayer player = minecraft.player;
5769
if (leg == null || pants == null || player == null || player.isInvisible()
@@ -92,6 +104,7 @@ static boolean render(RenderHandEvent event) {
92104
return true;
93105
}
94106

107+
/** Resolves the physical right hand for either main-arm preference. */
95108
static boolean isRightHand(RenderHandEvent event) {
96109
AbstractClientPlayer player = Minecraft.getInstance().player;
97110
if (player == null) {

0 commit comments

Comments
 (0)