-
Notifications
You must be signed in to change notification settings - Fork 40
Compatible with RealCamera #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
H31M5
wants to merge
3
commits into
Traben-0:master
Choose a base branch
from
H31M5:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/traben/entity_model_features/mixin/mixins/mod_compat/MixinRealCameraCore.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
|
|
9 changes: 9 additions & 0 deletions
9
src/main/java/traben/entity_model_features/mod_compat/RealCameraCompat.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
registerPauseConditionis 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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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

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
There was a problem hiding this comment.
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