mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 19:35:00 -04:00
ChunkLightS2CP: simplify position retrieving
This commit is contained in:
parent
4213fe8fd9
commit
44dfa62aa3
@ -29,8 +29,10 @@ import de.bixilon.minosoft.util.logging.LogLevels
|
|||||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||||
|
|
||||||
@LoadPacket(lowPriority = true)
|
@LoadPacket(lowPriority = true)
|
||||||
class ChunkLightS2CP @JvmOverloads constructor(buffer: PlayInByteBuffer, chunkPositionGetter: () -> Vec2i = { Vec2i(buffer.readVarInt(), buffer.readVarInt()) }) : PlayS2CPacket {
|
class ChunkLightS2CP @JvmOverloads constructor(
|
||||||
val chunkPosition: Vec2i = chunkPositionGetter()
|
buffer: PlayInByteBuffer,
|
||||||
|
val chunkPosition: Vec2i = Vec2i(buffer.readVarInt(), buffer.readVarInt()),
|
||||||
|
) : PlayS2CPacket {
|
||||||
var trustEdges: Boolean = false
|
var trustEdges: Boolean = false
|
||||||
private set
|
private set
|
||||||
val chunkData: ChunkData
|
val chunkData: ChunkData
|
||||||
|
@ -149,7 +149,7 @@ class ChunkS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
|||||||
if (StaticConfiguration.IGNORE_SERVER_LIGHT) {
|
if (StaticConfiguration.IGNORE_SERVER_LIGHT) {
|
||||||
buffer.pointer = buffer.size
|
buffer.pointer = buffer.size
|
||||||
} else {
|
} else {
|
||||||
this.chunkData.replace(ChunkLightS2CP(buffer) { chunkPosition }.chunkData)
|
this.chunkData.replace(ChunkLightS2CP(buffer, chunkPosition).chunkData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user