diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/entity/EntityDefinition.java b/api/geyser/src/main/java/org/geysermc/geyser/api/entity/EntityDefinition.java new file mode 100644 index 000000000..1a74c46f1 --- /dev/null +++ b/api/geyser/src/main/java/org/geysermc/geyser/api/entity/EntityDefinition.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2019-2022 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 + */ + +package org.geysermc.geyser.api.entity; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.geysermc.geyser.api.GeyserApi; + +/** + * Holds information about an entity that remains constant no matter + * its properties. This is typically data such as its identifier, + * its height/width, offset, etc. + */ +public interface EntityDefinition { + + /** + * Gets the identifier of this entity. + * + * @return the identifier of this entity + */ + @NonNull + EntityIdentifier entityIdentifier(); + + /** + * Gets the width of this entity. + * + * @return the width of this entity + */ + float width(); + + /** + * Gets the height of this entity. + * + * @return the height of this entity + */ + float height(); + + /** + * Gets the offset of this entity. + * + * @return the offset of this entity + */ + float offset(); + + static Builder builder() { + return GeyserApi.api().providerManager().builderProvider().provideBuilder(Builder.class); + } + + interface Builder { + + /** + * Sets the identifier of this entity. + * + * @param identifier the identifier of this entity + * @return the builder + */ + Builder identifier(EntityIdentifier identifier); + + /** + * Sets the width of this entity. + * + * @param width the width of this entity + * @return the builder + */ + Builder width(float width); + + /** + * Sets the height of this entity. + * + * @param height the height of this entity + * @return the builder + */ + Builder height(float height); + + /** + * Sets the offset of this entity. + * + * @param offset the offset of this entity + * @return the builder + */ + Builder offset(float offset); + + /** + * Builds the entity definition. + * + * @return the entity definition + */ + EntityDefinition build(); + } +} diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/ServerDefineCommandsEvent.java b/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/command/ServerDefineCommandsEvent.java similarity index 97% rename from api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/ServerDefineCommandsEvent.java rename to api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/command/ServerDefineCommandsEvent.java index ba7254c94..2555fd58f 100644 --- a/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/ServerDefineCommandsEvent.java +++ b/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/command/ServerDefineCommandsEvent.java @@ -23,7 +23,7 @@ * @link https://github.com/GeyserMC/Geyser */ -package org.geysermc.geyser.api.event.downstream; +package org.geysermc.geyser.api.event.downstream.command; import org.checkerframework.checker.nullness.qual.NonNull; import org.geysermc.geyser.api.connection.GeyserConnection; diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/entity/ServerSpawnEntityEvent.java b/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/entity/ServerSpawnEntityEvent.java new file mode 100644 index 000000000..7208a3d52 --- /dev/null +++ b/api/geyser/src/main/java/org/geysermc/geyser/api/event/downstream/entity/ServerSpawnEntityEvent.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2019-2022 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 + */ + +package org.geysermc.geyser.api.event.downstream.entity; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.geysermc.geyser.api.connection.GeyserConnection; +import org.geysermc.geyser.api.entity.EntityDefinition; +import org.geysermc.geyser.api.event.connection.ConnectionEvent; + +import java.util.UUID; + +/** + * Called when the downstream server spawns an entity. + */ +public class ServerSpawnEntityEvent extends ConnectionEvent { + private final int entityId; + private final UUID uuid; + + private EntityDefinition entityDefinition; + + public ServerSpawnEntityEvent(@NonNull GeyserConnection connection, int entityId, @Nullable UUID uuid, + @NonNull EntityDefinition entityDefinition) { + super(connection); + this.entityId = entityId; + this.uuid = uuid; + this.entityDefinition = entityDefinition; + } + + /** + * Gets the entity id of the entity being spawned. + * + * @return the entity id of the entity being spawned + */ + public int entityId() { + return this.entityId; + } + + /** + * Gets the uuid of the entity being spawned. + * + * @return the uuid of the entity being spawned + */ + @Nullable + public UUID uuid() { + return this.uuid; + } + + /** + * Gets the entity definition sent to the connection + * when the entity is spawned. + * + * @return the entity definition sent to the connection + * when the entity is spawned + */ + @NonNull + public EntityDefinition entityDefinition() { + return this.entityDefinition; + } + + /** + * Sets the entity definition sent to the connection + * when the entity is spawned. + * + * @param entityDefinition the entity definition sent to the connection + * when the entity is spawned + */ + public void setEntityDefinition(@NonNull EntityDefinition entityDefinition) { + this.entityDefinition = entityDefinition; + } +} diff --git a/api/geyser/src/main/java/org/geysermc/geyser/api/event/entity/DefineEntitiesEvent.java b/api/geyser/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java similarity index 64% rename from api/geyser/src/main/java/org/geysermc/geyser/api/event/entity/DefineEntitiesEvent.java rename to api/geyser/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java index 9bdae3dba..4638caa4d 100644 --- a/api/geyser/src/main/java/org/geysermc/geyser/api/event/entity/DefineEntitiesEvent.java +++ b/api/geyser/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserDefineEntitiesEvent.java @@ -23,24 +23,19 @@ * @link https://github.com/GeyserMC/Geyser */ -package org.geysermc.geyser.api.event.entity; +package org.geysermc.geyser.api.event.lifecycle; import org.checkerframework.checker.nullness.qual.NonNull; -import org.geysermc.geyser.api.connection.GeyserConnection; -import org.geysermc.geyser.api.entity.EntityIdentifier; +import org.geysermc.geyser.api.entity.EntityDefinition; import org.geysermc.geyser.api.event.Event; import java.util.List; /** - * Called when Geyser sends a list of available entities to the - * Bedrock client. This will typically contain all the available - * entities within vanilla, but can be modified to include any custom - * entity defined through a resource pack. + * Called when entities are defined within Geyser. * - * @param connection the {@link GeyserConnection} that is receiving the entities - * @param identifiers a mutable list of all the {@link EntityIdentifier}s - * sent to the client + * @param definitions a mutable list of the currently + * registered entity definitions */ -public record DefineEntitiesEvent(@NonNull GeyserConnection connection, @NonNull List identifiers) implements Event { +public record GeyserDefineEntitiesEvent(@NonNull List definitions) implements Event { } diff --git a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java index 188393f4c..ce6d7d011 100644 --- a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java +++ b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java @@ -194,6 +194,9 @@ public class GeyserImpl implements GeyserApi { this.eventBus.fire(new GeyserPreInitializeEvent(this.extensionManager, this.eventBus)); + /* Call Registry events */ + Registries.callRegistryEvents(); + start(); GeyserConfiguration config = bootstrap.getGeyserConfig(); diff --git a/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java b/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java index 1de571c94..18d959b75 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java +++ b/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java @@ -51,130 +51,130 @@ import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.translator.text.MessageTranslator; public final class EntityDefinitions { - public static final EntityDefinition AREA_EFFECT_CLOUD; - public static final EntityDefinition ARMOR_STAND; - public static final EntityDefinition ARROW; - public static final EntityDefinition AXOLOTL; - public static final EntityDefinition BAT; - public static final EntityDefinition BEE; - public static final EntityDefinition BLAZE; - public static final EntityDefinition BOAT; - public static final EntityDefinition CAT; - public static final EntityDefinition CAVE_SPIDER; - public static final EntityDefinition CHEST_MINECART; - public static final EntityDefinition CHICKEN; - public static final EntityDefinition COD; - public static final EntityDefinition COMMAND_BLOCK_MINECART; - public static final EntityDefinition COW; - public static final EntityDefinition CREEPER; - public static final EntityDefinition DOLPHIN; - public static final EntityDefinition DONKEY; - public static final EntityDefinition DRAGON_FIREBALL; - public static final EntityDefinition DROWNED; - public static final EntityDefinition EGG; - public static final EntityDefinition ELDER_GUARDIAN; - public static final EntityDefinition ENDERMAN; - public static final EntityDefinition ENDERMITE; - public static final EntityDefinition ENDER_DRAGON; - public static final EntityDefinition ENDER_PEARL; - public static final EntityDefinition END_CRYSTAL; - public static final EntityDefinition EVOKER; - public static final EntityDefinition EVOKER_FANGS; - public static final EntityDefinition EXPERIENCE_BOTTLE; - public static final EntityDefinition EXPERIENCE_ORB; - public static final EntityDefinition EYE_OF_ENDER; - public static final EntityDefinition FALLING_BLOCK; - public static final EntityDefinition FIREBALL; - public static final EntityDefinition FIREWORK_ROCKET; - public static final EntityDefinition FISHING_BOBBER; - public static final EntityDefinition FOX; - public static final EntityDefinition FURNACE_MINECART; // Not present on Bedrock - public static final EntityDefinition GHAST; - public static final EntityDefinition GIANT; - public static final EntityDefinition GLOW_ITEM_FRAME; - public static final EntityDefinition GLOW_SQUID; - public static final EntityDefinition GOAT; - public static final EntityDefinition GUARDIAN; - public static final EntityDefinition HOGLIN; - public static final EntityDefinition HOPPER_MINECART; - public static final EntityDefinition HORSE; - public static final EntityDefinition HUSK; - public static final EntityDefinition ILLUSIONER; // Not present on Bedrock - public static final EntityDefinition IRON_GOLEM; - public static final EntityDefinition ITEM; - public static final EntityDefinition ITEM_FRAME; - public static final EntityDefinition LEASH_KNOT; - public static final EntityDefinition LIGHTNING_BOLT; - public static final EntityDefinition LLAMA; - public static final EntityDefinition LLAMA_SPIT; - public static final EntityDefinition MAGMA_CUBE; - public static final EntityDefinition MINECART; - public static final EntityDefinition MOOSHROOM; - public static final EntityDefinition MULE; - public static final EntityDefinition OCELOT; - public static final EntityDefinition PAINTING; - public static final EntityDefinition PANDA; - public static final EntityDefinition PARROT; - public static final EntityDefinition PHANTOM; - public static final EntityDefinition PIG; - public static final EntityDefinition PIGLIN; - public static final EntityDefinition PIGLIN_BRUTE; - public static final EntityDefinition PILLAGER; - public static final EntityDefinition PLAYER; - public static final EntityDefinition POLAR_BEAR; - public static final EntityDefinition POTION; - public static final EntityDefinition PUFFERFISH; - public static final EntityDefinition RABBIT; - public static final EntityDefinition RAVAGER; - public static final EntityDefinition SALMON; - public static final EntityDefinition SHEEP; - public static final EntityDefinition SHULKER; - public static final EntityDefinition SHULKER_BULLET; - public static final EntityDefinition SILVERFISH; - public static final EntityDefinition SKELETON; - public static final EntityDefinition SKELETON_HORSE; - public static final EntityDefinition SLIME; - public static final EntityDefinition SMALL_FIREBALL; - public static final EntityDefinition SNOWBALL; - public static final EntityDefinition SNOW_GOLEM; - public static final EntityDefinition SPAWNER_MINECART; // Not present on Bedrock - public static final EntityDefinition SPECTRAL_ARROW; - public static final EntityDefinition SPIDER; - public static final EntityDefinition SQUID; - public static final EntityDefinition STRAY; - public static final EntityDefinition STRIDER; - public static final EntityDefinition TNT; - public static final EntityDefinition TNT_MINECART; - public static final EntityDefinition TRADER_LLAMA; - public static final EntityDefinition TRIDENT; - public static final EntityDefinition TROPICAL_FISH; - public static final EntityDefinition TURTLE; - public static final EntityDefinition VEX; - public static final EntityDefinition VILLAGER; - public static final EntityDefinition VINDICATOR; - public static final EntityDefinition WANDERING_TRADER; - public static final EntityDefinition WITCH; - public static final EntityDefinition WITHER; - public static final EntityDefinition WITHER_SKELETON; - public static final EntityDefinition WITHER_SKULL; - public static final EntityDefinition WOLF; - public static final EntityDefinition ZOGLIN; - public static final EntityDefinition ZOMBIE; - public static final EntityDefinition ZOMBIE_HORSE; - public static final EntityDefinition ZOMBIE_VILLAGER; - public static final EntityDefinition ZOMBIFIED_PIGLIN; + public static final GeyserEntityDefinition AREA_EFFECT_CLOUD; + public static final GeyserEntityDefinition ARMOR_STAND; + public static final GeyserEntityDefinition ARROW; + public static final GeyserEntityDefinition AXOLOTL; + public static final GeyserEntityDefinition BAT; + public static final GeyserEntityDefinition BEE; + public static final GeyserEntityDefinition BLAZE; + public static final GeyserEntityDefinition BOAT; + public static final GeyserEntityDefinition CAT; + public static final GeyserEntityDefinition CAVE_SPIDER; + public static final GeyserEntityDefinition CHEST_MINECART; + public static final GeyserEntityDefinition CHICKEN; + public static final GeyserEntityDefinition COD; + public static final GeyserEntityDefinition COMMAND_BLOCK_MINECART; + public static final GeyserEntityDefinition COW; + public static final GeyserEntityDefinition CREEPER; + public static final GeyserEntityDefinition DOLPHIN; + public static final GeyserEntityDefinition DONKEY; + public static final GeyserEntityDefinition DRAGON_FIREBALL; + public static final GeyserEntityDefinition DROWNED; + public static final GeyserEntityDefinition EGG; + public static final GeyserEntityDefinition ELDER_GUARDIAN; + public static final GeyserEntityDefinition ENDERMAN; + public static final GeyserEntityDefinition ENDERMITE; + public static final GeyserEntityDefinition ENDER_DRAGON; + public static final GeyserEntityDefinition ENDER_PEARL; + public static final GeyserEntityDefinition END_CRYSTAL; + public static final GeyserEntityDefinition EVOKER; + public static final GeyserEntityDefinition EVOKER_FANGS; + public static final GeyserEntityDefinition EXPERIENCE_BOTTLE; + public static final GeyserEntityDefinition EXPERIENCE_ORB; + public static final GeyserEntityDefinition EYE_OF_ENDER; + public static final GeyserEntityDefinition FALLING_BLOCK; + public static final GeyserEntityDefinition FIREBALL; + public static final GeyserEntityDefinition FIREWORK_ROCKET; + public static final GeyserEntityDefinition FISHING_BOBBER; + public static final GeyserEntityDefinition FOX; + public static final GeyserEntityDefinition FURNACE_MINECART; // Not present on Bedrock + public static final GeyserEntityDefinition GHAST; + public static final GeyserEntityDefinition GIANT; + public static final GeyserEntityDefinition GLOW_ITEM_FRAME; + public static final GeyserEntityDefinition GLOW_SQUID; + public static final GeyserEntityDefinition GOAT; + public static final GeyserEntityDefinition GUARDIAN; + public static final GeyserEntityDefinition HOGLIN; + public static final GeyserEntityDefinition HOPPER_MINECART; + public static final GeyserEntityDefinition HORSE; + public static final GeyserEntityDefinition HUSK; + public static final GeyserEntityDefinition ILLUSIONER; // Not present on Bedrock + public static final GeyserEntityDefinition IRON_GOLEM; + public static final GeyserEntityDefinition ITEM; + public static final GeyserEntityDefinition ITEM_FRAME; + public static final GeyserEntityDefinition LEASH_KNOT; + public static final GeyserEntityDefinition LIGHTNING_BOLT; + public static final GeyserEntityDefinition LLAMA; + public static final GeyserEntityDefinition LLAMA_SPIT; + public static final GeyserEntityDefinition MAGMA_CUBE; + public static final GeyserEntityDefinition MINECART; + public static final GeyserEntityDefinition MOOSHROOM; + public static final GeyserEntityDefinition MULE; + public static final GeyserEntityDefinition OCELOT; + public static final GeyserEntityDefinition PAINTING; + public static final GeyserEntityDefinition PANDA; + public static final GeyserEntityDefinition PARROT; + public static final GeyserEntityDefinition PHANTOM; + public static final GeyserEntityDefinition PIG; + public static final GeyserEntityDefinition PIGLIN; + public static final GeyserEntityDefinition PIGLIN_BRUTE; + public static final GeyserEntityDefinition PILLAGER; + public static final GeyserEntityDefinition PLAYER; + public static final GeyserEntityDefinition POLAR_BEAR; + public static final GeyserEntityDefinition POTION; + public static final GeyserEntityDefinition PUFFERFISH; + public static final GeyserEntityDefinition RABBIT; + public static final GeyserEntityDefinition RAVAGER; + public static final GeyserEntityDefinition SALMON; + public static final GeyserEntityDefinition SHEEP; + public static final GeyserEntityDefinition SHULKER; + public static final GeyserEntityDefinition SHULKER_BULLET; + public static final GeyserEntityDefinition SILVERFISH; + public static final GeyserEntityDefinition SKELETON; + public static final GeyserEntityDefinition SKELETON_HORSE; + public static final GeyserEntityDefinition SLIME; + public static final GeyserEntityDefinition SMALL_FIREBALL; + public static final GeyserEntityDefinition SNOWBALL; + public static final GeyserEntityDefinition SNOW_GOLEM; + public static final GeyserEntityDefinition SPAWNER_MINECART; // Not present on Bedrock + public static final GeyserEntityDefinition SPECTRAL_ARROW; + public static final GeyserEntityDefinition SPIDER; + public static final GeyserEntityDefinition SQUID; + public static final GeyserEntityDefinition STRAY; + public static final GeyserEntityDefinition STRIDER; + public static final GeyserEntityDefinition TNT; + public static final GeyserEntityDefinition TNT_MINECART; + public static final GeyserEntityDefinition TRADER_LLAMA; + public static final GeyserEntityDefinition TRIDENT; + public static final GeyserEntityDefinition TROPICAL_FISH; + public static final GeyserEntityDefinition TURTLE; + public static final GeyserEntityDefinition VEX; + public static final GeyserEntityDefinition VILLAGER; + public static final GeyserEntityDefinition VINDICATOR; + public static final GeyserEntityDefinition WANDERING_TRADER; + public static final GeyserEntityDefinition WITCH; + public static final GeyserEntityDefinition WITHER; + public static final GeyserEntityDefinition WITHER_SKELETON; + public static final GeyserEntityDefinition WITHER_SKULL; + public static final GeyserEntityDefinition WOLF; + public static final GeyserEntityDefinition ZOGLIN; + public static final GeyserEntityDefinition ZOMBIE; + public static final GeyserEntityDefinition ZOMBIE_HORSE; + public static final GeyserEntityDefinition ZOMBIE_VILLAGER; + public static final GeyserEntityDefinition ZOMBIFIED_PIGLIN; /** * Is not sent over the network */ - public static final EntityDefinition ENDER_DRAGON_PART; + public static final GeyserEntityDefinition ENDER_DRAGON_PART; /** * Special Bedrock type */ - public static final EntityDefinition WITHER_SKULL_DANGEROUS; + public static final GeyserEntityDefinition WITHER_SKULL_DANGEROUS; static { - EntityDefinition entityBase = EntityDefinition.builder(Entity::new) + GeyserEntityDefinition entityBase = GeyserEntityDefinition.builder(Entity::new) .addTranslator(MetadataType.BYTE, Entity::setFlags) .addTranslator(MetadataType.INT, Entity::setAir) // Air/bubbles .addTranslator(MetadataType.OPTIONAL_CHAT, Entity::setDisplayName) @@ -187,15 +187,15 @@ public final class EntityDefinitions { // Extends entity { - AREA_EFFECT_CLOUD = EntityDefinition.inherited(AreaEffectCloudEntity::new, entityBase) + AREA_EFFECT_CLOUD = GeyserEntityDefinition.inherited(AreaEffectCloudEntity::new, entityBase) .type(EntityType.AREA_EFFECT_CLOUD) .height(0.5f).width(1.0f) .addTranslator(MetadataType.FLOAT, AreaEffectCloudEntity::setRadius) .addTranslator(MetadataType.INT, (entity, entityMetadata) -> entity.getDirtyMetadata().put(EntityData.EFFECT_COLOR, entityMetadata.getValue())) .addTranslator(null) // Waiting .addTranslator(MetadataType.PARTICLE, AreaEffectCloudEntity::setParticle) - .build(); - BOAT = EntityDefinition.inherited(BoatEntity::new, entityBase) + .build(true); + BOAT = GeyserEntityDefinition.inherited(BoatEntity::new, entityBase) .type(EntityType.BOAT) .height(0.6f).width(1.6f) .offset(0.35f) @@ -208,153 +208,153 @@ public final class EntityDefinitions { .addTranslator(MetadataType.BOOLEAN, BoatEntity::setPaddlingLeft) .addTranslator(MetadataType.BOOLEAN, BoatEntity::setPaddlingRight) .addTranslator(MetadataType.INT, (boatEntity, entityMetadata) -> boatEntity.getDirtyMetadata().put(EntityData.BOAT_BUBBLE_TIME, entityMetadata.getValue())) // May not actually do anything - .build(); - DRAGON_FIREBALL = EntityDefinition.inherited(FireballEntity::new, entityBase) + .build(true); + DRAGON_FIREBALL = GeyserEntityDefinition.inherited(FireballEntity::new, entityBase) .type(EntityType.DRAGON_FIREBALL) .heightAndWidth(1.0f) - .build(); - END_CRYSTAL = EntityDefinition.inherited(EnderCrystalEntity::new, entityBase) + .build(true); + END_CRYSTAL = GeyserEntityDefinition.inherited(EnderCrystalEntity::new, entityBase) .type(EntityType.END_CRYSTAL) .heightAndWidth(2.0f) .identifier("minecraft:ender_crystal") .addTranslator(MetadataType.OPTIONAL_POSITION, EnderCrystalEntity::setBlockTarget) .addTranslator(MetadataType.BOOLEAN, (enderCrystalEntity, entityMetadata) -> enderCrystalEntity.setFlag(EntityFlag.SHOW_BOTTOM, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) // There is a base located on the ender crystal - .build(); - EXPERIENCE_ORB = EntityDefinition.inherited(null, entityBase) + .build(true); + EXPERIENCE_ORB = GeyserEntityDefinition.inherited(null, entityBase) .type(EntityType.EXPERIENCE_ORB) .identifier("minecraft:xp_orb") - .build(); - EVOKER_FANGS = EntityDefinition.builder(EvokerFangsEntity::new) // No entity metadata to listen to as of 1.18.1 + .build(true); + EVOKER_FANGS = GeyserEntityDefinition.builder(EvokerFangsEntity::new) // No entity metadata to listen to as of 1.18.1 .type(EntityType.EVOKER_FANGS) .height(0.8f).width(0.5f) .identifier("minecraft:evocation_fang") - .build(); - EYE_OF_ENDER = EntityDefinition.inherited(Entity::new, entityBase) + .build(true); + EYE_OF_ENDER = GeyserEntityDefinition.inherited(Entity::new, entityBase) .type(EntityType.EYE_OF_ENDER) .heightAndWidth(0.25f) .identifier("minecraft:eye_of_ender_signal") .addTranslator(null) // Item - .build(); - FALLING_BLOCK = EntityDefinition.inherited(null, entityBase) + .build(true); + FALLING_BLOCK = GeyserEntityDefinition.inherited(null, entityBase) .type(EntityType.FALLING_BLOCK) .heightAndWidth(0.98f) .addTranslator(null) // "start block position" - .build(); - FIREWORK_ROCKET = EntityDefinition.inherited(FireworkEntity::new, entityBase) + .build(true); + FIREWORK_ROCKET = GeyserEntityDefinition.inherited(FireworkEntity::new, entityBase) .type(EntityType.FIREWORK_ROCKET) .heightAndWidth(0.25f) .identifier("minecraft:fireworks_rocket") .addTranslator(MetadataType.ITEM, FireworkEntity::setFireworkItem) .addTranslator(MetadataType.OPTIONAL_VARINT, FireworkEntity::setPlayerGliding) .addTranslator(null) // Shot at angle - .build(); - FISHING_BOBBER = EntityDefinition.inherited(null, entityBase) + .build(true); + FISHING_BOBBER = GeyserEntityDefinition.inherited(null, entityBase) .type(EntityType.FISHING_BOBBER) .identifier("minecraft:fishing_hook") .addTranslator(MetadataType.INT, FishingHookEntity::setHookedEntity) .addTranslator(null) // Biting TODO check - .build(); - ITEM = EntityDefinition.inherited(ItemEntity::new, entityBase) + .build(true); + ITEM = GeyserEntityDefinition.inherited(ItemEntity::new, entityBase) .type(EntityType.ITEM) .heightAndWidth(0.25f) .offset(0.125f) .addTranslator(MetadataType.ITEM, ItemEntity::setItem) - .build(); - LEASH_KNOT = EntityDefinition.inherited(LeashKnotEntity::new, entityBase) + .build(true); + LEASH_KNOT = GeyserEntityDefinition.inherited(LeashKnotEntity::new, entityBase) .type(EntityType.LEASH_KNOT) .height(0.5f).width(0.375f) - .build(); - LIGHTNING_BOLT = EntityDefinition.inherited(LightningEntity::new, entityBase) + .build(true); + LIGHTNING_BOLT = GeyserEntityDefinition.inherited(LightningEntity::new, entityBase) .type(EntityType.LIGHTNING_BOLT) - .build(); - LLAMA_SPIT = EntityDefinition.inherited(ThrowableEntity::new, entityBase) + .build(true); + LLAMA_SPIT = GeyserEntityDefinition.inherited(ThrowableEntity::new, entityBase) .type(EntityType.LLAMA_SPIT) .heightAndWidth(0.25f) - .build(); - PAINTING = EntityDefinition.inherited(null, entityBase) + .build(true); + PAINTING = GeyserEntityDefinition.inherited(null, entityBase) .type(EntityType.PAINTING) - .build(); - SHULKER_BULLET = EntityDefinition.inherited(ThrowableEntity::new, entityBase) + .build(true); + SHULKER_BULLET = GeyserEntityDefinition.inherited(ThrowableEntity::new, entityBase) .type(EntityType.SHULKER_BULLET) .heightAndWidth(0.3125f) - .build(); - TNT = EntityDefinition.inherited(TNTEntity::new, entityBase) + .build(true); + TNT = GeyserEntityDefinition.inherited(TNTEntity::new, entityBase) .type(EntityType.TNT) .heightAndWidth(0.98f) .addTranslator(MetadataType.INT, TNTEntity::setFuseLength) - .build(); + .build(true); - EntityDefinition fireballBase = EntityDefinition.inherited(FireballEntity::new, entityBase) + GeyserEntityDefinition fireballBase = GeyserEntityDefinition.inherited(FireballEntity::new, entityBase) .addTranslator(null) // Item .build(); - FIREBALL = EntityDefinition.inherited(FireballEntity::new, fireballBase) + FIREBALL = GeyserEntityDefinition.inherited(FireballEntity::new, fireballBase) .type(EntityType.FIREBALL) .heightAndWidth(1.0f) - .build(); - SMALL_FIREBALL = EntityDefinition.inherited(FireballEntity::new, fireballBase) + .build(true); + SMALL_FIREBALL = GeyserEntityDefinition.inherited(FireballEntity::new, fireballBase) .type(EntityType.SMALL_FIREBALL) .heightAndWidth(0.3125f) - .build(); + .build(true); - EntityDefinition throwableItemBase = EntityDefinition.inherited(ThrowableItemEntity::new, entityBase) + GeyserEntityDefinition throwableItemBase = GeyserEntityDefinition.inherited(ThrowableItemEntity::new, entityBase) .addTranslator(MetadataType.ITEM, ThrowableItemEntity::setItem) .build(); - EGG = EntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) + EGG = GeyserEntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) .type(EntityType.EGG) .heightAndWidth(0.25f) - .build(); - ENDER_PEARL = EntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) + .build(true); + ENDER_PEARL = GeyserEntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) .type(EntityType.ENDER_PEARL) .heightAndWidth(0.25f) - .build(); - EXPERIENCE_BOTTLE = EntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) + .build(true); + EXPERIENCE_BOTTLE = GeyserEntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) .type(EntityType.EXPERIENCE_BOTTLE) .heightAndWidth(0.25f) .identifier("minecraft:xp_bottle") - .build(); - POTION = EntityDefinition.inherited(ThrownPotionEntity::new, throwableItemBase) + .build(true); + POTION = GeyserEntityDefinition.inherited(ThrownPotionEntity::new, throwableItemBase) .type(EntityType.POTION) .heightAndWidth(0.25f) .identifier("minecraft:splash_potion") - .build(); - SNOWBALL = EntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) + .build(true); + SNOWBALL = GeyserEntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase) .type(EntityType.SNOWBALL) .heightAndWidth(0.25f) - .build(); + .build(true); - EntityDefinition abstractArrowBase = EntityDefinition.inherited(AbstractArrowEntity::new, entityBase) + GeyserEntityDefinition abstractArrowBase = GeyserEntityDefinition.inherited(AbstractArrowEntity::new, entityBase) .addTranslator(MetadataType.BYTE, AbstractArrowEntity::setArrowFlags) .addTranslator(null) // "Piercing level" .build(); - ARROW = EntityDefinition.inherited(TippedArrowEntity::new, abstractArrowBase) + ARROW = GeyserEntityDefinition.inherited(TippedArrowEntity::new, abstractArrowBase) .type(EntityType.ARROW) .heightAndWidth(0.25f) .addTranslator(MetadataType.INT, TippedArrowEntity::setPotionEffectColor) - .build(); - SPECTRAL_ARROW = EntityDefinition.inherited(abstractArrowBase.factory(), abstractArrowBase) + .build(true); + SPECTRAL_ARROW = GeyserEntityDefinition.inherited(abstractArrowBase.factory(), abstractArrowBase) .type(EntityType.SPECTRAL_ARROW) .heightAndWidth(0.25f) .identifier("minecraft:arrow") - .build(); - TRIDENT = EntityDefinition.inherited(TridentEntity::new, abstractArrowBase) // TODO remove class + .build(true); + TRIDENT = GeyserEntityDefinition.inherited(TridentEntity::new, abstractArrowBase) // TODO remove class .type(EntityType.TRIDENT) .identifier("minecraft:thrown_trident") .addTranslator(null) // Loyalty .addTranslator(MetadataType.BOOLEAN, (tridentEntity, entityMetadata) -> tridentEntity.setFlag(EntityFlag.ENCHANTED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) - .build(); + .build(true); // Item frames are handled differently as they are blocks, not items, in Bedrock - ITEM_FRAME = EntityDefinition.inherited(null, entityBase) + ITEM_FRAME = GeyserEntityDefinition.inherited(null, entityBase) .type(EntityType.ITEM_FRAME) .addTranslator(MetadataType.ITEM, ItemFrameEntity::setItemInFrame) .addTranslator(MetadataType.INT, ItemFrameEntity::setItemRotation) - .build(); - GLOW_ITEM_FRAME = EntityDefinition.inherited(ITEM_FRAME.factory(), ITEM_FRAME) + .build(true); + GLOW_ITEM_FRAME = GeyserEntityDefinition.inherited(ITEM_FRAME.factory(), ITEM_FRAME) .type(EntityType.GLOW_ITEM_FRAME) - .build(); + .build(true); - MINECART = EntityDefinition.inherited(MinecartEntity::new, entityBase) + MINECART = GeyserEntityDefinition.inherited(MinecartEntity::new, entityBase) .type(EntityType.MINECART) .height(0.7f).width(0.98f) .offset(0.35f) @@ -366,41 +366,41 @@ public final class EntityDefinitions { .addTranslator(MetadataType.INT, MinecartEntity::setCustomBlock) .addTranslator(MetadataType.INT, MinecartEntity::setCustomBlockOffset) .addTranslator(MetadataType.BOOLEAN, MinecartEntity::setShowCustomBlock) - .build(); - CHEST_MINECART = EntityDefinition.inherited(MINECART.factory(), MINECART) + .build(true); + CHEST_MINECART = GeyserEntityDefinition.inherited(MINECART.factory(), MINECART) .type(EntityType.CHEST_MINECART) - .build(); - COMMAND_BLOCK_MINECART = EntityDefinition.inherited(CommandBlockMinecartEntity::new, MINECART) + .build(true); + COMMAND_BLOCK_MINECART = GeyserEntityDefinition.inherited(CommandBlockMinecartEntity::new, MINECART) .type(EntityType.COMMAND_BLOCK_MINECART) .addTranslator(MetadataType.STRING, (entity, entityMetadata) -> entity.getDirtyMetadata().put(EntityData.COMMAND_BLOCK_COMMAND, entityMetadata.getValue())) .addTranslator(MetadataType.CHAT, (entity, entityMetadata) -> entity.getDirtyMetadata().put(EntityData.COMMAND_BLOCK_LAST_OUTPUT, MessageTranslator.convertMessage(entityMetadata.getValue()))) - .build(); - FURNACE_MINECART = EntityDefinition.inherited(FurnaceMinecartEntity::new, MINECART) + .build(true); + FURNACE_MINECART = GeyserEntityDefinition.inherited(FurnaceMinecartEntity::new, MINECART) .type(EntityType.FURNACE_MINECART) .identifier("minecraft:minecart") .addTranslator(MetadataType.BOOLEAN, FurnaceMinecartEntity::setHasFuel) - .build(); - HOPPER_MINECART = EntityDefinition.inherited(MINECART.factory(), MINECART) + .build(true); + HOPPER_MINECART = GeyserEntityDefinition.inherited(MINECART.factory(), MINECART) .type(EntityType.HOPPER_MINECART) - .build(); - SPAWNER_MINECART = EntityDefinition.inherited(SpawnerMinecartEntity::new, MINECART) + .build(true); + SPAWNER_MINECART = GeyserEntityDefinition.inherited(SpawnerMinecartEntity::new, MINECART) .type(EntityType.SPAWNER_MINECART) .identifier("minecraft:minecart") - .build(); - TNT_MINECART = EntityDefinition.inherited(MINECART.factory(), MINECART) + .build(true); + TNT_MINECART = GeyserEntityDefinition.inherited(MINECART.factory(), MINECART) .type(EntityType.TNT_MINECART) - .build(); + .build(true); - WITHER_SKULL = EntityDefinition.inherited(WitherSkullEntity::new, entityBase) + WITHER_SKULL = GeyserEntityDefinition.inherited(WitherSkullEntity::new, entityBase) .type(EntityType.WITHER_SKULL) .heightAndWidth(0.3125f) .addTranslator(MetadataType.BOOLEAN, WitherSkullEntity::setDangerous) - .build(); - WITHER_SKULL_DANGEROUS = EntityDefinition.inherited(WITHER_SKULL.factory(), WITHER_SKULL) + .build(true); + WITHER_SKULL_DANGEROUS = GeyserEntityDefinition.inherited(WITHER_SKULL.factory(), WITHER_SKULL) .build(false); } - EntityDefinition livingEntityBase = EntityDefinition.inherited(LivingEntity::new, entityBase) + GeyserEntityDefinition livingEntityBase = GeyserEntityDefinition.inherited(LivingEntity::new, entityBase) .addTranslator(MetadataType.BYTE, LivingEntity::setLivingEntityFlags) .addTranslator(MetadataType.FLOAT, LivingEntity::setHealth) .addTranslator(MetadataType.INT, @@ -412,7 +412,7 @@ public final class EntityDefinitions { .addTranslator(MetadataType.OPTIONAL_POSITION, LivingEntity::setBedPosition) .build(); - ARMOR_STAND = EntityDefinition.inherited(ArmorStandEntity::new, livingEntityBase) + ARMOR_STAND = GeyserEntityDefinition.inherited(ArmorStandEntity::new, livingEntityBase) .type(EntityType.ARMOR_STAND) .height(1.975f).width(0.5f) .addTranslator(MetadataType.BYTE, ArmorStandEntity::setArmorStandFlags) @@ -422,8 +422,8 @@ public final class EntityDefinitions { .addTranslator(MetadataType.ROTATION, ArmorStandEntity::setRightArmRotation) .addTranslator(MetadataType.ROTATION, ArmorStandEntity::setLeftLegRotation) .addTranslator(MetadataType.ROTATION, ArmorStandEntity::setRightLegRotation) - .build(); - PLAYER = EntityDefinition.inherited(null, livingEntityBase) + .build(true); + PLAYER = GeyserEntityDefinition.inherited(null, livingEntityBase) .type(EntityType.PLAYER) .height(1.8f).width(0.6f) .offset(1.62f) @@ -433,329 +433,329 @@ public final class EntityDefinitions { .addTranslator(null) // Player main hand .addTranslator(MetadataType.NBT_TAG, PlayerEntity::setLeftParrot) .addTranslator(MetadataType.NBT_TAG, PlayerEntity::setRightParrot) - .build(); + .build(true); - EntityDefinition mobEntityBase = EntityDefinition.inherited(MobEntity::new, livingEntityBase) + GeyserEntityDefinition mobEntityBase = GeyserEntityDefinition.inherited(MobEntity::new, livingEntityBase) .addTranslator(MetadataType.BYTE, MobEntity::setMobFlags) .build(); // Extends mob { - BAT = EntityDefinition.inherited(BatEntity::new, mobEntityBase) + BAT = GeyserEntityDefinition.inherited(BatEntity::new, mobEntityBase) .type(EntityType.BAT) .height(0.9f).width(0.5f) .addTranslator(MetadataType.BYTE, BatEntity::setBatFlags) - .build(); - BLAZE = EntityDefinition.inherited(BlazeEntity::new, mobEntityBase) + .build(true); + BLAZE = GeyserEntityDefinition.inherited(BlazeEntity::new, mobEntityBase) .type(EntityType.BLAZE) .height(1.8f).width(0.6f) .addTranslator(MetadataType.BYTE, BlazeEntity::setBlazeFlags) - .build(); - CREEPER = EntityDefinition.inherited(CreeperEntity::new, mobEntityBase) + .build(true); + CREEPER = GeyserEntityDefinition.inherited(CreeperEntity::new, mobEntityBase) .type(EntityType.CREEPER) .height(1.7f).width(0.6f) .offset(1.62f) .addTranslator(MetadataType.INT, CreeperEntity::setSwelling) .addTranslator(MetadataType.BOOLEAN, (entity, entityMetadata) -> entity.setFlag(EntityFlag.POWERED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) .addTranslator(MetadataType.BOOLEAN, CreeperEntity::setIgnited) - .build(); - DOLPHIN = EntityDefinition.inherited(DolphinEntity::new, mobEntityBase) + .build(true); + DOLPHIN = GeyserEntityDefinition.inherited(DolphinEntity::new, mobEntityBase) .type(EntityType.DOLPHIN) .height(0.6f).width(0.9f) //TODO check .addTranslator(null) // treasure position .addTranslator(null) // "got fish" .addTranslator(null) // "moistness level" - .build(); - ENDERMAN = EntityDefinition.inherited(EndermanEntity::new, mobEntityBase) + .build(true); + ENDERMAN = GeyserEntityDefinition.inherited(EndermanEntity::new, mobEntityBase) .type(EntityType.ENDERMAN) .height(2.9f).width(0.6f) .addTranslator(MetadataType.BLOCK_STATE, EndermanEntity::setCarriedBlock) .addTranslator(MetadataType.BOOLEAN, EndermanEntity::setScreaming) .addTranslator(MetadataType.BOOLEAN, EndermanEntity::setAngry) - .build(); - ENDERMITE = EntityDefinition.inherited(MonsterEntity::new, mobEntityBase) + .build(true); + ENDERMITE = GeyserEntityDefinition.inherited(MonsterEntity::new, mobEntityBase) .type(EntityType.ENDERMITE) .height(0.3f).width(0.4f) - .build(); - ENDER_DRAGON = EntityDefinition.inherited(EnderDragonEntity::new, mobEntityBase) + .build(true); + ENDER_DRAGON = GeyserEntityDefinition.inherited(EnderDragonEntity::new, mobEntityBase) .type(EntityType.ENDER_DRAGON) .addTranslator(MetadataType.INT, EnderDragonEntity::setPhase) - .build(); - GHAST = EntityDefinition.inherited(GhastEntity::new, mobEntityBase) + .build(true); + GHAST = GeyserEntityDefinition.inherited(GhastEntity::new, mobEntityBase) .type(EntityType.GHAST) .heightAndWidth(4.0f) .addTranslator(MetadataType.BOOLEAN, GhastEntity::setGhastAttacking) - .build(); - GIANT = EntityDefinition.inherited(GiantEntity::new, mobEntityBase) + .build(true); + GIANT = GeyserEntityDefinition.inherited(GiantEntity::new, mobEntityBase) .type(EntityType.GIANT) .height(1.8f).width(1.6f) .offset(1.62f) .identifier("minecraft:zombie") - .build(); - IRON_GOLEM = EntityDefinition.inherited(IronGolemEntity::new, mobEntityBase) + .build(true); + IRON_GOLEM = GeyserEntityDefinition.inherited(IronGolemEntity::new, mobEntityBase) .type(EntityType.IRON_GOLEM) .height(2.7f).width(1.4f) .addTranslator(null) // "is player created", which doesn't seem to do anything clientside - .build(); - PHANTOM = EntityDefinition.inherited(PhantomEntity::new, mobEntityBase) + .build(true); + PHANTOM = GeyserEntityDefinition.inherited(PhantomEntity::new, mobEntityBase) .type(EntityType.PHANTOM) .height(0.5f).width(0.9f) .offset(0.6f) .addTranslator(MetadataType.INT, PhantomEntity::setPhantomScale) - .build(); - SILVERFISH = EntityDefinition.inherited(MonsterEntity::new, mobEntityBase) + .build(true); + SILVERFISH = GeyserEntityDefinition.inherited(MonsterEntity::new, mobEntityBase) .type(EntityType.SILVERFISH) .height(0.3f).width(0.4f) - .build(); - SHULKER = EntityDefinition.inherited(ShulkerEntity::new, mobEntityBase) + .build(true); + SHULKER = GeyserEntityDefinition.inherited(ShulkerEntity::new, mobEntityBase) .type(EntityType.SHULKER) .heightAndWidth(1f) .addTranslator(MetadataType.DIRECTION, ShulkerEntity::setAttachedFace) .addTranslator(MetadataType.BYTE, ShulkerEntity::setShulkerHeight) .addTranslator(MetadataType.BYTE, ShulkerEntity::setShulkerColor) - .build(); - SKELETON = EntityDefinition.inherited(SkeletonEntity::new, mobEntityBase) + .build(true); + SKELETON = GeyserEntityDefinition.inherited(SkeletonEntity::new, mobEntityBase) .type(EntityType.SKELETON) .height(1.8f).width(0.6f) .offset(1.62f) .addTranslator(MetadataType.BOOLEAN, SkeletonEntity::setConvertingToStray) - .build(); - SNOW_GOLEM = EntityDefinition.inherited(SnowGolemEntity::new, mobEntityBase) + .build(true); + SNOW_GOLEM = GeyserEntityDefinition.inherited(SnowGolemEntity::new, mobEntityBase) .type(EntityType.SNOW_GOLEM) .height(1.9f).width(0.7f) .addTranslator(MetadataType.BYTE, SnowGolemEntity::setSnowGolemFlags) - .build(); - SPIDER = EntityDefinition.inherited(SpiderEntity::new, mobEntityBase) + .build(true); + SPIDER = GeyserEntityDefinition.inherited(SpiderEntity::new, mobEntityBase) .type(EntityType.SPIDER) .height(0.9f).width(1.4f) .offset(1f) .addTranslator(MetadataType.BYTE, SpiderEntity::setSpiderFlags) - .build(); - CAVE_SPIDER = EntityDefinition.inherited(SpiderEntity::new, SPIDER) + .build(true); + CAVE_SPIDER = GeyserEntityDefinition.inherited(SpiderEntity::new, SPIDER) .type(EntityType.CAVE_SPIDER) .height(0.5f).width(0.7f) - .build(); - SQUID = EntityDefinition.inherited(SquidEntity::new, mobEntityBase) + .build(true); + SQUID = GeyserEntityDefinition.inherited(SquidEntity::new, mobEntityBase) .type(EntityType.SQUID) .heightAndWidth(0.8f) - .build(); - STRAY = EntityDefinition.inherited(AbstractSkeletonEntity::new, mobEntityBase) + .build(true); + STRAY = GeyserEntityDefinition.inherited(AbstractSkeletonEntity::new, mobEntityBase) .type(EntityType.STRAY) .height(1.8f).width(0.6f) .offset(1.62f) - .build(); - VEX = EntityDefinition.inherited(VexEntity::new, mobEntityBase) + .build(true); + VEX = GeyserEntityDefinition.inherited(VexEntity::new, mobEntityBase) .type(EntityType.VEX) .height(0.8f).width(0.4f) .addTranslator(MetadataType.BYTE, VexEntity::setVexFlags) - .build(); - WITHER = EntityDefinition.inherited(WitherEntity::new, mobEntityBase) + .build(true); + WITHER = GeyserEntityDefinition.inherited(WitherEntity::new, mobEntityBase) .type(EntityType.WITHER) .height(3.5f).width(0.9f) .addTranslator(MetadataType.INT, WitherEntity::setTarget1) .addTranslator(MetadataType.INT, WitherEntity::setTarget2) .addTranslator(MetadataType.INT, WitherEntity::setTarget3) .addTranslator(MetadataType.INT, WitherEntity::setInvulnerableTicks) - .build(); - WITHER_SKELETON = EntityDefinition.inherited(AbstractSkeletonEntity::new, mobEntityBase) + .build(true); + WITHER_SKELETON = GeyserEntityDefinition.inherited(AbstractSkeletonEntity::new, mobEntityBase) .type(EntityType.WITHER_SKELETON) .height(2.4f).width(0.7f) - .build(); - ZOGLIN = EntityDefinition.inherited(ZoglinEntity::new, mobEntityBase) + .build(true); + ZOGLIN = GeyserEntityDefinition.inherited(ZoglinEntity::new, mobEntityBase) .type(EntityType.ZOGLIN) .height(1.4f).width(1.3965f) .addTranslator(MetadataType.BOOLEAN, ZoglinEntity::setBaby) - .build(); - ZOMBIE = EntityDefinition.inherited(ZombieEntity::new, mobEntityBase) + .build(true); + ZOMBIE = GeyserEntityDefinition.inherited(ZombieEntity::new, mobEntityBase) .type(EntityType.ZOMBIE) .height(1.8f).width(0.6f) .offset(1.62f) .addTranslator(MetadataType.BOOLEAN, ZombieEntity::setZombieBaby) .addTranslator(null) // "set special type", doesn't do anything .addTranslator(MetadataType.BOOLEAN, ZombieEntity::setConvertingToDrowned) - .build(); - ZOMBIE_VILLAGER = EntityDefinition.inherited(ZombieVillagerEntity::new, ZOMBIE) + .build(true); + ZOMBIE_VILLAGER = GeyserEntityDefinition.inherited(ZombieVillagerEntity::new, ZOMBIE) .type(EntityType.ZOMBIE_VILLAGER) .height(1.8f).width(0.6f) .offset(1.62f) .identifier("minecraft:zombie_villager_v2") .addTranslator(MetadataType.BOOLEAN, ZombieVillagerEntity::setTransforming) .addTranslator(MetadataType.VILLAGER_DATA, ZombieVillagerEntity::setZombieVillagerData) - .build(); - ZOMBIFIED_PIGLIN = EntityDefinition.inherited(ZombifiedPiglinEntity::new, ZOMBIE) //TODO test how zombie entity metadata is handled? + .build(true); + ZOMBIFIED_PIGLIN = GeyserEntityDefinition.inherited(ZombifiedPiglinEntity::new, ZOMBIE) //TODO test how zombie entity metadata is handled? .type(EntityType.ZOMBIFIED_PIGLIN) .height(1.95f).width(0.6f) .offset(1.62f) .identifier("minecraft:zombie_pigman") - .build(); + .build(true); - DROWNED = EntityDefinition.inherited(ZOMBIE.factory(), ZOMBIE) + DROWNED = GeyserEntityDefinition.inherited(ZOMBIE.factory(), ZOMBIE) .type(EntityType.DROWNED) .height(1.95f).width(0.6f) - .build(); - HUSK = EntityDefinition.inherited(ZOMBIE.factory(), ZOMBIE) + .build(true); + HUSK = GeyserEntityDefinition.inherited(ZOMBIE.factory(), ZOMBIE) .type(EntityType.HUSK) - .build(); + .build(true); - GUARDIAN = EntityDefinition.inherited(GuardianEntity::new, mobEntityBase) + GUARDIAN = GeyserEntityDefinition.inherited(GuardianEntity::new, mobEntityBase) .type(EntityType.GUARDIAN) .heightAndWidth(0.85f) .addTranslator(null) // Moving //TODO .addTranslator(MetadataType.INT, GuardianEntity::setGuardianTarget) - .build(); - ELDER_GUARDIAN = EntityDefinition.inherited(ElderGuardianEntity::new, GUARDIAN) + .build(true); + ELDER_GUARDIAN = GeyserEntityDefinition.inherited(ElderGuardianEntity::new, GUARDIAN) .type(EntityType.ELDER_GUARDIAN) .heightAndWidth(1.9975f) - .build(); + .build(true); - SLIME = EntityDefinition.inherited(SlimeEntity::new, mobEntityBase) + SLIME = GeyserEntityDefinition.inherited(SlimeEntity::new, mobEntityBase) .type(EntityType.SLIME) .heightAndWidth(0.51f) .addTranslator(MetadataType.INT, SlimeEntity::setScale) - .build(); - MAGMA_CUBE = EntityDefinition.inherited(MagmaCubeEntity::new, SLIME) + .build(true); + MAGMA_CUBE = GeyserEntityDefinition.inherited(MagmaCubeEntity::new, SLIME) .type(EntityType.MAGMA_CUBE) - .build(); + .build(true); - EntityDefinition abstractFishEntityBase = EntityDefinition.inherited(AbstractFishEntity::new, mobEntityBase) + GeyserEntityDefinition abstractFishEntityBase = GeyserEntityDefinition.inherited(AbstractFishEntity::new, mobEntityBase) .addTranslator(null) // From bucket .build(); - COD = EntityDefinition.inherited(abstractFishEntityBase.factory(), abstractFishEntityBase) + COD = GeyserEntityDefinition.inherited(abstractFishEntityBase.factory(), abstractFishEntityBase) .type(EntityType.COD) .height(0.25f).width(0.5f) - .build(); - PUFFERFISH = EntityDefinition.inherited(PufferFishEntity::new, abstractFishEntityBase) + .build(true); + PUFFERFISH = GeyserEntityDefinition.inherited(PufferFishEntity::new, abstractFishEntityBase) .type(EntityType.PUFFERFISH) .heightAndWidth(0.7f) .addTranslator(MetadataType.INT, PufferFishEntity::setPufferfishSize) - .build(); - SALMON = EntityDefinition.inherited(abstractFishEntityBase.factory(), abstractFishEntityBase) + .build(true); + SALMON = GeyserEntityDefinition.inherited(abstractFishEntityBase.factory(), abstractFishEntityBase) .type(EntityType.SALMON) .height(0.5f).width(0.7f) - .build(); - TROPICAL_FISH = EntityDefinition.inherited(TropicalFishEntity::new, abstractFishEntityBase) + .build(true); + TROPICAL_FISH = GeyserEntityDefinition.inherited(TropicalFishEntity::new, abstractFishEntityBase) .type(EntityType.TROPICAL_FISH) .heightAndWidth(0.6f) .identifier("minecraft:tropicalfish") .addTranslator(MetadataType.INT, TropicalFishEntity::setFishVariant) - .build(); + .build(true); - EntityDefinition abstractPiglinEntityBase = EntityDefinition.inherited(BasePiglinEntity::new, mobEntityBase) + GeyserEntityDefinition abstractPiglinEntityBase = GeyserEntityDefinition.inherited(BasePiglinEntity::new, mobEntityBase) .addTranslator(MetadataType.BOOLEAN, BasePiglinEntity::setImmuneToZombification) .build(); - PIGLIN = EntityDefinition.inherited(PiglinEntity::new, abstractPiglinEntityBase) + PIGLIN = GeyserEntityDefinition.inherited(PiglinEntity::new, abstractPiglinEntityBase) .type(EntityType.PIGLIN) .height(1.95f).width(0.6f) .addTranslator(MetadataType.BOOLEAN, PiglinEntity::setBaby) .addTranslator(MetadataType.BOOLEAN, PiglinEntity::setChargingCrossbow) .addTranslator(MetadataType.BOOLEAN, PiglinEntity::setDancing) - .build(); - PIGLIN_BRUTE = EntityDefinition.inherited(abstractPiglinEntityBase.factory(), abstractPiglinEntityBase) + .build(true); + PIGLIN_BRUTE = GeyserEntityDefinition.inherited(abstractPiglinEntityBase.factory(), abstractPiglinEntityBase) .type(EntityType.PIGLIN_BRUTE) .height(1.95f).width(0.6f) - .build(); + .build(true); - GLOW_SQUID = EntityDefinition.inherited(GlowSquidEntity::new, SQUID) + GLOW_SQUID = GeyserEntityDefinition.inherited(GlowSquidEntity::new, SQUID) .type(EntityType.GLOW_SQUID) .addTranslator(null) // Set dark ticks remaining, possible TODO - .build(); + .build(true); - EntityDefinition raidParticipantEntityBase = EntityDefinition.inherited(RaidParticipantEntity::new, mobEntityBase) + GeyserEntityDefinition raidParticipantEntityBase = GeyserEntityDefinition.inherited(RaidParticipantEntity::new, mobEntityBase) .addTranslator(null) // Celebrating //TODO .build(); - EntityDefinition spellcasterEntityBase = EntityDefinition.inherited(SpellcasterIllagerEntity::new, raidParticipantEntityBase) + GeyserEntityDefinition spellcasterEntityBase = GeyserEntityDefinition.inherited(SpellcasterIllagerEntity::new, raidParticipantEntityBase) .addTranslator(MetadataType.BYTE, SpellcasterIllagerEntity::setSpellType) .build(); - EVOKER = EntityDefinition.inherited(spellcasterEntityBase.factory(), spellcasterEntityBase) + EVOKER = GeyserEntityDefinition.inherited(spellcasterEntityBase.factory(), spellcasterEntityBase) .type(EntityType.EVOKER) .height(1.95f).width(0.6f) .identifier("minecraft:evocation_illager") - .build(); - ILLUSIONER = EntityDefinition.inherited(spellcasterEntityBase.factory(), spellcasterEntityBase) + .build(true); + ILLUSIONER = GeyserEntityDefinition.inherited(spellcasterEntityBase.factory(), spellcasterEntityBase) .type(EntityType.ILLUSIONER) .height(1.95f).width(0.6f) .identifier("minecraft:evocation_illager") - .build(); - PILLAGER = EntityDefinition.inherited(PillagerEntity::new, raidParticipantEntityBase) + .build(true); + PILLAGER = GeyserEntityDefinition.inherited(PillagerEntity::new, raidParticipantEntityBase) .type(EntityType.PILLAGER) .height(1.8f).width(0.6f) .offset(1.62f) .addTranslator(null) // Charging; doesn't have an equivalent on Bedrock //TODO check - .build(); - RAVAGER = EntityDefinition.inherited(raidParticipantEntityBase.factory(), raidParticipantEntityBase) + .build(true); + RAVAGER = GeyserEntityDefinition.inherited(raidParticipantEntityBase.factory(), raidParticipantEntityBase) .type(EntityType.RAVAGER) .height(1.9f).width(1.2f) - .build(); - VINDICATOR = EntityDefinition.inherited(VindicatorEntity::new, raidParticipantEntityBase) + .build(true); + VINDICATOR = GeyserEntityDefinition.inherited(VindicatorEntity::new, raidParticipantEntityBase) .type(EntityType.VINDICATOR) .height(1.8f).width(0.6f) .offset(1.62f) - .build(); - WITCH = EntityDefinition.inherited(raidParticipantEntityBase.factory(), raidParticipantEntityBase) + .build(true); + WITCH = GeyserEntityDefinition.inherited(raidParticipantEntityBase.factory(), raidParticipantEntityBase) .type(EntityType.WITCH) .height(1.8f).width(0.6f) .offset(1.62f) .addTranslator(null) // Using item - .build(); + .build(true); } - EntityDefinition ageableEntityBase = EntityDefinition.inherited(AgeableEntity::new, mobEntityBase) + GeyserEntityDefinition ageableEntityBase = GeyserEntityDefinition.inherited(AgeableEntity::new, mobEntityBase) .addTranslator(MetadataType.BOOLEAN, AgeableEntity::setBaby) .build(); // Extends ageable { - AXOLOTL = EntityDefinition.inherited(AxolotlEntity::new, ageableEntityBase) + AXOLOTL = GeyserEntityDefinition.inherited(AxolotlEntity::new, ageableEntityBase) .type(EntityType.AXOLOTL) .height(0.42f).width(0.7f) .addTranslator(MetadataType.INT, AxolotlEntity::setVariant) .addTranslator(MetadataType.BOOLEAN, AxolotlEntity::setPlayingDead) .addTranslator(null) // From bucket - .build(); - BEE = EntityDefinition.inherited(BeeEntity::new, ageableEntityBase) + .build(true); + BEE = GeyserEntityDefinition.inherited(BeeEntity::new, ageableEntityBase) .type(EntityType.BEE) .heightAndWidth(0.6f) .addTranslator(MetadataType.BYTE, BeeEntity::setBeeFlags) .addTranslator(MetadataType.INT, BeeEntity::setAngerTime) - .build(); - CHICKEN = EntityDefinition.inherited(ChickenEntity::new, ageableEntityBase) + .build(true); + CHICKEN = GeyserEntityDefinition.inherited(ChickenEntity::new, ageableEntityBase) .type(EntityType.CHICKEN) .height(0.7f).width(0.4f) - .build(); - COW = EntityDefinition.inherited(CowEntity::new, ageableEntityBase) + .build(true); + COW = GeyserEntityDefinition.inherited(CowEntity::new, ageableEntityBase) .type(EntityType.COW) .height(1.4f).width(0.9f) - .build(); - FOX = EntityDefinition.inherited(FoxEntity::new, ageableEntityBase) + .build(true); + FOX = GeyserEntityDefinition.inherited(FoxEntity::new, ageableEntityBase) .type(EntityType.FOX) .height(0.5f).width(1.25f) .addTranslator(MetadataType.INT, FoxEntity::setFoxVariant) .addTranslator(MetadataType.BYTE, FoxEntity::setFoxFlags) .addTranslator(null) // Trusted player 1 .addTranslator(null) // Trusted player 2 - .build(); - HOGLIN = EntityDefinition.inherited(HoglinEntity::new, ageableEntityBase) + .build(true); + HOGLIN = GeyserEntityDefinition.inherited(HoglinEntity::new, ageableEntityBase) .type(EntityType.HOGLIN) .height(1.4f).width(1.3965f) .addTranslator(MetadataType.BOOLEAN, HoglinEntity::setImmuneToZombification) - .build(); - GOAT = EntityDefinition.inherited(GoatEntity::new, ageableEntityBase) + .build(true); + GOAT = GeyserEntityDefinition.inherited(GoatEntity::new, ageableEntityBase) .type(EntityType.GOAT) .height(1.3f).width(0.9f) .addTranslator(MetadataType.BOOLEAN, GoatEntity::setScreamer) - .build(); - MOOSHROOM = EntityDefinition.inherited(MooshroomEntity::new, ageableEntityBase) + .build(true); + MOOSHROOM = GeyserEntityDefinition.inherited(MooshroomEntity::new, ageableEntityBase) .type(EntityType.MOOSHROOM) .height(1.4f).width(0.9f) .addTranslator(MetadataType.STRING, MooshroomEntity::setVariant) - .build(); - OCELOT = EntityDefinition.inherited(OcelotEntity::new, ageableEntityBase) + .build(true); + OCELOT = GeyserEntityDefinition.inherited(OcelotEntity::new, ageableEntityBase) .type(EntityType.OCELOT) .height(0.7f).width(0.6f) .addTranslator(MetadataType.BOOLEAN, (ocelotEntity, entityMetadata) -> ocelotEntity.setFlag(EntityFlag.TRUSTING, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) - .build(); - PANDA = EntityDefinition.inherited(PandaEntity::new, ageableEntityBase) + .build(true); + PANDA = GeyserEntityDefinition.inherited(PandaEntity::new, ageableEntityBase) .type(EntityType.PANDA) .height(1.25f).width(1.125f) .addTranslator(null) // Unhappy counter @@ -764,36 +764,36 @@ public final class EntityDefinitions { .addTranslator(MetadataType.BYTE, PandaEntity::setMainGene) .addTranslator(MetadataType.BYTE, PandaEntity::setHiddenGene) .addTranslator(MetadataType.BYTE, PandaEntity::setPandaFlags) - .build(); - PIG = EntityDefinition.inherited(PigEntity::new, ageableEntityBase) + .build(true); + PIG = GeyserEntityDefinition.inherited(PigEntity::new, ageableEntityBase) .type(EntityType.PIG) .heightAndWidth(0.9f) .addTranslator(MetadataType.BOOLEAN, (pigEntity, entityMetadata) -> pigEntity.setFlag(EntityFlag.SADDLED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) .addTranslator(null) // Boost time - .build(); - POLAR_BEAR = EntityDefinition.inherited(PolarBearEntity::new, ageableEntityBase) + .build(true); + POLAR_BEAR = GeyserEntityDefinition.inherited(PolarBearEntity::new, ageableEntityBase) .type(EntityType.POLAR_BEAR) .height(1.4f).width(1.3f) .addTranslator(MetadataType.BOOLEAN, (entity, entityMetadata) -> entity.setFlag(EntityFlag.STANDING, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) - .build(); - RABBIT = EntityDefinition.inherited(RabbitEntity::new, ageableEntityBase) + .build(true); + RABBIT = GeyserEntityDefinition.inherited(RabbitEntity::new, ageableEntityBase) .type(EntityType.RABBIT) .height(0.5f).width(0.4f) .addTranslator(MetadataType.INT, RabbitEntity::setRabbitVariant) - .build(); - SHEEP = EntityDefinition.inherited(SheepEntity::new, ageableEntityBase) + .build(true); + SHEEP = GeyserEntityDefinition.inherited(SheepEntity::new, ageableEntityBase) .type(EntityType.SHEEP) .height(1.3f).width(0.9f) .addTranslator(MetadataType.BYTE, SheepEntity::setSheepFlags) - .build(); - STRIDER = EntityDefinition.inherited(StriderEntity::new, ageableEntityBase) + .build(true); + STRIDER = GeyserEntityDefinition.inherited(StriderEntity::new, ageableEntityBase) .type(EntityType.STRIDER) .height(1.7f).width(0.9f) .addTranslator(null) // Boost time .addTranslator(MetadataType.BOOLEAN, StriderEntity::setCold) .addTranslator(MetadataType.BOOLEAN, StriderEntity::setSaddled) - .build(); - TURTLE = EntityDefinition.inherited(TurtleEntity::new, ageableEntityBase) + .build(true); + TURTLE = GeyserEntityDefinition.inherited(TurtleEntity::new, ageableEntityBase) .type(EntityType.TURTLE) .height(0.4f).width(1.2f) .addTranslator(null) // Home position @@ -802,100 +802,100 @@ public final class EntityDefinitions { .addTranslator(null) // Travel position .addTranslator(null) // Going home .addTranslator(null) // Travelling - .build(); + .build(true); - EntityDefinition abstractVillagerEntityBase = EntityDefinition.inherited(AbstractMerchantEntity::new, ageableEntityBase) + GeyserEntityDefinition abstractVillagerEntityBase = GeyserEntityDefinition.inherited(AbstractMerchantEntity::new, ageableEntityBase) .addTranslator(null) // Unhappy ticks .build(); - VILLAGER = EntityDefinition.inherited(VillagerEntity::new, abstractVillagerEntityBase) + VILLAGER = GeyserEntityDefinition.inherited(VillagerEntity::new, abstractVillagerEntityBase) .type(EntityType.VILLAGER) .height(1.8f).width(0.6f) .offset(1.62f) .identifier("minecraft:villager_v2") .addTranslator(MetadataType.VILLAGER_DATA, VillagerEntity::setVillagerData) - .build(); - WANDERING_TRADER = EntityDefinition.inherited(abstractVillagerEntityBase.factory(), abstractVillagerEntityBase) + .build(true); + WANDERING_TRADER = GeyserEntityDefinition.inherited(abstractVillagerEntityBase.factory(), abstractVillagerEntityBase) .type(EntityType.WANDERING_TRADER) .height(1.8f).width(0.6f) .offset(1.62f) - .build(); + .build(true); } // Horses { - EntityDefinition abstractHorseEntityBase = EntityDefinition.inherited(AbstractHorseEntity::new, ageableEntityBase) + GeyserEntityDefinition abstractHorseEntityBase = GeyserEntityDefinition.inherited(AbstractHorseEntity::new, ageableEntityBase) .addTranslator(MetadataType.BYTE, AbstractHorseEntity::setHorseFlags) .addTranslator(null) // UUID of owner .build(); - HORSE = EntityDefinition.inherited(HorseEntity::new, abstractHorseEntityBase) + HORSE = GeyserEntityDefinition.inherited(HorseEntity::new, abstractHorseEntityBase) .type(EntityType.HORSE) .height(1.6f).width(1.3965f) .addTranslator(MetadataType.INT, HorseEntity::setHorseVariant) - .build(); - SKELETON_HORSE = EntityDefinition.inherited(SkeletonHorseEntity::new, abstractHorseEntityBase) + .build(true); + SKELETON_HORSE = GeyserEntityDefinition.inherited(SkeletonHorseEntity::new, abstractHorseEntityBase) .type(EntityType.SKELETON_HORSE) .height(1.6f).width(1.3965f) - .build(); - ZOMBIE_HORSE = EntityDefinition.inherited(ZombieHorseEntity::new, abstractHorseEntityBase) + .build(true); + ZOMBIE_HORSE = GeyserEntityDefinition.inherited(ZombieHorseEntity::new, abstractHorseEntityBase) .type(EntityType.ZOMBIE_HORSE) .height(1.6f).width(1.3965f) - .build(); - EntityDefinition chestedHorseEntityBase = EntityDefinition.inherited(ChestedHorseEntity::new, abstractHorseEntityBase) + .build(true); + GeyserEntityDefinition chestedHorseEntityBase = GeyserEntityDefinition.inherited(ChestedHorseEntity::new, abstractHorseEntityBase) .addTranslator(MetadataType.BOOLEAN, (horseEntity, entityMetadata) -> horseEntity.setFlag(EntityFlag.CHESTED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) .build(); - DONKEY = EntityDefinition.inherited(chestedHorseEntityBase.factory(), chestedHorseEntityBase) + DONKEY = GeyserEntityDefinition.inherited(chestedHorseEntityBase.factory(), chestedHorseEntityBase) .type(EntityType.DONKEY) .height(1.6f).width(1.3965f) - .build(); - MULE = EntityDefinition.inherited(chestedHorseEntityBase.factory(), chestedHorseEntityBase) + .build(true); + MULE = GeyserEntityDefinition.inherited(chestedHorseEntityBase.factory(), chestedHorseEntityBase) .type(EntityType.MULE) .height(1.6f).width(1.3965f) - .build(); - LLAMA = EntityDefinition.inherited(LlamaEntity::new, chestedHorseEntityBase) + .build(true); + LLAMA = GeyserEntityDefinition.inherited(LlamaEntity::new, chestedHorseEntityBase) .type(EntityType.LLAMA) .height(1.87f).width(0.9f) .addTranslator(MetadataType.INT, (entity, entityMetadata) -> entity.getDirtyMetadata().put(EntityData.STRENGTH, entityMetadata.getValue())) .addTranslator(MetadataType.INT, LlamaEntity::setCarpetedColor) .addTranslator(MetadataType.INT, (entity, entityMetadata) -> entity.getDirtyMetadata().put(EntityData.VARIANT, entityMetadata.getValue())) - .build(); - TRADER_LLAMA = EntityDefinition.inherited(TraderLlamaEntity::new, LLAMA) + .build(true); + TRADER_LLAMA = GeyserEntityDefinition.inherited(TraderLlamaEntity::new, LLAMA) .type(EntityType.TRADER_LLAMA) .identifier("minecraft:llama") - .build(); + .build(true); } - EntityDefinition tameableEntityBase = EntityDefinition.inherited(TameableEntity::new, ageableEntityBase) + GeyserEntityDefinition tameableEntityBase = GeyserEntityDefinition.inherited(TameableEntity::new, ageableEntityBase) .addTranslator(MetadataType.BYTE, TameableEntity::setTameableFlags) .addTranslator(MetadataType.OPTIONAL_UUID, TameableEntity::setOwner) .build(); - CAT = EntityDefinition.inherited(CatEntity::new, tameableEntityBase) + CAT = GeyserEntityDefinition.inherited(CatEntity::new, tameableEntityBase) .type(EntityType.CAT) .height(0.35f).width(0.3f) .addTranslator(MetadataType.INT, CatEntity::setCatVariant) .addTranslator(MetadataType.BOOLEAN, CatEntity::setResting) .addTranslator(null) // "resting state one" //TODO .addTranslator(MetadataType.INT, CatEntity::setCollarColor) - .build(); - PARROT = EntityDefinition.inherited(ParrotEntity::new, tameableEntityBase) + .build(true); + PARROT = GeyserEntityDefinition.inherited(ParrotEntity::new, tameableEntityBase) .type(EntityType.PARROT) .height(0.9f).width(0.5f) .addTranslator(MetadataType.INT, (parrotEntity, entityMetadata) -> parrotEntity.getDirtyMetadata().put(EntityData.VARIANT, entityMetadata.getValue())) // Parrot color - .build(); - WOLF = EntityDefinition.inherited(WolfEntity::new, tameableEntityBase) + .build(true); + WOLF = GeyserEntityDefinition.inherited(WolfEntity::new, tameableEntityBase) .type(EntityType.WOLF) .height(0.85f).width(0.6f) // "Begging" on wiki.vg, "Interested" in Nukkit - the tilt of the head .addTranslator(MetadataType.BOOLEAN, (wolfEntity, entityMetadata) -> wolfEntity.setFlag(EntityFlag.INTERESTED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue())) .addTranslator(MetadataType.INT, WolfEntity::setCollarColor) .addTranslator(MetadataType.INT, WolfEntity::setWolfAngerTime) - .build(); + .build(true); // As of 1.18 these don't track entity data at all - ENDER_DRAGON_PART = EntityDefinition.builder(null) + ENDER_DRAGON_PART = GeyserEntityDefinition.builder(null) .identifier("minecraft:armor_stand") // Emulated .build(false); // Never sent over the network - Registries.JAVA_ENTITY_IDENTIFIERS.get().put("minecraft:marker", null); // We don't need an entity definition for this as it is never sent over the network + Registries.ENTITY_IDENTIFIERS.get().put("minecraft:marker", null); // We don't need an entity definition for this as it is never sent over the network } public static void init() { diff --git a/core/src/main/java/org/geysermc/geyser/entity/EntityDefinition.java b/core/src/main/java/org/geysermc/geyser/entity/GeyserEntityDefinition.java similarity index 50% rename from core/src/main/java/org/geysermc/geyser/entity/EntityDefinition.java rename to core/src/main/java/org/geysermc/geyser/entity/GeyserEntityDefinition.java index 566b3daff..560311018 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/EntityDefinition.java +++ b/core/src/main/java/org/geysermc/geyser/entity/GeyserEntityDefinition.java @@ -28,17 +28,25 @@ package org.geysermc.geyser.entity; import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata; import com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType; import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType; +import com.nukkitx.nbt.NbtMap; +import com.nukkitx.nbt.NbtType; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import lombok.Setter; +import lombok.ToString; import lombok.experimental.Accessors; import org.geysermc.geyser.GeyserImpl; +import org.geysermc.geyser.api.entity.EntityDefinition; +import org.geysermc.geyser.api.entity.EntityIdentifier; import org.geysermc.geyser.entity.factory.EntityFactory; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.translator.entity.EntityMetadataTranslator; +import org.geysermc.geyser.util.EntityUtils; +import java.util.ArrayList; import java.util.List; import java.util.Locale; +import java.util.Optional; import java.util.function.BiConsumer; /** @@ -48,15 +56,16 @@ import java.util.function.BiConsumer; * * @param the entity type this definition represents */ -public record EntityDefinition(EntityFactory factory, EntityType entityType, String identifier, - float width, float height, float offset, List> translators) { +public record GeyserEntityDefinition(EntityFactory factory, EntityType entityType, EntityIdentifier entityIdentifier, + float width, float height, float offset, List> translators, + boolean custom) implements EntityDefinition { - public static Builder inherited(EntityFactory factory, EntityDefinition parent) { - return new Builder<>(factory, parent.entityType, parent.identifier, parent.width, parent.height, parent.offset, new ObjectArrayList<>(parent.translators)); + public static EntityDefinitionBuilder inherited(EntityFactory factory, GeyserEntityDefinition parent) { + return new EntityDefinitionBuilder<>(factory, parent.entityType, parent.entityIdentifier, parent.width, parent.height, parent.offset, new ObjectArrayList<>(parent.translators)); } - public static Builder builder(EntityFactory factory) { - return new Builder<>(factory); + public static EntityDefinitionBuilder builder(EntityFactory factory) { + return new EntityDefinitionBuilder<>(factory); } public void translateMetadata(T entity, EntityMetadata> metadata) { @@ -77,23 +86,52 @@ public record EntityDefinition(EntityFactory factory, Entit translator.translate(entity, metadata); } + public String identifier() { + return this.entityIdentifier.identifier(); + } + + public boolean isRegistered() { + return Registries.ENTITY_DEFINITIONS.get().containsValue(this); + } + + public EntityDefinitionBuilder toBuilder() { + return new EntityDefinitionBuilder<>(this); + } + @Setter @Accessors(fluent = true, chain = true) - public static class Builder { + public static class EntityDefinitionBuilder implements EntityDefinition.Builder { private final EntityFactory factory; private EntityType type; - private String identifier; + private EntityIdentifier identifier; private float width; private float height; private float offset = 0.00001f; private final List> translators; + private final boolean custom; - private Builder(EntityFactory factory) { - this.factory = factory; - translators = new ObjectArrayList<>(); + private EntityDefinitionBuilder(GeyserEntityDefinition definition) { + this.factory = definition.factory; + this.type = definition.entityType; + this.identifier = definition.entityIdentifier; + this.width = definition.width; + this.height = definition.height; + this.offset = definition.offset; + this.translators = new ArrayList<>(definition.translators); + this.custom = definition.custom; } - public Builder(EntityFactory factory, EntityType type, String identifier, float width, float height, float offset, List> translators) { + private EntityDefinitionBuilder(EntityFactory factory) { + this(factory, false); + } + + public EntityDefinitionBuilder(EntityFactory factory, boolean custom) { + this.factory = factory; + this.translators = new ObjectArrayList<>(); + this.custom = custom; + } + + public EntityDefinitionBuilder(EntityFactory factory, EntityType type, EntityIdentifier identifier, float width, float height, float offset, List> translators) { this.factory = factory; this.type = type; this.identifier = identifier; @@ -101,18 +139,46 @@ public record EntityDefinition(EntityFactory factory, Entit this.height = height; this.offset = offset; this.translators = translators; + this.custom = false; + } + + @Override + public EntityDefinitionBuilder identifier(EntityIdentifier identifier) { + this.identifier = identifier; + return this; + } + + public EntityDefinitionBuilder identifier(String identifier) { + NbtMap nbt = Registries.BEDROCK_ENTITY_IDENTIFIERS.get(); + List idlist = nbt.getList("idlist", NbtType.COMPOUND); + Optional entityIdentifier = idlist.stream().filter(tag -> tag.getString("id").equals(identifier)).findFirst(); + + // Create a fake entity identifier for entities which are + // in Java but may not be in Bedrock (e.g. item frames). + if (entityIdentifier.isEmpty()) { + this.identifier = new GeyserEntityIdentifier(NbtMap.builder() + .putString("id", identifier) + .putBoolean("hasspawnegg", false) + .putBoolean("summonable", false) + .build()); + + return this; + } + + this.identifier = new GeyserEntityIdentifier(entityIdentifier.get()); + return this; } /** * Sets the height and width as one value */ - public Builder heightAndWidth(float value) { + public EntityDefinitionBuilder heightAndWidth(float value) { height = value; width = value; return this; } - public Builder offset(float offset) { + public EntityDefinitionBuilder offset(float offset) { this.offset = offset + 0.00001f; return this; } @@ -120,39 +186,44 @@ public record EntityDefinition(EntityFactory factory, Entit /** * Resets the identifier as well */ - public Builder type(EntityType type) { + public EntityDefinitionBuilder type(EntityType type) { this.type = type; identifier = null; return this; } - public >> Builder addTranslator(MetadataType type, BiConsumer translateFunction) { + public >> EntityDefinitionBuilder addTranslator(MetadataType type, BiConsumer translateFunction) { translators.add(new EntityMetadataTranslator<>(type, translateFunction)); return this; } - public Builder addTranslator(EntityMetadataTranslator translator) { + public EntityDefinitionBuilder addTranslator(EntityMetadataTranslator translator) { translators.add(translator); return this; } - public EntityDefinition build() { - return build(true); + public GeyserEntityDefinition build() { + return build(false); } /** * @param register whether to register this entity in the Registries for entity types. Generally this should be * set to false if we're not expecting this entity to spawn from the network. */ - public EntityDefinition build(boolean register) { - if (identifier == null && type != null) { + public GeyserEntityDefinition build(boolean register) { + String identifier = null; + if (this.identifier == null && type != null) { identifier = "minecraft:" + type.name().toLowerCase(Locale.ROOT); + this.identifier(identifier); + } else if (this.identifier != null && type == null) { + identifier = this.identifier.identifier(); } - EntityDefinition definition = new EntityDefinition<>(factory, type, identifier, width, height, offset, translators); - if (register && definition.entityType() != null) { - Registries.ENTITY_DEFINITIONS.get().putIfAbsent(definition.entityType(), definition); - Registries.JAVA_ENTITY_IDENTIFIERS.get().putIfAbsent("minecraft:" + type.name().toLowerCase(Locale.ROOT), definition); + + GeyserEntityDefinition definition = new GeyserEntityDefinition<>(factory, type, this.identifier, width, height, offset, translators, custom); + if (register && identifier != null) { + EntityUtils.registerEntity(identifier, definition); } + return definition; } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/GeyserEntityIdentifier.java b/core/src/main/java/org/geysermc/geyser/entity/GeyserEntityIdentifier.java index 9a4a5e5d5..6643326da 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/GeyserEntityIdentifier.java +++ b/core/src/main/java/org/geysermc/geyser/entity/GeyserEntityIdentifier.java @@ -33,7 +33,7 @@ import org.geysermc.geyser.api.entity.EntityIdentifier; import java.util.concurrent.atomic.AtomicInteger; public record GeyserEntityIdentifier(NbtMap nbt) implements EntityIdentifier { - private static final AtomicInteger RUNTIME_ID_ALLOCATORS = new AtomicInteger(100000); + private static final AtomicInteger RUNTIME_ID_ALLOCATOR = new AtomicInteger(100000); @Override public boolean hasSpawnEgg() { @@ -76,7 +76,7 @@ public record GeyserEntityIdentifier(NbtMap nbt) implements EntityIdentifier { public EntityIdentifier build() { // Vanilla registry information this.nbt.putString("bid", ""); - this.nbt.putInt("rid", RUNTIME_ID_ALLOCATORS.getAndIncrement()); + this.nbt.putInt("rid", RUNTIME_ID_ALLOCATOR.getAndIncrement()); this.nbt.putBoolean("experimental", false); return new GeyserEntityIdentifier(this.nbt.build()); diff --git a/core/src/main/java/org/geysermc/geyser/entity/factory/EntityFactory.java b/core/src/main/java/org/geysermc/geyser/entity/factory/EntityFactory.java index 9f23cdc78..bb427ecf3 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/factory/EntityFactory.java +++ b/core/src/main/java/org/geysermc/geyser/entity/factory/EntityFactory.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.factory; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.session.GeyserSession; @@ -37,5 +37,5 @@ import java.util.UUID; */ public interface EntityFactory { - T create(GeyserSession session, int javaId, long bedrockId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw); + T create(GeyserSession session, int javaId, long bedrockId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java index 963e0b70a..c47b4663f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/AbstractArrowEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractArrowEntity extends Entity { - public AbstractArrowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractArrowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Set the correct texture if using the resource pack diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java index 164fbf705..499f9978c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.data.game.level.particle.Particle; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.Registries; @@ -39,7 +39,7 @@ import java.util.UUID; public class AreaEffectCloudEntity extends Entity { - public AreaEffectCloudEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AreaEffectCloudEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java index 9fd96f46b..e8198e402 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java @@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.packet.AnimatePacket; import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import lombok.Getter; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -68,7 +68,7 @@ public class BoatEntity extends Entity { // Looks too fast and too choppy with 0.1f, which is how I believe the Microsoftian client handles it private final float ROWING_SPEED = 0.05f; - public BoatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BoatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { // Initial rotation is incorrect super(session, entityId, geyserId, uuid, definition, position.add(0d, definition.offset(), 0d), motion, yaw + 90, 0, yaw + 90); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java index 251eb98a0..c6e147a3b 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/CommandBlockMinecartEntity.java @@ -31,7 +31,7 @@ import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import com.nukkitx.protocol.bedrock.packet.ContainerOpenPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; import org.geysermc.geyser.util.InteractiveTag; @@ -40,7 +40,7 @@ import java.util.UUID; public class CommandBlockMinecartEntity extends DefaultBlockMinecartEntity { - public CommandBlockMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CommandBlockMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java index ab43bf7b3..ea1ab6b0d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/DefaultBlockMinecartEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -43,7 +43,7 @@ public class DefaultBlockMinecartEntity extends MinecartEntity { public int customBlockOffset = 0; public boolean showCustomBlock = false; - public DefaultBlockMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public DefaultBlockMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); dirtyMetadata.put(EntityData.CUSTOM_DISPLAY, (byte) 1); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java index a1e91bfd2..ab5d8d427 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/EnderCrystalEntity.java @@ -31,7 +31,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.Optional; @@ -39,7 +39,7 @@ import java.util.UUID; public class EnderCrystalEntity extends Entity { - public EnderCrystalEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EnderCrystalEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java b/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java index a841bc05d..5786a3d5c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/Entity.java @@ -42,7 +42,9 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; import net.kyori.adventure.text.Component; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.GeyserImpl; +import org.geysermc.geyser.api.event.downstream.entity.ServerSpawnEntityEvent; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.GeyserDirtyMetadata; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -80,7 +82,7 @@ public class Entity { */ protected boolean onGround; - protected EntityDefinition definition; + protected GeyserEntityDefinition definition; /** * Indicates if the entity has been initialized and spawned @@ -116,7 +118,7 @@ public class Entity { @Setter(AccessLevel.PROTECTED) // For players private boolean flagsDirty = false; - public Entity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public Entity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { this.session = session; this.entityId = entityId; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/EvokerFangsEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/EvokerFangsEntity.java index 03c71cec6..aa752608e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/EvokerFangsEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/EvokerFangsEntity.java @@ -29,7 +29,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -39,7 +39,7 @@ public class EvokerFangsEntity extends Entity implements Tickable { private int limitedLife = 22; private boolean attackStarted = false; - public EvokerFangsEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EvokerFangsEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // As of 1.18.2 Bedrock, this line is required for the entity to be visible // 22 is the starting number on Java Edition diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FireballEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FireballEntity.java index 135f58906..0bb7614dc 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FireballEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FireballEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -39,7 +39,7 @@ public class FireballEntity extends ThrowableEntity { */ protected int futureTicks = 3; - public FireballEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FireballEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, Vector3f.ZERO, yaw, pitch, headYaw); float magnitude = motion.length(); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java index fa22422ba..7208eafb4 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FireworkEntity.java @@ -36,7 +36,7 @@ import com.nukkitx.nbt.NbtMapBuilder; import com.nukkitx.nbt.NbtType; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.player.PlayerEntity; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.FireworkColor; @@ -50,7 +50,7 @@ import java.util.UUID; public class FireworkEntity extends Entity { - public FireworkEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FireworkEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java index dbd9bf91f..c5a8a689d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FurnaceMinecartEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.util.InteractionResult; @@ -39,7 +39,7 @@ import java.util.UUID; public class FurnaceMinecartEntity extends DefaultBlockMinecartEntity { private boolean hasFuel = false; - public FurnaceMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FurnaceMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java index f36a7c732..06dd75c32 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ItemEntity.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.AddItemEntityPacket; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; import org.geysermc.geyser.level.block.BlockStateValues; @@ -46,7 +46,7 @@ public class ItemEntity extends ThrowableEntity { private int waterLevel = -1; - public ItemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ItemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java index 9cfa22a1f..d6001f990 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ItemFrameEntity.java @@ -39,7 +39,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket; import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket; import lombok.Getter; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.item.ItemTranslator; @@ -79,7 +79,7 @@ public class ItemFrameEntity extends Entity { */ private boolean changed = true; - public ItemFrameEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) { + public ItemFrameEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, Direction direction) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, 0f); NbtMapBuilder blockBuilder = NbtMap.builder() diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java index 4ff1dfe7c..c55af6a2e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/LeashKnotEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type; import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -35,7 +35,7 @@ import java.util.UUID; public class LeashKnotEntity extends Entity { - public LeashKnotEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LeashKnotEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { // Position is incorrect by default super(session, entityId, geyserId, uuid, definition, position.add(0.5f, 0.25f, 0.5f), motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java index 3adb30e24..218fbc259 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/LightningEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -35,7 +35,7 @@ import java.util.concurrent.ThreadLocalRandom; public class LightningEntity extends Entity { - public LightningEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LightningEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java index 0cce0f8df..35faee609 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/LivingEntity.java @@ -49,7 +49,7 @@ import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; @@ -85,7 +85,7 @@ public class LivingEntity extends Entity { */ private boolean isMaxFrozenState = false; - public LivingEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LivingEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java index 6f722864b..793e91bfd 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/MinecartEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -40,7 +40,7 @@ import java.util.UUID; public class MinecartEntity extends Entity { - public MinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position.add(0d, definition.offset(), 0d), motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java index 5f7c906e9..d3682ad1b 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/SpawnerMinecartEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; @@ -35,7 +35,7 @@ import java.util.UUID; public class SpawnerMinecartEntity extends DefaultBlockMinecartEntity { - public SpawnerMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpawnerMinecartEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java index 38f4dba25..c7f3e6b13 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/TNTEntity.java @@ -30,7 +30,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -38,7 +38,7 @@ import java.util.UUID; public class TNTEntity extends Entity implements Tickable { private int currentTick; - public TNTEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TNTEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java index ad8b60bdb..070713359 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableEntity.java @@ -31,7 +31,7 @@ import com.nukkitx.protocol.bedrock.data.LevelEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.LevelEventPacket; import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; @@ -44,7 +44,7 @@ public class ThrowableEntity extends Entity implements Tickable { protected Vector3f lastJavaPosition; - public ThrowableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrowableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); this.lastJavaPosition = position; } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java index 47031e27b..0ec406e93 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadat import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -44,7 +44,7 @@ public class ThrowableItemEntity extends ThrowableEntity { private int age; private boolean invisible; - public ThrowableItemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrowableItemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.INVISIBLE, true); invisible = false; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java index 6f6125f2d..2e4ab4bec 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/ThrownPotionEntity.java @@ -33,7 +33,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.item.Potion; import org.geysermc.geyser.registry.type.ItemMapping; @@ -44,7 +44,7 @@ import java.util.UUID; public class ThrownPotionEntity extends ThrowableItemEntity { private static final EnumSet NON_ENCHANTED_POTIONS = EnumSet.of(Potion.WATER, Potion.MUNDANE, Potion.THICK, Potion.AWKWARD); - public ThrownPotionEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ThrownPotionEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java index d296019c1..f85ba8537 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/TippedArrowEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.inventory.item.TippedArrowPotion; @@ -39,7 +39,7 @@ import java.util.UUID; */ public class TippedArrowEntity extends AbstractArrowEntity { - public TippedArrowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TippedArrowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java index 09d315b19..82eeec49f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/TridentEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class TridentEntity extends AbstractArrowEntity { - public TridentEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TridentEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java index f70d4afc1..9bfe057f5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/WitherSkullEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.session.GeyserSession; @@ -36,7 +36,7 @@ import java.util.UUID; public class WitherSkullEntity extends FireballEntity { private boolean isCharged; - public WitherSkullEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WitherSkullEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); this.futureTicks = 1; diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java index e6cd13f61..faa27601b 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/AbstractFishEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.EntityUtils; @@ -38,7 +38,7 @@ import java.util.UUID; public class AbstractFishEntity extends WaterEntity { - public AbstractFishEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractFishEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.CAN_SWIM, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java index 2d1de8ed2..181cb7832 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/AgeableEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AgeableEntity extends CreatureEntity { - public AgeableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AgeableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java index d4c627a8e..6e0f417c9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/AmbientEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AmbientEntity extends MobEntity { - public AmbientEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AmbientEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java index 18076763e..ecefa82a1 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java @@ -28,7 +28,6 @@ package org.geysermc.geyser.entity.type.living; import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata; import com.github.steveice10.mc.protocol.data.game.entity.metadata.Rotation; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; -import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; @@ -37,7 +36,7 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import lombok.Getter; import net.kyori.adventure.text.Component; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.LivingEntity; import org.geysermc.geyser.session.GeyserSession; @@ -82,7 +81,7 @@ public class ArmorStandEntity extends LivingEntity { */ private boolean positionUpdateRequired = false; - public ArmorStandEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ArmorStandEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java index f6bfd8e26..2618cfb92 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/BatEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class BatEntity extends AmbientEntity { - public BatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java index c19b00b21..0eddb52ac 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/CreatureEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class CreatureEntity extends MobEntity { - public CreatureEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CreatureEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/DolphinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/DolphinEntity.java index 7085547f8..6fc02a4c4 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/DolphinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/DolphinEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -36,7 +36,7 @@ import javax.annotation.Nonnull; import java.util.UUID; public class DolphinEntity extends WaterEntity { - public DolphinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public DolphinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java index 10d9dc417..196a968a9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/FlyingEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class FlyingEntity extends MobEntity { - public FlyingEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FlyingEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java index 277eee027..8f03d2357 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/GlowSquidEntity.java @@ -26,13 +26,13 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GlowSquidEntity extends SquidEntity { - public GlowSquidEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GlowSquidEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java index c6f5727a4..d0870d7ea 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/GolemEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GolemEntity extends CreatureEntity { - public GolemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GolemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java index 4ab36b00e..9f004eba8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/IronGolemEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -38,7 +38,7 @@ import java.util.UUID; public class IronGolemEntity extends GolemEntity { - public IronGolemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public IronGolemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Indicate that we should show cracks through a resource pack setFlag(EntityFlag.BRIBED, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java index 2d988373c..b64ba7fb5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/MagmaCubeEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class MagmaCubeEntity extends SlimeEntity { - public MagmaCubeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MagmaCubeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java index 8734f8bd1..f4d4f8138 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/MobEntity.java @@ -31,7 +31,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import lombok.Getter; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.LivingEntity; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.item.StoredItemMappings; @@ -50,7 +50,7 @@ public class MobEntity extends LivingEntity { @Getter private long leashHolderBedrockId; - public MobEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MobEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java index 26cf2d627..907cfe6f0 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/SlimeEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SlimeEntity extends MobEntity { - public SlimeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SlimeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java index 794f71c04..2f9c68d53 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/SnowGolemEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -39,7 +39,7 @@ import java.util.UUID; public class SnowGolemEntity extends GolemEntity { - public SnowGolemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SnowGolemEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java index 552f6a46c..5dcadacc8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/SquidEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.Tickable; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.level.block.BlockStateValues; @@ -41,7 +41,7 @@ public class SquidEntity extends WaterEntity implements Tickable { private boolean inWater; - public SquidEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SquidEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java index 44275a7b1..1406a0b73 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/WaterEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type.living; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class WaterEntity extends CreatureEntity { - public WaterEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WaterEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java index 64f41c5ad..86153e4fd 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AnimalEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.AgeableEntity; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; @@ -41,7 +41,7 @@ import java.util.UUID; public class AnimalEntity extends AgeableEntity { - public AnimalEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AnimalEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java index aafa2b782..ed4f1271c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/AxolotlEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -41,7 +41,7 @@ import javax.annotation.Nonnull; import java.util.UUID; public class AxolotlEntity extends AnimalEntity { - public AxolotlEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AxolotlEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java index 09b1b73c5..87939f3e6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/BeeEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -40,7 +40,7 @@ import java.util.UUID; public class BeeEntity extends AnimalEntity { - public BeeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BeeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java index c5fad8bb8..b9f197713 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -34,7 +34,7 @@ import java.util.UUID; public class ChickenEntity extends AnimalEntity { - public ChickenEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ChickenEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/CowEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/CowEntity.java index b5ae48b23..ed10f4c5f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/CowEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/CowEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -38,7 +38,7 @@ import javax.annotation.Nonnull; import java.util.UUID; public class CowEntity extends AnimalEntity { - public CowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java index 5ae3bd524..ef5f915c7 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/FoxEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -38,7 +38,7 @@ import java.util.UUID; public class FoxEntity extends AnimalEntity { - public FoxEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public FoxEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java index 817b466fa..21533c7ae 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/GoatEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -44,7 +44,7 @@ public class GoatEntity extends AnimalEntity { private boolean isScreamer; - public GoatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GoatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java index 362c25256..ff08a05a6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/HoglinEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.session.GeyserSession; @@ -37,7 +37,7 @@ import java.util.UUID; public class HoglinEntity extends AnimalEntity { private boolean isImmuneToZombification; - public HoglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public HoglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java index c249663ac..8b39882b2 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/MooshroomEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ObjectEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.inventory.item.StoredItemMappings; import org.geysermc.geyser.session.GeyserSession; @@ -41,7 +41,7 @@ import java.util.UUID; public class MooshroomEntity extends AnimalEntity { private boolean isBrown = false; - public MooshroomEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MooshroomEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java index 4ed2bdce1..493955a82 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/OcelotEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -39,7 +39,7 @@ import java.util.UUID; public class OcelotEntity extends AnimalEntity { - public OcelotEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public OcelotEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java index d607f113b..5c8745415 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PandaEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -47,7 +47,7 @@ public class PandaEntity extends AnimalEntity { private Gene mainGene = Gene.NORMAL; private Gene hiddenGene = Gene.NORMAL; - public PandaEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PandaEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java index 05f628f44..948617875 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PigEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -40,7 +40,7 @@ import java.util.UUID; public class PigEntity extends AnimalEntity { - public PigEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PigEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java index b677c135e..16392545e 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PolarBearEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -34,7 +34,7 @@ import java.util.UUID; public class PolarBearEntity extends AnimalEntity { - public PolarBearEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PolarBearEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java index 76ba15e09..6ca9873a7 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/PufferFishEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.AbstractFishEntity; import org.geysermc.geyser.session.GeyserSession; @@ -36,7 +36,7 @@ import java.util.UUID; public class PufferFishEntity extends AbstractFishEntity { - public PufferFishEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PufferFishEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java index 966e500b4..a36f2dd1d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/RabbitEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -38,7 +38,7 @@ import java.util.UUID; public class RabbitEntity extends AnimalEntity { - public RabbitEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public RabbitEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java index 9481944a7..52fcd35a3 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/SheepEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -42,7 +42,7 @@ import java.util.UUID; public class SheepEntity extends AnimalEntity { private int color; - public SheepEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SheepEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java index 5f42b4b67..50f89a444 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/StriderEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -44,7 +44,7 @@ public class StriderEntity extends AnimalEntity { private boolean isCold = false; - public StriderEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public StriderEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.FIRE_IMMUNE, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java index 384ba30d4..672eeccc8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TropicalFishEntity.java @@ -30,7 +30,7 @@ import com.google.common.collect.ImmutableList; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import it.unimi.dsi.fastutil.ints.IntList; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.AbstractFishEntity; import org.geysermc.geyser.session.GeyserSession; @@ -48,7 +48,7 @@ public class TropicalFishEntity extends AbstractFishEntity { private static final List VARIANT_NAMES = ImmutableList.of("kob", "sunstreak", "snooper", "dasher", "brinely", "spotty", "flopper", "stripey", "glitter", "blockfish", "betty", "clayfish"); private static final List COLOR_NAMES = ImmutableList.of("white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "light_gray", "cyan", "purple", "blue", "brown", "green", "red", "black"); - public TropicalFishEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TropicalFishEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java index 79a7b8f50..a9f46e1f0 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/TurtleEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.animal; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -36,7 +36,7 @@ import java.util.UUID; public class TurtleEntity extends AnimalEntity { - public TurtleEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TurtleEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java index 9139495b8..ccc936e98 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/AbstractHorseEntity.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.data.inventory.ContainerType; import com.nukkitx.protocol.bedrock.packet.EntityEventPacket; import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.entity.type.living.animal.AnimalEntity; import org.geysermc.geyser.inventory.GeyserItemStack; @@ -55,7 +55,7 @@ public class AbstractHorseEntity extends AnimalEntity { private static final Set DONKEY_AND_HORSE_FOODS = ImmutableSet.of("golden_apple", "enchanted_golden_apple", "golden_carrot", "sugar", "apple", "wheat", "hay_block"); - public AbstractHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Specifies the size of the entity's inventory. Required to place slots in the entity. diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java index 7d59be713..2b4af5c2a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ChestedHorseEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; @@ -36,7 +36,7 @@ import java.util.UUID; public class ChestedHorseEntity extends AbstractHorseEntity { - public ChestedHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ChestedHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java index d084ed3e3..44958e1a8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/HorseEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class HorseEntity extends AbstractHorseEntity { - public HorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public HorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java index c2548daaf..9788345f0 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/LlamaEntity.java @@ -30,7 +30,7 @@ import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.packet.MobArmorEquipmentPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.session.GeyserSession; @@ -38,7 +38,7 @@ import java.util.UUID; public class LlamaEntity extends ChestedHorseEntity { - public LlamaEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public LlamaEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); dirtyMetadata.put(EntityData.CONTAINER_STRENGTH_MODIFIER, 3); // Presumably 3 slots for every 1 strength diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/SkeletonHorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/SkeletonHorseEntity.java index c9f95f507..61201d116 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/SkeletonHorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/SkeletonHorseEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -36,7 +36,7 @@ import javax.annotation.Nonnull; import java.util.UUID; public class SkeletonHorseEntity extends AbstractHorseEntity { - public SkeletonHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SkeletonHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java index ff3fba9b0..222155dc6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/TraderLlamaEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class TraderLlamaEntity extends LlamaEntity { - public TraderLlamaEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TraderLlamaEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ZombieHorseEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ZombieHorseEntity.java index ddde11c5d..ccdf1a8b6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ZombieHorseEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/horse/ZombieHorseEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living.animal.horse; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -36,7 +36,7 @@ import javax.annotation.Nonnull; import java.util.UUID; public class ZombieHorseEntity extends AbstractHorseEntity { - public ZombieHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieHorseEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java index c17503606..82500a151 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -45,7 +45,7 @@ public class CatEntity extends TameableEntity { private byte collarColor; - public CatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java index b7aca99e5..6d9a0b712 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/ParrotEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living.animal.tameable; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -39,7 +39,7 @@ import java.util.UUID; public class ParrotEntity extends TameableEntity { - public ParrotEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ParrotEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java index 33b2144e8..4648d6472 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/TameableEntity.java @@ -32,7 +32,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import lombok.Getter; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.animal.AnimalEntity; import org.geysermc.geyser.session.GeyserSession; @@ -46,7 +46,7 @@ public class TameableEntity extends AnimalEntity { @Getter protected long ownerBedrockId; - public TameableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public TameableEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java index 8b900f071..d0122c107 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/WolfEntity.java @@ -31,7 +31,7 @@ import com.google.common.collect.ImmutableSet; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -54,7 +54,7 @@ public class WolfEntity extends TameableEntity { private byte collarColor; - public WolfEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WolfEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java index 633ba707f..97b77e29a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/AbstractMerchantEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living.merchant; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.living.AgeableEntity; import org.geysermc.geyser.inventory.GeyserItemStack; @@ -40,7 +40,7 @@ import java.util.UUID; public class AbstractMerchantEntity extends AgeableEntity { - public AbstractMerchantEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractMerchantEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java index 866ba36fc..06fafbe76 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/merchant/VillagerEntity.java @@ -34,7 +34,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import lombok.Getter; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.session.GeyserSession; @@ -85,7 +85,7 @@ public class VillagerEntity extends AbstractMerchantEntity { @Getter private boolean canTradeWith; - public VillagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VillagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java index baa48fcc1..ddd79715d 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/AbstractSkeletonEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractSkeletonEntity extends MonsterEntity { - public AbstractSkeletonEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractSkeletonEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java index ed26a71e1..a31c3c638 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BasePiglinEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -36,7 +36,7 @@ import java.util.UUID; public class BasePiglinEntity extends MonsterEntity { private boolean isImmuneToZombification; - public BasePiglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BasePiglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java index 02539b26a..bd760da70 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/BlazeEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class BlazeEntity extends MonsterEntity { - public BlazeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public BlazeEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java index cf9393410..cad1e1150 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/CreeperEntity.java @@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -46,7 +46,7 @@ public class CreeperEntity extends MonsterEntity { */ private boolean ignitedByFlintAndSteel = false; - public CreeperEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public CreeperEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java index 1ac4e9527..d1eaf01af 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ElderGuardianEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ElderGuardianEntity extends GuardianEntity { - public ElderGuardianEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ElderGuardianEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java index 99ab1a55c..c805847f6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java @@ -33,7 +33,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityEventType; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.*; import lombok.Data; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.Tickable; import org.geysermc.geyser.entity.type.living.MobEntity; import org.geysermc.geyser.session.GeyserSession; @@ -79,7 +79,7 @@ public class EnderDragonEntity extends MobEntity implements Tickable { private float wingPosition; private float lastWingPosition; - public EnderDragonEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EnderDragonEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java index 03492d518..38b615a93 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EndermanEntity.java @@ -32,14 +32,14 @@ import com.nukkitx.protocol.bedrock.data.SoundEvent; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.packet.LevelSoundEvent2Packet; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class EndermanEntity extends MonsterEntity { - public EndermanEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public EndermanEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java index 511c56ff7..ed47282a5 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GhastEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.FlyingEntity; import org.geysermc.geyser.session.GeyserSession; @@ -36,7 +36,7 @@ import java.util.UUID; public class GhastEntity extends FlyingEntity { - public GhastEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GhastEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java index 12e0966ea..4df65bb25 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GiantEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GiantEntity extends MonsterEntity { - public GiantEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GiantEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); dirtyMetadata.put(EntityData.SCALE, 6f); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java index fe1f3038b..c83f957a3 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/GuardianEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class GuardianEntity extends MonsterEntity { - public GuardianEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public GuardianEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java index 92fbeee67..d6a7aa13f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/MonsterEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.CreatureEntity; import org.geysermc.geyser.session.GeyserSession; @@ -34,7 +34,7 @@ import java.util.UUID; public class MonsterEntity extends CreatureEntity { - public MonsterEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public MonsterEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java index dff79104b..3e03970c6 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PhantomEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.FlyingEntity; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class PhantomEntity extends FlyingEntity { - public PhantomEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PhantomEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java index f0577ee20..9de26ca77 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/PiglinEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.InteractionResult; @@ -40,7 +40,7 @@ import java.util.UUID; public class PiglinEntity extends BasePiglinEntity { - public PiglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PiglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java index ff1ba9ac3..f3e80fc56 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ShulkerEntity.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.object.Direction; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.GolemEntity; import org.geysermc.geyser.session.GeyserSession; @@ -39,7 +39,7 @@ import java.util.UUID; public class ShulkerEntity extends GolemEntity { - public ShulkerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ShulkerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // Indicate that invisibility should be fixed through the resource pack setFlag(EntityFlag.BRIBED, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java index b720f1d4e..4997207be 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SkeletonEntity.java @@ -28,7 +28,7 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -36,7 +36,7 @@ import java.util.UUID; public class SkeletonEntity extends AbstractSkeletonEntity { private boolean convertingToStray = false; - public SkeletonEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SkeletonEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java index 0d9a2b37a..f4a1c1f85 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/SpiderEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class SpiderEntity extends MonsterEntity { - public SpiderEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpiderEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java index 545c4bc73..8aa6e790c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/VexEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class VexEntity extends MonsterEntity { - public VexEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VexEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java index d6926996e..925585319 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WitherEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntit import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import org.geysermc.geyser.entity.type.Entity; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class WitherEntity extends MonsterEntity { - public WitherEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public WitherEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java index dd5acbfb1..c2fc42143 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZoglinEntity.java @@ -29,14 +29,14 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ZoglinEntity extends MonsterEntity { - public ZoglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZoglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java index 0dac50d07..b97f20c1f 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; @@ -37,7 +37,7 @@ import java.util.UUID; public class ZombieEntity extends MonsterEntity { private boolean convertingToDrowned = false; - public ZombieEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java index 1ec0fc26b..a3ae5897a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombieVillagerEntity.java @@ -31,7 +31,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanE import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity; import org.geysermc.geyser.inventory.GeyserItemStack; import org.geysermc.geyser.session.GeyserSession; @@ -43,7 +43,7 @@ import java.util.UUID; public class ZombieVillagerEntity extends ZombieEntity { - public ZombieVillagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombieVillagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java index a711718d3..7e7adce50 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/ZombifiedPiglinEntity.java @@ -27,14 +27,14 @@ package org.geysermc.geyser.entity.type.living.monster; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class ZombifiedPiglinEntity extends ZombieEntity { - public ZombifiedPiglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public ZombifiedPiglinEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); setFlag(EntityFlag.FIRE_IMMUNE, true); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java index 21395a0ca..2b556e706 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/AbstractIllagerEntity.java @@ -26,14 +26,14 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class AbstractIllagerEntity extends RaidParticipantEntity { - public AbstractIllagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public AbstractIllagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java index 4359c4254..52e693761 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/PillagerEntity.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.registry.type.ItemMapping; @@ -35,7 +35,7 @@ import java.util.UUID; public class PillagerEntity extends AbstractIllagerEntity { - public PillagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public PillagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java index 458eabf09..48242b7bf 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/RaidParticipantEntity.java @@ -26,7 +26,7 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.living.monster.MonsterEntity; import org.geysermc.geyser.session.GeyserSession; @@ -34,7 +34,7 @@ import java.util.UUID; public class RaidParticipantEntity extends MonsterEntity { - public RaidParticipantEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public RaidParticipantEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } } diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java index 38b8cd9a8..383c87e2a 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/SpellcasterIllagerEntity.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEnti import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.session.GeyserSession; @@ -40,7 +40,7 @@ public class SpellcasterIllagerEntity extends AbstractIllagerEntity { private static final int ATTACK_PARTICLE_COLOR = (102 << 16) | (77 << 8) | 89; private static final int WOLOLO_PARTICLE_COLOR = (179 << 16) | (128 << 8) | 51; - public SpellcasterIllagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public SpellcasterIllagerEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); // OptionalPack usage setFlag(EntityFlag.BRIBED, this.definition == EntityDefinitions.ILLUSIONER); diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java index 199cffff9..0713f70c9 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/raid/VindicatorEntity.java @@ -28,14 +28,14 @@ package org.geysermc.geyser.entity.type.living.monster.raid; import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata; import com.nukkitx.math.vector.Vector3f; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.session.GeyserSession; import java.util.UUID; public class VindicatorEntity extends AbstractIllagerEntity { - public VindicatorEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { + public VindicatorEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, GeyserEntityDefinition definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) { super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw); } diff --git a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java index 676231c5b..3879a8fb0 100644 --- a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java +++ b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java @@ -90,7 +90,12 @@ public class GeyserExtensionLoader extends ExtensionLoader { this.classLoaders.put(description.name(), loader); final Extension extension = loader.load(description); - return this.setup(extension, description, dataFolder, new GeyserExtensionEventBus(GeyserImpl.getInstance().eventBus(), extension)); + try { + return this.setup(extension, description, dataFolder, new GeyserExtensionEventBus(GeyserImpl.getInstance().eventBus(), extension)); + } finally { + // Register events + GeyserImpl.getInstance().eventBus().register(extension, extension); + } } private GeyserExtensionContainer setup(Extension extension, GeyserExtensionDescription description, Path dataFolder, ExtensionEventBus eventBus) { diff --git a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionManager.java b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionManager.java index c125d010b..e6dba5906 100644 --- a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionManager.java +++ b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionManager.java @@ -90,7 +90,6 @@ public class GeyserExtensionManager extends ExtensionManager { public void enableExtension(Extension extension) { if (!extension.isEnabled()) { extension.setEnabled(true); - GeyserImpl.getInstance().eventBus().register(extension, extension); GeyserImpl.getInstance().getLogger().info(GeyserLocale.getLocaleStringLog("geyser.extensions.enable.success", extension.description().name())); } } diff --git a/core/src/main/java/org/geysermc/geyser/registry/Registries.java b/core/src/main/java/org/geysermc/geyser/registry/Registries.java index e98066305..6cebffc47 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/Registries.java +++ b/core/src/main/java/org/geysermc/geyser/registry/Registries.java @@ -41,8 +41,11 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.kyori.adventure.key.Key; +import org.geysermc.geyser.GeyserImpl; +import org.geysermc.geyser.api.entity.EntityDefinition; +import org.geysermc.geyser.api.event.lifecycle.GeyserDefineEntitiesEvent; import org.geysermc.geyser.api.extension.ExtensionLoader; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.inventory.item.Enchantment.JavaEnchantment; import org.geysermc.geyser.inventory.recipe.GeyserRecipe; import org.geysermc.geyser.registry.loader.*; @@ -58,11 +61,10 @@ import org.geysermc.geyser.translator.level.block.entity.BlockEntityTranslator; import org.geysermc.geyser.translator.level.event.LevelEventTranslator; import org.geysermc.geyser.translator.sound.SoundInteractionTranslator; import org.geysermc.geyser.translator.sound.SoundTranslator; +import org.geysermc.geyser.util.EntityUtils; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; +import java.util.stream.Collectors; /** * Holds all the common registries in Geyser. @@ -111,7 +113,7 @@ public final class Registries { /** * A map containing all entity types and their respective Geyser definitions */ - public static final SimpleMappedRegistry> ENTITY_DEFINITIONS = SimpleMappedRegistry.create(RegistryLoaders.empty(() -> new EnumMap<>(EntityType.class))); + public static final SimpleMappedRegistry> ENTITY_DEFINITIONS = SimpleMappedRegistry.create(RegistryLoaders.empty(() -> new EnumMap<>(EntityType.class))); /** * A map containing all the extension loaders. @@ -119,9 +121,9 @@ public final class Registries { public static final SimpleMappedRegistry EXTENSION_LOADERS = SimpleMappedRegistry.create(RegistryLoaders.empty(Object2ObjectOpenHashMap::new)); /** - * A map containing all Java entity identifiers and their respective Geyser definitions + * A map containing all entity identifiers and their respective Geyser definitions */ - public static final SimpleMappedRegistry> JAVA_ENTITY_IDENTIFIERS = SimpleMappedRegistry.create(RegistryLoaders.empty(Object2ObjectOpenHashMap::new)); + public static final SimpleMappedRegistry> ENTITY_IDENTIFIERS = SimpleMappedRegistry.create(RegistryLoaders.empty(Object2ObjectOpenHashMap::new)); /** * A registry containing all the Java packet translators. @@ -184,4 +186,24 @@ public final class Registries { POTION_MIXES = SimpleRegistry.create(PotionMixRegistryLoader::new); ENCHANTMENTS = SimpleMappedRegistry.create("mappings/enchantments.json", EnchantmentRegistryLoader::new); } + + public static void callRegistryEvents() { + // Call registry events + List definitions = ENTITY_IDENTIFIERS.get().values().stream() + .map(def -> (EntityDefinition) def) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + GeyserDefineEntitiesEvent defineEntitiesEvent = new GeyserDefineEntitiesEvent(definitions); + GeyserImpl.getInstance().eventBus().fire(defineEntitiesEvent); + + defineEntitiesEvent.definitions().forEach(definition -> { + GeyserEntityDefinition geyserDefinition = (GeyserEntityDefinition) definition; + + // If our entity is custom, register it + if (geyserDefinition.custom()) { + EntityUtils.registerEntity(geyserDefinition.identifier(), geyserDefinition); + } + }); + } } \ No newline at end of file diff --git a/core/src/main/java/org/geysermc/geyser/registry/provider/GeyserBuilderProvider.java b/core/src/main/java/org/geysermc/geyser/registry/provider/GeyserBuilderProvider.java index 57789ae55..6182730a8 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/provider/GeyserBuilderProvider.java +++ b/core/src/main/java/org/geysermc/geyser/registry/provider/GeyserBuilderProvider.java @@ -29,10 +29,13 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.geysermc.geyser.api.command.Command; import org.geysermc.geyser.api.command.CommandSource; +import org.geysermc.geyser.api.entity.EntityDefinition; import org.geysermc.geyser.api.entity.EntityIdentifier; import org.geysermc.geyser.api.provider.BuilderProvider; import org.geysermc.geyser.command.GeyserCommandManager; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.GeyserEntityIdentifier; +import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.registry.ProviderRegistries; import org.geysermc.geyser.registry.SimpleMappedRegistry; @@ -49,6 +52,7 @@ public class GeyserBuilderProvider extends AbstractProvider implements BuilderPr public void registerProviders(Map, ProviderSupplier> providers) { providers.put(Command.Builder.class, args -> new GeyserCommandManager.CommandBuilder<>((Class) args[0])); providers.put(EntityIdentifier.Builder.class, args -> new GeyserEntityIdentifier.EntityIdentifierBuilder()); + providers.put(EntityDefinition.Builder.class, args -> new GeyserEntityDefinition.EntityDefinitionBuilder<>(Entity::new, true)); } @Override diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 8e8bbd8fc..5700b2243 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -92,7 +92,6 @@ import org.geysermc.geyser.Constants; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.api.connection.GeyserConnection; import org.geysermc.geyser.api.entity.EntityIdentifier; -import org.geysermc.geyser.api.event.entity.DefineEntitiesEvent; import org.geysermc.geyser.api.network.RemoteServer; import org.geysermc.geyser.command.GeyserCommandSource; import org.geysermc.geyser.configuration.EmoteOffhandWorkaroundOption; @@ -602,7 +601,9 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { biomeDefinitionListPacket.setDefinitions(Registries.BIOMES_NBT.get()); upstream.sendPacket(biomeDefinitionListPacket); - this.sendAvailableEntityIdentifiers(); + AvailableEntityIdentifiersPacket entityPacket = new AvailableEntityIdentifiersPacket(); + entityPacket.setIdentifiers(Registries.BEDROCK_ENTITY_IDENTIFIERS.get()); + upstream.sendPacket(entityPacket); CreativeContentPacket creativePacket = new CreativeContentPacket(); creativePacket.setContents(this.itemMappings.getCreativeItems()); @@ -632,29 +633,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { upstream.sendPacket(gamerulePacket); } - public void sendAvailableEntityIdentifiers() { - NbtMap nbt = Registries.BEDROCK_ENTITY_IDENTIFIERS.get(); - List idlist = nbt.getList("idlist", NbtType.COMPOUND); - List identifiers = new ArrayList<>(idlist.size()); - for (NbtMap identifier : idlist) { - identifiers.add(new GeyserEntityIdentifier(identifier)); - } - - DefineEntitiesEvent event = new DefineEntitiesEvent(this, identifiers); - this.geyser.eventBus().fire(event); - - NbtMapBuilder builder = nbt.toBuilder(); - builder.putList("idlist", NbtType.COMPOUND, event.identifiers() - .stream() - .map(identifer -> ((GeyserEntityIdentifier) identifer).nbt()) - .collect(Collectors.toList()) - ); - - AvailableEntityIdentifiersPacket entityPacket = new AvailableEntityIdentifiersPacket(); - entityPacket.setIdentifiers(builder.build()); - upstream.sendPacket(entityPacket); - } - public void authenticate(String username) { authenticate(username, ""); } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java index 012606615..71431541a 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/EntityCache.java @@ -32,6 +32,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import lombok.Getter; +import org.geysermc.geyser.api.event.downstream.entity.ServerSpawnEntityEvent; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.Tickable; import org.geysermc.geyser.entity.type.player.PlayerEntity; diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java index 3d11d5ced..29bafa7ca 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java @@ -29,7 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityType; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.Tag; import com.nukkitx.nbt.NbtMapBuilder; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.registry.Registries; @BlockEntity(type = BlockEntityType.MOB_SPAWNER) @@ -73,7 +73,7 @@ public class SpawnerBlockEntityTranslator extends BlockEntityTranslator { .getValue(); builder.put("EntityIdentifier", entityID); - EntityDefinition definition = Registries.JAVA_ENTITY_IDENTIFIERS.get(entityID); + GeyserEntityDefinition definition = Registries.ENTITY_IDENTIFIERS.get(entityID); if (definition != null) { builder.put("DisplayEntityWidth", definition.width()); builder.put("DisplayEntityHeight", definition.height()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java index 48a089b6e..7bd48b045 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockEntityPickRequestTranslator.java @@ -69,7 +69,7 @@ public class BedrockEntityPickRequestTranslator extends PacketTranslator // The Bedrock identifier matches the item name which moves MINECART to the end of the name // TODO test - itemName = entity.getDefinition().identifier(); + itemName = entity.getDefinition().entityIdentifier().identifier(); case SPAWNER_MINECART -> itemName = "minecart"; // Turns into a normal minecart //case ITEM_FRAME -> Not an entity in Bedrock Edition //case GLOW_ITEM_FRAME -> diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java index 440a3b14e..418869517 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java @@ -45,7 +45,7 @@ import lombok.Getter; import lombok.ToString; import net.kyori.adventure.text.format.NamedTextColor; import org.geysermc.geyser.GeyserImpl; -import org.geysermc.geyser.api.event.downstream.ServerDefineCommandsEvent; +import org.geysermc.geyser.api.event.downstream.command.ServerDefineCommandsEvent; import org.geysermc.geyser.command.GeyserCommandManager; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; @@ -235,7 +235,7 @@ public class JavaCommandsTranslator extends PacketTranslator BlockRegistries.JAVA_TO_BEDROCK_IDENTIFIERS.get().keySet().toArray(new String[0]); case ITEM_STACK -> session.getItemMappings().getItemNames(); case ITEM_ENCHANTMENT -> Enchantment.JavaEnchantment.ALL_JAVA_IDENTIFIERS; - case ENTITY_SUMMON -> Registries.JAVA_ENTITY_IDENTIFIERS.get().keySet().toArray(new String[0]); + case ENTITY_SUMMON -> Registries.ENTITY_IDENTIFIERS.get().keySet().toArray(new String[0]); case COLOR -> VALID_COLORS; case SCOREBOARD_SLOT -> VALID_SCOREBOARD_SLOTS; case MOB_EFFECT -> ALL_EFFECT_IDENTIFIERS; diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java index 54c14f7f0..3578e8bae 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaSetEntityDataTranslator.java @@ -27,7 +27,7 @@ package org.geysermc.geyser.translator.protocol.java.entity; import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.ClientboundSetEntityDataPacket; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; @@ -42,7 +42,7 @@ public class JavaSetEntityDataTranslator extends PacketTranslator definition = entity.getDefinition(); + GeyserEntityDefinition definition = entity.getDefinition(); for (EntityMetadata metadata : packet.getMetadata()) { if (metadata.getId() >= definition.translators().size()) { if (session.getGeyser().getConfig().isDebugMode()) { @@ -53,7 +53,7 @@ public class JavaSetEntityDataTranslator extends PacketTranslator definition = Registries.ENTITY_DEFINITIONS.get(packet.getType()); + GeyserEntityDefinition definition = Registries.ENTITY_DEFINITIONS.get(packet.getType()); if (definition == null) { session.getGeyser().getLogger().warning(GeyserLocale.getLocaleStringLog("geyser.entity.type_null", packet.getType())); return; } + ServerSpawnEntityEvent event = new ServerSpawnEntityEvent(session, packet.getEntityId(), packet.getUuid(), definition); + GeyserImpl.getInstance().eventBus().fire(event); + + GeyserEntityDefinition eventDefinition = (GeyserEntityDefinition) event.entityDefinition(); + + // If the definition is changed, we need to update our current + // definition to reflect that. + if (!eventDefinition.equals(definition)) { + definition = definition.toBuilder() + .identifier(eventDefinition.entityIdentifier()) + .width(eventDefinition.width()) + .height(eventDefinition.height()) + .offset(eventDefinition.offset()) + .build(); + } + + System.out.println("def used " + definition); + Entity entity; if (packet.getType() == EntityType.FALLING_BLOCK) { entity = new FallingBlockEntity(session, packet.getEntityId(), session.getEntityCache().getNextEntityId().incrementAndGet(), packet.getUuid(), diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java index 065b4d889..27b767b6e 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddMobTranslator.java @@ -27,7 +27,9 @@ package org.geysermc.geyser.translator.protocol.java.entity.spawn; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.spawn.ClientboundAddMobPacket; import com.nukkitx.math.vector.Vector3f; -import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.GeyserImpl; +import org.geysermc.geyser.api.event.downstream.entity.ServerSpawnEntityEvent; +import org.geysermc.geyser.entity.GeyserEntityDefinition; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.session.GeyserSession; @@ -43,12 +45,28 @@ public class JavaAddMobTranslator extends PacketTranslator definition = Registries.ENTITY_DEFINITIONS.get(packet.getType()); + GeyserEntityDefinition definition = Registries.ENTITY_DEFINITIONS.get(packet.getType()); if (definition == null) { session.getGeyser().getLogger().warning(GeyserLocale.getLocaleStringLog("geyser.entity.type_null", packet.getType())); return; } + ServerSpawnEntityEvent event = new ServerSpawnEntityEvent(session, packet.getEntityId(), packet.getUuid(), definition); + GeyserImpl.getInstance().eventBus().fire(event); + + GeyserEntityDefinition eventDefinition = (GeyserEntityDefinition) event.entityDefinition(); + + // If the definition is changed, we need to update our current + // definition to reflect that. + if (!eventDefinition.equals(definition)) { + definition = definition.toBuilder() + .identifier(eventDefinition.entityIdentifier()) + .width(eventDefinition.width()) + .height(eventDefinition.height()) + .offset(eventDefinition.offset()) + .build(); + } + Entity entity = definition.factory().create(session, packet.getEntityId(), session.getEntityCache().getNextEntityId().incrementAndGet(), packet.getUuid(), definition, position, motion, packet.getYaw(), packet.getPitch(), packet.getHeadYaw() ); diff --git a/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java b/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java index aafbbf66e..50826abf1 100644 --- a/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java @@ -29,15 +29,23 @@ import com.github.steveice10.mc.protocol.data.game.entity.Effect; import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType; import com.nukkitx.math.vector.Vector3f; +import com.nukkitx.nbt.NbtMap; +import com.nukkitx.nbt.NbtType; import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; +import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.entity.EntityDefinitions; +import org.geysermc.geyser.entity.GeyserEntityDefinition; +import org.geysermc.geyser.entity.GeyserEntityIdentifier; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.entity.type.living.ArmorStandEntity; import org.geysermc.geyser.entity.type.living.animal.AnimalEntity; import org.geysermc.geyser.inventory.GeyserItemStack; +import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.session.GeyserSession; +import java.util.ArrayList; +import java.util.List; import java.util.Locale; public final class EntityUtils { @@ -224,6 +232,28 @@ public final class EntityUtils { return InteractionResult.PASS; } + public static void registerEntity(String identifier, GeyserEntityDefinition definition) { + if (definition.entityType() != null) { + Registries.ENTITY_DEFINITIONS.get().putIfAbsent(definition.entityType(), definition); + Registries.ENTITY_IDENTIFIERS.get().putIfAbsent(identifier, definition); + } else { + // We're dealing with a custom entity here + Registries.ENTITY_IDENTIFIERS.get().putIfAbsent(identifier, definition); + + // Now let's add it to the entity identifiers + NbtMap nbt = Registries.BEDROCK_ENTITY_IDENTIFIERS.get(); + List idlist = new ArrayList<>(nbt.getList("idlist", NbtType.COMPOUND)); + idlist.add(((GeyserEntityIdentifier) definition.entityIdentifier()).nbt()); + + NbtMap newIdentifiers = nbt.toBuilder() + .putList("idlist", NbtType.COMPOUND, idlist) + .build(); + + Registries.BEDROCK_ENTITY_IDENTIFIERS.set(newIdentifiers); + GeyserImpl.getInstance().getLogger().info("Registered custom entity " + identifier); + } + } + private EntityUtils() { } }