04-21-2013, 04:32 AM
i was thinking since there is no World:ForEachEntity anymore becouse of the per-chunk entity ticking maybe there could be a World:ForEachChunk and a Chunk:ForEachEntity. or would this be realy slow?
ForEachEntity
|
04-21-2013, 04:32 AM
i was thinking since there is no World:ForEachEntity anymore becouse of the per-chunk entity ticking maybe there could be a World:ForEachChunk and a Chunk:ForEachEntity. or would this be realy slow?
04-21-2013, 05:52 AM
cWorld:ForEachEntity() has been kept and should work alright. And I'm a bit skeptical about exporting chunks - usually you don't need them, you need something a bit more high-level, so why not implement the higher level function optimized? Also, with chunks, one needs to be extra careful not to break any relations between them.
04-21-2013, 05:54 AM
what is a higher level function?
04-21-2013, 06:10 AM
Usually you want to do something with the chunk, for example "make an explosion". So "MakeAnExplosion" would be a higher level function, while "GetChunk, DigBlock, SetBlock" would be the lower level functions which you could use for the same purpose. Naturally, higher level functions are easier to use, but are not so universal. They are good because usually they can be more optimized.
05-02-2013, 11:35 PM
Are mobs also counted as Entitys by ForEachEntity? becouse i spawned a bunch of mobs and then i let the server do print( i ) i = i + 1 but it only printed like 2 times.
05-02-2013, 11:55 PM
Everything should be counted, but only in the loaded chunks.
|
« Next Oldest | Next Newest »
|