]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - src/main/java/com/irtimaled/bbor/common/events/WorldLoaded.java
Setup for 1.14.4-Fabric
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / common / events / WorldLoaded.java
index 0315004a7faa85376f38ffa75f5978c856b0e43e..f96d4d7a7f5020a10e357cdf289de730dabe10ac 100644 (file)
@@ -1,15 +1,36 @@
 package com.irtimaled.bbor.common.events;
 
-import net.minecraft.world.WorldServer;
+import com.irtimaled.bbor.common.models.DimensionId;
+import net.minecraft.server.world.ServerWorld;
+import net.minecraft.world.level.LevelProperties;
 
 public class WorldLoaded {
-    private final WorldServer world;
+    private final DimensionId dimensionId;
+    private final long seed;
+    private final int spawnX;
+    private final int spawnZ;
 
-    public WorldLoaded(WorldServer world) {
-        this.world = world;
+    public WorldLoaded(ServerWorld world) {
+        LevelProperties info = world.getLevelProperties();
+        this.dimensionId = DimensionId.from(world.getDimension().getType());
+        this.seed = info.getSeed();
+        this.spawnX = info.getSpawnX();
+        this.spawnZ = info.getSpawnZ();
     }
 
-    public WorldServer getWorld() {
-        return world;
+    public DimensionId getDimensionId() {
+        return dimensionId;
+    }
+
+    public long getSeed() {
+        return seed;
+    }
+
+    public int getSpawnX() {
+        return spawnX;
+    }
+
+    public int getSpawnZ() {
+        return spawnZ;
     }
 }