mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 19:28:03 +01:00
Maps shouldn't load chunks
Previously maps would load all chunks in a certain radius depending on their scale when trying to update their content. This would result in main thread chunk loads when they weren't really necessary, especially on low view distances or "slow" async chunk loads after teleports or other prioritisation. This changes it to only try to render already loaded chunks based on the assumption that the chunks around the player will get loaded eventually anyways and that maps will get checked for update every five ticks that movement occur in anyways.
This commit is contained in:
parent
2898b4a7eb
commit
1631c7e251
1 changed files with 13 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
|||
--- a/net/minecraft/world/item/MapItem.java
|
||||
+++ b/net/minecraft/world/item/MapItem.java
|
||||
@@ -97,8 +97,8 @@
|
||||
int r = (j / i + o - 64) * i;
|
||||
int s = (k / i + p - 64) * i;
|
||||
Multiset<MapColor> multiset = LinkedHashMultiset.create();
|
||||
- LevelChunk levelChunk = world.getChunk(SectionPos.blockToSectionCoord(r), SectionPos.blockToSectionCoord(s));
|
||||
- if (!levelChunk.isEmpty()) {
|
||||
+ LevelChunk levelChunk = world.getChunkIfLoaded(SectionPos.blockToSectionCoord(r), SectionPos.blockToSectionCoord(s)); // Paper - Maps shouldn't load chunks
|
||||
+ if (levelChunk != null && !levelChunk.isEmpty()) { // Paper - Maps shouldn't load chunks
|
||||
int t = 0;
|
||||
double e = 0.0;
|
||||
if (world.dimensionType().hasCeiling()) {
|
Loading…
Add table
Reference in a new issue