diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index a851f74a..f76271b3 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1521,7 +1521,6 @@ Rearchitecting - Cache busting for particle atlas cache Code cleanup - - Rename "BehaviorTree" to be "Component" (what it actually is) - Refactor ground movement components Build system to allow specifying certain audio files to load as stereo diff --git a/src/main/java/electrosphere/entity/state/attack/ClientAttackTree.java b/src/main/java/electrosphere/entity/state/attack/ClientAttackTree.java index fffbfe96..e90f1110 100644 --- a/src/main/java/electrosphere/entity/state/attack/ClientAttackTree.java +++ b/src/main/java/electrosphere/entity/state/attack/ClientAttackTree.java @@ -789,4 +789,15 @@ public class ClientAttackTree implements BehaviorTree { this.setState(newState); } + /** + *

+ * Checks if the entity has a ClientAttackTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientAttackTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTATTACKTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/attack/ServerAttackTree.java b/src/main/java/electrosphere/entity/state/attack/ServerAttackTree.java index f034c234..1885ddcb 100644 --- a/src/main/java/electrosphere/entity/state/attack/ServerAttackTree.java +++ b/src/main/java/electrosphere/entity/state/attack/ServerAttackTree.java @@ -770,4 +770,15 @@ public class ServerAttackTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ServerAttackTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerAttackTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERATTACKTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/block/ClientBlockTree.java b/src/main/java/electrosphere/entity/state/block/ClientBlockTree.java index 9e0b4390..df46870f 100644 --- a/src/main/java/electrosphere/entity/state/block/ClientBlockTree.java +++ b/src/main/java/electrosphere/entity/state/block/ClientBlockTree.java @@ -292,4 +292,15 @@ public class ClientBlockTree implements BehaviorTree { this.currentBlockVariant = currentBlockVariant; } + /** + *

+ * Checks if the entity has a ClientBlockTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientBlockTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTBLOCKTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/block/ServerBlockTree.java b/src/main/java/electrosphere/entity/state/block/ServerBlockTree.java index 4b721b56..273a720e 100644 --- a/src/main/java/electrosphere/entity/state/block/ServerBlockTree.java +++ b/src/main/java/electrosphere/entity/state/block/ServerBlockTree.java @@ -260,4 +260,15 @@ public class ServerBlockTree implements BehaviorTree { DataCellSearchUtils.getEntityDataCell(parent).broadcastNetworkMessage(SynchronizationMessage.constructUpdateClientStringStateMessage(parent.getId(), BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID, FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_CURRENTBLOCKVARIANT_ID, currentBlockVariant)); } } + /** + *

+ * Checks if the entity has a ServerBlockTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerBlockTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERBLOCKTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/equip/ClientEquipState.java b/src/main/java/electrosphere/entity/state/equip/ClientEquipState.java index 0d4cac1d..2fb541c2 100644 --- a/src/main/java/electrosphere/entity/state/equip/ClientEquipState.java +++ b/src/main/java/electrosphere/entity/state/equip/ClientEquipState.java @@ -491,4 +491,15 @@ public class ClientEquipState implements BehaviorTree { return (ClientEquipState)entity.getData(EntityDataStrings.TREE_CLIENTEQUIPSTATE); } + /** + *

+ * Checks if the entity has a ClientEquipState component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientEquipState(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTEQUIPSTATE); + } + } diff --git a/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java b/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java index 066a4cf8..d65b39ef 100644 --- a/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java +++ b/src/main/java/electrosphere/entity/state/equip/ClientToolbarState.java @@ -362,4 +362,15 @@ public class ClientToolbarState implements BehaviorTree { public void simulate(float deltaTime) { } + /** + *

+ * Checks if the entity has a ClientToolbarState component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientToolbarState(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTTOOLBARSTATE); + } + } diff --git a/src/main/java/electrosphere/entity/state/equip/ServerEquipState.java b/src/main/java/electrosphere/entity/state/equip/ServerEquipState.java index c0a1eb19..4e04452f 100644 --- a/src/main/java/electrosphere/entity/state/equip/ServerEquipState.java +++ b/src/main/java/electrosphere/entity/state/equip/ServerEquipState.java @@ -496,4 +496,15 @@ public class ServerEquipState implements BehaviorTree { return (ServerEquipState)entity.getData(EntityDataStrings.TREE_SERVEREQUIPSTATE); } + /** + *

+ * Checks if the entity has a ServerEquipState component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerEquipState(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVEREQUIPSTATE); + } + } diff --git a/src/main/java/electrosphere/entity/state/equip/ServerToolbarState.java b/src/main/java/electrosphere/entity/state/equip/ServerToolbarState.java index a76b43fc..cae7d391 100644 --- a/src/main/java/electrosphere/entity/state/equip/ServerToolbarState.java +++ b/src/main/java/electrosphere/entity/state/equip/ServerToolbarState.java @@ -413,4 +413,15 @@ public class ServerToolbarState implements BehaviorTree { public void simulate(float deltaTime) { } + /** + *

+ * Checks if the entity has a ServerToolbarState component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerToolbarState(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERTOOLBARSTATE); + } + } diff --git a/src/main/java/electrosphere/entity/state/gravity/ClientGravityTree.java b/src/main/java/electrosphere/entity/state/gravity/ClientGravityTree.java index 5c76b381..46ac7c26 100644 --- a/src/main/java/electrosphere/entity/state/gravity/ClientGravityTree.java +++ b/src/main/java/electrosphere/entity/state/gravity/ClientGravityTree.java @@ -237,4 +237,15 @@ public class ClientGravityTree implements BehaviorTree { public void setState(GravityTreeState state){ this.state = state; } + /** + *

+ * Checks if the entity has a ClientGravityTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientGravityTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTGRAVITY); + } + } diff --git a/src/main/java/electrosphere/entity/state/gravity/ServerGravityTree.java b/src/main/java/electrosphere/entity/state/gravity/ServerGravityTree.java index 7438d961..b0e93598 100644 --- a/src/main/java/electrosphere/entity/state/gravity/ServerGravityTree.java +++ b/src/main/java/electrosphere/entity/state/gravity/ServerGravityTree.java @@ -221,4 +221,15 @@ public class ServerGravityTree implements BehaviorTree { public static ServerGravityTree getServerGravityTree(Entity entity){ return (ServerGravityTree)entity.getData(EntityDataStrings.TREE_SERVERGRAVITY); } + /** + *

+ * Checks if the entity has a ServerGravityTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerGravityTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERGRAVITY); + } + } diff --git a/src/main/java/electrosphere/entity/state/idle/ClientIdleTree.java b/src/main/java/electrosphere/entity/state/idle/ClientIdleTree.java index 6655bd53..aed1d4af 100644 --- a/src/main/java/electrosphere/entity/state/idle/ClientIdleTree.java +++ b/src/main/java/electrosphere/entity/state/idle/ClientIdleTree.java @@ -210,4 +210,15 @@ public class ClientIdleTree implements BehaviorTree { public static ClientIdleTree getClientIdleTree(Entity entity){ return (ClientIdleTree)entity.getData(EntityDataStrings.TREE_IDLE); } + /** + *

+ * Checks if the entity has a ClientIdleTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientIdleTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_IDLE); + } + } \ No newline at end of file diff --git a/src/main/java/electrosphere/entity/state/idle/ServerIdleTree.java b/src/main/java/electrosphere/entity/state/idle/ServerIdleTree.java index 247416a5..21c7ebc4 100644 --- a/src/main/java/electrosphere/entity/state/idle/ServerIdleTree.java +++ b/src/main/java/electrosphere/entity/state/idle/ServerIdleTree.java @@ -217,4 +217,15 @@ public class ServerIdleTree implements BehaviorTree { public static ServerIdleTree getServerIdleTree(Entity entity){ return (ServerIdleTree)entity.getData(EntityDataStrings.TREE_SERVERIDLE); } + /** + *

+ * Checks if the entity has a ServerIdleTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerIdleTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERIDLE); + } + } \ No newline at end of file diff --git a/src/main/java/electrosphere/entity/state/life/ClientLifeTree.java b/src/main/java/electrosphere/entity/state/life/ClientLifeTree.java index ce1feee2..3c672995 100644 --- a/src/main/java/electrosphere/entity/state/life/ClientLifeTree.java +++ b/src/main/java/electrosphere/entity/state/life/ClientLifeTree.java @@ -175,4 +175,15 @@ public class ClientLifeTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ClientLifeTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientLifeTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTLIFETREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/life/ServerLifeTree.java b/src/main/java/electrosphere/entity/state/life/ServerLifeTree.java index b163286c..ec16ef3d 100644 --- a/src/main/java/electrosphere/entity/state/life/ServerLifeTree.java +++ b/src/main/java/electrosphere/entity/state/life/ServerLifeTree.java @@ -335,17 +335,6 @@ public class ServerLifeTree implements BehaviorTree { return (ServerLifeTree)entity.getData(EntityDataStrings.TREE_SERVERLIFETREE); } - /** - *

- * Checks if the entity has a copy of this tree - *

- * @param entity the entity - * @return true if the entity has a copy of this tree, false otherwise - */ - public static boolean hasServerLifeTree(Entity entity){ - return entity.containsKey(EntityDataStrings.TREE_SERVERLIFETREE); - } - /** * A single collision event */ @@ -401,4 +390,15 @@ public class ServerLifeTree implements BehaviorTree { } + /** + *

+ * Checks if the entity has a ServerLifeTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerLifeTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERLIFETREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/movement/editor/ClientEditorMovementTree.java b/src/main/java/electrosphere/entity/state/movement/editor/ClientEditorMovementTree.java index 3632ac97..7b0502f2 100644 --- a/src/main/java/electrosphere/entity/state/movement/editor/ClientEditorMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/editor/ClientEditorMovementTree.java @@ -470,6 +470,10 @@ public class ClientEditorMovementTree implements BehaviorTree { return 6; case BACKWARD_RIGHT: return 7; + case UP: + return 8; + case DOWN: + return 9; default: return 0; } @@ -500,6 +504,10 @@ public class ClientEditorMovementTree implements BehaviorTree { return MovementRelativeFacing.BACKWARD_LEFT; case 7: return MovementRelativeFacing.BACKWARD_RIGHT; + case 8: + return MovementRelativeFacing.UP; + case 9: + return MovementRelativeFacing.DOWN; default: return MovementRelativeFacing.FORWARD; } @@ -535,4 +543,15 @@ public class ClientEditorMovementTree implements BehaviorTree { Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_CLIENTEDITORMOVEMENTTREE_ID); } + /** + *

+ * Checks if the entity has a ClientEditorMovementTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientEditorMovementTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTEDITORMOVEMENTTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/movement/editor/ServerEditorMovementTree.java b/src/main/java/electrosphere/entity/state/movement/editor/ServerEditorMovementTree.java index 5c8f0b88..902a9813 100644 --- a/src/main/java/electrosphere/entity/state/movement/editor/ServerEditorMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/editor/ServerEditorMovementTree.java @@ -539,4 +539,15 @@ public class ServerEditorMovementTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ServerEditorMovementTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerEditorMovementTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVEREDITORMOVEMENTTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/movement/groundmove/ClientGroundMovementTree.java b/src/main/java/electrosphere/entity/state/movement/groundmove/ClientGroundMovementTree.java index aae799c1..e33b53af 100644 --- a/src/main/java/electrosphere/entity/state/movement/groundmove/ClientGroundMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/groundmove/ClientGroundMovementTree.java @@ -918,4 +918,15 @@ public class ClientGroundMovementTree implements BehaviorTree { return MovementRelativeFacing.FORWARD; } } + /** + *

+ * Checks if the entity has a ClientGroundMovementTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientGroundMovementTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTGROUNDMOVEMENTTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java b/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java index 56f132fb..c6f445b7 100644 --- a/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java @@ -845,4 +845,15 @@ public class ServerGroundMovementTree implements BehaviorTree { return (ServerGroundMovementTree)entity.getData(EntityDataStrings.TREE_SERVERGROUNDMOVEMENTTREE); } + /** + *

+ * Checks if the entity has a ServerGroundMovementTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerGroundMovementTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERGROUNDMOVEMENTTREE); + } + } 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 8ef90e1f..ba278581 100644 --- a/src/main/java/electrosphere/entity/state/movement/jump/ClientJumpTree.java +++ b/src/main/java/electrosphere/entity/state/movement/jump/ClientJumpTree.java @@ -332,4 +332,15 @@ public class ClientJumpTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ClientJumpTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientJumpTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTJUMPTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/movement/jump/ServerJumpTree.java b/src/main/java/electrosphere/entity/state/movement/jump/ServerJumpTree.java index 6e428cbe..372e8fd5 100644 --- a/src/main/java/electrosphere/entity/state/movement/jump/ServerJumpTree.java +++ b/src/main/java/electrosphere/entity/state/movement/jump/ServerJumpTree.java @@ -239,4 +239,15 @@ public class ServerJumpTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ServerJumpTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerJumpTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERJUMPTREE); + } + } 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 67a787c8..08fbaa2b 100644 --- a/src/main/java/electrosphere/entity/state/movement/sprint/ClientSprintTree.java +++ b/src/main/java/electrosphere/entity/state/movement/sprint/ClientSprintTree.java @@ -216,4 +216,15 @@ public class ClientSprintTree implements BehaviorTree { this.state = state; } + /** + *

+ * Checks if the entity has a ClientSprintTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientSprintTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTSPRINTTREE); + } + } 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 c1d86ca5..6102856a 100644 --- a/src/main/java/electrosphere/entity/state/movement/sprint/ServerSprintTree.java +++ b/src/main/java/electrosphere/entity/state/movement/sprint/ServerSprintTree.java @@ -196,4 +196,15 @@ public class ServerSprintTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ServerSprintTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerSprintTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERSPRINTTREE); + } + } 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 ad229b9c..cf80c1e0 100644 --- a/src/main/java/electrosphere/entity/state/movement/walk/ClientWalkTree.java +++ b/src/main/java/electrosphere/entity/state/movement/walk/ClientWalkTree.java @@ -227,4 +227,15 @@ public class ClientWalkTree implements BehaviorTree { return state; } + /** + *

+ * Checks if the entity has a ClientWalkTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientWalkTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTWALKTREE); + } + } 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 173ec3b5..0917215a 100644 --- a/src/main/java/electrosphere/entity/state/movement/walk/ServerWalkTree.java +++ b/src/main/java/electrosphere/entity/state/movement/walk/ServerWalkTree.java @@ -166,4 +166,15 @@ public class ServerWalkTree implements BehaviorTree { } } + /** + *

+ * Checks if the entity has a ServerWalkTree component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerWalkTree(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERWALKTREE); + } + } diff --git a/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java b/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java index 29feb8cf..5cf6ef92 100644 --- a/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java +++ b/src/main/java/electrosphere/entity/state/stance/ClientStanceComponent.java @@ -203,4 +203,15 @@ public class ClientStanceComponent implements BehaviorTree { return state; } + /** + *

+ * Checks if the entity has a ClientStanceComponent component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasClientStanceComponent(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_CLIENTSTANCECOMPONENT); + } + } diff --git a/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java b/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java index d40527a1..9eb6eb80 100644 --- a/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java +++ b/src/main/java/electrosphere/entity/state/stance/ServerStanceComponent.java @@ -126,4 +126,15 @@ public class ServerStanceComponent implements BehaviorTree { return state; } + /** + *

+ * Checks if the entity has a ServerStanceComponent component + *

+ * @param entity the entity + * @return true if the entity contains the component, false otherwise + */ + public static boolean hasServerStanceComponent(Entity entity){ + return entity.containsKey(EntityDataStrings.TREE_SERVERSTANCECOMPONENT); + } + }