update codegen for component checker method

This commit is contained in:
austin 2025-04-05 18:25:28 -04:00
parent 7858cc83ee
commit 13997acdf7
27 changed files with 294 additions and 12 deletions

View File

@ -1521,7 +1521,6 @@ Rearchitecting
- Cache busting for particle atlas cache - Cache busting for particle atlas cache
Code cleanup Code cleanup
- Rename "BehaviorTree" to be "Component" (what it actually is)
- Refactor ground movement components - Refactor ground movement components
Build system to allow specifying certain audio files to load as stereo Build system to allow specifying certain audio files to load as stereo

View File

@ -789,4 +789,15 @@ public class ClientAttackTree implements BehaviorTree {
this.setState(newState); this.setState(newState);
} }
/**
* <p>
* Checks if the entity has a ClientAttackTree component
* </p>
* @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);
}
} }

View File

@ -770,4 +770,15 @@ public class ServerAttackTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ServerAttackTree component
* </p>
* @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);
}
} }

View File

@ -292,4 +292,15 @@ public class ClientBlockTree implements BehaviorTree {
this.currentBlockVariant = currentBlockVariant; this.currentBlockVariant = currentBlockVariant;
} }
/**
* <p>
* Checks if the entity has a ClientBlockTree component
* </p>
* @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);
}
} }

View File

@ -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)); DataCellSearchUtils.getEntityDataCell(parent).broadcastNetworkMessage(SynchronizationMessage.constructUpdateClientStringStateMessage(parent.getId(), BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID, FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_CURRENTBLOCKVARIANT_ID, currentBlockVariant));
} }
} }
/**
* <p>
* Checks if the entity has a ServerBlockTree component
* </p>
* @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);
}
} }

View File

@ -491,4 +491,15 @@ public class ClientEquipState implements BehaviorTree {
return (ClientEquipState)entity.getData(EntityDataStrings.TREE_CLIENTEQUIPSTATE); return (ClientEquipState)entity.getData(EntityDataStrings.TREE_CLIENTEQUIPSTATE);
} }
/**
* <p>
* Checks if the entity has a ClientEquipState component
* </p>
* @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);
}
} }

View File

@ -362,4 +362,15 @@ public class ClientToolbarState implements BehaviorTree {
public void simulate(float deltaTime) { public void simulate(float deltaTime) {
} }
/**
* <p>
* Checks if the entity has a ClientToolbarState component
* </p>
* @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);
}
} }

View File

@ -496,4 +496,15 @@ public class ServerEquipState implements BehaviorTree {
return (ServerEquipState)entity.getData(EntityDataStrings.TREE_SERVEREQUIPSTATE); return (ServerEquipState)entity.getData(EntityDataStrings.TREE_SERVEREQUIPSTATE);
} }
/**
* <p>
* Checks if the entity has a ServerEquipState component
* </p>
* @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);
}
} }

View File

@ -413,4 +413,15 @@ public class ServerToolbarState implements BehaviorTree {
public void simulate(float deltaTime) { public void simulate(float deltaTime) {
} }
/**
* <p>
* Checks if the entity has a ServerToolbarState component
* </p>
* @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);
}
} }

View File

@ -237,4 +237,15 @@ public class ClientGravityTree implements BehaviorTree {
public void setState(GravityTreeState state){ public void setState(GravityTreeState state){
this.state = state; this.state = state;
} }
/**
* <p>
* Checks if the entity has a ClientGravityTree component
* </p>
* @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);
}
} }

View File

@ -221,4 +221,15 @@ public class ServerGravityTree implements BehaviorTree {
public static ServerGravityTree getServerGravityTree(Entity entity){ public static ServerGravityTree getServerGravityTree(Entity entity){
return (ServerGravityTree)entity.getData(EntityDataStrings.TREE_SERVERGRAVITY); return (ServerGravityTree)entity.getData(EntityDataStrings.TREE_SERVERGRAVITY);
} }
/**
* <p>
* Checks if the entity has a ServerGravityTree component
* </p>
* @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);
}
} }

View File

@ -210,4 +210,15 @@ public class ClientIdleTree implements BehaviorTree {
public static ClientIdleTree getClientIdleTree(Entity entity){ public static ClientIdleTree getClientIdleTree(Entity entity){
return (ClientIdleTree)entity.getData(EntityDataStrings.TREE_IDLE); return (ClientIdleTree)entity.getData(EntityDataStrings.TREE_IDLE);
} }
/**
* <p>
* Checks if the entity has a ClientIdleTree component
* </p>
* @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);
}
} }

View File

@ -217,4 +217,15 @@ public class ServerIdleTree implements BehaviorTree {
public static ServerIdleTree getServerIdleTree(Entity entity){ public static ServerIdleTree getServerIdleTree(Entity entity){
return (ServerIdleTree)entity.getData(EntityDataStrings.TREE_SERVERIDLE); return (ServerIdleTree)entity.getData(EntityDataStrings.TREE_SERVERIDLE);
} }
/**
* <p>
* Checks if the entity has a ServerIdleTree component
* </p>
* @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);
}
} }

View File

@ -175,4 +175,15 @@ public class ClientLifeTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ClientLifeTree component
* </p>
* @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);
}
} }

View File

@ -335,17 +335,6 @@ public class ServerLifeTree implements BehaviorTree {
return (ServerLifeTree)entity.getData(EntityDataStrings.TREE_SERVERLIFETREE); return (ServerLifeTree)entity.getData(EntityDataStrings.TREE_SERVERLIFETREE);
} }
/**
* <p>
* Checks if the entity has a copy of this tree
* </p>
* @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 * A single collision event
*/ */
@ -401,4 +390,15 @@ public class ServerLifeTree implements BehaviorTree {
} }
/**
* <p>
* Checks if the entity has a ServerLifeTree component
* </p>
* @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);
}
} }

View File

@ -470,6 +470,10 @@ public class ClientEditorMovementTree implements BehaviorTree {
return 6; return 6;
case BACKWARD_RIGHT: case BACKWARD_RIGHT:
return 7; return 7;
case UP:
return 8;
case DOWN:
return 9;
default: default:
return 0; return 0;
} }
@ -500,6 +504,10 @@ public class ClientEditorMovementTree implements BehaviorTree {
return MovementRelativeFacing.BACKWARD_LEFT; return MovementRelativeFacing.BACKWARD_LEFT;
case 7: case 7:
return MovementRelativeFacing.BACKWARD_RIGHT; return MovementRelativeFacing.BACKWARD_RIGHT;
case 8:
return MovementRelativeFacing.UP;
case 9:
return MovementRelativeFacing.DOWN;
default: default:
return MovementRelativeFacing.FORWARD; return MovementRelativeFacing.FORWARD;
} }
@ -535,4 +543,15 @@ public class ClientEditorMovementTree implements BehaviorTree {
Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_CLIENTEDITORMOVEMENTTREE_ID); Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_CLIENTEDITORMOVEMENTTREE_ID);
} }
/**
* <p>
* Checks if the entity has a ClientEditorMovementTree component
* </p>
* @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);
}
} }

View File

@ -539,4 +539,15 @@ public class ServerEditorMovementTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ServerEditorMovementTree component
* </p>
* @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);
}
} }

View File

@ -918,4 +918,15 @@ public class ClientGroundMovementTree implements BehaviorTree {
return MovementRelativeFacing.FORWARD; return MovementRelativeFacing.FORWARD;
} }
} }
/**
* <p>
* Checks if the entity has a ClientGroundMovementTree component
* </p>
* @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);
}
} }

View File

@ -845,4 +845,15 @@ public class ServerGroundMovementTree implements BehaviorTree {
return (ServerGroundMovementTree)entity.getData(EntityDataStrings.TREE_SERVERGROUNDMOVEMENTTREE); return (ServerGroundMovementTree)entity.getData(EntityDataStrings.TREE_SERVERGROUNDMOVEMENTTREE);
} }
/**
* <p>
* Checks if the entity has a ServerGroundMovementTree component
* </p>
* @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);
}
} }

View File

@ -332,4 +332,15 @@ public class ClientJumpTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ClientJumpTree component
* </p>
* @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);
}
} }

View File

@ -239,4 +239,15 @@ public class ServerJumpTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ServerJumpTree component
* </p>
* @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);
}
} }

View File

@ -216,4 +216,15 @@ public class ClientSprintTree implements BehaviorTree {
this.state = state; this.state = state;
} }
/**
* <p>
* Checks if the entity has a ClientSprintTree component
* </p>
* @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);
}
} }

View File

@ -196,4 +196,15 @@ public class ServerSprintTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ServerSprintTree component
* </p>
* @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);
}
} }

View File

@ -227,4 +227,15 @@ public class ClientWalkTree implements BehaviorTree {
return state; return state;
} }
/**
* <p>
* Checks if the entity has a ClientWalkTree component
* </p>
* @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);
}
} }

View File

@ -166,4 +166,15 @@ public class ServerWalkTree implements BehaviorTree {
} }
} }
/**
* <p>
* Checks if the entity has a ServerWalkTree component
* </p>
* @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);
}
} }

View File

@ -203,4 +203,15 @@ public class ClientStanceComponent implements BehaviorTree {
return state; return state;
} }
/**
* <p>
* Checks if the entity has a ClientStanceComponent component
* </p>
* @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);
}
} }

View File

@ -126,4 +126,15 @@ public class ServerStanceComponent implements BehaviorTree {
return state; return state;
} }
/**
* <p>
* Checks if the entity has a ServerStanceComponent component
* </p>
* @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);
}
} }