mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 03:44:54 -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
|
||||
|
||||
@LoadPacket(lowPriority = true)
|
||||
class ChunkLightS2CP @JvmOverloads constructor(buffer: PlayInByteBuffer, chunkPositionGetter: () -> Vec2i = { Vec2i(buffer.readVarInt(), buffer.readVarInt()) }) : PlayS2CPacket {
|
||||
val chunkPosition: Vec2i = chunkPositionGetter()
|
||||
class ChunkLightS2CP @JvmOverloads constructor(
|
||||
buffer: PlayInByteBuffer,
|
||||
val chunkPosition: Vec2i = Vec2i(buffer.readVarInt(), buffer.readVarInt()),
|
||||
) : PlayS2CPacket {
|
||||
var trustEdges: Boolean = false
|
||||
private set
|
||||
val chunkData: ChunkData
|
||||
|
@ -149,7 +149,7 @@ class ChunkS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||
if (StaticConfiguration.IGNORE_SERVER_LIGHT) {
|
||||
buffer.pointer = buffer.size
|
||||
} else {
|
||||
this.chunkData.replace(ChunkLightS2CP(buffer) { chunkPosition }.chunkData)
|
||||
this.chunkData.replace(ChunkLightS2CP(buffer, chunkPosition).chunkData)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user