diff --git a/src/main/java/electrosphere/entity/state/movement/jump/ClientJumpTree.java b/src/main/java/electrosphere/entity/state/movement/jump/ClientJumpTree.java index 725cac6e..a7d174f6 100644 --- a/src/main/java/electrosphere/entity/state/movement/jump/ClientJumpTree.java +++ b/src/main/java/electrosphere/entity/state/movement/jump/ClientJumpTree.java @@ -21,7 +21,12 @@ import electrosphere.net.synchronization.annotation.SynchronizableEnum; import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree; import electrosphere.renderer.actor.Actor; -@SynchronizedBehaviorTree(name = "clientJumpTree", isServer = false, correspondingTree="serverJumpTree") +@SynchronizedBehaviorTree( + name = "clientJumpTree", + isServer = false, + correspondingTree = "serverJumpTree", + genStartInt = true +) /* Behavior tree for jumping */ @@ -75,7 +80,7 @@ public class ClientJumpTree implements BehaviorTree { SynchronizationMessage.constructClientRequestBTreeActionMessage( Globals.clientSceneWrapper.mapClientToServerId(parent.getId()), BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID, - 1 + 0 ) ); } @@ -278,4 +283,20 @@ public class ClientJumpTree implements BehaviorTree { this.currentJumpForce = currentJumpForce; } + /** + *
Automatically generated
+ *+ * Requests that the server start this btree + *
+ */ + public void interrupt(){ + Globals.clientConnection.queueOutgoingMessage( + SynchronizationMessage.constructClientRequestBTreeActionMessage( + Globals.clientSceneWrapper.mapClientToServerId(parent.getId()), + BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID, + 1 + ) + ); + } + } diff --git a/src/main/java/electrosphere/net/synchronization/annotation/SynchronizedBehaviorTree.java b/src/main/java/electrosphere/net/synchronization/annotation/SynchronizedBehaviorTree.java index 2847e040..3883089e 100644 --- a/src/main/java/electrosphere/net/synchronization/annotation/SynchronizedBehaviorTree.java +++ b/src/main/java/electrosphere/net/synchronization/annotation/SynchronizedBehaviorTree.java @@ -21,5 +21,8 @@ public @interface SynchronizedBehaviorTree { //The corresponding behavior tree. If this is a server tree, it is the corresponding client tree. If this is a client tree, it is the corresponding server tree public String correspondingTree() default ""; + + //If true, auto generation tooling will generate start() and interrupt() methods for this tree. SHOULD ONLY BE USED ON CLIENT + public boolean genStartInt() default false; }