This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user