mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Project wide syntax/annotation cleanup (#4238)
Co-authored-by: Konicai <71294714+Konicai@users.noreply.github.com>
This commit is contained in:
parent
998caee156
commit
95d65350e4
270 changed files with 891 additions and 977 deletions
|
@ -77,6 +77,7 @@ public interface GeyserApi extends GeyserApiBase {
|
|||
* @param apiClass the builder class
|
||||
* @param <R> the implementation type
|
||||
* @param <T> the API type
|
||||
* @throws IllegalArgumentException if there is no provider for the specified API class
|
||||
* @return the builder instance
|
||||
*/
|
||||
@NonNull
|
||||
|
|
|
@ -27,5 +27,5 @@ package org.geysermc.geyser.api.bedrock.camera;
|
|||
|
||||
public enum CameraShake {
|
||||
POSITIONAL,
|
||||
ROTATIONAL;
|
||||
ROTATIONAL
|
||||
}
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
|
||||
package org.geysermc.geyser.api.block.custom.component;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* This class is used to store conditions for a placement filter for a custom block.
|
||||
*
|
||||
|
@ -43,7 +43,7 @@ public record PlacementConditions(@NonNull Set<Face> allowedFaces, @NonNull Link
|
|||
NORTH,
|
||||
SOUTH,
|
||||
WEST,
|
||||
EAST;
|
||||
EAST
|
||||
}
|
||||
|
||||
public enum BlockFilterType {
|
||||
|
|
|
@ -39,7 +39,7 @@ public interface JavaBlockState {
|
|||
*
|
||||
* @return whether the block state is waterlogged
|
||||
*/
|
||||
@NonNull boolean waterlogged();
|
||||
boolean waterlogged();
|
||||
|
||||
/**
|
||||
* Gets the collision of the block state
|
||||
|
@ -53,7 +53,7 @@ public interface JavaBlockState {
|
|||
*
|
||||
* @return whether the block state can be broken with hand
|
||||
*/
|
||||
@NonNull boolean canBreakWithHand();
|
||||
boolean canBreakWithHand();
|
||||
|
||||
/**
|
||||
* Gets the pick item of the block state
|
||||
|
@ -74,7 +74,7 @@ public interface JavaBlockState {
|
|||
*
|
||||
* @return whether the block state has block entity
|
||||
*/
|
||||
@Nullable boolean hasBlockEntity();
|
||||
boolean hasBlockEntity();
|
||||
|
||||
/**
|
||||
* Creates a new {@link JavaBlockState.Builder} instance
|
||||
|
@ -94,17 +94,17 @@ public interface JavaBlockState {
|
|||
|
||||
Builder blockHardness(@NonNegative float blockHardness);
|
||||
|
||||
Builder waterlogged(@NonNull boolean waterlogged);
|
||||
Builder waterlogged(boolean waterlogged);
|
||||
|
||||
Builder collision(@NonNull JavaBoundingBox[] collision);
|
||||
|
||||
Builder canBreakWithHand(@NonNull boolean canBreakWithHand);
|
||||
Builder canBreakWithHand(boolean canBreakWithHand);
|
||||
|
||||
Builder pickItem(@Nullable String pickItem);
|
||||
|
||||
Builder pistonBehavior(@Nullable String pistonBehavior);
|
||||
|
||||
Builder hasBlockEntity(@Nullable boolean hasBlockEntity);
|
||||
Builder hasBlockEntity(boolean hasBlockEntity);
|
||||
|
||||
JavaBlockState build();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
package org.geysermc.geyser.api.block.custom.nonvanilla;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public record JavaBoundingBox(@NonNull double middleX, @NonNull double middleY, @NonNull double middleZ, @NonNull double sizeX, @NonNull double sizeY, @NonNull double sizeZ) {
|
||||
public record JavaBoundingBox(double middleX, double middleY, double middleZ, double sizeX, double sizeY, double sizeZ) {
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ package org.geysermc.geyser.api.event;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.geysermc.event.Event;
|
||||
import org.geysermc.event.bus.OwnedEventBus;
|
||||
import org.geysermc.geyser.api.extension.Extension;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ package org.geysermc.geyser.api.event;
|
|||
|
||||
import org.geysermc.event.Event;
|
||||
import org.geysermc.event.subscribe.OwnedSubscriber;
|
||||
import org.geysermc.geyser.api.extension.Extension;
|
||||
|
||||
/**
|
||||
* Represents a subscribed listener to a {@link Event}. Wraps around
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.net.InetSocketAddress;
|
|||
|
||||
/**
|
||||
* Called whenever Geyser gets pinged
|
||||
*
|
||||
* <p>
|
||||
* This event allows you to modify/obtain the MOTD, maximum player count, and current number of players online,
|
||||
* Geyser will reply to the client with what was given.
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* Called when commands are defined within Geyser.
|
||||
*
|
||||
* <p>
|
||||
* This event allows you to register new commands using the {@link #register(Command)}
|
||||
* method and retrieve the default commands defined.
|
||||
*/
|
||||
|
|
|
@ -28,13 +28,12 @@ package org.geysermc.geyser.api.event.lifecycle;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.geysermc.geyser.api.block.custom.CustomBlockData;
|
||||
import org.geysermc.geyser.api.block.custom.CustomBlockState;
|
||||
import org.geysermc.geyser.api.block.custom.nonvanilla.JavaBlockItem;
|
||||
import org.geysermc.geyser.api.block.custom.nonvanilla.JavaBlockState;
|
||||
import org.geysermc.event.Event;
|
||||
|
||||
/**
|
||||
* Called on Geyser's startup when looking for custom blocks. Custom blocks must be registered through this event.
|
||||
*
|
||||
* <p>
|
||||
* This event will not be called if the "add-non-bedrock-items" setting is disabled in the Geyser config.
|
||||
*/
|
||||
public abstract class GeyserDefineCustomBlocksEvent implements Event {
|
||||
|
@ -48,8 +47,8 @@ public abstract class GeyserDefineCustomBlocksEvent implements Event {
|
|||
/**
|
||||
* Registers the given {@link CustomBlockState} as an override for the
|
||||
* given java state identifier
|
||||
* Java state identifiers are listed in
|
||||
* https://raw.githubusercontent.com/GeyserMC/mappings/master/blocks.json
|
||||
* Java state identifiers are listed
|
||||
* <a href="https://raw.githubusercontent.com/GeyserMC/mappings/master/blocks.json">here</a>
|
||||
*
|
||||
* @param javaIdentifier the java state identifier to override
|
||||
* @param customBlockState the custom block state with which to override java state identifier
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* Called on Geyser's startup when looking for custom items. Custom items must be registered through this event.
|
||||
*
|
||||
* <p>
|
||||
* This event will not be called if the "add non-Bedrock items" setting is disabled in the Geyser config.
|
||||
*/
|
||||
public interface GeyserDefineCustomItemsEvent extends Event {
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.geysermc.event.Event;
|
|||
|
||||
/**
|
||||
* Called on Geyser's startup when looking for custom skulls. Custom skulls must be registered through this event.
|
||||
*
|
||||
* <p>
|
||||
* This event will not be called if the "add-non-bedrock-items" setting is disabled in the Geyser config.
|
||||
*/
|
||||
public abstract class GeyserDefineCustomSkullsEvent implements Event {
|
||||
|
|
|
@ -25,10 +25,16 @@
|
|||
|
||||
package org.geysermc.geyser.api.extension.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Thrown when an extension's description is invalid.
|
||||
*/
|
||||
public class InvalidDescriptionException extends Exception {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public InvalidDescriptionException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
|
|
@ -25,10 +25,16 @@
|
|||
|
||||
package org.geysermc.geyser.api.extension.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Thrown when an extension is invalid.
|
||||
*/
|
||||
public class InvalidExtensionException extends Exception {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public InvalidExtensionException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public enum CreativeCategory {
|
|||
*
|
||||
* @return the name of the category
|
||||
*/
|
||||
@NonNull public String internalName() {
|
||||
public @NonNull String internalName() {
|
||||
return internalName;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
|||
|
||||
/**
|
||||
* This is a way to represent a boolean, but with a non set value added.
|
||||
* This class was inspired by adventure's version https://github.com/KyoriPowered/adventure/blob/main/4/api/src/main/java/net/kyori/adventure/util/TriState.java
|
||||
* This class was inspired by adventure's <a href="https://github.com/KyoriPowered/adventure/blob/main/4/api/src/main/java/net/kyori/adventure/util/TriState.java">TriState</a>
|
||||
*/
|
||||
public enum TriState {
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue