Skip to content

Commit 94308ee

Browse files
committed
firstSessionSpawnPoint merged to onServerStarting.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent f9cd7cd commit 94308ee

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/spawn/ModuleObject.kt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ class ModuleObject : IModule {
5656

5757
@SubscribeEvent
5858
fun onServerStarting(event: FMLServerStartingEvent) {
59-
firstSessionSpawnPoint(event)
59+
if (firstLaunch) {
60+
val world = event.server.getWorld(DimensionType.OVERWORLD)
61+
spawnConfiguration.take().xPos = world.spawnPoint.x
62+
spawnConfiguration.take().yPos = world.spawnPoint.y
63+
spawnConfiguration.take().zPos = world.spawnPoint.z
64+
}
6065
}
6166

6267
@SubscribeEvent(priority = EventPriority.HIGHEST)
@@ -78,15 +83,6 @@ class ModuleObject : IModule {
7883
}
7984
}
8085

81-
private fun firstSessionSpawnPoint(event: FMLServerStartingEvent) {
82-
if (firstLaunch) {
83-
val world = event.server.getWorld(DimensionType.OVERWORLD)
84-
spawnConfiguration.take().xPos = world.spawnPoint.x
85-
spawnConfiguration.take().yPos = world.spawnPoint.y
86-
spawnConfiguration.take().zPos = world.spawnPoint.z
87-
}
88-
}
89-
9086
private fun sendLocalizationRequest() {
9187
InterModComms.sendTo(
9288
"project_essentials_core",

0 commit comments

Comments
 (0)