Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
fa1841d6
Commit
fa1841d6
authored
Apr 03, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding lots more log statements to find behavior crash
parent
f989ee44
Pipeline
#11930
passed with stage
in 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
ChatDataManager.java
src/main/java/com/owlmaddie/ChatDataManager.java
+8
-0
EntityBehaviorManager.java
src/main/java/com/owlmaddie/goals/EntityBehaviorManager.java
+7
-1
No files found.
src/main/java/com/owlmaddie/ChatDataManager.java
View file @
fa1841d6
...
...
@@ -215,7 +215,15 @@ public class ChatDataManager {
", Argument: "
+
behavior
.
getArgument
()
:
""
));
// Apply behaviors to entity
LOGGER
.
info
(
"About to check behavior name - 1"
);
if
(
behavior
.
getName
().
equals
(
"FOLLOW"
))
{
LOGGER
.
info
(
"FOLLOW behavior detected - 2"
);
if
(
entity
!=
null
)
{
LOGGER
.
info
(
"Entity is not null - 3"
);
}
if
(
player
!=
null
)
{
LOGGER
.
info
(
"Player is not null - 4"
);
}
EntityBehaviorManager
.
addFollowPlayerGoal
(
player
,
entity
,
1.0
);
}
else
if
(
behavior
.
getName
().
equals
(
"UNFOLLOW"
))
{
EntityBehaviorManager
.
removeFollowPlayerGoal
(
entity
);
...
...
src/main/java/com/owlmaddie/goals/EntityBehaviorManager.java
View file @
fa1841d6
...
...
@@ -21,16 +21,22 @@ public class EntityBehaviorManager {
private
static
final
Map
<
UUID
,
FollowPlayerGoal
>
followGoals
=
new
HashMap
<>();
public
static
void
addFollowPlayerGoal
(
ServerPlayerEntity
player
,
MobEntity
entity
,
double
speed
)
{
LOGGER
.
info
(
"Start of addFollowPlayerGoal function - 5"
);
if
(!(
entity
.
getWorld
()
instanceof
ServerWorld
))
{
LOGGER
.
debug
(
"Attempted to add FollowPlayerGoal in a non-server world. Aborting."
);
return
;
}
UUID
entityId
=
entity
.
getUuid
();
LOGGER
.
info
(
"entity.getUuid(): "
+
entity
.
getUuid
()
+
" - 6"
);
if
(!
followGoals
.
containsKey
(
entityId
))
{
LOGGER
.
info
(
"followGoals does not contain the key yet - 7"
);
FollowPlayerGoal
goal
=
new
FollowPlayerGoal
(
player
,
entity
,
speed
);
LOGGER
.
info
(
"Created FollowPlayerGoal instance - 8"
);
GoalSelector
goalSelector
=
GoalUtils
.
getGoalSelector
(
entity
);
goalSelector
.
add
(
1
,
goal
);
// Priority 1
LOGGER
.
info
(
"Created goalSelector instance - 9"
);
goalSelector
.
add
(
1
,
goal
);
LOGGER
.
info
(
"Added goal to goalSelector - 10"
);
followGoals
.
put
(
entityId
,
goal
);
LOGGER
.
info
(
"FollowPlayerGoal added for entity UUID: {} with speed: {}"
,
entityId
,
speed
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment