Entity.description

This commit is contained in:
DBotThePony 2024-03-28 13:17:01 +07:00
parent 7973724193
commit b8a8e79819
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 4 additions and 3 deletions

View File

@ -88,6 +88,8 @@ abstract class AbstractEntity(path: String) : JsonDriven(path) {
var uniqueID: String? = null var uniqueID: String? = null
protected set protected set
var description = ""
/** /**
* Whenever this entity should be removed when chunk containing it is being unloaded * Whenever this entity should be removed when chunk containing it is being unloaded
* *

View File

@ -49,10 +49,9 @@ class PlayerEntity() : HumanoidActorEntity("/") {
constructor(data: DataInputStream, isLegacy: Boolean) : this() { constructor(data: DataInputStream, isLegacy: Boolean) : this() {
uniqueID = data.readInternedString() uniqueID = data.readInternedString()
println(data.readInternedString()) description = data.readInternedString()
gamemode = PlayerGamemode.entries[if (isLegacy) data.readInt() else data.readUnsignedByte()] gamemode = PlayerGamemode.entries[if (isLegacy) data.readInt() else data.readUnsignedByte()]
humanoidData = HumanoidData.read(data, isLegacy) humanoidData = HumanoidData.read(data, isLegacy)
println(humanoidData)
} }
override val type: EntityType override val type: EntityType
@ -62,7 +61,7 @@ class PlayerEntity() : HumanoidActorEntity("/") {
override fun writeNetwork(stream: DataOutputStream, isLegacy: Boolean) { override fun writeNetwork(stream: DataOutputStream, isLegacy: Boolean) {
stream.writeBinaryString(uniqueID!!) stream.writeBinaryString(uniqueID!!)
stream.writeBinaryString("") stream.writeBinaryString(description)
if (isLegacy) stream.writeInt(gamemode.ordinal) else stream.writeByte(gamemode.ordinal) if (isLegacy) stream.writeInt(gamemode.ordinal) else stream.writeByte(gamemode.ordinal)
humanoidData.write(stream, isLegacy) humanoidData.write(stream, isLegacy)
} }