diff --git a/docs/src/highlevel-design/chemisty/chemistrydesign.md b/docs/src/highlevel-design/chemisty/chemistrydesign.md new file mode 100644 index 00000000..c6167de7 --- /dev/null +++ b/docs/src/highlevel-design/chemisty/chemistrydesign.md @@ -0,0 +1,25 @@ +@page chemistrydesign Chemistry System Design + +Design notes for the chemistry system + + +Ideas for the chemistry system: + - fire + - water + - electricity + - ice + - gravity + - stabilization + - metal parts / conductivity + - light + - mirrors + - plants burning + - plants growing really fast + - flight + - springiness/catapults (eg tree catapulting something) + - spinning mechanisms and gears + - weighing things down and measuring scales w/ weight + - trampolines + - Wind/fans + - Weight + - Music \ No newline at end of file diff --git a/docs/src/highlevel-design/chemisty/chemistryindex.md b/docs/src/highlevel-design/chemisty/chemistryindex.md new file mode 100644 index 00000000..5524d8ff --- /dev/null +++ b/docs/src/highlevel-design/chemisty/chemistryindex.md @@ -0,0 +1,6 @@ +@page chemistryindex Chemistry + +Pages on the chemistry system + +[TOC] + - @subpage chemistrydesign \ No newline at end of file diff --git a/docs/src/highlevel-design/creatures/creaturetodo.md b/docs/src/highlevel-design/creatures/creaturetodo.md index 32602cd3..1e8c1bc3 100644 --- a/docs/src/highlevel-design/creatures/creaturetodo.md +++ b/docs/src/highlevel-design/creatures/creaturetodo.md @@ -17,12 +17,6 @@ A list of all creatures that are targets for the game, and what their status of - [X] Data -## Rat Man - - [ ] 3d Model - - [ ] Viewmodel - - [ ] Data - - ## Deer - [ ] 3d Model - [ ] Data @@ -51,6 +45,11 @@ A list of all creatures that are targets for the game, and what their status of - [ ] Data +## Horse + - [ ] 3d Model + - [ ] Data + + ## Elf - [X] Copy of Human - [ ] Attributes 0/? @@ -63,6 +62,12 @@ A list of all creatures that are targets for the game, and what their status of - [ ] Data + ## Rat Man + - [ ] 3d Model + - [ ] Viewmodel + - [ ] Data + + ## Frog Man - [ ] 3d Model - [ ] Viewmodel diff --git a/docs/src/highlevel-design/creatures/individual/skeletonprogress.md b/docs/src/highlevel-design/creatures/individual/skeletonprogress.md index dfb90898..54fed3cf 100644 --- a/docs/src/highlevel-design/creatures/individual/skeletonprogress.md +++ b/docs/src/highlevel-design/creatures/individual/skeletonprogress.md @@ -1,4 +1,4 @@ -@page skeletonprogres Skeleton +@page skeletonprogress Skeleton Progress on the skeleton creature diff --git a/docs/src/highlevel-design/highleveldesignindex.md b/docs/src/highlevel-design/highleveldesignindex.md index 8c6573f4..1f2c633c 100644 --- a/docs/src/highlevel-design/highleveldesignindex.md +++ b/docs/src/highlevel-design/highleveldesignindex.md @@ -11,6 +11,7 @@ Discussion of, at a high game-design level, how everything should work and conne - @subpage streamintegrationideas - @subpage magicindex - @subpage creaturesindex +- @subpage chemistryindex - @subpage macrosimtimeline - @subpage narrativemanager - @subpage itemsindex diff --git a/docs/src/progress/currenttarget.md b/docs/src/progress/currenttarget.md index db80d87d..8aa558de 100644 --- a/docs/src/progress/currenttarget.md +++ b/docs/src/progress/currenttarget.md @@ -38,6 +38,7 @@ + bug fixes Fix skeleton right strafe + Fix block tree preventing initiating an attack Fix return to title menu synchronization bug + unreproducible bugs diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index cfa53079..097608df 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -796,6 +796,10 @@ New katana icon UI fix Initial hitstun implementation +(09/18/2024) +Migrate documentation +Netcode generator qol fixes +Combat Stances Component # TODO diff --git a/src/main/java/electrosphere/entity/EntityDataStrings.java b/src/main/java/electrosphere/entity/EntityDataStrings.java index dcc6182d..14a0337e 100644 --- a/src/main/java/electrosphere/entity/EntityDataStrings.java +++ b/src/main/java/electrosphere/entity/EntityDataStrings.java @@ -316,6 +316,12 @@ public class EntityDataStrings { */ public static final String TREE_CLIENTWALKTREE = "treeClientWalkTree"; public static final String TREE_SERVERWALKTREE = "treeServerWalkTree"; + + /** + * Weapon stance + */ + public static final String TREE_CLIENTSTANCECOMPONENT = "treeClientStanceComponent"; + public static final String TREE_SERVERSTANCECOMPONENT = "treeServerStanceComponent"; /* Entity categories diff --git a/src/main/java/electrosphere/entity/state/movement/sprint/ClientSprintTree.java b/src/main/java/electrosphere/entity/state/movement/sprint/ClientSprintTree.java index 2528489d..67a787c8 100644 --- a/src/main/java/electrosphere/entity/state/movement/sprint/ClientSprintTree.java +++ b/src/main/java/electrosphere/entity/state/movement/sprint/ClientSprintTree.java @@ -45,8 +45,10 @@ public class ClientSprintTree implements BehaviorTree { Entity parent; /** - * Gets the state of the tree - * @return The state + *
Automatically generated
+ *+ * Gets state. + *
*/ public SprintTreeState getState(){ return state; diff --git a/src/main/java/electrosphere/entity/state/movement/sprint/ServerSprintTree.java b/src/main/java/electrosphere/entity/state/movement/sprint/ServerSprintTree.java index 6ecaaa7d..c1d86ca5 100644 --- a/src/main/java/electrosphere/entity/state/movement/sprint/ServerSprintTree.java +++ b/src/main/java/electrosphere/entity/state/movement/sprint/ServerSprintTree.java @@ -51,8 +51,10 @@ public class ServerSprintTree implements BehaviorTree { int staminaCurrent = 0; /** - * Gets the state of the tree - * @return The state of the tree + *Automatically generated
+ *+ * Gets state. + *
*/ public SprintTreeState getState(){ return state; diff --git a/src/main/java/electrosphere/entity/state/movement/walk/ClientWalkTree.java b/src/main/java/electrosphere/entity/state/movement/walk/ClientWalkTree.java index 1f562748..ad229b9c 100644 --- a/src/main/java/electrosphere/entity/state/movement/walk/ClientWalkTree.java +++ b/src/main/java/electrosphere/entity/state/movement/walk/ClientWalkTree.java @@ -217,4 +217,14 @@ public class ClientWalkTree implements BehaviorTree { } } + /** + *Automatically generated
+ *+ * Gets state. + *
+ */ + public WalkState getState(){ + return state; + } + } diff --git a/src/main/java/electrosphere/entity/state/movement/walk/ServerWalkTree.java b/src/main/java/electrosphere/entity/state/movement/walk/ServerWalkTree.java index 33d134ea..173ec3b5 100644 --- a/src/main/java/electrosphere/entity/state/movement/walk/ServerWalkTree.java +++ b/src/main/java/electrosphere/entity/state/movement/walk/ServerWalkTree.java @@ -83,11 +83,13 @@ public class ServerWalkTree implements BehaviorTree { } /** - * Gets the state - * @return The state + *Automatically generated
+ *+ * Gets state. + *
*/ public WalkState getState(){ - return this.state; + return state; } /** diff --git a/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java b/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java new file mode 100644 index 00000000..29feb8cf --- /dev/null +++ b/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java @@ -0,0 +1,206 @@ +package electrosphere.entity.state.stance; + + +import electrosphere.entity.btree.BehaviorTree; +import electrosphere.engine.Globals; +import electrosphere.entity.EntityDataStrings; +import electrosphere.net.synchronization.server.ServerSynchronizationManager; +import electrosphere.net.parser.net.message.SynchronizationMessage; +import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums; +import electrosphere.entity.Entity; +import electrosphere.net.synchronization.annotation.SyncedField; +import electrosphere.net.synchronization.annotation.SynchronizableEnum; +import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree; + +/** + * Tracks the weapon/combat stance of the entity + */ +@SynchronizedBehaviorTree( + name = "clientStanceComponent", + isServer = false, + correspondingTree = "serverStanceComponent", + genStartInt = true +) +public class ClientStanceComponent implements BehaviorTree { + + @SynchronizableEnum + public static enum CombatStance { + /** + * Not in attacking stance + */ + IDLE, + /** + * No weapon equipped, in attacking stance + */ + UNARMED, + /** + * Weapon equipped, in attacking stance + */ + ARMED, + } + + @SyncedField + CombatStance state = CombatStance.IDLE; + + /** + * The parent entity + */ + Entity parent; + + /** + *(initially) Automatically generated
+ *+ * Attaches this tree to the entity. + *
+ * @param entity The entity to attach to + * @param tree The behavior tree to attach + * @param params Optional parameters that will be provided to the constructor + */ + public static ClientStanceComponent attachTree(Entity parent, Object ... params){ + ClientStanceComponent rVal = new ClientStanceComponent(parent,params); + //!!WARNING!! from here below should not be touched + //This was generated automatically to properly alert various systems that the btree exists and should be tracked + parent.putData(EntityDataStrings.TREE_CLIENTSTANCECOMPONENT, rVal); + Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal); + Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID); + return rVal; + } + + /** + *Automatically generated
+ *+ * Detatches this tree from the entity. + *
+ * @param entity The entity to detach to + * @param tree The behavior tree to detach + */ + public static void detachTree(Entity entity, BehaviorTree tree){ + Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID); + } + + /** + *(initially) Automatically generated
+ *Private constructor to enforce using the attach methods
+ *+ * Constructor + *
+ * @param parent The parent entity of this tree + * @param params Optional parameters that can be provided when attaching the tree. All custom data required for creating this tree should be passed in this varargs. + */ + public ClientStanceComponent(Entity parent, Object ... params){ + this.parent = parent; + } + + /** + *+ * Gets the ClientStanceComponent of the entity + *
+ * @param entity the entity + * @return The ClientStanceComponent + */ + public static ClientStanceComponent getClientStanceComponent(Entity entity){ + return (ClientStanceComponent)entity.getData(EntityDataStrings.TREE_CLIENTSTANCECOMPONENT); + } + + /** + *Automatically generated
+ *+ * Requests that the server start this btree + *
+ */ + public void start(){ + Globals.clientConnection.queueOutgoingMessage( + SynchronizationMessage.constructClientRequestBTreeActionMessage( + Globals.clientSceneWrapper.mapClientToServerId(parent.getId()), + BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID, + ServerSynchronizationManager.SERVER_SYNC_START + ) + ); + } + + /** + *Automatically generated
+ *+ * Requests that the server start this btree + *
+ */ + public void interrupt(){ + Globals.clientConnection.queueOutgoingMessage( + SynchronizationMessage.constructClientRequestBTreeActionMessage( + Globals.clientSceneWrapper.mapClientToServerId(parent.getId()), + BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID, + ServerSynchronizationManager.SERVER_SYNC_INTERRUPT + ) + ); + } + + /** + *Automatically generated
+ *+ * Sets state and handles the synchronization logic for it. + *
+ * @param state The value to set state to. + */ + public void setState(CombatStance state){ + this.state = state; + } + + /** + *Automatically generated
+ *+ * Converts a short to the equivalent enum value + *
+ * @param shortVal The short value + * @return The enum value + */ + public static CombatStance getCombatStanceShortAsEnum(short shortVal){ + switch(shortVal){ + case 0: + return CombatStance.IDLE; + case 1: + return CombatStance.UNARMED; + case 2: + return CombatStance.ARMED; + default: + return CombatStance.IDLE; + } + } + + /** + *Automatically generated
+ *+ * Converts this enum type to an equivalent short value + *
+ * @param enumVal The enum value + * @return The short value + */ + public static short getCombatStanceEnumAsShort(CombatStance enumVal){ + switch(enumVal){ + case IDLE: + return 0; + case UNARMED: + return 1; + case ARMED: + return 2; + default: + return 0; + } + } + + @Override + public void simulate(float deltaTime) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'simulate'"); + } + + /** + *Automatically generated
+ *+ * Gets state. + *
+ */ + public CombatStance getState(){ + return state; + } + +} diff --git a/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java b/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java new file mode 100644 index 00000000..d40527a1 --- /dev/null +++ b/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java @@ -0,0 +1,129 @@ +package electrosphere.entity.state.stance; + + +import electrosphere.entity.btree.BehaviorTree; +import electrosphere.engine.Globals; +import electrosphere.entity.EntityDataStrings; +import electrosphere.net.synchronization.enums.FieldIdEnums; +import electrosphere.server.datacell.utils.DataCellSearchUtils; +import electrosphere.net.parser.net.message.SynchronizationMessage; +import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums; +import electrosphere.server.datacell.utils.ServerBehaviorTreeUtils; +import electrosphere.entity.Entity; +import electrosphere.entity.state.stance.ClientStanceComponent.CombatStance; +import electrosphere.net.synchronization.annotation.SyncedField; +import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree; + +/** + * Tracks the weapon/combat stance of the entity + */ +@SynchronizedBehaviorTree( + name = "serverStanceComponent", + isServer = true, + correspondingTree = "clientStanceComponent" +) +public class ServerStanceComponent implements BehaviorTree { + + @SyncedField + CombatStance state = CombatStance.IDLE; + + /** + * The parent entity of this component + */ + Entity parent; + + /** + *(initially) Automatically generated
+ *+ * Attaches this tree to the entity. + *
+ * @param entity The entity to attach to + * @param tree The behavior tree to attach + * @param params Optional parameters that will be provided to the constructor + */ + public static ServerStanceComponent attachTree(Entity parent, Object ... params){ + ServerStanceComponent rVal = new ServerStanceComponent(parent,params); + //!!WARNING!! from here below should not be touched + //This was generated automatically to properly alert various systems that the btree exists and should be tracked + ServerBehaviorTreeUtils.attachBTreeToEntity(parent, rVal); + parent.putData(EntityDataStrings.TREE_SERVERSTANCECOMPONENT, rVal); + Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID); + return rVal; + } + + /** + *Automatically generated
+ *+ * Detatches this tree from the entity. + *
+ * @param entity The entity to detach to + * @param tree The behavior tree to detach + */ + public static void detachTree(Entity entity, BehaviorTree tree){ + Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID); + } + + /** + *(initially) Automatically generated
+ *Private constructor to enforce using the attach methods
+ *+ * Constructor + *
+ * @param parent The parent entity of this tree + * @param params Optional parameters that can be provided when attaching the tree. All custom data required for creating this tree should be passed in this varargs. + */ + public ServerStanceComponent(Entity parent, Object ... params){ + this.parent = parent; + } + + /** + *+ * Gets the ServerStanceComponent of the entity + *
+ * @param entity the entity + * @return The ServerStanceComponent + */ + public static ServerStanceComponent getServerStanceComponent(Entity entity){ + return (ServerStanceComponent)entity.getData(EntityDataStrings.TREE_SERVERSTANCECOMPONENT); + } + + /** + *Automatically generated
+ *+ * Sets state and handles the synchronization logic for it. + *
+ * @param state The value to set state to. + */ + public void setState(CombatStance state){ + this.state = state; + int value = ClientStanceComponent.getCombatStanceEnumAsShort(state); + if(DataCellSearchUtils.getEntityDataCell(parent) != null){ + DataCellSearchUtils.getEntityDataCell(parent).broadcastNetworkMessage(SynchronizationMessage.constructUpdateClientStateMessage(parent.getId(), BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID, FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID, value)); + } + } + + @Override + public void simulate(float deltaTime) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'simulate'"); + } + + public void start(){ + + } + + public void interrupt(){ + + } + + /** + *Automatically generated
+ *+ * Gets state. + *
+ */ + public CombatStance getState(){ + return state; + } + +} diff --git a/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java b/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java index 59c3611f..4f537750 100644 --- a/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java +++ b/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java @@ -1,8 +1,8 @@ package electrosphere.net.synchronization.client; +import electrosphere.entity.state.stance.ClientStanceComponent; import electrosphere.entity.state.movement.sprint.ClientSprintTree; -import electrosphere.entity.state.equip.ClientEquipState; import electrosphere.entity.state.movement.jump.ClientJumpTree; import electrosphere.entity.state.movement.walk.ClientWalkTree; import electrosphere.entity.state.life.ClientLifeTree; @@ -203,6 +203,14 @@ public class ClientSynchronizationManager { } break; } } break; + case BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID: { + switch(message.getfieldId()){ + case FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID:{ + ClientStanceComponent tree = ClientStanceComponent.getClientStanceComponent(entity); + tree.setState(ClientStanceComponent.getCombatStanceShortAsEnum((short)message.getbTreeValue())); + } break; + } + } break; case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: { switch(message.getfieldId()){ case FieldIdEnums.TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID:{ diff --git a/src/main/java/electrosphere/net/synchronization/enums/BehaviorTreeIdEnums.java b/src/main/java/electrosphere/net/synchronization/enums/BehaviorTreeIdEnums.java index a3eb5318..30726453 100644 --- a/src/main/java/electrosphere/net/synchronization/enums/BehaviorTreeIdEnums.java +++ b/src/main/java/electrosphere/net/synchronization/enums/BehaviorTreeIdEnums.java @@ -17,6 +17,8 @@ public class BehaviorTreeIdEnums { public static final int BTREE_SERVERIDLE_ID = 9; public static final int BTREE_CLIENTLIFETREE_ID = 6; public static final int BTREE_SERVERLIFETREE_ID = 13; + public static final int BTREE_CLIENTSTANCECOMPONENT_ID = 20; + public static final int BTREE_SERVERSTANCECOMPONENT_ID = 21; public static final int BTREE_CLIENTGROUNDMOVEMENTTREE_ID = 10; public static final int BTREE_SERVERGROUNDMOVEMENTTREE_ID = 11; public static final int BTREE_CLIENTJUMPTREE_ID = 14; diff --git a/src/main/java/electrosphere/net/synchronization/enums/FieldIdEnums.java b/src/main/java/electrosphere/net/synchronization/enums/FieldIdEnums.java index 2640d505..13b2ceb7 100644 --- a/src/main/java/electrosphere/net/synchronization/enums/FieldIdEnums.java +++ b/src/main/java/electrosphere/net/synchronization/enums/FieldIdEnums.java @@ -21,6 +21,8 @@ public class FieldIdEnums { public static final int TREE_SERVERIDLE_SYNCEDFIELD_STATE_ID = 13; public static final int TREE_CLIENTLIFETREE_SYNCEDFIELD_STATE_ID = 10; public static final int TREE_SERVERLIFETREE_SYNCEDFIELD_STATE_ID = 17; + public static final int TREE_CLIENTSTANCECOMPONENT_SYNCEDFIELD_STATE_ID = 28; + public static final int TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID = 29; public static final int TREE_CLIENTGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID = 14; public static final int TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID = 15; public static final int TREE_CLIENTJUMPTREE_SYNCEDFIELD_STATE_ID = 18; diff --git a/src/main/java/electrosphere/net/synchronization/server/ServerSynchronizationManager.java b/src/main/java/electrosphere/net/synchronization/server/ServerSynchronizationManager.java index 476c9f76..769b0227 100644 --- a/src/main/java/electrosphere/net/synchronization/server/ServerSynchronizationManager.java +++ b/src/main/java/electrosphere/net/synchronization/server/ServerSynchronizationManager.java @@ -1,6 +1,7 @@ package electrosphere.net.synchronization.server; +import electrosphere.entity.state.stance.ServerStanceComponent; import electrosphere.entity.state.movement.sprint.ServerSprintTree; import electrosphere.logger.LoggerInterface; @@ -89,6 +90,17 @@ public class ServerSynchronizationManager { */ private void updateEntityState(Entity entity, int bTreeId, SynchronizationMessage message){ switch(bTreeId){ + case BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID: { + ServerStanceComponent tree = ServerStanceComponent.getServerStanceComponent(entity); + switch(message.getbTreeValue()){ + case ServerSynchronizationManager.SERVER_SYNC_START: { + tree.start(); + } break; + case ServerSynchronizationManager.SERVER_SYNC_INTERRUPT: { + tree.interrupt(); + } break; + } + } break; case BehaviorTreeIdEnums.BTREE_CLIENTJUMPTREE_ID: { ServerJumpTree tree = ServerJumpTree.getServerJumpTree(entity); switch(message.getbTreeValue()){ diff --git a/src/main/java/electrosphere/net/synchronization/transport/StateCollection.java b/src/main/java/electrosphere/net/synchronization/transport/StateCollection.java index 198c2d49..a37a1a69 100644 --- a/src/main/java/electrosphere/net/synchronization/transport/StateCollection.java +++ b/src/main/java/electrosphere/net/synchronization/transport/StateCollection.java @@ -1,9 +1,10 @@ package electrosphere.net.synchronization.transport; +import electrosphere.entity.state.stance.ServerStanceComponent; +import electrosphere.entity.state.stance.ClientStanceComponent; import electrosphere.entity.state.movement.sprint.ServerSprintTree; import electrosphere.entity.state.movement.sprint.ClientSprintTree; -import electrosphere.entity.state.equip.ClientEquipState; import java.util.LinkedList; import java.util.List; @@ -13,7 +14,6 @@ import electrosphere.entity.state.attack.ClientAttackTree; import electrosphere.entity.state.attack.ServerAttackTree; import electrosphere.entity.state.block.ClientBlockTree; import electrosphere.entity.state.block.ServerBlockTree; -import electrosphere.entity.state.equip.ServerEquipState; import electrosphere.entity.state.gravity.ClientGravityTree; import electrosphere.entity.state.gravity.ServerGravityTree; import electrosphere.entity.state.idle.ClientIdleTree; @@ -79,9 +79,6 @@ public class StateCollection { collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID,FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_STATE_ID,ClientBlockTree.getBlockStateEnumAsShort(tree.getState()))); collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID,FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_CURRENTBLOCKVARIANT_ID,tree.getCurrentBlockVariant())); } break; - case BehaviorTreeIdEnums.BTREE_SERVEREQUIPSTATE_ID: { - ServerEquipState tree = ServerEquipState.getServerEquipState(entity); - } break; case BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID: { ServerGravityTree tree = ServerGravityTree.getServerGravityTree(entity); collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID,FieldIdEnums.TREE_SERVERGRAVITY_SYNCEDFIELD_STATE_ID,ClientGravityTree.getGravityTreeStateEnumAsShort(tree.getState()))); @@ -94,6 +91,10 @@ public class StateCollection { ServerLifeTree tree = ServerLifeTree.getServerLifeTree(entity); collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERLIFETREE_ID,FieldIdEnums.TREE_SERVERLIFETREE_SYNCEDFIELD_STATE_ID,ClientLifeTree.getLifeStateEnumEnumAsShort(tree.getState()))); } break; + case BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID: { + ServerStanceComponent tree = ServerStanceComponent.getServerStanceComponent(entity); + collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID,FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID,ClientStanceComponent.getCombatStanceEnumAsShort(tree.getState()))); + } break; case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: { ServerGroundMovementTree tree = ServerGroundMovementTree.getServerGroundMovementTree(entity); collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID,FieldIdEnums.TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID,ClientGroundMovementTree.getMovementRelativeFacingEnumAsShort(tree.getFacing()))); @@ -154,11 +155,6 @@ public class StateCollection { } break; } } break; - case BehaviorTreeIdEnums.BTREE_SERVEREQUIPSTATE_ID: { - ClientEquipState tree = ClientEquipState.getClientEquipState(entity); - switch(syncedValue.getFieldId()){ - } - } break; case BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID: { ClientGravityTree tree = ClientGravityTree.getClientGravityTree(entity); switch(syncedValue.getFieldId()){ @@ -183,6 +179,14 @@ public class StateCollection { } break; } } break; + case BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID: { + ClientStanceComponent tree = ClientStanceComponent.getClientStanceComponent(entity); + switch(syncedValue.getFieldId()){ + case(FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID): { + tree.setState(ClientStanceComponent.getCombatStanceShortAsEnum(((Double)syncedValue.getValue()).shortValue())); + } break; + } + } break; case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: { ClientGroundMovementTree tree = ClientGroundMovementTree.getClientGroundMovementTree(entity); switch(syncedValue.getFieldId()){