mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Update the view distance before scheduling chunk loads (#5269)
This commit is contained in:
parent
3d9382e8ac
commit
ab75d99f1c
@ -309,6 +309,35 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// CraftBukkit end
|
||||
@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance {
|
||||
|
||||
class c extends ChunkMapDistance.b {
|
||||
|
||||
- private int e = 0;
|
||||
+ private int e = 0; private int getViewDistance() { return e; } private void setViewDistance(int value) { this.e = value; } // Paper - OBFHELPER
|
||||
private final Long2IntMap f = Long2IntMaps.synchronize(new Long2IntOpenHashMap());
|
||||
private final LongSet g = new LongOpenHashSet();
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance {
|
||||
|
||||
public void a(int i) {
|
||||
ObjectIterator objectiterator = this.a.long2ByteEntrySet().iterator();
|
||||
+ // Paper start - set the view distance before scheduling chunk loads/unloads
|
||||
+ int lastViewDistance = getViewDistance();
|
||||
+ setViewDistance(i);
|
||||
+ // Paper end
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
Long2ByteMap.Entry it_unimi_dsi_fastutil_longs_long2bytemap_entry = (Long2ByteMap.Entry) objectiterator.next(); // Paper - decompile fix
|
||||
byte b0 = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getByteValue();
|
||||
long j = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getLongKey();
|
||||
|
||||
- this.a(j, b0, this.c(b0), b0 <= i - 2);
|
||||
+ this.a(j, b0, b0 <= lastViewDistance - 2, this.c(b0)); // Paper
|
||||
}
|
||||
|
||||
- this.e = i;
|
||||
+ //this.e = i; // Paper - view distance is now set further up
|
||||
}
|
||||
|
||||
private void a(long i, int j, boolean flag, boolean flag1) {
|
||||
if (flag != flag1) {
|
||||
- Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, 33, new ChunkCoordIntPair(i)); // Paper - no-tick view distance
|
||||
|
Loading…
Reference in New Issue
Block a user