diff --git a/src/main/java/net/minestom/server/instance/InstanceManager.java b/src/main/java/net/minestom/server/instance/InstanceManager.java index 9ad83600d..ccbbc9e60 100644 --- a/src/main/java/net/minestom/server/instance/InstanceManager.java +++ b/src/main/java/net/minestom/server/instance/InstanceManager.java @@ -161,11 +161,12 @@ public final class InstanceManager { * @return {@link Optional#empty()} if instance is not found */ @NotNull - public Optional getInstance(UUID uuid) { - return getInstances() - .stream() - .filter(instance -> instance.getUniqueId().equals(uuid)) - .findFirst(); + public @Nullable Instance getInstance(UUID uuid) { + Optional instance = getInstances() + .stream() + .filter(someInstance -> someInstance.getUniqueId().equals(uuid)) + .findFirst(); + return instance.orElse(null); } /**