This function does not update the block for the players, so it should not be used. All of the position values should be absolute (aka (chunkPos<<4)+pos
(x, y, z int32, be BlockEntity)
| 131 | |
| 132 | // This function does not update the block for the players, so it should not be used. All of the position values should be absolute (aka (chunkPos<<4)+pos |
| 133 | func (chunk *Chunk) SetBlockEntity(x, y, z int32, be BlockEntity) { |
| 134 | //c.LastModified = time.Now().UnixMilli() |
| 135 | var index int = -1 |
| 136 | be.X, be.Y, be.Z = x, y, z |
| 137 | for i, entity := range chunk.BlockEntities { |
| 138 | if entity.X == x && entity.Y == y && entity.Z == z { |
| 139 | index = i |
| 140 | break |
| 141 | } |
| 142 | } |
| 143 | if index == -1 { |
| 144 | chunk.BlockEntities = append(chunk.BlockEntities, be) |
| 145 | return |
| 146 | } |
| 147 | chunk.BlockEntities[index] = be |
| 148 | } |
nothing calls this directly
no outgoing calls
no test coverage detected