mirror of
https://github.com/GeyserExtensionists/GeyserModelEngine.git
synced 2025-12-20 15:39:18 +00:00
fix override anim
This commit is contained in:
@@ -208,7 +208,7 @@ public class EntityTask {
|
|||||||
Map<String, Boolean> boneUpdates = new HashMap<>();
|
Map<String, Boolean> boneUpdates = new HashMap<>();
|
||||||
Map<String, Boolean> animUpdates = new HashMap<>();
|
Map<String, Boolean> animUpdates = new HashMap<>();
|
||||||
Set<String> overrideAnimUpdates = new HashSet<>();
|
Set<String> overrideAnimUpdates = new HashSet<>();
|
||||||
|
Set<String> defaultAnims = new HashSet<>();
|
||||||
// if (GeyserModelEngine.getInstance().getEnablePartVisibilityModels().contains(model.getActiveModel().getBlueprint().getName())) {
|
// if (GeyserModelEngine.getInstance().getEnablePartVisibilityModels().contains(model.getActiveModel().getBlueprint().getName())) {
|
||||||
model.getActiveModel().getBones().forEach((s, bone) -> {
|
model.getActiveModel().getBones().forEach((s, bone) -> {
|
||||||
String name = unstripName(bone).toLowerCase();
|
String name = unstripName(bone).toLowerCase();
|
||||||
@@ -223,6 +223,12 @@ public class EntityTask {
|
|||||||
boneUpdates.put(name, bone.isVisible());
|
boneUpdates.put(name, bone.isVisible());
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
|
for (ModelState state : ModelState.values()) {
|
||||||
|
AnimationHandler.DefaultProperty p = model.getActiveModel().getAnimationHandler().getDefaultProperty(state);
|
||||||
|
if (p != null){
|
||||||
|
defaultAnims.add(p.getAnimation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
model.getActiveModel().getBlueprint().getAnimations().forEach((s, anim) -> {
|
model.getActiveModel().getBlueprint().getAnimations().forEach((s, anim) -> {
|
||||||
if (anim.isOverride() && model.getActiveModel().getAnimationHandler().isPlayingAnimation(s)) {
|
if (anim.isOverride() && model.getActiveModel().getAnimationHandler().isPlayingAnimation(s)) {
|
||||||
@@ -233,7 +239,13 @@ public class EntityTask {
|
|||||||
if (overrideAnimUpdates.isEmpty()) {
|
if (overrideAnimUpdates.isEmpty()) {
|
||||||
animUpdates.put(s, model.getActiveModel().getAnimationHandler().isPlayingAnimation(s));
|
animUpdates.put(s, model.getActiveModel().getAnimationHandler().isPlayingAnimation(s));
|
||||||
} else {
|
} else {
|
||||||
animUpdates.put(s, overrideAnimUpdates.contains(s));
|
if (overrideAnimUpdates.contains(s)) {
|
||||||
|
animUpdates.put(s, true);
|
||||||
|
} else if (defaultAnims.contains(s)) {
|
||||||
|
animUpdates.put(s, false);
|
||||||
|
} else {
|
||||||
|
animUpdates.put(s, model.getActiveModel().getAnimationHandler().isPlayingAnimation(s));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user