aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/gui/entity/FakeWorld.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/gui/entity/FakeWorld.kt')
-rw-r--r--src/main/kotlin/gui/entity/FakeWorld.kt13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/kotlin/gui/entity/FakeWorld.kt b/src/main/kotlin/gui/entity/FakeWorld.kt
index c17f2ad..7ec385c 100644
--- a/src/main/kotlin/gui/entity/FakeWorld.kt
+++ b/src/main/kotlin/gui/entity/FakeWorld.kt
@@ -5,6 +5,7 @@ import java.util.function.BooleanSupplier
import java.util.function.Consumer
import net.minecraft.block.Block
import net.minecraft.block.BlockState
+import net.minecraft.client.gui.screen.world.SelectWorldScreen
import net.minecraft.component.type.MapIdComponent
import net.minecraft.entity.Entity
import net.minecraft.entity.damage.DamageSource
@@ -22,10 +23,15 @@ import net.minecraft.registry.DynamicRegistryManager
import net.minecraft.registry.Registries
import net.minecraft.registry.RegistryKey
import net.minecraft.registry.RegistryKeys
+import net.minecraft.registry.ServerDynamicRegistryType
import net.minecraft.registry.entry.RegistryEntry
+import net.minecraft.resource.DataConfiguration
+import net.minecraft.resource.ResourcePackManager
import net.minecraft.resource.featuretoggle.FeatureFlags
import net.minecraft.resource.featuretoggle.FeatureSet
import net.minecraft.scoreboard.Scoreboard
+import net.minecraft.server.SaveLoading
+import net.minecraft.server.command.CommandManager
import net.minecraft.sound.SoundCategory
import net.minecraft.sound.SoundEvent
import net.minecraft.util.Identifier
@@ -53,8 +59,10 @@ import net.minecraft.world.explosion.ExplosionBehavior
import net.minecraft.world.tick.OrderedTick
import net.minecraft.world.tick.QueryableTickScheduler
import net.minecraft.world.tick.TickManager
+import moe.nea.firmament.util.MC
fun createDynamicRegistry(): DynamicRegistryManager.Immutable {
+ // TODO: use SaveLoading.load() to properly load a full registry
return DynamicRegistryManager.of(Registries.REGISTRIES)
}
@@ -64,9 +72,8 @@ class FakeWorld(
Properties,
RegistryKey.of(RegistryKeys.WORLD, Identifier.of("firmament", "fakeworld")),
registries,
- registries.getOrThrow(RegistryKeys.DIMENSION_TYPE).getEntry(
- Identifier.of("minecraft", "overworld")
- ).get(),
+ MC.defaultRegistries.getOrThrow(RegistryKeys.DIMENSION_TYPE)
+ .getOrThrow(RegistryKey.of(RegistryKeys.DIMENSION_TYPE, Identifier.of("minecraft", "overworld"))),
true,
false,
0L,