Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
remove short array used for checking if array is empty
Dieser Commit ist enthalten in:
Ursprung
d5f65eceb0
Commit
f45a727396
@ -7,13 +7,11 @@ import us.myles.ViaVersion.api.minecraft.Position;
|
|||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BlockConnectionStorage extends StoredObject {
|
public class BlockConnectionStorage extends StoredObject {
|
||||||
private Map<Long, short[]> blockStorage = createLongObjectMap();
|
private Map<Long, short[]> blockStorage = createLongObjectMap();
|
||||||
private static short[] short4096 = new short[4096];
|
|
||||||
|
|
||||||
private static Constructor<?> fastUtilLongObjectHashMap;
|
private static Constructor<?> fastUtilLongObjectHashMap;
|
||||||
|
|
||||||
@ -48,9 +46,10 @@ public class BlockConnectionStorage extends StoredObject {
|
|||||||
short[] map = blockStorage.get(pair);
|
short[] map = blockStorage.get(pair);
|
||||||
if (map == null) return;
|
if (map == null) return;
|
||||||
map[encodeBlockPos(position)] = 0;
|
map[encodeBlockPos(position)] = 0;
|
||||||
if (Arrays.equals(short4096, map)) {
|
for (short entry : map) {
|
||||||
blockStorage.remove(pair);
|
if (entry != 0) return;
|
||||||
}
|
}
|
||||||
|
blockStorage.remove(pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren