cleanup autogen bug

This commit is contained in:
austin 2024-07-31 17:30:30 -04:00
parent 07d18b6126
commit 8d6b4f71b8
6 changed files with 31 additions and 58 deletions

View File

@ -1,7 +1,6 @@
package electrosphere.entity.state.attack;
import electrosphere.net.parser.net.message.SynchronizationMessage;
import electrosphere.net.synchronization.BehaviorTreeIdEnums;
import electrosphere.engine.Globals;
@ -112,19 +111,26 @@ public class ClientAttackTree implements BehaviorTree {
}
/**
* <p> Automatically generated </p>
* <p>
* Requests that the server start this btree
* </p>
* Starts an attack
*/
public void start(){
Globals.clientConnection.queueOutgoingMessage(
SynchronizationMessage.constructClientRequestBTreeActionMessage(
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID,
1
)
);
currentMoveCanHold = false;
currentMoveHasWindup = false;
stillHold = true;
firesProjectile = false;
projectileToFire = null;
currentWeapon = null;
attackingPoint = null;
//figure out attack type we should be doing
String attackType = getAttackType();
//if we can attack, setup doing so
if(canAttack(attackType)){
setAttackMoveTypeActive(attackType);
currentMoveset = getMoveset(attackType);
if(currentMoveset != null){
Globals.clientConnection.queueOutgoingMessage(EntityMessage.constructstartAttackMessage());
}
}
}
public void release(){

View File

@ -1,7 +1,6 @@
package electrosphere.entity.state.block;
import electrosphere.net.parser.net.message.SynchronizationMessage;
import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings;
@ -225,20 +224,5 @@ public class ClientBlockTree implements BehaviorTree {
public void setCurrentBlockVariant(String currentBlockVariant){
this.currentBlockVariant = currentBlockVariant;
}
/**
* <p> Automatically generated </p>
* <p>
* Requests that the server start this btree
* </p>
*/
public void start(){
Globals.clientConnection.queueOutgoingMessage(
SynchronizationMessage.constructClientRequestBTreeActionMessage(
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID,
1
)
);
}
}

View File

@ -56,17 +56,17 @@ public class ClientCollidableTree implements BehaviorTree {
// System.out.println("Impulse force: " + impulseForce);
// System.out.println("Position: " + position);
}
if(impulse.type.matches(Collidable.TYPE_ITEM)){
if(ClientGravityTree.getClientGravityTree(parent)!=null){
ClientGravityTree.getClientGravityTree(parent).start();
}
}
if(impulse.type.matches(Collidable.TYPE_CREATURE)){
// System.out.println(System.currentTimeMillis() + " creature hit!");
if(ClientGravityTree.getClientGravityTree(parent)!=null){
ClientGravityTree.getClientGravityTree(parent).start();
}
}
// if(impulse.type.matches(Collidable.TYPE_ITEM)){
// if(ClientGravityTree.getClientGravityTree(parent)!=null){
// ClientGravityTree.getClientGravityTree(parent).start();
// }
// }
// if(impulse.type.matches(Collidable.TYPE_CREATURE)){
// // System.out.println(System.currentTimeMillis() + " creature hit!");
// if(ClientGravityTree.getClientGravityTree(parent)!=null){
// ClientGravityTree.getClientGravityTree(parent).start();
// }
// }
}
//bound to world bounds
if(newPosition.x < Globals.clientWorldData.getWorldBoundMin().x){

View File

@ -25,7 +25,6 @@ import electrosphere.game.data.item.type.EquipWhitelist;
import electrosphere.logger.LoggerInterface;
import electrosphere.net.parser.net.message.InventoryMessage;
import electrosphere.net.parser.net.message.NetworkMessage;
import electrosphere.net.parser.net.message.SynchronizationMessage;
import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
import electrosphere.renderer.actor.Actor;
import electrosphere.renderer.actor.ActorMeshMask;
@ -452,20 +451,4 @@ public class ClientEquipState implements BehaviorTree {
return (ClientEquipState)entity.getData(EntityDataStrings.TREE_CLIENTEQUIPSTATE);
}
/**
* <p> Automatically generated </p>
* <p>
* Requests that the server start this btree
* </p>
*/
public void start(){
Globals.clientConnection.queueOutgoingMessage(
SynchronizationMessage.constructClientRequestBTreeActionMessage(
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
BehaviorTreeIdEnums.BTREE_CLIENTGROUNDMOVEMENTTREE_ID,
1
)
);
}
}

View File

@ -5,10 +5,10 @@ import electrosphere.entity.EntityDataStrings;
public class GravityUtils {
@Deprecated
public static void clientAttemptActivateGravity(Entity target){
if(target.containsKey(EntityDataStrings.GRAVITY_ENTITY)){
ClientGravityTree tree = ClientGravityTree.getClientGravityTree(target);
tree.start();
}
}

View File

@ -33,7 +33,7 @@ public class SynchronizationProtocol implements ServerProtocolTemplate<Synchroni
public void handleSyncMessage(ServerConnectionHandler connectionHandler, SynchronizationMessage message) {
switch(message.getMessageSubtype()){
case CLIENTREQUESTBTREEACTION:
throw new UnsupportedOperationException("Not implemented yet!");
// throw new UnsupportedOperationException("Not implemented yet!");
case UPDATECLIENTSTATE:
case UPDATECLIENTSTRINGSTATE:
case UPDATECLIENTDOUBLESTATE: