Fix issue with 0,0 chunks causing crash

This commit is contained in:
Aikar 2020-04-09 23:02:05 -04:00
parent bc8fafb206
commit 23ee0a8a88
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
1 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
From ae2e2e396fefd177b43f3c44db54bceafaf07eb1 Mon Sep 17 00:00:00 2001
From e245683a13582175b68dbfa9babb6bef2b3d2fd5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 9 Apr 2020 00:09:26 -0400
Subject: [PATCH] Speed up processing of chunk loads and generation
@ -46,10 +46,10 @@ index 69e26a8267..434833d50e 100644
public static final Timing connectionTimer = Timings.ofSafe("Connection Handler");
diff --git a/src/main/java/com/destroystokyo/paper/util/map/Long2ObjectLinkedOpenHashMapFastCopy.java b/src/main/java/com/destroystokyo/paper/util/map/Long2ObjectLinkedOpenHashMapFastCopy.java
new file mode 100644
index 0000000000..99e2041bd9
index 0000000000..e0ad725b2e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/map/Long2ObjectLinkedOpenHashMapFastCopy.java
@@ -0,0 +1,34 @@
@@ -0,0 +1,32 @@
+package com.destroystokyo.paper.util.map;
+
+import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
@ -79,9 +79,7 @@ index 0000000000..99e2041bd9
+ this.last = map.last;
+ this.n = map.n;
+ this.maxFill = map.maxFill;
+ if (map.containsKey(null)) {
+ this.put(null, map.get(null));
+ }
+ this.containsNullKey = map.containsNullKey;
+ }
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java