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
2ef0dfb7
Commit
2ef0dfb7
authored
Nov 05, 2023
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renaming the C2S packets for clarity, before adding the S3C packets.
parent
4d44550c
Pipeline
#11644
passed with stage
in 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
ModPackets.java
src/client/java/com/owlmaddie/ModPackets.java
+2
-2
ModInit.java
src/main/java/com/owlmaddie/ModInit.java
+4
-4
No files found.
src/client/java/com/owlmaddie/ModPackets.java
View file @
2ef0dfb7
...
@@ -16,7 +16,7 @@ public class ModPackets {
...
@@ -16,7 +16,7 @@ public class ModPackets {
buf
.
writeInt
(
entity
.
getId
());
buf
.
writeInt
(
entity
.
getId
());
// Send C2S packet
// Send C2S packet
ClientPlayNetworking
.
send
(
ModInit
.
PACKET_C
LIENT
_GREETING
,
buf
);
ClientPlayNetworking
.
send
(
ModInit
.
PACKET_C
2S
_GREETING
,
buf
);
}
}
public
static
void
sendUpdateLineNumber
(
Entity
entity
,
Integer
lineNumber
)
{
public
static
void
sendUpdateLineNumber
(
Entity
entity
,
Integer
lineNumber
)
{
...
@@ -25,7 +25,7 @@ public class ModPackets {
...
@@ -25,7 +25,7 @@ public class ModPackets {
buf
.
writeInt
(
lineNumber
);
buf
.
writeInt
(
lineNumber
);
// Send C2S packet
// Send C2S packet
ClientPlayNetworking
.
send
(
ModInit
.
PACKET_C
LIENT
_READ_NEXT
,
buf
);
ClientPlayNetworking
.
send
(
ModInit
.
PACKET_C
2S
_READ_NEXT
,
buf
);
}
}
}
}
src/main/java/com/owlmaddie/ModInit.java
View file @
2ef0dfb7
...
@@ -14,8 +14,8 @@ import org.slf4j.LoggerFactory;
...
@@ -14,8 +14,8 @@ import org.slf4j.LoggerFactory;
public
class
ModInit
implements
ModInitializer
{
public
class
ModInit
implements
ModInitializer
{
public
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
"mobgpt"
);
public
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
"mobgpt"
);
public
static
final
Identifier
PACKET_C
LIENT_GREETING
=
new
Identifier
(
"mobgpt"
,
"packet_client
_greeting"
);
public
static
final
Identifier
PACKET_C
2S_GREETING
=
new
Identifier
(
"mobgpt"
,
"packet_c2s
_greeting"
);
public
static
final
Identifier
PACKET_C
LIENT_READ_NEXT
=
new
Identifier
(
"mobgpt"
,
"packet_client
_read_next"
);
public
static
final
Identifier
PACKET_C
2S_READ_NEXT
=
new
Identifier
(
"mobgpt"
,
"packet_c2s
_read_next"
);
@Override
@Override
public
void
onInitialize
()
{
public
void
onInitialize
()
{
...
@@ -24,7 +24,7 @@ public class ModInit implements ModInitializer {
...
@@ -24,7 +24,7 @@ public class ModInit implements ModInitializer {
// Proceed with mild caution.
// Proceed with mild caution.
// Handle packet for Greeting
// Handle packet for Greeting
ServerPlayNetworking
.
registerGlobalReceiver
(
PACKET_C
LIENT
_GREETING
,
(
server
,
player
,
handler
,
buf
,
responseSender
)
->
{
ServerPlayNetworking
.
registerGlobalReceiver
(
PACKET_C
2S
_GREETING
,
(
server
,
player
,
handler
,
buf
,
responseSender
)
->
{
int
entityId
=
buf
.
readInt
();
int
entityId
=
buf
.
readInt
();
// Ensure that the task is synced with the server thread
// Ensure that the task is synced with the server thread
...
@@ -44,7 +44,7 @@ public class ModInit implements ModInitializer {
...
@@ -44,7 +44,7 @@ public class ModInit implements ModInitializer {
});
});
// Handle packet for reading lines of message
// Handle packet for reading lines of message
ServerPlayNetworking
.
registerGlobalReceiver
(
PACKET_C
LIENT
_READ_NEXT
,
(
server
,
player
,
handler
,
buf
,
responseSender
)
->
{
ServerPlayNetworking
.
registerGlobalReceiver
(
PACKET_C
2S
_READ_NEXT
,
(
server
,
player
,
handler
,
buf
,
responseSender
)
->
{
int
entityId
=
buf
.
readInt
();
int
entityId
=
buf
.
readInt
();
int
lineNumber
=
buf
.
readInt
();
int
lineNumber
=
buf
.
readInt
();
...
...
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