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
c46c53e3
Commit
c46c53e3
authored
Nov 03, 2023
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added hooks for server LOAD and UNLOAD, for future data saving operations
parent
487a1d74
Pipeline
#11640
passed with stage
in 19 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
ModInit.java
src/main/java/com/owlmaddie/ModInit.java
+11
-0
No files found.
src/main/java/com/owlmaddie/ModInit.java
View file @
c46c53e3
...
@@ -4,6 +4,7 @@ import net.fabricmc.api.ModInitializer;
...
@@ -4,6 +4,7 @@ import net.fabricmc.api.ModInitializer;
import
net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking
;
import
net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking
;
import
net.minecraft.entity.Entity
;
import
net.minecraft.entity.Entity
;
import
net.minecraft.util.Identifier
;
import
net.minecraft.util.Identifier
;
import
net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -32,6 +33,15 @@ public class ModInit implements ModInitializer {
...
@@ -32,6 +33,15 @@ public class ModInit implements ModInitializer {
});
});
});
});
ServerWorldEvents
.
LOAD
.
register
((
server
,
world
)
->
{
// Load chat data...
LOGGER
.
info
(
"LOAD chat data from NBT: "
+
world
.
getRegistryKey
().
getValue
());
});
ServerWorldEvents
.
UNLOAD
.
register
((
server
,
world
)
->
{
// Save chat data...
LOGGER
.
info
(
"SAVE chat data to NBT: "
+
world
.
getRegistryKey
().
getValue
());
});
LOGGER
.
info
(
"MobGPT Initialized!"
);
LOGGER
.
info
(
"MobGPT Initialized!"
);
}
}
}
}
\ No newline at end of file
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