1
1
#include " SimulatedPlayerHelper.h"
2
2
3
- #include " mc/deps/ecs/gamerefs_entity/EntityContext.h"
4
3
#include " mc/entity/components_json_legacy/NavigationComponent.h"
5
4
#include " mc/server/sim/LookAtIntent.h"
6
5
#include " mc/server/sim/MoveInDirectionIntent.h"
7
6
#include " mc/server/sim/MoveToPositionIntent.h"
8
- #include " mc/server/sim/MovementIntent.h"
9
7
#include " mc/server/sim/NavigateToEntityIntent.h"
10
8
#include " mc/server/sim/NavigateToPositionsIntent.h"
11
- #include " mc/server/sim/VoidMoveIntent.h"
12
9
#include " mc/server/sim/sim.h"
13
10
#include " mc/world/actor/ai/navigation/PathNavigation.h"
14
11
#include " mc/world/actor/provider/MobMovement.h"
@@ -33,7 +30,8 @@ bool SimulatedPlayerHelper::simulateRespawn(SimulatedPlayer& player) {
33
30
}
34
31
35
32
void SimulatedPlayerHelper::simulateLookAt (SimulatedPlayer& player, Actor& actor, sim::LookDuration lookType) {
36
- sim::lookAt (player, actor.getEntityContext (), lookType);
33
+ auto intent = sim::lookAt (player, actor.getEntityContext (), lookType);
34
+ memcpy ((void *)&player.mLookAtIntent , &intent, sizeof (sim::LookAtIntent));
37
35
}
38
36
39
37
void SimulatedPlayerHelper::simulateLookAt (
@@ -42,15 +40,17 @@ void SimulatedPlayerHelper::simulateLookAt(
42
40
sim::LookDuration lookType
43
41
) {
44
42
glm::vec3 vec3;
45
- vec3.x = (float )blockPos.x + 0 .5f ;
46
- vec3.y = (float )blockPos.y + 0 .5f ;
47
- vec3.z = (float )blockPos.z + 0 .5f ;
48
- sim::lookAt (player, vec3, lookType);
43
+ vec3.x = (float )blockPos.x + 0 .5f ;
44
+ vec3.y = (float )blockPos.y + 0 .5f ;
45
+ vec3.z = (float )blockPos.z + 0 .5f ;
46
+ auto intent = sim::lookAt (player, vec3, lookType);
47
+ memcpy ((void *)&player.mLookAtIntent , &intent, sizeof (sim::LookAtIntent));
49
48
}
50
49
51
50
void SimulatedPlayerHelper::simulateLookAt (SimulatedPlayer& player, Vec3 const & pos, sim::LookDuration lookType) {
52
51
glm::vec3 vec3 (pos.x , pos.y , pos.z );
53
- sim::lookAt (player, vec3, lookType);
52
+ auto intent = sim::lookAt (player, vec3, lookType);
53
+ memcpy ((void *)&player.mLookAtIntent , &intent, sizeof (sim::LookAtIntent));
54
54
}
55
55
56
56
bool SimulatedPlayerHelper::simulateUseItem (SimulatedPlayer& player, ItemStack& item) {
0 commit comments