diff --git a/bootstrap/fabric/src/main/kotlin/kr/toxicity/hud/bootstrap/fabric/FabricBootstrapImpl.kt b/bootstrap/fabric/src/main/kotlin/kr/toxicity/hud/bootstrap/fabric/FabricBootstrapImpl.kt index 024e1c36..71e25a31 100644 --- a/bootstrap/fabric/src/main/kotlin/kr/toxicity/hud/bootstrap/fabric/FabricBootstrapImpl.kt +++ b/bootstrap/fabric/src/main/kotlin/kr/toxicity/hud/bootstrap/fabric/FabricBootstrapImpl.kt @@ -35,7 +35,6 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.server.MinecraftServer import net.minecraft.server.level.ServerLevel import net.minecraft.server.level.ServerPlayer -import net.minecraft.world.level.storage.ServerLevelData import org.slf4j.Logger import org.slf4j.LoggerFactory import java.io.File @@ -260,7 +259,7 @@ class FabricBootstrapImpl : FabricBootstrap, DedicatedServerModInitializer { } fun wrap(world: ServerLevel): WorldWrapper { - val levelName = (world.levelData as ServerLevelData).levelName + val levelName = world.dimension().location().path return WorldWrapper( levelName, createUUID(levelName) diff --git a/dist/src/main/kotlin/kr/toxicity/hud/popup/PopupLayout.kt b/dist/src/main/kotlin/kr/toxicity/hud/popup/PopupLayout.kt index ad99a0a3..8a659b26 100644 --- a/dist/src/main/kotlin/kr/toxicity/hud/popup/PopupLayout.kt +++ b/dist/src/main/kotlin/kr/toxicity/hud/popup/PopupLayout.kt @@ -191,12 +191,12 @@ class PopupLayout( pixel.opacity, textLayout.property ) - val group = ShaderGroup(textShader, textLayout.text.name, textLayout.scale, pixel.y) val imageCodepointMap = textLayout.text.imageCharWidth.map { it.value.name to it.key }.toMap() val index = ++textIndex val keys = (0.. + val group = ShaderGroup(textShader, textLayout.text.name, textLayout.scale, pixel.y + lineIndex * textLayout.lineWidth) TextManagerImpl.getKey(group) ?: run { val array = textLayout.startJson() HudImpl.createBit(textShader, pixel.y + lineIndex * textLayout.lineWidth) { y -> @@ -213,7 +213,7 @@ class PopupLayout( } } val imageMap = HashMap() - val textEncoded = "popup_${parent.name}_text_${index}".encodeKey() + val textEncoded = "popup_${parent.name}_text_${index}_${lineIndex + 1}".encodeKey() val key = createAdventureKey(textEncoded) var imageTextIndex = TEXT_IMAGE_START_CODEPOINT + textLayout.text.imageCharWidth.size textLayout.text.imageCharWidth.forEach {