2021-11-18 03:02:38 +00:00
/ *
2022-01-01 19:03:05 +00:00
* Copyright ( c ) 2019 - 2022 GeyserMC . http : //geysermc.org
2021-11-18 03:02:38 +00:00
*
* 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
* /
2021-11-20 21:34:30 +00:00
package org.geysermc.geyser.entity ;
2021-11-18 03:02:38 +00:00
import com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType ;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata ;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.FloatEntityMetadata ;
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType ;
2022-10-30 00:23:21 +00:00
import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes ;
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag ;
2021-11-20 23:29:46 +00:00
import org.geysermc.geyser.entity.type.* ;
import org.geysermc.geyser.entity.type.living.* ;
import org.geysermc.geyser.entity.type.living.animal.* ;
import org.geysermc.geyser.entity.type.living.animal.horse.* ;
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity ;
import org.geysermc.geyser.entity.type.living.animal.tameable.ParrotEntity ;
import org.geysermc.geyser.entity.type.living.animal.tameable.TameableEntity ;
import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity ;
import org.geysermc.geyser.entity.type.living.merchant.AbstractMerchantEntity ;
import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity ;
import org.geysermc.geyser.entity.type.living.monster.* ;
import org.geysermc.geyser.entity.type.living.monster.raid.PillagerEntity ;
import org.geysermc.geyser.entity.type.living.monster.raid.RaidParticipantEntity ;
import org.geysermc.geyser.entity.type.living.monster.raid.SpellcasterIllagerEntity ;
import org.geysermc.geyser.entity.type.living.monster.raid.VindicatorEntity ;
import org.geysermc.geyser.entity.type.player.PlayerEntity ;
2021-11-20 21:34:30 +00:00
import org.geysermc.geyser.registry.Registries ;
2021-12-21 00:25:11 +00:00
import org.geysermc.geyser.translator.text.MessageTranslator ;
2021-11-18 03:02:38 +00:00
public final class EntityDefinitions {
2023-05-09 16:46:06 +00:00
public static final GeyserEntityDefinition < AllayEntity > ALLAY ;
public static final GeyserEntityDefinition < AreaEffectCloudEntity > AREA_EFFECT_CLOUD ;
public static final GeyserEntityDefinition < ArmorStandEntity > ARMOR_STAND ;
public static final GeyserEntityDefinition < TippedArrowEntity > ARROW ;
public static final GeyserEntityDefinition < AxolotlEntity > AXOLOTL ;
public static final GeyserEntityDefinition < BatEntity > BAT ;
public static final GeyserEntityDefinition < BeeEntity > BEE ;
public static final GeyserEntityDefinition < BlazeEntity > BLAZE ;
public static final GeyserEntityDefinition < BoatEntity > BOAT ;
public static final GeyserEntityDefinition < CamelEntity > CAMEL ;
public static final GeyserEntityDefinition < CatEntity > CAT ;
public static final GeyserEntityDefinition < SpiderEntity > CAVE_SPIDER ;
public static final GeyserEntityDefinition < MinecartEntity > CHEST_MINECART ;
public static final GeyserEntityDefinition < ChickenEntity > CHICKEN ;
public static final GeyserEntityDefinition < ChestBoatEntity > CHEST_BOAT ;
public static final GeyserEntityDefinition < AbstractFishEntity > COD ;
public static final GeyserEntityDefinition < CommandBlockMinecartEntity > COMMAND_BLOCK_MINECART ;
public static final GeyserEntityDefinition < CowEntity > COW ;
public static final GeyserEntityDefinition < CreeperEntity > CREEPER ;
public static final GeyserEntityDefinition < DolphinEntity > DOLPHIN ;
public static final GeyserEntityDefinition < ChestedHorseEntity > DONKEY ;
public static final GeyserEntityDefinition < FireballEntity > DRAGON_FIREBALL ;
public static final GeyserEntityDefinition < ZombieEntity > DROWNED ;
public static final GeyserEntityDefinition < ThrowableItemEntity > EGG ;
public static final GeyserEntityDefinition < ElderGuardianEntity > ELDER_GUARDIAN ;
public static final GeyserEntityDefinition < EndermanEntity > ENDERMAN ;
public static final GeyserEntityDefinition < MonsterEntity > ENDERMITE ;
public static final GeyserEntityDefinition < EnderDragonEntity > ENDER_DRAGON ;
public static final GeyserEntityDefinition < ThrowableItemEntity > ENDER_PEARL ;
public static final GeyserEntityDefinition < EnderCrystalEntity > END_CRYSTAL ;
public static final GeyserEntityDefinition < SpellcasterIllagerEntity > EVOKER ;
public static final GeyserEntityDefinition < EvokerFangsEntity > EVOKER_FANGS ;
public static final GeyserEntityDefinition < ThrowableItemEntity > EXPERIENCE_BOTTLE ;
public static final GeyserEntityDefinition < ExpOrbEntity > EXPERIENCE_ORB ;
public static final GeyserEntityDefinition < Entity > EYE_OF_ENDER ;
public static final GeyserEntityDefinition < FallingBlockEntity > FALLING_BLOCK ;
public static final GeyserEntityDefinition < FireballEntity > FIREBALL ;
public static final GeyserEntityDefinition < FireworkEntity > FIREWORK_ROCKET ;
public static final GeyserEntityDefinition < FishingHookEntity > FISHING_BOBBER ;
public static final GeyserEntityDefinition < FoxEntity > FOX ;
public static final GeyserEntityDefinition < FrogEntity > FROG ;
public static final GeyserEntityDefinition < FurnaceMinecartEntity > FURNACE_MINECART ; // Not present on Bedrock
public static final GeyserEntityDefinition < GhastEntity > GHAST ;
public static final GeyserEntityDefinition < GiantEntity > GIANT ;
public static final GeyserEntityDefinition < ItemFrameEntity > GLOW_ITEM_FRAME ;
public static final GeyserEntityDefinition < GlowSquidEntity > GLOW_SQUID ;
public static final GeyserEntityDefinition < GoatEntity > GOAT ;
public static final GeyserEntityDefinition < GuardianEntity > GUARDIAN ;
public static final GeyserEntityDefinition < HoglinEntity > HOGLIN ;
public static final GeyserEntityDefinition < MinecartEntity > HOPPER_MINECART ;
public static final GeyserEntityDefinition < HorseEntity > HORSE ;
public static final GeyserEntityDefinition < ZombieEntity > HUSK ;
public static final GeyserEntityDefinition < SpellcasterIllagerEntity > ILLUSIONER ; // Not present on Bedrock
public static final GeyserEntityDefinition < IronGolemEntity > IRON_GOLEM ;
public static final GeyserEntityDefinition < ItemEntity > ITEM ;
public static final GeyserEntityDefinition < ItemFrameEntity > ITEM_FRAME ;
public static final GeyserEntityDefinition < LeashKnotEntity > LEASH_KNOT ;
public static final GeyserEntityDefinition < LightningEntity > LIGHTNING_BOLT ;
public static final GeyserEntityDefinition < LlamaEntity > LLAMA ;
public static final GeyserEntityDefinition < ThrowableEntity > LLAMA_SPIT ;
public static final GeyserEntityDefinition < MagmaCubeEntity > MAGMA_CUBE ;
public static final GeyserEntityDefinition < MinecartEntity > MINECART ;
public static final GeyserEntityDefinition < MooshroomEntity > MOOSHROOM ;
public static final GeyserEntityDefinition < ChestedHorseEntity > MULE ;
public static final GeyserEntityDefinition < OcelotEntity > OCELOT ;
public static final GeyserEntityDefinition < PaintingEntity > PAINTING ;
public static final GeyserEntityDefinition < PandaEntity > PANDA ;
public static final GeyserEntityDefinition < ParrotEntity > PARROT ;
public static final GeyserEntityDefinition < PhantomEntity > PHANTOM ;
public static final GeyserEntityDefinition < PigEntity > PIG ;
public static final GeyserEntityDefinition < PiglinEntity > PIGLIN ;
public static final GeyserEntityDefinition < BasePiglinEntity > PIGLIN_BRUTE ;
public static final GeyserEntityDefinition < PillagerEntity > PILLAGER ;
public static final GeyserEntityDefinition < PlayerEntity > PLAYER ;
public static final GeyserEntityDefinition < PolarBearEntity > POLAR_BEAR ;
public static final GeyserEntityDefinition < ThrownPotionEntity > POTION ;
public static final GeyserEntityDefinition < PufferFishEntity > PUFFERFISH ;
public static final GeyserEntityDefinition < RabbitEntity > RABBIT ;
public static final GeyserEntityDefinition < RaidParticipantEntity > RAVAGER ;
public static final GeyserEntityDefinition < AbstractFishEntity > SALMON ;
public static final GeyserEntityDefinition < SheepEntity > SHEEP ;
public static final GeyserEntityDefinition < ShulkerEntity > SHULKER ;
public static final GeyserEntityDefinition < ThrowableEntity > SHULKER_BULLET ;
public static final GeyserEntityDefinition < MonsterEntity > SILVERFISH ;
public static final GeyserEntityDefinition < SkeletonEntity > SKELETON ;
public static final GeyserEntityDefinition < SkeletonHorseEntity > SKELETON_HORSE ;
public static final GeyserEntityDefinition < SlimeEntity > SLIME ;
public static final GeyserEntityDefinition < FireballEntity > SMALL_FIREBALL ;
public static final GeyserEntityDefinition < ThrowableItemEntity > SNOWBALL ;
public static final GeyserEntityDefinition < SnowGolemEntity > SNOW_GOLEM ;
public static final GeyserEntityDefinition < SpawnerMinecartEntity > SPAWNER_MINECART ; // Not present on Bedrock
public static final GeyserEntityDefinition < AbstractArrowEntity > SPECTRAL_ARROW ;
public static final GeyserEntityDefinition < SpiderEntity > SPIDER ;
public static final GeyserEntityDefinition < SquidEntity > SQUID ;
public static final GeyserEntityDefinition < AbstractSkeletonEntity > STRAY ;
public static final GeyserEntityDefinition < StriderEntity > STRIDER ;
public static final GeyserEntityDefinition < TadpoleEntity > TADPOLE ;
public static final GeyserEntityDefinition < TextDisplayEntity > TEXT_DISPLAY ;
public static final GeyserEntityDefinition < TNTEntity > TNT ;
public static final GeyserEntityDefinition < MinecartEntity > TNT_MINECART ;
public static final GeyserEntityDefinition < TraderLlamaEntity > TRADER_LLAMA ;
public static final GeyserEntityDefinition < TridentEntity > TRIDENT ;
public static final GeyserEntityDefinition < TropicalFishEntity > TROPICAL_FISH ;
public static final GeyserEntityDefinition < TurtleEntity > TURTLE ;
public static final GeyserEntityDefinition < VexEntity > VEX ;
public static final GeyserEntityDefinition < VillagerEntity > VILLAGER ;
public static final GeyserEntityDefinition < VindicatorEntity > VINDICATOR ;
public static final GeyserEntityDefinition < AbstractMerchantEntity > WANDERING_TRADER ;
public static final GeyserEntityDefinition < WardenEntity > WARDEN ;
public static final GeyserEntityDefinition < RaidParticipantEntity > WITCH ;
public static final GeyserEntityDefinition < WitherEntity > WITHER ;
public static final GeyserEntityDefinition < AbstractSkeletonEntity > WITHER_SKELETON ;
public static final GeyserEntityDefinition < WitherSkullEntity > WITHER_SKULL ;
public static final GeyserEntityDefinition < WolfEntity > WOLF ;
public static final GeyserEntityDefinition < ZoglinEntity > ZOGLIN ;
public static final GeyserEntityDefinition < ZombieEntity > ZOMBIE ;
public static final GeyserEntityDefinition < ZombieHorseEntity > ZOMBIE_HORSE ;
public static final GeyserEntityDefinition < ZombieVillagerEntity > ZOMBIE_VILLAGER ;
public static final GeyserEntityDefinition < ZombifiedPiglinEntity > ZOMBIFIED_PIGLIN ;
2021-11-18 03:02:38 +00:00
/ * *
* Is not sent over the network
* /
2023-05-09 16:46:06 +00:00
public static final GeyserEntityDefinition < EnderDragonPartEntity > ENDER_DRAGON_PART ;
2021-11-18 03:02:38 +00:00
/ * *
* Special Bedrock type
* /
2023-05-09 16:46:06 +00:00
public static final GeyserEntityDefinition < WitherSkullEntity > WITHER_SKULL_DANGEROUS ;
2021-11-18 03:02:38 +00:00
static {
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < Entity > entityBase = GeyserEntityDefinition . builder ( Entity : : new )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , Entity : : setFlags )
. addTranslator ( MetadataType . INT , Entity : : setAir ) // Air/bubbles
. addTranslator ( MetadataType . OPTIONAL_CHAT , Entity : : setDisplayName )
. addTranslator ( MetadataType . BOOLEAN , Entity : : setDisplayNameVisible )
2022-05-31 18:25:15 +00:00
. addTranslator ( MetadataType . BOOLEAN , Entity : : setSilent )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , Entity : : setGravity )
2021-12-24 00:49:58 +00:00
. addTranslator ( MetadataType . POSE , ( entity , entityMetadata ) - > entity . setPose ( entityMetadata . getValue ( ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . INT , Entity : : setFreezing )
. build ( ) ;
// Extends entity
{
2023-05-09 16:46:06 +00:00
AREA_EFFECT_CLOUD = GeyserEntityDefinition . inherited ( AreaEffectCloudEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . AREA_EFFECT_CLOUD )
. height ( 0 . 5f ) . width ( 1 . 0f )
. addTranslator ( MetadataType . FLOAT , AreaEffectCloudEntity : : setRadius )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( entity , entityMetadata ) - > entity . getDirtyMetadata ( ) . put ( EntityDataTypes . EFFECT_COLOR , entityMetadata . getValue ( ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( null ) // Waiting
. addTranslator ( MetadataType . PARTICLE , AreaEffectCloudEntity : : setParticle )
. build ( ) ;
2023-05-09 16:46:06 +00:00
BOAT = GeyserEntityDefinition . inherited ( BoatEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . BOAT )
. height ( 0 . 6f ) . width ( 1 . 6f )
. offset ( 0 . 35f )
2022-10-30 03:02:11 +00:00
. addTranslator ( MetadataType . INT , ( boatEntity , entityMetadata ) - > boatEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . HURT_TICKS , entityMetadata . getValue ( ) ) ) // Time since last hit
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( boatEntity , entityMetadata ) - > boatEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . HURT_DIRECTION , entityMetadata . getValue ( ) ) ) // Rocking direction
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . FLOAT , ( boatEntity , entityMetadata ) - >
2021-11-18 03:02:38 +00:00
// 'Health' in Bedrock, damage taken in Java - it makes motion in Bedrock
2022-10-30 03:02:11 +00:00
boatEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . STRUCTURAL_INTEGRITY , 40 - ( ( int ) ( ( FloatEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . INT , BoatEntity : : setVariant )
. addTranslator ( MetadataType . BOOLEAN , BoatEntity : : setPaddlingLeft )
. addTranslator ( MetadataType . BOOLEAN , BoatEntity : : setPaddlingRight )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( boatEntity , entityMetadata ) - > boatEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . BOAT_BUBBLE_TIME , entityMetadata . getValue ( ) ) ) // May not actually do anything
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
CHEST_BOAT = GeyserEntityDefinition . inherited ( ChestBoatEntity : : new , BOAT )
2022-05-26 17:11:39 +00:00
. type ( EntityType . CHEST_BOAT )
. build ( ) ;
2023-05-09 16:46:06 +00:00
DRAGON_FIREBALL = GeyserEntityDefinition . inherited ( FireballEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . DRAGON_FIREBALL )
. heightAndWidth ( 1 . 0f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
END_CRYSTAL = GeyserEntityDefinition . inherited ( EnderCrystalEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . END_CRYSTAL )
. heightAndWidth ( 2 . 0f )
2021-11-27 04:03:46 +00:00
. identifier ( " minecraft:ender_crystal " )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . OPTIONAL_POSITION , EnderCrystalEntity : : setBlockTarget )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN ,
2021-11-18 03:02:38 +00:00
( enderCrystalEntity , entityMetadata ) - > enderCrystalEntity . setFlag ( EntityFlag . SHOW_BOTTOM , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) ) // There is a base located on the ender crystal
. build ( ) ;
2023-05-09 16:46:06 +00:00
EXPERIENCE_ORB = GeyserEntityDefinition . < ExpOrbEntity > inherited ( null , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . EXPERIENCE_ORB )
. identifier ( " minecraft:xp_orb " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
EVOKER_FANGS = GeyserEntityDefinition . builder ( EvokerFangsEntity : : new ) // No entity metadata to listen to as of 1.18.1
2021-11-18 03:02:38 +00:00
. type ( EntityType . EVOKER_FANGS )
. height ( 0 . 8f ) . width ( 0 . 5f )
. identifier ( " minecraft:evocation_fang " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
EYE_OF_ENDER = GeyserEntityDefinition . inherited ( Entity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . EYE_OF_ENDER )
. heightAndWidth ( 0 . 25f )
. identifier ( " minecraft:eye_of_ender_signal " )
2021-11-27 04:03:46 +00:00
. addTranslator ( null ) // Item
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
FALLING_BLOCK = GeyserEntityDefinition . < FallingBlockEntity > inherited ( null , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . FALLING_BLOCK )
. heightAndWidth ( 0 . 98f )
2021-11-19 01:44:03 +00:00
. addTranslator ( null ) // "start block position"
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
FIREWORK_ROCKET = GeyserEntityDefinition . inherited ( FireworkEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . FIREWORK_ROCKET )
. heightAndWidth ( 0 . 25f )
. identifier ( " minecraft:fireworks_rocket " )
. addTranslator ( MetadataType . ITEM , FireworkEntity : : setFireworkItem )
. addTranslator ( MetadataType . OPTIONAL_VARINT , FireworkEntity : : setPlayerGliding )
2021-11-20 02:37:26 +00:00
. addTranslator ( null ) // Shot at angle
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
FISHING_BOBBER = GeyserEntityDefinition . < FishingHookEntity > inherited ( null , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . FISHING_BOBBER )
2021-11-27 04:03:46 +00:00
. identifier ( " minecraft:fishing_hook " )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . INT , FishingHookEntity : : setHookedEntity )
2021-11-27 04:03:46 +00:00
. addTranslator ( null ) // Biting TODO check
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
ITEM = GeyserEntityDefinition . inherited ( ItemEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ITEM )
. heightAndWidth ( 0 . 25f )
. offset ( 0 . 125f )
. addTranslator ( MetadataType . ITEM , ItemEntity : : setItem )
. build ( ) ;
2023-05-09 16:46:06 +00:00
LEASH_KNOT = GeyserEntityDefinition . inherited ( LeashKnotEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . LEASH_KNOT )
. height ( 0 . 5f ) . width ( 0 . 375f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
LIGHTNING_BOLT = GeyserEntityDefinition . inherited ( LightningEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . LIGHTNING_BOLT )
. build ( ) ;
2023-05-09 16:46:06 +00:00
LLAMA_SPIT = GeyserEntityDefinition . inherited ( ThrowableEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . LLAMA_SPIT )
. heightAndWidth ( 0 . 25f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PAINTING = GeyserEntityDefinition . < PaintingEntity > inherited ( null , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PAINTING )
2022-05-25 22:44:33 +00:00
. addTranslator ( MetadataType . PAINTING_VARIANT , PaintingEntity : : setPaintingType )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
SHULKER_BULLET = GeyserEntityDefinition . inherited ( ThrowableEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SHULKER_BULLET )
. heightAndWidth ( 0 . 3125f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
TNT = GeyserEntityDefinition . inherited ( TNTEntity : : new , entityBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . TNT )
. heightAndWidth ( 0 . 98f )
. addTranslator ( MetadataType . INT , TNTEntity : : setFuseLength )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < Entity > displayBase = GeyserEntityDefinition . inherited ( entityBase . factory ( ) , entityBase )
2023-03-28 22:48:48 +00:00
. addTranslator ( null ) // Interpolation start ticks
. addTranslator ( null ) // Interpolation duration ID
. addTranslator ( null ) // Translation
. addTranslator ( null ) // Scale
. addTranslator ( null ) // Left rotation
. addTranslator ( null ) // Right rotation
. addTranslator ( null ) // Billboard render constraints
. addTranslator ( null ) // Brightness override
. addTranslator ( null ) // View range
. addTranslator ( null ) // Shadow radius
. addTranslator ( null ) // Shadow strength
. addTranslator ( null ) // Width
. addTranslator ( null ) // Height
. addTranslator ( null ) // Glow color override
. build ( ) ;
2023-05-09 16:46:06 +00:00
TEXT_DISPLAY = GeyserEntityDefinition . inherited ( TextDisplayEntity : : new , displayBase )
2023-03-28 22:48:48 +00:00
. type ( EntityType . TEXT_DISPLAY )
. identifier ( " minecraft:armor_stand " )
. addTranslator ( MetadataType . CHAT , TextDisplayEntity : : setText )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < FireballEntity > fireballBase = GeyserEntityDefinition . inherited ( FireballEntity : : new , entityBase )
2021-11-27 04:03:46 +00:00
. addTranslator ( null ) // Item
. build ( ) ;
2023-05-09 16:46:06 +00:00
FIREBALL = GeyserEntityDefinition . inherited ( FireballEntity : : new , fireballBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . FIREBALL )
. heightAndWidth ( 1 . 0f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SMALL_FIREBALL = GeyserEntityDefinition . inherited ( FireballEntity : : new , fireballBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SMALL_FIREBALL )
. heightAndWidth ( 0 . 3125f )
. build ( ) ;
2021-11-27 04:03:46 +00:00
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < ThrowableItemEntity > throwableItemBase = GeyserEntityDefinition . inherited ( ThrowableItemEntity : : new , entityBase )
2021-11-27 04:03:46 +00:00
. addTranslator ( MetadataType . ITEM , ThrowableItemEntity : : setItem )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
EGG = GeyserEntityDefinition . inherited ( ThrowableItemEntity : : new , throwableItemBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . EGG )
2021-11-18 03:02:38 +00:00
. heightAndWidth ( 0 . 25f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ENDER_PEARL = GeyserEntityDefinition . inherited ( ThrowableItemEntity : : new , throwableItemBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . ENDER_PEARL )
2021-11-18 03:02:38 +00:00
. heightAndWidth ( 0 . 25f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
EXPERIENCE_BOTTLE = GeyserEntityDefinition . inherited ( ThrowableItemEntity : : new , throwableItemBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . EXPERIENCE_BOTTLE )
2021-11-18 03:02:38 +00:00
. heightAndWidth ( 0 . 25f )
. identifier ( " minecraft:xp_bottle " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
POTION = GeyserEntityDefinition . inherited ( ThrownPotionEntity : : new , throwableItemBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . POTION )
2021-11-18 03:02:38 +00:00
. heightAndWidth ( 0 . 25f )
. identifier ( " minecraft:splash_potion " )
2021-11-27 04:03:46 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
SNOWBALL = GeyserEntityDefinition . inherited ( ThrowableItemEntity : : new , throwableItemBase )
2021-11-27 04:03:46 +00:00
. type ( EntityType . SNOWBALL )
. heightAndWidth ( 0 . 25f )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < AbstractArrowEntity > abstractArrowBase = GeyserEntityDefinition . inherited ( AbstractArrowEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , AbstractArrowEntity : : setArrowFlags )
. addTranslator ( null ) // "Piercing level"
. build ( ) ;
2023-05-09 16:46:06 +00:00
ARROW = GeyserEntityDefinition . inherited ( TippedArrowEntity : : new , abstractArrowBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ARROW )
. heightAndWidth ( 0 . 25f )
. addTranslator ( MetadataType . INT , TippedArrowEntity : : setPotionEffectColor )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SPECTRAL_ARROW = GeyserEntityDefinition . inherited ( abstractArrowBase . factory ( ) , abstractArrowBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SPECTRAL_ARROW )
. heightAndWidth ( 0 . 25f )
. identifier ( " minecraft:arrow " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
TRIDENT = GeyserEntityDefinition . inherited ( TridentEntity : : new , abstractArrowBase ) // TODO remove class
2021-11-18 03:02:38 +00:00
. type ( EntityType . TRIDENT )
. identifier ( " minecraft:thrown_trident " )
. addTranslator ( null ) // Loyalty
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( tridentEntity , entityMetadata ) - > tridentEntity . setFlag ( EntityFlag . ENCHANTED , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. build ( ) ;
// Item frames are handled differently as they are blocks, not items, in Bedrock
2023-05-09 16:46:06 +00:00
ITEM_FRAME = GeyserEntityDefinition . < ItemFrameEntity > inherited ( null , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ITEM_FRAME )
. addTranslator ( MetadataType . ITEM , ItemFrameEntity : : setItemInFrame )
2021-11-19 01:44:03 +00:00
. addTranslator ( MetadataType . INT , ItemFrameEntity : : setItemRotation )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
GLOW_ITEM_FRAME = GeyserEntityDefinition . inherited ( ITEM_FRAME . factory ( ) , ITEM_FRAME )
2021-11-18 03:02:38 +00:00
. type ( EntityType . GLOW_ITEM_FRAME )
. build ( ) ;
2023-05-09 16:46:06 +00:00
MINECART = GeyserEntityDefinition . inherited ( MinecartEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . MINECART )
. height ( 0 . 7f ) . width ( 0 . 98f )
. offset ( 0 . 35f )
2022-10-30 03:02:11 +00:00
. addTranslator ( MetadataType . INT , ( minecartEntity , entityMetadata ) - > minecartEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . STRUCTURAL_INTEGRITY , entityMetadata . getValue ( ) ) )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( minecartEntity , entityMetadata ) - > minecartEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . HURT_DIRECTION , entityMetadata . getValue ( ) ) ) // Direction in which the minecart is shaking
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . FLOAT , ( minecartEntity , entityMetadata ) - >
2022-10-30 03:02:11 +00:00
// Power in Java, hurt ticks in Bedrock
minecartEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . HURT_TICKS , Math . min ( ( int ) ( ( FloatEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) , 15 ) ) )
2021-11-19 01:44:03 +00:00
. addTranslator ( MetadataType . INT , MinecartEntity : : setCustomBlock )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . INT , MinecartEntity : : setCustomBlockOffset )
. addTranslator ( MetadataType . BOOLEAN , MinecartEntity : : setShowCustomBlock )
. build ( ) ;
2023-05-09 16:46:06 +00:00
CHEST_MINECART = GeyserEntityDefinition . inherited ( MINECART . factory ( ) , MINECART )
2021-11-27 04:03:46 +00:00
. type ( EntityType . CHEST_MINECART )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
COMMAND_BLOCK_MINECART = GeyserEntityDefinition . inherited ( CommandBlockMinecartEntity : : new , MINECART )
2021-11-27 04:03:46 +00:00
. type ( EntityType . COMMAND_BLOCK_MINECART )
2022-10-30 03:02:11 +00:00
. addTranslator ( MetadataType . STRING , ( entity , entityMetadata ) - > entity . getDirtyMetadata ( ) . put ( EntityDataTypes . COMMAND_BLOCK_NAME , entityMetadata . getValue ( ) ) )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . CHAT , ( entity , entityMetadata ) - > entity . getDirtyMetadata ( ) . put ( EntityDataTypes . COMMAND_BLOCK_LAST_OUTPUT , MessageTranslator . convertMessage ( entityMetadata . getValue ( ) ) ) )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
FURNACE_MINECART = GeyserEntityDefinition . inherited ( FurnaceMinecartEntity : : new , MINECART )
2021-11-27 04:03:46 +00:00
. type ( EntityType . FURNACE_MINECART )
2021-11-18 03:02:38 +00:00
. identifier ( " minecraft:minecart " )
. addTranslator ( MetadataType . BOOLEAN , FurnaceMinecartEntity : : setHasFuel )
. build ( ) ;
2023-05-09 16:46:06 +00:00
HOPPER_MINECART = GeyserEntityDefinition . inherited ( MINECART . factory ( ) , MINECART )
2021-11-27 04:03:46 +00:00
. type ( EntityType . HOPPER_MINECART )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
SPAWNER_MINECART = GeyserEntityDefinition . inherited ( SpawnerMinecartEntity : : new , MINECART )
2021-11-27 04:03:46 +00:00
. type ( EntityType . SPAWNER_MINECART )
2021-11-18 03:02:38 +00:00
. identifier ( " minecraft:minecart " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
TNT_MINECART = GeyserEntityDefinition . inherited ( MINECART . factory ( ) , MINECART )
2021-11-27 04:03:46 +00:00
. type ( EntityType . TNT_MINECART )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
WITHER_SKULL = GeyserEntityDefinition . inherited ( WitherSkullEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . WITHER_SKULL )
. heightAndWidth ( 0 . 3125f )
. addTranslator ( MetadataType . BOOLEAN , WitherSkullEntity : : setDangerous )
. build ( ) ;
2023-05-09 16:46:06 +00:00
WITHER_SKULL_DANGEROUS = GeyserEntityDefinition . inherited ( WITHER_SKULL . factory ( ) , WITHER_SKULL )
2021-11-18 03:02:38 +00:00
. build ( false ) ;
}
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < LivingEntity > livingEntityBase = GeyserEntityDefinition . inherited ( LivingEntity : : new , entityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , LivingEntity : : setLivingEntityFlags )
. addTranslator ( MetadataType . FLOAT , LivingEntity : : setHealth )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . INT ,
2022-10-30 00:23:21 +00:00
( livingEntity , entityMetadata ) - > livingEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . EFFECT_COLOR , entityMetadata . getValue ( ) ) )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN ,
2022-10-30 03:02:11 +00:00
( livingEntity , entityMetadata ) - > livingEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . EFFECT_AMBIENCE , ( byte ) ( ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ? 1 : 0 ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( null ) // Arrow count
. addTranslator ( null ) // Stinger count
2021-11-19 01:44:03 +00:00
. addTranslator ( MetadataType . OPTIONAL_POSITION , LivingEntity : : setBedPosition )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
ARMOR_STAND = GeyserEntityDefinition . inherited ( ArmorStandEntity : : new , livingEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ARMOR_STAND )
. height ( 1 . 975f ) . width ( 0 . 5f )
. addTranslator ( MetadataType . BYTE , ArmorStandEntity : : setArmorStandFlags )
. addTranslator ( MetadataType . ROTATION , ArmorStandEntity : : setHeadRotation )
. addTranslator ( MetadataType . ROTATION , ArmorStandEntity : : setBodyRotation )
. addTranslator ( MetadataType . ROTATION , ArmorStandEntity : : setLeftArmRotation )
. addTranslator ( MetadataType . ROTATION , ArmorStandEntity : : setRightArmRotation )
. addTranslator ( MetadataType . ROTATION , ArmorStandEntity : : setLeftLegRotation )
. addTranslator ( MetadataType . ROTATION , ArmorStandEntity : : setRightLegRotation )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PLAYER = GeyserEntityDefinition . < PlayerEntity > inherited ( null , livingEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PLAYER )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. addTranslator ( MetadataType . FLOAT , PlayerEntity : : setAbsorptionHearts )
. addTranslator ( null ) // Player score
. addTranslator ( MetadataType . BYTE , PlayerEntity : : setSkinVisibility )
. addTranslator ( null ) // Player main hand
. addTranslator ( MetadataType . NBT_TAG , PlayerEntity : : setLeftParrot )
. addTranslator ( MetadataType . NBT_TAG , PlayerEntity : : setRightParrot )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < MobEntity > mobEntityBase = GeyserEntityDefinition . inherited ( MobEntity : : new , livingEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , MobEntity : : setMobFlags )
. build ( ) ;
// Extends mob
{
2023-05-09 16:46:06 +00:00
ALLAY = GeyserEntityDefinition . inherited ( AllayEntity : : new , mobEntityBase )
2022-05-26 21:51:55 +00:00
. type ( EntityType . ALLAY )
. height ( 0 . 6f ) . width ( 0 . 35f )
2022-07-28 21:45:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , AllayEntity : : setDancing )
. addTranslator ( MetadataType . BOOLEAN , AllayEntity : : setCanDuplicate )
2022-05-26 21:51:55 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
BAT = GeyserEntityDefinition . inherited ( BatEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . BAT )
. height ( 0 . 9f ) . width ( 0 . 5f )
. addTranslator ( MetadataType . BYTE , BatEntity : : setBatFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
BLAZE = GeyserEntityDefinition . inherited ( BlazeEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . BLAZE )
. height ( 1 . 8f ) . width ( 0 . 6f )
. addTranslator ( MetadataType . BYTE , BlazeEntity : : setBlazeFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
CREEPER = GeyserEntityDefinition . inherited ( CreeperEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . CREEPER )
. height ( 1 . 7f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. addTranslator ( MetadataType . INT , CreeperEntity : : setSwelling )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( entity , entityMetadata ) - > entity . setFlag ( EntityFlag . POWERED , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , CreeperEntity : : setIgnited )
. build ( ) ;
2023-05-09 16:46:06 +00:00
DOLPHIN = GeyserEntityDefinition . inherited ( DolphinEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . DOLPHIN )
. height ( 0 . 6f ) . width ( 0 . 9f )
//TODO check
. addTranslator ( null ) // treasure position
. addTranslator ( null ) // "got fish"
. addTranslator ( null ) // "moistness level"
. build ( ) ;
2023-05-09 16:46:06 +00:00
ENDERMAN = GeyserEntityDefinition . inherited ( EndermanEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ENDERMAN )
. height ( 2 . 9f ) . width ( 0 . 6f )
2023-03-11 01:51:51 +00:00
. addTranslator ( MetadataType . OPTIONAL_BLOCK_STATE , EndermanEntity : : setCarriedBlock )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , EndermanEntity : : setScreaming )
. addTranslator ( MetadataType . BOOLEAN , EndermanEntity : : setAngry )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ENDERMITE = GeyserEntityDefinition . inherited ( MonsterEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ENDERMITE )
. height ( 0 . 3f ) . width ( 0 . 4f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ENDER_DRAGON = GeyserEntityDefinition . inherited ( EnderDragonEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ENDER_DRAGON )
. addTranslator ( MetadataType . INT , EnderDragonEntity : : setPhase )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GHAST = GeyserEntityDefinition . inherited ( GhastEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . GHAST )
. heightAndWidth ( 4 . 0f )
. addTranslator ( MetadataType . BOOLEAN , GhastEntity : : setGhastAttacking )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GIANT = GeyserEntityDefinition . inherited ( GiantEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . GIANT )
. height ( 1 . 8f ) . width ( 1 . 6f )
. offset ( 1 . 62f )
. identifier ( " minecraft:zombie " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
IRON_GOLEM = GeyserEntityDefinition . inherited ( IronGolemEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . IRON_GOLEM )
. height ( 2 . 7f ) . width ( 1 . 4f )
2021-11-19 01:44:03 +00:00
. addTranslator ( null ) // "is player created", which doesn't seem to do anything clientside
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
PHANTOM = GeyserEntityDefinition . inherited ( PhantomEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PHANTOM )
. height ( 0 . 5f ) . width ( 0 . 9f )
. offset ( 0 . 6f )
. addTranslator ( MetadataType . INT , PhantomEntity : : setPhantomScale )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SILVERFISH = GeyserEntityDefinition . inherited ( MonsterEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SILVERFISH )
. height ( 0 . 3f ) . width ( 0 . 4f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SHULKER = GeyserEntityDefinition . inherited ( ShulkerEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SHULKER )
. heightAndWidth ( 1f )
. addTranslator ( MetadataType . DIRECTION , ShulkerEntity : : setAttachedFace )
. addTranslator ( MetadataType . BYTE , ShulkerEntity : : setShulkerHeight )
. addTranslator ( MetadataType . BYTE , ShulkerEntity : : setShulkerColor )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SKELETON = GeyserEntityDefinition . inherited ( SkeletonEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SKELETON )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. addTranslator ( MetadataType . BOOLEAN , SkeletonEntity : : setConvertingToStray )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SNOW_GOLEM = GeyserEntityDefinition . inherited ( SnowGolemEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SNOW_GOLEM )
. height ( 1 . 9f ) . width ( 0 . 7f )
. addTranslator ( MetadataType . BYTE , SnowGolemEntity : : setSnowGolemFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SPIDER = GeyserEntityDefinition . inherited ( SpiderEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SPIDER )
. height ( 0 . 9f ) . width ( 1 . 4f )
. offset ( 1f )
. addTranslator ( MetadataType . BYTE , SpiderEntity : : setSpiderFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
CAVE_SPIDER = GeyserEntityDefinition . inherited ( SpiderEntity : : new , SPIDER )
2021-11-27 04:03:46 +00:00
. type ( EntityType . CAVE_SPIDER )
. height ( 0 . 5f ) . width ( 0 . 7f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SQUID = GeyserEntityDefinition . inherited ( SquidEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SQUID )
. heightAndWidth ( 0 . 8f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
STRAY = GeyserEntityDefinition . inherited ( AbstractSkeletonEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . STRAY )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
VEX = GeyserEntityDefinition . inherited ( VexEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . VEX )
. height ( 0 . 8f ) . width ( 0 . 4f )
. addTranslator ( MetadataType . BYTE , VexEntity : : setVexFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
WARDEN = GeyserEntityDefinition . inherited ( WardenEntity : : new , mobEntityBase )
2022-05-26 22:41:19 +00:00
. type ( EntityType . WARDEN )
. height ( 2 . 9f ) . width ( 0 . 9f )
. addTranslator ( MetadataType . INT , WardenEntity : : setAngerLevel )
. build ( ) ;
2023-05-09 16:46:06 +00:00
WITHER = GeyserEntityDefinition . inherited ( WitherEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. 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 ( ) ;
2023-05-09 16:46:06 +00:00
WITHER_SKELETON = GeyserEntityDefinition . inherited ( AbstractSkeletonEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . WITHER_SKELETON )
. height ( 2 . 4f ) . width ( 0 . 7f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ZOGLIN = GeyserEntityDefinition . inherited ( ZoglinEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ZOGLIN )
. height ( 1 . 4f ) . width ( 1 . 3965f )
. addTranslator ( MetadataType . BOOLEAN , ZoglinEntity : : setBaby )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ZOMBIE = GeyserEntityDefinition . inherited ( ZombieEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. 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 ( ) ;
2023-05-09 16:46:06 +00:00
ZOMBIE_VILLAGER = GeyserEntityDefinition . inherited ( ZombieVillagerEntity : : new , ZOMBIE )
2021-11-18 03:02:38 +00:00
. 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 ( ) ;
2023-05-09 16:46:06 +00:00
ZOMBIFIED_PIGLIN = GeyserEntityDefinition . inherited ( ZombifiedPiglinEntity : : new , ZOMBIE ) //TODO test how zombie entity metadata is handled?
2021-11-18 03:02:38 +00:00
. type ( EntityType . ZOMBIFIED_PIGLIN )
. height ( 1 . 95f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. identifier ( " minecraft:zombie_pigman " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
DROWNED = GeyserEntityDefinition . inherited ( ZOMBIE . factory ( ) , ZOMBIE )
2021-11-18 03:02:38 +00:00
. type ( EntityType . DROWNED )
. height ( 1 . 95f ) . width ( 0 . 6f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
HUSK = GeyserEntityDefinition . inherited ( ZOMBIE . factory ( ) , ZOMBIE )
2021-11-18 03:02:38 +00:00
. type ( EntityType . HUSK )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GUARDIAN = GeyserEntityDefinition . inherited ( GuardianEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . GUARDIAN )
. heightAndWidth ( 0 . 85f )
. addTranslator ( null ) // Moving //TODO
. addTranslator ( MetadataType . INT , GuardianEntity : : setGuardianTarget )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ELDER_GUARDIAN = GeyserEntityDefinition . inherited ( ElderGuardianEntity : : new , GUARDIAN )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ELDER_GUARDIAN )
. heightAndWidth ( 1 . 9975f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SLIME = GeyserEntityDefinition . inherited ( SlimeEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SLIME )
. heightAndWidth ( 0 . 51f )
. addTranslator ( MetadataType . INT , SlimeEntity : : setScale )
. build ( ) ;
2023-05-09 16:46:06 +00:00
MAGMA_CUBE = GeyserEntityDefinition . inherited ( MagmaCubeEntity : : new , SLIME )
2021-11-18 03:02:38 +00:00
. type ( EntityType . MAGMA_CUBE )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < AbstractFishEntity > abstractFishEntityBase = GeyserEntityDefinition . inherited ( AbstractFishEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( null ) // From bucket
. build ( ) ;
2023-05-09 16:46:06 +00:00
COD = GeyserEntityDefinition . inherited ( abstractFishEntityBase . factory ( ) , abstractFishEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . COD )
. height ( 0 . 25f ) . width ( 0 . 5f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PUFFERFISH = GeyserEntityDefinition . inherited ( PufferFishEntity : : new , abstractFishEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PUFFERFISH )
. heightAndWidth ( 0 . 7f )
. addTranslator ( MetadataType . INT , PufferFishEntity : : setPufferfishSize )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SALMON = GeyserEntityDefinition . inherited ( abstractFishEntityBase . factory ( ) , abstractFishEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SALMON )
. height ( 0 . 5f ) . width ( 0 . 7f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
TADPOLE = GeyserEntityDefinition . inherited ( TadpoleEntity : : new , abstractFishEntityBase )
2022-05-26 22:52:04 +00:00
. type ( EntityType . TADPOLE )
. height ( 0 . 3f ) . width ( 0 . 4f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
TROPICAL_FISH = GeyserEntityDefinition . inherited ( TropicalFishEntity : : new , abstractFishEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . TROPICAL_FISH )
. heightAndWidth ( 0 . 6f )
. identifier ( " minecraft:tropicalfish " )
2021-11-19 01:44:03 +00:00
. addTranslator ( MetadataType . INT , TropicalFishEntity : : setFishVariant )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < BasePiglinEntity > abstractPiglinEntityBase = GeyserEntityDefinition . inherited ( BasePiglinEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , BasePiglinEntity : : setImmuneToZombification )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PIGLIN = GeyserEntityDefinition . inherited ( PiglinEntity : : new , abstractPiglinEntityBase )
2021-11-18 03:02:38 +00:00
. 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 ( ) ;
2023-05-09 16:46:06 +00:00
PIGLIN_BRUTE = GeyserEntityDefinition . inherited ( abstractPiglinEntityBase . factory ( ) , abstractPiglinEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PIGLIN_BRUTE )
. height ( 1 . 95f ) . width ( 0 . 6f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GLOW_SQUID = GeyserEntityDefinition . inherited ( GlowSquidEntity : : new , SQUID )
2021-11-18 03:02:38 +00:00
. type ( EntityType . GLOW_SQUID )
. addTranslator ( null ) // Set dark ticks remaining, possible TODO
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < RaidParticipantEntity > raidParticipantEntityBase = GeyserEntityDefinition . inherited ( RaidParticipantEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( null ) // Celebrating //TODO
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < SpellcasterIllagerEntity > spellcasterEntityBase = GeyserEntityDefinition . inherited ( SpellcasterIllagerEntity : : new , raidParticipantEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , SpellcasterIllagerEntity : : setSpellType )
. build ( ) ;
2023-05-09 16:46:06 +00:00
EVOKER = GeyserEntityDefinition . inherited ( spellcasterEntityBase . factory ( ) , spellcasterEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . EVOKER )
. height ( 1 . 95f ) . width ( 0 . 6f )
. identifier ( " minecraft:evocation_illager " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ILLUSIONER = GeyserEntityDefinition . inherited ( spellcasterEntityBase . factory ( ) , spellcasterEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ILLUSIONER )
. height ( 1 . 95f ) . width ( 0 . 6f )
. identifier ( " minecraft:evocation_illager " )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PILLAGER = GeyserEntityDefinition . inherited ( PillagerEntity : : new , raidParticipantEntityBase )
2021-11-18 03:02:38 +00:00
. 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 ( ) ;
2023-05-09 16:46:06 +00:00
RAVAGER = GeyserEntityDefinition . inherited ( raidParticipantEntityBase . factory ( ) , raidParticipantEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . RAVAGER )
. height ( 1 . 9f ) . width ( 1 . 2f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
VINDICATOR = GeyserEntityDefinition . inherited ( VindicatorEntity : : new , raidParticipantEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . VINDICATOR )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
WITCH = GeyserEntityDefinition . inherited ( raidParticipantEntityBase . factory ( ) , raidParticipantEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . WITCH )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
2021-11-20 00:11:36 +00:00
. addTranslator ( null ) // Using item
2021-11-18 03:02:38 +00:00
. build ( ) ;
}
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < AgeableEntity > ageableEntityBase = GeyserEntityDefinition . inherited ( AgeableEntity : : new , mobEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , AgeableEntity : : setBaby )
. build ( ) ;
// Extends ageable
{
2023-05-09 16:46:06 +00:00
AXOLOTL = GeyserEntityDefinition . inherited ( AxolotlEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . AXOLOTL )
. height ( 0 . 42f ) . width ( 0 . 7f )
. addTranslator ( MetadataType . INT , AxolotlEntity : : setVariant )
. addTranslator ( MetadataType . BOOLEAN , AxolotlEntity : : setPlayingDead )
2021-11-19 01:44:03 +00:00
. addTranslator ( null ) // From bucket
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
BEE = GeyserEntityDefinition . inherited ( BeeEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . BEE )
. heightAndWidth ( 0 . 6f )
. addTranslator ( MetadataType . BYTE , BeeEntity : : setBeeFlags )
. addTranslator ( MetadataType . INT , BeeEntity : : setAngerTime )
. build ( ) ;
2023-05-09 16:46:06 +00:00
CHICKEN = GeyserEntityDefinition . inherited ( ChickenEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . CHICKEN )
. height ( 0 . 7f ) . width ( 0 . 4f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
COW = GeyserEntityDefinition . inherited ( CowEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . COW )
. height ( 1 . 4f ) . width ( 0 . 9f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
FOX = GeyserEntityDefinition . inherited ( FoxEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . FOX )
. height ( 0 . 5f ) . width ( 1 . 25f )
. addTranslator ( MetadataType . INT , FoxEntity : : setFoxVariant )
. addTranslator ( MetadataType . BYTE , FoxEntity : : setFoxFlags )
2021-11-27 04:03:46 +00:00
. addTranslator ( null ) // Trusted player 1
. addTranslator ( null ) // Trusted player 2
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
FROG = GeyserEntityDefinition . inherited ( FrogEntity : : new , ageableEntityBase )
2022-05-26 20:22:53 +00:00
. type ( EntityType . FROG )
. heightAndWidth ( 0 . 5f )
. addTranslator ( MetadataType . FROG_VARIANT , FrogEntity : : setFrogVariant )
. addTranslator ( MetadataType . OPTIONAL_VARINT , FrogEntity : : setTongueTarget )
. build ( ) ;
2023-05-09 16:46:06 +00:00
HOGLIN = GeyserEntityDefinition . inherited ( HoglinEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . HOGLIN )
. height ( 1 . 4f ) . width ( 1 . 3965f )
. addTranslator ( MetadataType . BOOLEAN , HoglinEntity : : setImmuneToZombification )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GOAT = GeyserEntityDefinition . inherited ( GoatEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . GOAT )
. height ( 1 . 3f ) . width ( 0 . 9f )
. addTranslator ( MetadataType . BOOLEAN , GoatEntity : : setScreamer )
2022-06-07 01:06:02 +00:00
. addTranslator ( MetadataType . BOOLEAN , GoatEntity : : setHasLeftHorn )
. addTranslator ( MetadataType . BOOLEAN , GoatEntity : : setHasRightHorn )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
MOOSHROOM = GeyserEntityDefinition . inherited ( MooshroomEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . MOOSHROOM )
. height ( 1 . 4f ) . width ( 0 . 9f )
2022-02-25 03:49:10 +00:00
. addTranslator ( MetadataType . STRING , MooshroomEntity : : setVariant )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
OCELOT = GeyserEntityDefinition . inherited ( OcelotEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . OCELOT )
2022-02-25 03:49:10 +00:00
. height ( 0 . 7f ) . width ( 0 . 6f )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( ocelotEntity , entityMetadata ) - > ocelotEntity . setFlag ( EntityFlag . TRUSTING , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
PANDA = GeyserEntityDefinition . inherited ( PandaEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PANDA )
. height ( 1 . 25f ) . width ( 1 . 125f )
. addTranslator ( null ) // Unhappy counter
. addTranslator ( null ) // Sneeze counter
. addTranslator ( MetadataType . INT , PandaEntity : : setEatingCounter )
. addTranslator ( MetadataType . BYTE , PandaEntity : : setMainGene )
. addTranslator ( MetadataType . BYTE , PandaEntity : : setHiddenGene )
. addTranslator ( MetadataType . BYTE , PandaEntity : : setPandaFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PIG = GeyserEntityDefinition . inherited ( PigEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PIG )
. heightAndWidth ( 0 . 9f )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( pigEntity , entityMetadata ) - > pigEntity . setFlag ( EntityFlag . SADDLED , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( null ) // Boost time
. build ( ) ;
2023-05-09 16:46:06 +00:00
POLAR_BEAR = GeyserEntityDefinition . inherited ( PolarBearEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . POLAR_BEAR )
. height ( 1 . 4f ) . width ( 1 . 3f )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( entity , entityMetadata ) - > entity . setFlag ( EntityFlag . STANDING , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
RABBIT = GeyserEntityDefinition . inherited ( RabbitEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . RABBIT )
. height ( 0 . 5f ) . width ( 0 . 4f )
. addTranslator ( MetadataType . INT , RabbitEntity : : setRabbitVariant )
. build ( ) ;
2023-05-09 16:46:06 +00:00
SHEEP = GeyserEntityDefinition . inherited ( SheepEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SHEEP )
2022-02-25 03:49:10 +00:00
. height ( 1 . 3f ) . width ( 0 . 9f )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , SheepEntity : : setSheepFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
STRIDER = GeyserEntityDefinition . inherited ( StriderEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . STRIDER )
. height ( 1 . 7f ) . width ( 0 . 9f )
. addTranslator ( null ) // Boost time
. addTranslator ( MetadataType . BOOLEAN , StriderEntity : : setCold )
. addTranslator ( MetadataType . BOOLEAN , StriderEntity : : setSaddled )
. build ( ) ;
2023-05-09 16:46:06 +00:00
TURTLE = GeyserEntityDefinition . inherited ( TurtleEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . TURTLE )
. height ( 0 . 4f ) . width ( 1 . 2f )
2021-11-20 00:11:36 +00:00
. addTranslator ( null ) // Home position
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , TurtleEntity : : setPregnant )
. addTranslator ( MetadataType . BOOLEAN , TurtleEntity : : setLayingEgg )
2021-11-20 00:11:36 +00:00
. addTranslator ( null ) // Travel position
. addTranslator ( null ) // Going home
. addTranslator ( null ) // Travelling
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < AbstractMerchantEntity > abstractVillagerEntityBase = GeyserEntityDefinition . inherited ( AbstractMerchantEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( null ) // Unhappy ticks
. build ( ) ;
2023-05-09 16:46:06 +00:00
VILLAGER = GeyserEntityDefinition . inherited ( VillagerEntity : : new , abstractVillagerEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . VILLAGER )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. identifier ( " minecraft:villager_v2 " )
. addTranslator ( MetadataType . VILLAGER_DATA , VillagerEntity : : setVillagerData )
. build ( ) ;
2023-05-09 16:46:06 +00:00
WANDERING_TRADER = GeyserEntityDefinition . inherited ( abstractVillagerEntityBase . factory ( ) , abstractVillagerEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . WANDERING_TRADER )
. height ( 1 . 8f ) . width ( 0 . 6f )
. offset ( 1 . 62f )
. build ( ) ;
}
// Horses
{
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < AbstractHorseEntity > abstractHorseEntityBase = GeyserEntityDefinition . inherited ( AbstractHorseEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , AbstractHorseEntity : : setHorseFlags )
. build ( ) ;
2023-05-09 16:46:06 +00:00
CAMEL = GeyserEntityDefinition . inherited ( CamelEntity : : new , abstractHorseEntityBase )
2022-12-05 19:20:34 +00:00
. type ( EntityType . CAMEL )
. identifier ( " minecraft:llama " ) // todo 1.20
. height ( 2 . 375f ) . width ( 1 . 7f )
. addTranslator ( MetadataType . BOOLEAN , CamelEntity : : setDashing )
. addTranslator ( null ) // Last pose change tick
. build ( ) ;
2023-05-09 16:46:06 +00:00
HORSE = GeyserEntityDefinition . inherited ( HorseEntity : : new , abstractHorseEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . HORSE )
. height ( 1 . 6f ) . width ( 1 . 3965f )
2021-11-19 01:44:03 +00:00
. addTranslator ( MetadataType . INT , HorseEntity : : setHorseVariant )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
SKELETON_HORSE = GeyserEntityDefinition . inherited ( SkeletonHorseEntity : : new , abstractHorseEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . SKELETON_HORSE )
. height ( 1 . 6f ) . width ( 1 . 3965f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
ZOMBIE_HORSE = GeyserEntityDefinition . inherited ( ZombieHorseEntity : : new , abstractHorseEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . ZOMBIE_HORSE )
. height ( 1 . 6f ) . width ( 1 . 3965f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < ChestedHorseEntity > chestedHorseEntityBase = GeyserEntityDefinition . inherited ( ChestedHorseEntity : : new , abstractHorseEntityBase )
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( horseEntity , entityMetadata ) - > horseEntity . setFlag ( EntityFlag . CHESTED , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
DONKEY = GeyserEntityDefinition . inherited ( chestedHorseEntityBase . factory ( ) , chestedHorseEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . DONKEY )
. height ( 1 . 6f ) . width ( 1 . 3965f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
MULE = GeyserEntityDefinition . inherited ( chestedHorseEntityBase . factory ( ) , chestedHorseEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . MULE )
. height ( 1 . 6f ) . width ( 1 . 3965f )
. build ( ) ;
2023-05-09 16:46:06 +00:00
LLAMA = GeyserEntityDefinition . inherited ( LlamaEntity : : new , chestedHorseEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . LLAMA )
. height ( 1 . 87f ) . width ( 0 . 9f )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( entity , entityMetadata ) - > entity . getDirtyMetadata ( ) . put ( EntityDataTypes . STRENGTH , entityMetadata . getValue ( ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . INT , LlamaEntity : : setCarpetedColor )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( entity , entityMetadata ) - > entity . getDirtyMetadata ( ) . put ( EntityDataTypes . VARIANT , entityMetadata . getValue ( ) ) )
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
TRADER_LLAMA = GeyserEntityDefinition . inherited ( TraderLlamaEntity : : new , LLAMA )
2021-11-18 03:02:38 +00:00
. type ( EntityType . TRADER_LLAMA )
. identifier ( " minecraft:llama " )
. build ( ) ;
}
2023-05-09 16:46:06 +00:00
GeyserEntityDefinition < TameableEntity > tameableEntityBase = GeyserEntityDefinition . inherited ( TameableEntity : : new , ageableEntityBase )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BYTE , TameableEntity : : setTameableFlags )
. addTranslator ( MetadataType . OPTIONAL_UUID , TameableEntity : : setOwner )
. build ( ) ;
2023-05-09 16:46:06 +00:00
CAT = GeyserEntityDefinition . inherited ( CatEntity : : new , tameableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . CAT )
. height ( 0 . 35f ) . width ( 0 . 3f )
2022-05-25 22:44:33 +00:00
. addTranslator ( MetadataType . CAT_VARIANT , CatEntity : : setCatVariant )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . BOOLEAN , CatEntity : : setResting )
. addTranslator ( null ) // "resting state one" //TODO
. addTranslator ( MetadataType . INT , CatEntity : : setCollarColor )
. build ( ) ;
2023-05-09 16:46:06 +00:00
PARROT = GeyserEntityDefinition . inherited ( ParrotEntity : : new , tameableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . PARROT )
. height ( 0 . 9f ) . width ( 0 . 5f )
2022-10-30 00:23:21 +00:00
. addTranslator ( MetadataType . INT , ( parrotEntity , entityMetadata ) - > parrotEntity . getDirtyMetadata ( ) . put ( EntityDataTypes . VARIANT , entityMetadata . getValue ( ) ) ) // Parrot color
2021-11-18 03:02:38 +00:00
. build ( ) ;
2023-05-09 16:46:06 +00:00
WOLF = GeyserEntityDefinition . inherited ( WolfEntity : : new , tameableEntityBase )
2021-11-18 03:02:38 +00:00
. type ( EntityType . WOLF )
. height ( 0 . 85f ) . width ( 0 . 6f )
// "Begging" on wiki.vg, "Interested" in Nukkit - the tilt of the head
2021-11-20 19:25:21 +00:00
. addTranslator ( MetadataType . BOOLEAN , ( wolfEntity , entityMetadata ) - > wolfEntity . setFlag ( EntityFlag . INTERESTED , ( ( BooleanEntityMetadata ) entityMetadata ) . getPrimitiveValue ( ) ) )
2021-11-18 03:02:38 +00:00
. addTranslator ( MetadataType . INT , WolfEntity : : setCollarColor )
. addTranslator ( MetadataType . INT , WolfEntity : : setWolfAngerTime )
. build ( ) ;
// As of 1.18 these don't track entity data at all
2023-05-09 16:46:06 +00:00
ENDER_DRAGON_PART = GeyserEntityDefinition . < EnderDragonPartEntity > builder ( null )
2021-11-18 03:02:38 +00:00
. identifier ( " minecraft:armor_stand " ) // Emulated
2021-11-27 04:03:46 +00:00
. build ( false ) ; // Never sent over the network
2021-11-19 01:44:03 +00:00
2023-05-09 16:46:06 +00:00
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
2021-11-18 03:02:38 +00:00
}
public static void init ( ) {
// no-op
}
private EntityDefinitions ( ) {
}
}