mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Remove usage of Fastutil Object2Reference maps
These are only beneficial for containsValue checks.
This commit is contained in:
parent
2d7a463089
commit
a99afe4418
3 changed files with 6 additions and 7 deletions
|
@ -26,7 +26,6 @@ dependencies {
|
||||||
implementation("com.nukkitx.fastutil", "fastutil-int-boolean-maps", Versions.fastutilVersion)
|
implementation("com.nukkitx.fastutil", "fastutil-int-boolean-maps", Versions.fastutilVersion)
|
||||||
implementation("com.nukkitx.fastutil", "fastutil-object-int-maps", Versions.fastutilVersion)
|
implementation("com.nukkitx.fastutil", "fastutil-object-int-maps", Versions.fastutilVersion)
|
||||||
implementation("com.nukkitx.fastutil", "fastutil-object-object-maps", Versions.fastutilVersion)
|
implementation("com.nukkitx.fastutil", "fastutil-object-object-maps", Versions.fastutilVersion)
|
||||||
implementation("com.nukkitx.fastutil", "fastutil-object-reference-maps", Versions.fastutilVersion)
|
|
||||||
|
|
||||||
// Network libraries
|
// Network libraries
|
||||||
implementation("org.java-websocket", "Java-WebSocket", Versions.websocketVersion)
|
implementation("org.java-websocket", "Java-WebSocket", Versions.websocketVersion)
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.extension;
|
package org.geysermc.geyser.extension;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ReferenceMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ReferenceOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||||
import org.geysermc.geyser.api.extension.Extension;
|
import org.geysermc.geyser.api.extension.Extension;
|
||||||
import org.geysermc.geyser.api.extension.ExtensionDescription;
|
import org.geysermc.geyser.api.extension.ExtensionDescription;
|
||||||
import org.geysermc.geyser.api.extension.exception.InvalidExtensionException;
|
import org.geysermc.geyser.api.extension.exception.InvalidExtensionException;
|
||||||
|
@ -39,7 +39,7 @@ import java.nio.file.Path;
|
||||||
|
|
||||||
public class GeyserExtensionClassLoader extends URLClassLoader {
|
public class GeyserExtensionClassLoader extends URLClassLoader {
|
||||||
private final GeyserExtensionLoader loader;
|
private final GeyserExtensionLoader loader;
|
||||||
private final Object2ReferenceMap<String, Class<?>> classes = new Object2ReferenceOpenHashMap<>();
|
private final Object2ObjectMap<String, Class<?>> classes = new Object2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
public GeyserExtensionClassLoader(GeyserExtensionLoader loader, ClassLoader parent, Path path) throws MalformedURLException {
|
public GeyserExtensionClassLoader(GeyserExtensionLoader loader, ClassLoader parent, Path path) throws MalformedURLException {
|
||||||
super(new URL[] { path.toUri().toURL() }, parent);
|
super(new URL[] { path.toUri().toURL() }, parent);
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.extension;
|
package org.geysermc.geyser.extension;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ReferenceMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ReferenceOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.geysermc.api.Geyser;
|
import org.geysermc.api.Geyser;
|
||||||
|
@ -51,7 +51,7 @@ import java.util.stream.Stream;
|
||||||
public class GeyserExtensionLoader extends ExtensionLoader {
|
public class GeyserExtensionLoader extends ExtensionLoader {
|
||||||
private static final Pattern[] EXTENSION_FILTERS = new Pattern[] { Pattern.compile("^.+\\.jar$") };
|
private static final Pattern[] EXTENSION_FILTERS = new Pattern[] { Pattern.compile("^.+\\.jar$") };
|
||||||
|
|
||||||
private final Object2ReferenceMap<String, Class<?>> classes = new Object2ReferenceOpenHashMap<>();
|
private final Object2ObjectMap<String, Class<?>> classes = new Object2ObjectOpenHashMap<>();
|
||||||
private final Map<String, GeyserExtensionClassLoader> classLoaders = new HashMap<>();
|
private final Map<String, GeyserExtensionClassLoader> classLoaders = new HashMap<>();
|
||||||
private final Map<Extension, GeyserExtensionContainer> extensionContainers = new HashMap<>();
|
private final Map<Extension, GeyserExtensionContainer> extensionContainers = new HashMap<>();
|
||||||
private final Path extensionsDirectory = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("extensions");
|
private final Path extensionsDirectory = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("extensions");
|
||||||
|
|
Loading…
Reference in a new issue