summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ChunkProviderServer.java
Commit message (Collapse)AuthorAgeLines
* Update to Minecraft 1.8Thinkofdeath2014-11-28-399/+0
| | | | For more information please see http://www.spigotmc.org/
* Update CraftBukkit to Minecraft 1.7.10Travis Watkins2014-07-08-3/+3
|
* Avoid checking for loaded chunks for lighting and entity ticking.Travis Watkins2014-06-21-2/+36
| | | | | | | | | | | | | | When a chunk is loaded the server tries to ensure it has its initial light calculations done before sending it to the player. When ticking entities the server tries to ensure the entity does not walk into an unloaded chunk. To accomplish these the server checks a one chunk radius around the chunk to be lit or a two chunk radius around the chunk the entity is in. These lookups happen every tick even though their result is unlikely to change that often. To reduce the cost of these checks we replace them with a system to keep track of what neighbor chunks a chunk has loaded and update it when chunks load or unload which is a much less frequent action. On a server with ten players this change removes about 100,000 calls a tick to LongObjectHashMap's containsKey method.
* Update CraftBukkit to Minecraft 1.7.8Travis Watkins2014-04-11-4/+8
|
* Update CraftBukkit to Minecraft 1.7.5Nate Mortensen2014-03-21-3/+11
|
* Load all already generated chunks via async chunk systemTravis Watkins2014-02-01-13/+25
| | | | | | | | | | | | | Currently we use the async chunk loading system only when players trigger chunk loading. If a chunk is loaded for any other reason it goes through a separate codepath. This means if a player has trigged a chunk load and before the chunk loads something else wants the same chunk we will load it twice and throw away the second result. With this change we instead use the sync processing feature of the AsynchronousExecutor to load the chunk which will pull it out of the queue if it was already queued to load. This means we only ever load a chunk once. Because chunk generation is not thread safe we still fallback to the vanilla chunk loading system if the chunk does not currently exist.
* Remove references to chunklist. Fixes BUKKIT-5190frymaster2013-12-17-3/+0
| | | | | | | | | | Commit c576054539790bdeb35285f62863d74b48c0782d removed the chunklist collection stored in ChunkProviderServer, however it has been partially restored in some places by 7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2. As not all references to this were restored, this has caused the chunklist and chunks collections to become out of sync, resulting in a memory leak. This commit removes chunklist from ChunkProviderServer again.
* [Bleeding] Ignore Block Physics in Chunk population. Fixes BUKKIT-4923t00thpick12013-12-08-2/+7
| | | | | | Suppressing physics updates during Chunk population prevents infinite recursion due to custom Block Populators editing border blocks on chunks.
* Update CraftBukkit to Minecraft 1.7.2mbax2013-11-30-41/+48
|
* Update CraftBukkit to Minecraft 1.5.2Travis Watkins2013-04-27-6/+4
|
* Cleanup comments, formatting, etcTravis Watkins2013-03-25-5/+4
|
* Update CraftBukkit to Minecraft 1.5Travis Watkins2013-03-15-2/+2
|
* Load chunks asynchronously for players.Travis Watkins2012-12-12-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a player triggers a chunk load via walking around or teleporting there is no need to stop everything and get this chunk on the main thread. The client is used to having to wait some time for this chunk and the server doesn't immediately do anything with it except send it to the player. At the same time chunk loading is the last major source of file IO that still runs on the main thread. These two facts make it possible to offload chunks loaded for this reason to another thread. However, not all parts of chunk loading can happen off the main thread. For this we use the new AsynchronousExecutor system to split chunk loading in to three pieces. The first is loading data from disk, decompressing it, and parsing it in to an NBT structure. The second piece is creating entities and tile entities in the chunk and adding them to the world, this is still done on the main thread. The third piece is informing everyone who requested a chunk load that the load is finished. For this we register callbacks and then run them on the main thread once the previous two stages are finished. There are still cases where a chunk is needed immediately and these will still trigger chunk loading entirely on the main thread. The most obvious case is plugins using the API to request a chunk load. We also must load the chunk immediately when something in the world tries to access it. In these cases we ignore any possibly pending or in progress chunk loading that is happening asynchronously as we will have the chunk loaded by the time they are finished. The hope is that overall this system will result in less CPU time and pauses due to blocking file IO on the main thread thus giving more consistent performance. Testing so far has shown that this also speeds up chunk loading client side although some of this is likely to be because we are sending less chunks at once for the client to process. Thanks for @ammaraskar for help with the implementation of this feature.
* Update CraftBukkit to Minecraft 1.4.4.Travis Watkins2012-11-13-2/+14
|
* Update CraftBukkit to Minecraft 1.4(.2).Travis Watkins2012-10-27-1/+6
|
* Replace LongObjectHashMap with a more efficient implementationTravis Watkins2012-09-21-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | After further testing it appears that while the original LongHashtable has issues with object creation churn and is severly slower than even java.util.HashMap in general case benchmarks it is in fact very efficient for our use case. With this in mind I wrote a replacement LongObjectHashMap modeled after LongHashtable. Unlike the original implementation this one does not use Entry objects for storage so does not have the same object creation churn. It also uses a 2D array instead of a 3D one and does not use a cache as benchmarking shows this is more efficient. The "bucket size" was chosen based on benchmarking performance of the HashMap with contents that would be plausible for a 200+ player server. This means it uses a little extra memory for smaller servers but almost always uses less than the normal java.util.HashMap. To make up for the original LongHashtable being a poor choice for generic datasets I added a mixer to the new implementation based on code from MurmurHash. While this has no noticable effect positive or negative with our normal use of chunk coordinates it makes the HashMap perform just as well with nearly any kind of dataset. After these changes ChunkProviderServer.isChunkLoaded() goes from using 20% CPU time while sampling to not even showing up after 45 minutes of sampling due to the CPU usage being too low to be noticed.
* [Bleeding] Remove redundant chunkList from ChunkProviderServerMike Primm2012-08-19-5/+2
| | | | | | This ArrayList duplicates part of the functionality of the much more efficient chunk map so can be removed as the map can be used in the few places this was needed.
* Add LongObjectHashMap and LongHashSetTravis Watkins2012-08-19-4/+4
| | | | | | | | | | | | | | | Replace uses of LongHashtable and LongHashset with new implementations. Remove EntryBase, LongBaseHashtable, LongHashset, and LongHashtable as they are no longer used. LongObjectHashMap does not use Entry or EntryBase classes internally for storage so has much lower object churn and greater performance. LongHashSet is not as much of performance win for our use case but for general use is up to seventeen times faster than the old implementation and is in fact faster than alternatives from "high performance" java libraries. This is being added so that if someone tries to use it in the future in a place unrelated to its current use they don't accidentally end up with something slower than the Java collections HashSet implementation.
* Fix issues with chunk saving. Fixes BUKKIT-2158, BUKKIT-2018 and BUKKIT-2229Mike Primm2012-08-19-4/+18
|
* Don't force chunks to load again, causes chunk leaks with multiworld.Travis Watkins2012-08-06-1/+1
|
* Don't tick chunks or entities on chunks that are queued for unload.Travis Watkins2012-08-04-2/+2
| | | | | Treat chunks in the unload queue as if they are already unloaded to prevent processing on them removing them from the unload queue and leaking.
* Potentially fix chunk leaking, needs further examinationfeildmaster2012-08-04-1/+1
|
* Update CraftBukkit to Minecraft 1.3.1feildmaster2012-08-02-7/+16
|
* Cleaned up CraftBukkit comments in NMS.Wesley Wolfe2012-07-23-9/+7
| | | | | | | | | | | | | Added newlines at the end of files Fixed improper line endings on some files Matched start - end comments Added some missing comments for diffs Fixed syntax on some spots Minimized some diff Removed some no longer used files Added comment on some required files with no changes Fixed imports of items used once Added imports for items used more than once
* Remove legacy Chunk cache. Fixes BUKKIT-1400feildmaster2012-04-24-2/+0
|
* Updated CraftBukkit to 1.2Nathan Adams2012-03-01-7/+7
|
* Updated to Minecraft 1.1Erik Broes2012-01-12-0/+15
|
* Update to mc-dev rename revision 01Nathan Adams2012-01-12-4/+4
|
* Update for 1.0.0Erik Broes2011-11-20-11/+19
|
* Update to mcdev rename revision 01 for 1.8.1Dinnerbone2011-09-24-2/+2
|
* Invalid position errors for chunks now display what world they're forDinnerbone2011-09-17-2/+2
|
* Bunchafixes which may or may not have any end resultDinnerbone2011-09-16-1/+5
|
* Update for Minecraft 1.8Dinnerbone2011-09-15-21/+5
|
* Implemented per world setting to keep the spawn in memory or not.Rigby2011-08-05-1/+1
|
* Massive renaming update in nms. If you bypassed Bukkit, you will likely break.Erik Broes2011-06-27-16/+13
| | | | Also minimized all the nms diffs and generic cleanups all around.
* Implemented ChunkPopulateEventDinnerbone2011-06-16-1/+6
|
* Fixed random NPEs when generating a worldDinnerbone2011-06-11-2/+6
|
* Generic cleanupErik Broes2011-06-12-4/+4
|
* Implemented custom chunk generators and block populatorsDinnerbone2011-06-06-0/+16
|
* Implemented 1.6!Dinnerbone2011-05-26-15/+16
|
* Whitespace + general cleanupErik Broes2011-05-15-5/+5
|
* Update for 1.5_02.Erik Broes2011-04-21-2/+2
|
* Update for 1.4_00_01 -- if you bypassed Bukkit, you will most likely break.Erik Broes2011-04-20-84/+82
|
* Updated to Minecraft version 1.4Dinnerbone2011-03-31-16/+24
|
* Updated for the cleanups done in BukkitErik Broes2011-03-26-3/+2
|
* Fixing event namesErik Broes2011-03-21-2/+2
|
* Code cleanup, fixed doors, chunk entity fetchingTahg2011-03-11-2/+2
|
* Regenerate and refresh chunk methodsRaphfrk2011-03-07-2/+2
|
* limit chunk unloading to 50 per ticktahg2011-03-02-1/+1
|
* Synchronized and moved Hash classesFrozenCow2011-03-01-0/+2
|