Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,26 @@ dependencies {
//region MOD DEPENDENCIES

fun modImpl(modPrefix: String, vararg versions: Pair<Int, String?>): Boolean {
for ((versionMC, versionMod) in versions) {
for ((versionMC, implVersionMod) in versions) {
if (platform.mcVersion >= versionMC) {
if (versionMod != null) {
modImplementation("$modPrefix$versionMod") {
if (implVersionMod != null) {
modImplementation("$modPrefix$implVersionMod") {
exclude("net.fabricmc.fabric-api")
isTransitive = true
}
return true
}
break
}
}
return false
}

fun modComp(modPrefix: String, vararg versions: Pair<Int, String?>): Boolean {
for ((versionMC, compVersionMod) in versions) {
if (platform.mcVersion >= versionMC) {
if (compVersionMod != null) {
compileOnly("$modPrefix$compVersionMod") {
exclude("net.fabricmc.fabric-api")
isTransitive = true
}
Expand Down Expand Up @@ -166,15 +182,22 @@ dependencies {
}

if (!platform.isForge) {
if (mcVersion >= 12109) {
compileOnly("com.zigythebird.playeranim:PlayerAnimationLibCommon:1.1.0+alpha.1+mc.1.21.9")
compileOnly("com.zigythebird.playeranim:PlayerAnimationLibCore:1.1.0+alpha.1+mc.1.21.9")
} else if (mcVersion >= 12100) {
compileOnly("com.zigythebird.playeranim:PlayerAnimationLibCommon:1.0.14+mc.1.21.1")
compileOnly("com.zigythebird.playeranim:PlayerAnimationLibCore:1.0.14+mc.1.21.1")
}
val playerAnimVersions = arrayOf(
12109 to "1.1.0+alpha.1+mc.1.21.9",
12100 to "1.0.14+mc.1.21.1"
)
modComp("com.zigythebird.playeranim:PlayerAnimationLibCommon:", *playerAnimVersions)
modComp("com.zigythebird.playeranim:PlayerAnimationLibCore:", *playerAnimVersions)
}

modComp("maven.modrinth:real-camera:",
26_01_00 to ver("8iDFFsGL", null, "tPhOLg40"),
1_21_04 to ver("ERGbfBFO", null, "j9j0EChP"),
1_21_02 to ver("ERGbfBFO", null, "j9j0EChP"),
1_21_00 to ver("ERGbfBFO", null, "j9j0EChP"),
1_20_01 to ver("GtVt9wyh", "zxrGLIlw", null),
)

//endregion

if (platform.isNeoForge && mcVersion < 12002) { // NeoForge 20.2.84+ added it themselves
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ public void preApply(final String targetClassName, final ClassNode targetClass,
public void postApply(final String targetClassName, final ClassNode targetClass, final String mixinClassName, final IMixinInfo mixinInfo) {

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package traben.entity_model_features.mixin.mixins.mod_compat;

import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import traben.entity_model_features.mod_compat.RealCameraCompat;

@Pseudo
@Mixin(targets = "com.xtracr.realcamera.RealCameraCore", remap = false)
public class MixinRealCameraCore {
// This method is used to get the vertex catcher
// It does NOT render the entity in the world
//#if MC == 1.20.1 && !NEOFORGE || MC >= 1.21.1 && MC <= 1.21.4 && !FORGE || MC == 26.1 && !FORGE
//$$ @Inject(method = "computeCamera", at = @At("HEAD"))
//$$ private static void EFM$onComputeCameraHead(Minecraft client, float partialTicks, CallbackInfo ci) {
//$$ RealCameraCompat.isComputeCameraRendering = true;
//$$ }
//$$
//$$ @Inject(method = "computeCamera", at = @At("RETURN"))
//$$ private static void EFM$onComputeCameraReturn(Minecraft client, float partialTicks, CallbackInfo ci) {
//$$ RealCameraCompat.isComputeCameraRendering = false;
//$$ }
//#endif
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package traben.entity_model_features.mod_compat;

public class RealCameraCompat {
public static boolean isComputeCameraRendering = false;

public static boolean isShouldRenderEntity() {
return !isComputeCameraRendering;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import traben.entity_model_features.models.animation.math.expression_tree.MathValue;
import traben.entity_model_features.models.animation.math.variables.VariableRegistry;
import traben.entity_model_features.models.animation.math.variables.factories.GlobalVariableFactory;
import traben.entity_model_features.mod_compat.RealCameraCompat;
import traben.entity_model_features.utils.EMFUtils;
import traben.entity_texture_features.utils.ETFLruCache;

Expand Down Expand Up @@ -61,8 +62,9 @@ protected void animateInner(ModelPart[] pausedParts) throws Throwable {
if (logsASM) asmLog(asmVariableHandler, vars, "Start ASM anim with variable state:");

compiledAnimationExecutor.execute(vars.floats(), vars.bools());

varConsumer.accept(vars, true);
//Default is TRUE
boolean shouldUpdateVars = RealCameraCompat.isShouldRenderEntity();
varConsumer.accept(vars, shouldUpdateVars);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: a nicer point to check this would be inside the the isLODSkippingThisFrame() check just a bit above this as it seems like at a glance you want the same thing that accomplishes and i already do similar things in there to pause things during iris's shadow pass, unless i've missed somet technical detail here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question: if registerPauseCondition is called, is it still necessary to perform modifications here?

Additionally, if we disable rendering logic inside isLODSkippingThisFrame, will this cause entity position desync?
To elaborate: when animation updates are blocked, the head position we retrieve remains its original value. Once rendering resumes from the player’s view, the head will shift due to resource pack adjustments, resulting in clipping through models.

@Traben-0 Traben-0 Jul 25, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm i might have been misunderstanding what you were trying to accomplish here, as i said i havent tested in-game yet so ignore this for now

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do push your other changes first btw as i'll want to test with all those addressed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few issues. As shown in the screenshot, registerPauseCondition does not seem to apply correctly in version 26.1, while it works fine on 1.21.1
屏幕截图(123)
On Fabric, I’m attempting registration inside onInitializeClient(). I also set breakpoints during debugging and confirmed that this block of code runs normally, yet the logic still fails to take effect

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to check the relevant code, please take a look at lines 55 to 63 here

if (lod && state != null) lastResultsPerEntity.put(state.uuid(), vars);

if (logsASM) asmLog(asmVariableHandler, vars, "End ASM anim with variable state:");
Expand Down Expand Up @@ -255,4 +257,4 @@ private interface VarConsumer {
}

private record AnimVars(float[] floats, boolean[] bools) { }
}
}
1 change: 1 addition & 0 deletions src/main/resources/entity_model_features.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"exporting.MixinBabyModelTransform",
"exporting.MixinEntityModelSet",
"exporting.MixinMeshTransformer",
"mod_compat.MixinRealCameraCore",
"rendering.Mixin_SpecialModelRenderers_SetCurrentSpecifiedModel",
"rendering.MixinBannerRenderer",
"rendering.MixinBlockEntityRenderDispatcher",
Expand Down