update to fix accidentally pushed broken code

This commit is contained in:
olebeck 2023-05-26 17:23:12 +02:00
parent a18548ffc2
commit fd02dd5d16
4 changed files with 18 additions and 9 deletions

2
go.mod
View File

@ -6,7 +6,7 @@ go 1.20
replace github.com/sandertv/gophertunnel => github.com/olebeck/gophertunnel v1.29.0-1
//replace github.com/df-mc/dragonfly => ./dragonfly
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.9.4-13
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.9.4-14
//replace gioui.org => ./gio
replace gioui.org => github.com/olebeck/gio v0.0.0-20230427194143-c9c9d8bc704d

View File

@ -39,7 +39,7 @@ func (s *secondaryUser) processLevelChunk(pk *packet.LevelChunk) {
subChunkCount = int(pk.SubChunkCount)
}
ch, blockNBTs, err := chunk.NetworkDecode(world.AirRID(), pk.RawPayload, subChunkCount, s.dimension.Range(), s.ispre118, s.hasCustomBlocks)
ch, blockNBTs, err := chunk.NetworkDecode(world.AirRID(), pk.RawPayload, subChunkCount, s.ispre118, s.dimension.Range())
if err != nil {
logrus.Error(err)
return

View File

@ -37,7 +37,7 @@ func (w *worldsHandler) processLevelChunk(pk *packet.LevelChunk) {
subChunkCount = int(pk.SubChunkCount)
}
ch, blockNBTs, err := chunk.NetworkDecode(world.AirRID(), pk.RawPayload, subChunkCount, w.worldState.dimension.Range(), w.serverState.ispre118, w.bp.HasBlocks())
ch, blockNBTs, err := chunk.NetworkDecode(world.AirRID(), pk.RawPayload, subChunkCount, w.serverState.ispre118, w.worldState.dimension.Range())
if err != nil {
logrus.Error(err)
return

View File

@ -205,14 +205,23 @@ func (s *entityState) ToServerEntity() serverEntity {
}
entityMetadataToNBT(s.Metadata, e.EntityType.NBT)
if s.Helmet != nil || s.Chestplate != nil || s.Leggings != nil || s.Boots != nil {
e.EntityType.NBT["Armor"] = []map[string]any{
nbtconv.WriteItem(stackToItem(s.Helmet.Stack), true),
nbtconv.WriteItem(stackToItem(s.Chestplate.Stack), true),
nbtconv.WriteItem(stackToItem(s.Leggings.Stack), true),
nbtconv.WriteItem(stackToItem(s.Boots.Stack), true),
if false {
armor := make([]map[string]any, 4)
if s.Helmet != nil {
armor[0] = nbtconv.WriteItem(stackToItem(s.Helmet.Stack), true)
}
if s.Chestplate != nil {
armor[1] = nbtconv.WriteItem(stackToItem(s.Chestplate.Stack), true)
}
if s.Leggings != nil {
armor[2] = nbtconv.WriteItem(stackToItem(s.Leggings.Stack), true)
}
if s.Boots != nil {
armor[3] = nbtconv.WriteItem(stackToItem(s.Boots.Stack), true)
}
e.EntityType.NBT["Armor"] = armor
}
return e
}