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
0
Merge Requests
0
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
9af9177b
Commit
9af9177b
authored
Dec 24, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Yet another fix for a player message regression due to all this refactoring of player data.
parent
d435b21a
Pipeline
#13206
passed with stages
in 2 minutes 9 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
ClientPackets.java
src/client/java/com/owlmaddie/network/ClientPackets.java
+2
-2
BubbleRenderer.java
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
+9
-4
ServerPackets.java
src/main/java/com/owlmaddie/network/ServerPackets.java
+1
-1
No files found.
src/client/java/com/owlmaddie/network/ClientPackets.java
View file @
9af9177b
...
...
@@ -102,7 +102,7 @@ public class ClientPackets {
// Read the data from the server packet
UUID
entityId
=
UUID
.
fromString
(
buffer
.
readString
());
UUID
playerId
=
UUID
.
fromString
(
buffer
.
readString
());
String
playerName
=
buffer
.
readString
(
32767
);
String
playerName
=
buffer
.
readString
(
32767
);
String
message
=
buffer
.
readString
(
32767
);
int
line
=
buffer
.
readInt
();
String
status_name
=
buffer
.
readString
(
32767
);
...
...
@@ -124,7 +124,7 @@ public class ClientPackets {
PlayerData
playerData
=
chatData
.
getPlayerData
(
playerName
);
playerData
.
friendship
=
friendship
;
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
USER
)
{
if
(
chatData
.
sender
==
ChatDataManager
.
ChatSender
.
USER
&&
chatData
.
status
==
ChatDataManager
.
ChatStatus
.
DISPLAY
)
{
// Add player message to queue for rendering
PlayerMessageManager
.
addMessage
(
playerId
,
playerName
,
chatData
.
currentMessage
,
ChatDataManager
.
TICKS_TO_DISPLAY_USER_MESSAGE
);
}
...
...
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
View file @
9af9177b
...
...
@@ -480,14 +480,19 @@ public class BubbleRenderer {
PlayerData
playerData
=
null
;
if
(
entity
instanceof
MobEntity
)
{
chatData
=
ChatDataManager
.
getClientInstance
().
getOrCreateChatData
(
entity
.
getUuidAsString
(),
player
.
getDisplayName
().
getString
());
if
(
chatData
!=
null
)
{
playerData
=
chatData
.
getPlayerData
(
player
.
getDisplayName
().
getString
());
}
}
else
if
(
entity
instanceof
PlayerEntity
)
{
PlayerEntity
playerEntity
=
(
PlayerEntity
)
entity
;
chatData
=
PlayerMessageManager
.
getMessage
(
entity
.
getUuid
());
if
(
chatData
!=
null
)
{
playerData
=
chatData
.
getPlayerData
(
playerEntity
.
getDisplayName
().
getString
());
}
}
// Get playerData: friendship (if any)
if
(
chatData
!=
null
)
{
playerData
=
chatData
.
getPlayerData
(
player
.
getDisplayName
().
getString
());
}
else
{
// Don't allow a null playerData
if
(
playerData
==
null
)
{
playerData
=
new
PlayerData
();
}
...
...
src/main/java/com/owlmaddie/network/ServerPackets.java
View file @
9af9177b
...
...
@@ -359,7 +359,7 @@ public class ServerPackets {
buffer
.
writeString
(
chatData
.
sender
.
toString
());
buffer
.
writeInt
(
playerData
.
friendship
);
LOGGER
.
debug
(
"Server broadcast message to client: "
+
player
.
getName
().
getString
()
+
" | Message: "
+
chatData
.
currentMessage
);
LOGGER
.
debug
(
"Server broadcast message to client: "
+
player
.
getName
().
getString
()
+
" |
Status: "
+
chatData
.
status
.
toString
()
+
" |
Message: "
+
chatData
.
currentMessage
);
ServerPlayNetworking
.
send
(
player
,
PACKET_S2C_MESSAGE
,
buffer
);
}
break
;
...
...
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