server plays blocking animation
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				studiorailgun/Renderer/pipeline/head There was a failure building this commit
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	studiorailgun/Renderer/pipeline/head There was a failure building this commit
				
			This commit is contained in:
		
							parent
							
								
									91a84185c1
								
							
						
					
					
						commit
						92a6cefc20
					
				
										
											Binary file not shown.
										
									
								
							| @ -159,19 +159,23 @@ public class StateTransitionUtil { | |||||||
|                 animation = state.getAnimation.get(); |                 animation = state.getAnimation.get(); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             //Main simulation | 
 | ||||||
|             if(!poseActor.isPlayingAnimation() && state.onComplete != null && state.startedAnimation == true && animation != null){ |             if(animation == null){ | ||||||
|  |                 state.startedAnimation = true; | ||||||
|  |                 if(state.onComplete != null){ | ||||||
|  |                     state.onComplete.run(); | ||||||
|  |                 } | ||||||
|  |             } else if(!poseActor.isPlayingAnimation() && state.onComplete != null && state.startedAnimation == true){ | ||||||
|                 //state transition if this isn't set to loop |                 //state transition if this isn't set to loop | ||||||
|                 state.onComplete.run(); |                 state.onComplete.run(); | ||||||
|                 state.startedAnimation = false; |                 state.startedAnimation = false; | ||||||
|             } else if(state.animation != null && (!poseActor.isPlayingAnimation() || !poseActor.isPlayingAnimation(animation))){ |             } else if(!poseActor.isPlayingAnimation() || !poseActor.isPlayingAnimation(animation)){ | ||||||
|                 //play animation for state |                 //play animation for state | ||||||
|  |                 if(animation != null){ | ||||||
|                     poseActor.playAnimation(animation); |                     poseActor.playAnimation(animation); | ||||||
|  |                 } | ||||||
|                 poseActor.incrementAnimationTime(0.0001); |                 poseActor.incrementAnimationTime(0.0001); | ||||||
|                 state.startedAnimation = true; |                 state.startedAnimation = true; | ||||||
|             } else if(state.animation == null && state.onComplete != null){ |  | ||||||
|                 state.onComplete.run(); |  | ||||||
|                 state.startedAnimation = false; |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -50,7 +50,13 @@ public class ServerBlockTree implements BehaviorTree { | |||||||
|         this.stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{ |         this.stateTransitionUtil = StateTransitionUtil.create(parent, true, new StateTransitionUtilItem[]{ | ||||||
|             StateTransitionUtilItem.create( |             StateTransitionUtilItem.create( | ||||||
|                 BlockState.WIND_UP, |                 BlockState.WIND_UP, | ||||||
|                 () -> {return this.blockSystem.getBlockVariant(this.currentBlockVariant).getWindUpAnimation();}, |                 () -> { | ||||||
|  |                     BlockVariant variant = this.blockSystem.getBlockVariant(this.currentBlockVariant); | ||||||
|  |                     if(variant != null){ | ||||||
|  |                         return variant.getWindUpAnimation(); | ||||||
|  |                     } | ||||||
|  |                     return null; | ||||||
|  |                 }, | ||||||
|                 null, |                 null, | ||||||
|                 () -> {this.setState(BlockState.BLOCKING);} |                 () -> {this.setState(BlockState.BLOCKING);} | ||||||
|             ), |             ), | ||||||
|  | |||||||
| @ -101,12 +101,15 @@ public class PoseActor { | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Gets whether the animation is currently playing or not |      * Gets whether the animation is currently playing or not | ||||||
|      * @param animationName The animation |      * @param animationData The animation | ||||||
|      * @return True if the animation is playing, false otherwise |      * @return True if the animation is playing, false otherwise | ||||||
|      */ |      */ | ||||||
|     public boolean isPlayingAnimation(TreeDataAnimation animationName){ |     public boolean isPlayingAnimation(TreeDataAnimation animationData){ | ||||||
|  |         if(animationData == null){ | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|         for(ActorAnimationMask mask : animationQueue){ |         for(ActorAnimationMask mask : animationQueue){ | ||||||
|             if(mask.getAnimationName().contains(animationName.getNameThirdPerson())){ |             if(mask.getAnimationName().contains(animationData.getNameThirdPerson())){ | ||||||
|                 return true; |                 return true; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user