Implement dungeon breathable and gravity

This commit is contained in:
DBotThePony 2024-12-02 12:31:50 +07:00
parent 885bccb2d2
commit 45e95f7f71
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -474,9 +474,9 @@ class ServerWorld private constructor(
if (updated) {
if (breathable != null) {
LOGGER.info("Dungeon ID $id breathable set to: $breathable")
LOGGER.info("Dungeon ID $id 'breathable' set to: $breathable")
} else {
LOGGER.info("Dungeon ID $id no longer has special breathable flag")
LOGGER.info("Dungeon ID $id no longer has special 'breathable' flag")
}
broadcast(UpdateDungeonBreathablePacket(id, breathable))
@ -716,7 +716,7 @@ class ServerWorld private constructor(
var currentDungeonID = 0
// primary dungeons must be generated sequentially since they can get very large
// and to avoid dungeons colliding with each other, we must generate them first, one by one
// and to avoid dungeons colliding with each other, we must generate them one after another
for (dungeon in template.gatherDungeons()) {
var spawnDungeonRetries = Globals.worldServer.spawnDungeonRetries
@ -751,14 +751,8 @@ class ServerWorld private constructor(
protectedDungeonIDsInternal.add(currentDungeonID)
}
if (dungeon.dungeon.value.metadata.gravity != null) {
// TODO: set gravity here
}
if (dungeon.dungeon.value.metadata.breathable != null) {
// TODO: set "breathable" here
}
dungeon.dungeon.value.metadata.gravity?.map({ setDungeonGravity(currentDungeonID, it) }, { setDungeonGravity(currentDungeonID, it) })
setDungeonBreathable(currentDungeonID, dungeon.dungeon.value.metadata.breathable)
currentDungeonID++
break
}