mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-23 00:39:19 +00:00
Minor cleanup
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
package org.geysermc.geyser.api.entity.data;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.geysermc.geyser.api.GeyserApi;
|
||||
import org.geysermc.geyser.api.entity.type.GeyserEntity;
|
||||
|
||||
@@ -46,7 +47,7 @@ public interface GeyserEntityDataType<T> {
|
||||
*
|
||||
* @return the class of the value used by this entity data type
|
||||
*/
|
||||
Class<T> typeClass();
|
||||
@NonNull Class<T> typeClass();
|
||||
|
||||
/**
|
||||
* Gets the unique name of this data type.
|
||||
@@ -56,12 +57,12 @@ public interface GeyserEntityDataType<T> {
|
||||
*
|
||||
* @return the name of this entity data type
|
||||
*/
|
||||
String name();
|
||||
@NonNull String name();
|
||||
|
||||
/**
|
||||
* For API usage only; use the types defined in {@link GeyserEntityDataTypes}
|
||||
*/
|
||||
static <T> GeyserEntityDataType<T> of(Class<T> typeClass, String name) {
|
||||
static <T> GeyserEntityDataType<T> of(@NonNull Class<T> typeClass, @NonNull String name) {
|
||||
return GeyserApi.api().provider(GeyserEntityDataType.class, typeClass, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,24 +25,28 @@
|
||||
|
||||
package org.geysermc.geyser.api.entity.data;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.geysermc.geyser.api.GeyserApi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a list of objects for an entity data types
|
||||
* For example, there can be multiple hitboxes on an entity
|
||||
* Represents a list of objects for specific entity data types.
|
||||
* For example, there can be multiple hitboxes on an entity.
|
||||
*
|
||||
* @param <T>
|
||||
* @param <T> the object type in the list
|
||||
*/
|
||||
public interface GeyserListEntityDataType<T> extends GeyserEntityDataType<List<T>> {
|
||||
|
||||
Class<T> listTypeClass();
|
||||
/**
|
||||
* @return the class of the list entries
|
||||
*/
|
||||
@NonNull Class<T> listEntryClass();
|
||||
|
||||
/**
|
||||
* API usage only, use the types defined in {@link GeyserEntityDataTypes}
|
||||
*/
|
||||
static <T> GeyserListEntityDataType<T> of(Class<T> typeClass, String name) {
|
||||
static <T> GeyserListEntityDataType<T> of(@NonNull Class<T> typeClass, @NonNull String name) {
|
||||
return GeyserApi.api().provider(GeyserListEntityDataType.class, List.class, typeClass, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package org.geysermc.geyser.api.entity.data.types;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.cloudburstmc.math.vector.Vector3f;
|
||||
import org.geysermc.geyser.api.GeyserApi;
|
||||
|
||||
@@ -47,7 +48,7 @@ public interface Hitbox {
|
||||
|
||||
/**
|
||||
* The pivot of the hitbox
|
||||
* @return
|
||||
* @return the pivot
|
||||
*/
|
||||
Vector3f pivot();
|
||||
|
||||
@@ -60,12 +61,33 @@ public interface Hitbox {
|
||||
*/
|
||||
interface Builder {
|
||||
|
||||
Builder min(Vector3f min);
|
||||
/**
|
||||
* Sets the min corner of the hitbox
|
||||
* @param min the vector of the corner
|
||||
* @return this builder
|
||||
*/
|
||||
Builder min(@NonNull Vector3f min);
|
||||
|
||||
Builder max(Vector3f max);
|
||||
/**
|
||||
* Sets the max corner of the hitbox
|
||||
* @param max the vector of the corner
|
||||
* @return this builder
|
||||
*/
|
||||
Builder max(@NonNull Vector3f max);
|
||||
|
||||
Builder origin(Vector3f pivot);
|
||||
/**
|
||||
* Sets the pivot of the hitbox
|
||||
* @param pivot the pivot vector
|
||||
* @return this builder
|
||||
*/
|
||||
Builder pivot(@NonNull Vector3f pivot);
|
||||
|
||||
/**
|
||||
* Builds this hitbox, defaulting to {@code Vector3f.ZERO} if
|
||||
* any one vector was not provided.
|
||||
*
|
||||
* @return a new hitbox
|
||||
*/
|
||||
Hitbox build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user