Fix player animations being applied to all instances of the model
This commit is contained in:
@@ -143,16 +143,12 @@ public class PlayerAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
boolean flag = false;
|
||||
|
||||
for(Animation animation : animations){
|
||||
|
||||
if(animation.shouldDisplay(player, firstPerson)){
|
||||
|
||||
boolean autoRotateSecondLayer = animation.autoRotateSecondLayer(player, firstPerson);
|
||||
|
||||
flag = true;
|
||||
|
||||
for(ModelBiped model : playerLayerModels.get(renderer)){
|
||||
|
||||
animation.setRotationAngles(player, model, partialTicks, firstPerson);
|
||||
@@ -164,17 +160,6 @@ public class PlayerAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
if(!flag){
|
||||
for(ModelBiped model : playerLayerModels.get(renderer)){
|
||||
for(ModelRenderer box : model.boxList){ // For ModelPlayer, this will include the second layer
|
||||
// Some models have extra boxes, they (probably) don't need wrapping but we need this check!
|
||||
if(box instanceof ModelRendererExtended){
|
||||
((ModelRendererExtended)box).resetRotation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Rotates the second layer boxes of the given (wrapped) player model to match the first layer. */
|
||||
@@ -216,9 +201,20 @@ public class PlayerAnimator {
|
||||
updateModels(event.getEntityPlayer(), event.getRenderer(), event.getPartialRenderTick(), false);
|
||||
}
|
||||
|
||||
// @SubscribeEvent
|
||||
// public static void onRenderPlayerPostEvent(RenderPlayerEvent.Post event){
|
||||
// TODO: Would we ever need to unwrap the models?
|
||||
// }
|
||||
@SubscribeEvent
|
||||
public static void onRenderPlayerPostEvent(RenderPlayerEvent.Post event){
|
||||
|
||||
if(!Wizardry.settings.spellcastingAnimations) return;
|
||||
|
||||
for(ModelBiped model : playerLayerModels.get(event.getRenderer())){
|
||||
for(ModelRenderer box : model.boxList){ // For ModelPlayer, this will include the second layer
|
||||
// Some models have extra boxes, they (probably) don't need wrapping but we need this check!
|
||||
if(box instanceof ModelRendererExtended){
|
||||
((ModelRendererExtended)box).resetRotation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user