Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions api/src/main/java/org/geysermc/geyser/api/GeyserApi.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* Copyright (c) 2019-2026 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,8 +25,6 @@

package org.geysermc.geyser.api;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.api.Geyser;
import org.geysermc.api.GeyserApiBase;
import org.geysermc.api.util.ApiVersion;
Expand All @@ -40,6 +38,7 @@
import org.geysermc.geyser.api.util.MinecraftVersion;
import org.geysermc.geyser.api.util.PlatformType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.Nullable;

import java.nio.file.Path;
import java.util.List;
Expand All @@ -54,26 +53,24 @@ public interface GeyserApi extends GeyserApiBase {
* {@inheritDoc}
*/
@Override
@Nullable GeyserConnection connectionByUuid(@NonNull UUID uuid);
@Nullable GeyserConnection connectionByUuid(UUID uuid);

/**
* {@inheritDoc}
*/
@Override
@Nullable GeyserConnection connectionByXuid(@NonNull String xuid);
@Nullable GeyserConnection connectionByXuid(String xuid);

/**
* {@inheritDoc}
*/
@NonNull
List<? extends GeyserConnection> onlineConnections();

/**
* Gets the {@link ExtensionManager}.
*
* @return the extension manager
*/
@NonNull
ExtensionManager extensionManager();

/**
Expand All @@ -85,16 +82,14 @@ public interface GeyserApi extends GeyserApiBase {
* @throws IllegalArgumentException if there is no provider for the specified API class
* @return the builder instance
*/
@NonNull
<R extends T, T> R provider(@NonNull Class<T> apiClass, @Nullable Object... args);
<R extends T, T> R provider(Class<T> apiClass, @Nullable Object... args);

/**
* Gets the {@link EventBus} for handling
* Geyser events.
*
* @return the event bus
*/
@NonNull
EventBus<EventRegistrar> eventBus();

/**
Expand All @@ -103,7 +98,6 @@ public interface GeyserApi extends GeyserApiBase {
*
* @return the default remote server used within Geyser
*/
@NonNull
RemoteServer defaultRemoteServer();

/**
Expand All @@ -112,63 +106,55 @@ public interface GeyserApi extends GeyserApiBase {
*
* @return the listener used for Bedrock client connectins
*/
@NonNull
BedrockListener bedrockListener();

/**
* Gets the {@link Path} to the Geyser config directory.
*
* @return the path to the Geyser config directory
*/
@NonNull
Path configDirectory();

/**
* Gets the {@link Path} to the Geyser packs directory.
*
* @return the path to the Geyser packs directory
*/
@NonNull
Path packDirectory();

/**
* Gets {@link PlatformType} the extension is running on
*
* @return type of platform
*/
@NonNull
PlatformType platformType();

/**
* Gets the version of Java Minecraft that is supported.
*
* @return the supported version of Java Minecraft
*/
@NonNull
MinecraftVersion supportedJavaVersion();

/**
* Gets a list of Bedrock Minecraft versions that are supported.
*
* @return the list of supported Bedrock Minecraft versions
*/
@NonNull
List<MinecraftVersion> supportedBedrockVersions();

/**
* Gets the {@link CommandSource} for the console.
*
* @return the console command source
*/
@NonNull
CommandSource consoleCommandSource();

/**
* Gets the current {@link GeyserApiBase} instance.
*
* @return the current geyser api instance
*/
@NonNull
static GeyserApi api() {
return Geyser.api(GeyserApi.class);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 GeyserMC. http://geysermc.org
* Copyright (c) 2019-2026 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,9 +25,8 @@

package org.geysermc.geyser.api.bedrock.camera;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.geyser.api.connection.GeyserConnection;
import org.jspecify.annotations.Nullable;

import java.util.Set;
import java.util.UUID;
Expand All @@ -46,7 +45,7 @@ public interface CameraData {
*
* @param fade the camera fade instruction to send
*/
void sendCameraFade(@NonNull CameraFade fade);
void sendCameraFade(CameraFade fade);

/**
* Sends a camera position instruction to the client.
Expand All @@ -58,7 +57,7 @@ public interface CameraData {
*
* @param position the camera position instruction to send
*/
void sendCameraPosition(@NonNull CameraPosition position);
void sendCameraPosition(CameraPosition position);

/**
* Stops all sent camera instructions (fades, movements, and perspective locks).
Expand All @@ -76,7 +75,7 @@ public interface CameraData {
*
* @param perspective the {@link CameraPerspective} to force
*/
void forceCameraPerspective(@NonNull CameraPerspective perspective);
void forceCameraPerspective(CameraPerspective perspective);

/**
* Gets the client's current {@link CameraPerspective}, if one is currently forced.
Expand All @@ -99,7 +98,7 @@ public interface CameraData {
* @param duration the time in seconds that the shake will occur for
* @param type the type of shake
*/
void shakeCamera(float intensity, float duration, @NonNull CameraShake type);
void shakeCamera(float intensity, float duration, CameraShake type);

/**
* Stops all camera shakes of any type.
Expand All @@ -125,7 +124,6 @@ public interface CameraData {
/**
* Returns an immutable copy of all fog affects currently applied to this client.
*/
@NonNull
Set<String> fogEffects();

/**
Expand All @@ -137,7 +135,7 @@ public interface CameraData {
* @param owner the owner of the lock, represented with a UUID
* @return if the camera is locked after this method call
*/
boolean lockCamera(boolean lock, @NonNull UUID owner);
boolean lockCamera(boolean lock, UUID owner);

/**
* Returns whether the client's camera is locked.
Expand All @@ -151,7 +149,7 @@ public interface CameraData {
*
* @param element the {@link GuiElement} to hide
*/
void hideElement(@NonNull GuiElement... element);
void hideElement(GuiElement... element);

/**
* Resets a {@link GuiElement} on the client's side.
Expand All @@ -162,19 +160,19 @@ public interface CameraData {
*
* @param element the {@link GuiElement} to reset
*/
void resetElement(@NonNull GuiElement @Nullable... element);
void resetElement(GuiElement @Nullable... element);

/**
* Determines whether a {@link GuiElement} is currently hidden.
*
* @param element the {@link GuiElement} to check
*/
boolean isHudElementHidden(@NonNull GuiElement element);
boolean isHudElementHidden(GuiElement element);

/**
* Returns the currently hidden {@link GuiElement}s.
*
* @return an unmodifiable view of all currently hidden {@link GuiElement}s
*/
@NonNull Set<GuiElement> hiddenElements();
Set<GuiElement> hiddenElements();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 GeyserMC. http://geysermc.org
* Copyright (c) 2019-2026 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,7 +25,6 @@

package org.geysermc.geyser.api.bedrock.camera;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.common.value.qual.IntRange;
import org.geysermc.geyser.api.GeyserApi;

Expand All @@ -44,7 +43,7 @@ public interface CameraFade {
*
* @return the color of the fade
*/
@NonNull Color color();
Color color();

/**
* Gets the seconds it takes to fade in.
Expand Down Expand Up @@ -81,7 +80,7 @@ static CameraFade.Builder builder() {

interface Builder {

Builder color(@NonNull Color color);
Builder color(Color color);

Builder fadeInSeconds(@IntRange(from = 0, to = 10) float fadeInSeconds);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 GeyserMC. http://geysermc.org
* Copyright (c) 2019-2026 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,11 +25,10 @@

package org.geysermc.geyser.api.bedrock.camera;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.common.value.qual.IntRange;
import org.cloudburstmc.math.vector.Vector3f;
import org.geysermc.geyser.api.GeyserApi;
import org.jspecify.annotations.Nullable;

/**
* This interface represents a camera position instruction. Can be built with the {@link #builder()}.
Expand All @@ -47,7 +46,7 @@ public interface CameraPosition {
*
* @return camera position vector
*/
@NonNull Vector3f position();
Vector3f position();

/**
* Gets the {@link CameraEaseType} of the camera.
Expand Down Expand Up @@ -137,7 +136,7 @@ interface Builder {

Builder easeSeconds(float easeSeconds);

Builder position(@NonNull Vector3f position);
Builder position(Vector3f position);

Builder rotationX(@IntRange(from = -90, to = 90) int rotationX);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2026 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/

@NullMarked
package org.geysermc.geyser.api.bedrock.camera;

import org.jspecify.annotations.NullMarked;
Loading
Loading