2 Commits

Author SHA1 Message Date
Lara Jensen 00371134f8 Update README.md
build / build (push) Waiting to run
2026-05-02 20:08:35 +00:00
GetAGripGal 2661932b3f bumped to 2.0.0. Coordinates now stored as doubles
build / build (push) Waiting to run
2026-02-17 00:49:50 +01:00
4 changed files with 11 additions and 8 deletions
+2
View File
@@ -1,3 +1,4 @@
# Persistent Spawn
A very simple mod that implements the functionality of spawning a player at the same location on every join.
Written for fabric.
@@ -20,3 +21,4 @@ If you wish to throw me a dollar, this can be done through modrinth, or in crypt
### Wallets
XMR: `48E3iH61FSFMM4wvvo73LJcCgi9G2JN2J6KSXQJ2CAn8DnWufhyVUe49TXdkV9snVyaij8bgyTaaQhcCo3kcWQxMDLkkLJ7`
+1 -1
View File
@@ -5,7 +5,7 @@ minecraft_version=1.21.11
loader_version=0.18.4
loom_version=1.14-SNAPSHOT
mod_version=1.0.0
mod_version=2.0.0
maven_group=nl.getagripgal.persistentspawn
archives_base_name=persistentspawn
@@ -4,9 +4,9 @@ package nl.getagripgal.persistentspawn;
* The spawn config as stored on disk.
*/
public class PersistentSpawnConfig {
public int x;
public int y;
public int z;
public double x;
public double y;
public double z;
public String dimension;
public boolean enabled;
@@ -1,6 +1,7 @@
package nl.getagripgal.persistentspawn;
import java.io.File;
import java.io.IOException;
import com.moandjiezana.toml.Toml;
import com.moandjiezana.toml.TomlWriter;
@@ -63,15 +64,15 @@ public class PersistentSpawnManager {
public static void syncToDisk() {
try {
PersistentSpawnConfig config = new PersistentSpawnConfig();
config.x = (int) CurrentSpawn.x;
config.y = (int) CurrentSpawn.y;
config.z = (int) CurrentSpawn.z;
config.x = CurrentSpawn.x;
config.y = CurrentSpawn.y;
config.z = CurrentSpawn.z;
config.dimension = Dimension.identifier().toString();
config.enabled = Enabled;
TomlWriter writer = new TomlWriter();
writer.write(config, new File(CONFIG_FILE));
} catch (Exception e) {
} catch (IOException e) {
PersistentSpawn.LOGGER.error("Failed to save persistent spawn config to disk.", e);
}
}