diff --git a/api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java b/api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java index 648ede4d2..9e9670903 100644 --- a/api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java +++ b/api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java @@ -180,9 +180,7 @@ public interface GeyserConnection extends Connection, CommandSource { * * @param emoter the player entity emoting. * @param emoteId the emote ID to send to this client. - * @deprecated use {@link EntityData#showEmote(GeyserPlayerEntity, String)} instead */ - @Deprecated void showEmote(@NonNull GeyserPlayerEntity emoter, @NonNull String emoteId); /** @@ -250,5 +248,5 @@ public interface GeyserConnection extends Connection, CommandSource { * Sends a request to the Java server to switch the items in the main and offhand. * There is no guarantee of the server accepting the request. */ - void requestHandSwap(); + void switchHands(); } diff --git a/api/src/main/java/org/geysermc/geyser/api/entity/EntityData.java b/api/src/main/java/org/geysermc/geyser/api/entity/EntityData.java index 0dfc6b015..191c037f0 100644 --- a/api/src/main/java/org/geysermc/geyser/api/entity/EntityData.java +++ b/api/src/main/java/org/geysermc/geyser/api/entity/EntityData.java @@ -71,6 +71,7 @@ public interface EntityData { * @param emoter the player entity emoting * @param emoteId the emote ID to send to this client */ + @Deprecated void showEmote(@NonNull GeyserPlayerEntity emoter, @NonNull String emoteId); /** @@ -98,7 +99,7 @@ public interface EntityData { boolean isMovementLocked(); /** - * @deprecated use {@link GeyserConnection#requestHandSwap()} + * @deprecated use {@link GeyserConnection#switchHands()} */ @Deprecated void switchHands(); diff --git a/api/src/main/java/org/geysermc/geyser/api/entity/custom/CustomJavaEntityType.java b/api/src/main/java/org/geysermc/geyser/api/entity/custom/CustomJavaEntityType.java index 17bf6b51c..2181dd2ba 100644 --- a/api/src/main/java/org/geysermc/geyser/api/entity/custom/CustomJavaEntityType.java +++ b/api/src/main/java/org/geysermc/geyser/api/entity/custom/CustomJavaEntityType.java @@ -84,6 +84,6 @@ public interface CustomJavaEntityType extends JavaEntityType { * @param defaultBedrockDefinition the default Bedrock definition * @return this builder */ - Builder defaultBedrockDefinition(@Nullable GeyserEntityDefinition defaultBedrockDefinition); + Builder definition(@Nullable GeyserEntityDefinition defaultBedrockDefinition); } } diff --git a/api/src/main/java/org/geysermc/geyser/api/entity/type/GeyserEntity.java b/api/src/main/java/org/geysermc/geyser/api/entity/type/GeyserEntity.java index dea35a5e0..29fb2cd6f 100644 --- a/api/src/main/java/org/geysermc/geyser/api/entity/type/GeyserEntity.java +++ b/api/src/main/java/org/geysermc/geyser/api/entity/type/GeyserEntity.java @@ -112,12 +112,9 @@ public interface GeyserEntity { } /** - * Updates multiple properties with just one update packet. - * - * @param consumer a batch updater - * @see BatchPropertyUpdater - * @since 2.9.0 + * @deprecated - use {@link #updateProperty(GeyserEntityProperty, Object)} instead */ + @Deprecated default void updatePropertiesBatched(Consumer consumer) { this.updatePropertiesBatched(consumer, false); } diff --git a/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java b/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java index 81e87a803..9bfeb78a2 100644 --- a/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java +++ b/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java @@ -27,6 +27,7 @@ package org.geysermc.geyser.api.event.lifecycle; import org.checkerframework.checker.nullness.qual.NonNull; import org.geysermc.event.Event; +import org.geysermc.geyser.api.entity.custom.CustomEntityDefinition; import org.geysermc.geyser.api.entity.custom.CustomJavaEntityType; import org.geysermc.geyser.api.entity.definition.GeyserEntityDefinition; @@ -37,8 +38,6 @@ import java.util.function.Consumer; * Called when entities are defined within Geyser. *

* This event can be used to add custom entities to Geyser. - * Entity definitions can be created using the builder provided - * inside of {@link GeyserEntityDefinition}. */ public interface GeyserDefineEntitiesEvent extends Event { @@ -47,11 +46,16 @@ public interface GeyserDefineEntitiesEvent extends Event { */ Collection entities(); + /** + * @return an immutable collection of all registered custom entity definitions + */ + Collection customEntities(); + /** * Registers a custom entity definition * @param definition the custom entity definition to register */ - void register(@NonNull GeyserEntityDefinition definition); + void register(@NonNull CustomEntityDefinition definition); /** * Registers a non-vanilla Java entity type. diff --git a/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntityPropertiesEvent.java b/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntityPropertiesEvent.java index 94091d3be..55ffa4112 100644 --- a/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntityPropertiesEvent.java +++ b/api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntityPropertiesEvent.java @@ -41,7 +41,6 @@ import org.geysermc.geyser.api.util.Identifier; import java.util.Collection; import java.util.List; -import java.util.function.Consumer; /** * Lifecycle event fired during Geyser's startup to allow custom entity properties @@ -63,10 +62,9 @@ import java.util.function.Consumer; * } * } * - * Retrieving entity instances is possible with the {@link EntityData#entityByJavaId(int)} method, or + * Retrieving entity instances is possible with, for example, the {@link EntityData#byJavaId(int)} method, or * {@link GeyserConnection#playerEntity()} for the connection player entity. - * To update the value of a property on a specific entity, use {@link GeyserEntity#updateProperty(GeyserEntityProperty, Object)}, - * or {@link GeyserEntity#updatePropertiesBatched(Consumer)} to update multiple properties efficiently at once. + * To update the value of a property on a specific entity, use {@link GeyserEntity#updateProperty(GeyserEntityProperty, Object)}. * *

Notes: *