|
5 | 5 | import com.ticxo.modelengine.api.animation.BlueprintAnimation;
|
6 | 6 | import com.ticxo.modelengine.api.animation.handler.AnimationHandler;
|
7 | 7 | import com.ticxo.modelengine.api.entity.CullType;
|
| 8 | +import com.ticxo.modelengine.api.generator.blueprint.BlueprintBone; |
8 | 9 | import com.ticxo.modelengine.api.model.ActiveModel;
|
9 | 10 | import com.ticxo.modelengine.api.model.ModeledEntity;
|
10 | 11 | import com.ticxo.modelengine.api.model.bone.BoneBehaviorTypes;
|
@@ -197,20 +198,10 @@ public void updateEntityProperties(Collection<Player> players, boolean firstSend
|
197 | 198 | Map<String, Boolean> animUpdates = new HashMap<>();
|
198 | 199 | Set<String> anims = new HashSet<>();
|
199 | 200 | // if (GeyserModelEngine.getInstance().getEnablePartVisibilityModels().contains(model.getActiveModel().getBlueprint().getName())) {
|
200 |
| - model.getActiveModel().getBones().forEach((s, bone) -> { |
201 |
| - String name = unstripName(bone).toLowerCase(); |
202 |
| - |
203 |
| - if (name.equals("hitbox") || |
204 |
| - name.equals("shadow") || |
205 |
| - name.equals("mount") || |
206 |
| - name.startsWith("p_") || |
207 |
| - name.startsWith("b_") || |
208 |
| - name.startsWith("ob_")) { |
209 |
| - return; |
210 |
| - } |
211 |
| - boneUpdates.put(name, bone.isVisible()); |
212 |
| - }); |
213 | 201 |
|
| 202 | + model.getActiveModel().getBlueprint().getBones().forEach((s, bone) -> { |
| 203 | + processBone(bone, boneUpdates); |
| 204 | + }); |
214 | 205 | // }
|
215 | 206 |
|
216 | 207 |
|
@@ -285,10 +276,31 @@ public void updateEntityProperties(Collection<Player> players, boolean firstSend
|
285 | 276 | }
|
286 | 277 | }
|
287 | 278 |
|
288 |
| - private String unstripName(ModelBone bone) { |
289 |
| - String name = bone.getBoneId(); |
290 |
| - if (bone.getBlueprintBone().getBehaviors().get("head") != null) { |
291 |
| - if (!bone.getBlueprintBone().getBehaviors().get("head").isEmpty()) return "hi_" + name; |
| 279 | + private void processBone(BlueprintBone bone, Map<String, Boolean> map) { |
| 280 | + String name = unstripName(bone).toLowerCase(); |
| 281 | + if (name.equals("hitbox") || |
| 282 | + name.equals("shadow") || |
| 283 | + name.equals("mount") || |
| 284 | + name.startsWith("p_") || |
| 285 | + name.startsWith("b_") || |
| 286 | + name.startsWith("ob_")) { |
| 287 | + return; |
| 288 | + } |
| 289 | + for (BlueprintBone blueprintBone : bone.getChildren().values()) { |
| 290 | + processBone(blueprintBone, map); |
| 291 | + } |
| 292 | + ModelBone activeBone = model.getActiveModel().getBones().get(bone.getName()); |
| 293 | + |
| 294 | + boolean visible = false; |
| 295 | + if (activeBone != null) { |
| 296 | + visible = activeBone.isVisible(); |
| 297 | + } |
| 298 | + map.put(name, visible); |
| 299 | + } |
| 300 | + private String unstripName(BlueprintBone bone) { |
| 301 | + String name = bone.getName(); |
| 302 | + if (bone.getBehaviors().get("head") != null) { |
| 303 | + if (!bone.getBehaviors().get("head").isEmpty()) return "hi_" + name; |
292 | 304 | return "h_" + name;
|
293 | 305 | }
|
294 | 306 |
|
|
0 commit comments