Changed

Changed

184k Downloads

Some mods cause TransfurAnimator to fail to capture the player model properties.

cecnull1 opened this issue · 16 comments

commented

crash-2024-09-14_21.28.05-client.txt

Trigger Condition: When using the Origin Module, if the player selects the Phantom race and undergoes metamorphosis, a Beastification event from another module may occur. This can result in a situation where the Pose value is null, leading to a NullPointerException subsequently. My temporary solution is to use early return, but this does not fundamentally solve the issue.

(Use Qwen for translation.)

commented

Moreover, this issue is not triggered by a single condition; any modification involving the player model could potentially lead to errors.

commented

目前已知会导致造成Pose = null而导致NullPointerException的问题有几个:
起源模组 - 幻化技能来隐身自己,然后在这种情况下被兽化
魔法模组 - 真实隐身来隐身自己,然后在这种情况下被兽化
本模组 - 修改版 - 在抓住目标情况下手动兽化目标(前提是注释掉 释放实体 逻辑)
对一个玩家实体进行乱七八糟的值修改也有可能引发此问题
其他

This issue, causing Pose to be set to null and leading to a NullPointerException, can arise from several known causes:

  • Origin Mod: Using the polymorph skill to make oneself invisible, followed by being transformed (bestialized) in this state.
  • Magic Mod: Using true invisibility to become invisible, followed by being transformed (bestialized) in this state.
  • This Mod (modified version): Manually transforming the target while it is being held (assuming the 'release entity' logic has been commented out).
  • Arbitrary value modifications to a player entity may also trigger this problem.
  • Other factors.
commented

My temporary solution is to use early return, but this does not fundamentally solve the issue.

There isn't a "fundamental fix" for this kind of issue. In both external mod cases, the player is invisible. The transfur animator is only capable of transitioning a HumanoidModel (Vanilla player model) into a AdvancedHumanoidModel (Changed entity model).
Any other case would need to be omitted from rendering the transfurring player.

commented

Can't you set conditions for TF? Like 0 for normal, 1 for TF status, etc etc. Then set it on NBT then compare.

commented

Can't you set conditions for TF? Like 0 for normal, 1 for TF status, etc etc. Then set it on NBT then compare.

What is this supposed to mean? What's it for?

commented

First create the NBT and put the human form values in it.
`
@mixin(someclass.class)
public class FormValueMixin {

@Unique
private static int HumanFormValue= 0;

public static int getHumanFormValue() {
    return HumanFormValue;
}

public static void setHumanFormValue(int newValue) {
    HumanFormValue = newValue;
}

`

commented

#1045
The same applies to commands.

commented

Then compare before TF
`
int Value = FormValueMixin.getHumanFormValue();
if (Value == 0){

}//Assuming a human value of 0
`

commented

What are you talking about? What is the point for any of this?
You don't show at all what you mean by "setting it to NBT and comparing it."

If you're talking about a condition to allowing Transfur, I'm already aware of that (See ChangedCompatibility.isPlayerUsedByOtherMod()).

And just to let you know, mixin wont let you access public static methods and members in a mixin class. And just for future reference please make sure your comments are understandable, and that the quality of your presented code meets the repository's standards.

commented

Of course I know mixin doesn't have access to mixin. but that's beside the point. The code you wrote before only had the human and latex cases. If you count the case of other modules you have to categorize this case to prevent null values. Or even if there is a null value, use a “try-catch” to handle it.

commented

So you are suggesting to check if the player is being used by another mod? Kind of like ChangedCompatibility.isPlayerUsedByOtherMod()?

There's no need for the Changed mod to keep its own "case" value for what other mods modify the player for, that's redundant.

commented

Ex:
String str = null;
try {

} catch (NullPointerException e) {

}

commented

That leaves try-catch, right?

commented

Already added in bcde3a3