예제 #1
0
파일: chunk.go 프로젝트: huin/chunkymonkey
func (chunk *Chunk) removeEntity(s gamerules.INonPlayerEntity) {
	e := s.GetEntityId()
	chunk.shard.entityMgr.RemoveEntityById(e)
	delete(chunk.entities, e)
	// Tell all subscribers that the spawn's entity is destroyed.
	buf := new(bytes.Buffer)
	proto.WriteEntityDestroy(buf, e)
	chunk.reqMulticastPlayers(-1, buf.Bytes())

	chunk.storeDirty = true
}
예제 #2
0
파일: chunk.go 프로젝트: huin/chunkymonkey
// Tells the chunk to take posession of the item/mob from another chunk.
func (chunk *Chunk) transferEntity(s gamerules.INonPlayerEntity) {
	chunk.entities[s.GetEntityId()] = s
	chunk.storeDirty = true
}