mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-31 21:48:08 +01:00
Added default meta constructor to EntityTypes
This commit is contained in:
parent
237466c90e
commit
eb274ce95e
@ -1,5 +1,115 @@
|
||||
package net.minestom.server.entity;
|
||||
|
||||
import java.util.function.Function;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.PlayerMeta;
|
||||
import net.minestom.server.entity.metadata.ambient.BatMeta;
|
||||
import net.minestom.server.entity.metadata.animal.BeeMeta;
|
||||
import net.minestom.server.entity.metadata.animal.ChickenMeta;
|
||||
import net.minestom.server.entity.metadata.animal.CowMeta;
|
||||
import net.minestom.server.entity.metadata.animal.DonkeyMeta;
|
||||
import net.minestom.server.entity.metadata.animal.FoxMeta;
|
||||
import net.minestom.server.entity.metadata.animal.HoglinMeta;
|
||||
import net.minestom.server.entity.metadata.animal.HorseMeta;
|
||||
import net.minestom.server.entity.metadata.animal.LlamaMeta;
|
||||
import net.minestom.server.entity.metadata.animal.MooshroomMeta;
|
||||
import net.minestom.server.entity.metadata.animal.MuleMeta;
|
||||
import net.minestom.server.entity.metadata.animal.OcelotMeta;
|
||||
import net.minestom.server.entity.metadata.animal.PandaMeta;
|
||||
import net.minestom.server.entity.metadata.animal.PigMeta;
|
||||
import net.minestom.server.entity.metadata.animal.PolarBearMeta;
|
||||
import net.minestom.server.entity.metadata.animal.RabbitMeta;
|
||||
import net.minestom.server.entity.metadata.animal.SheepMeta;
|
||||
import net.minestom.server.entity.metadata.animal.SkeletonHorseMeta;
|
||||
import net.minestom.server.entity.metadata.animal.StriderMeta;
|
||||
import net.minestom.server.entity.metadata.animal.TurtleMeta;
|
||||
import net.minestom.server.entity.metadata.animal.ZombieHorseMeta;
|
||||
import net.minestom.server.entity.metadata.animal.tameable.CatMeta;
|
||||
import net.minestom.server.entity.metadata.animal.tameable.ParrotMeta;
|
||||
import net.minestom.server.entity.metadata.animal.tameable.WolfMeta;
|
||||
import net.minestom.server.entity.metadata.arrow.ArrowMeta;
|
||||
import net.minestom.server.entity.metadata.arrow.SpectralArrowMeta;
|
||||
import net.minestom.server.entity.metadata.arrow.ThrownTridentMeta;
|
||||
import net.minestom.server.entity.metadata.flying.GhastMeta;
|
||||
import net.minestom.server.entity.metadata.flying.PhantomMeta;
|
||||
import net.minestom.server.entity.metadata.golem.IronGolemMeta;
|
||||
import net.minestom.server.entity.metadata.golem.ShulkerMeta;
|
||||
import net.minestom.server.entity.metadata.golem.SnowGolemMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.ChestMinecartMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.CommandBlockMinecartMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.FurnaceMinecartMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.HopperMinecartMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.MinecartMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.SpawnerMinecartMeta;
|
||||
import net.minestom.server.entity.metadata.minecart.TntMinecartMeta;
|
||||
import net.minestom.server.entity.metadata.monster.BlazeMeta;
|
||||
import net.minestom.server.entity.metadata.monster.CaveSpiderMeta;
|
||||
import net.minestom.server.entity.metadata.monster.CreeperMeta;
|
||||
import net.minestom.server.entity.metadata.monster.ElderGuardianMeta;
|
||||
import net.minestom.server.entity.metadata.monster.EndermanMeta;
|
||||
import net.minestom.server.entity.metadata.monster.EndermiteMeta;
|
||||
import net.minestom.server.entity.metadata.monster.GiantMeta;
|
||||
import net.minestom.server.entity.metadata.monster.GuardianMeta;
|
||||
import net.minestom.server.entity.metadata.monster.PiglinBruteMeta;
|
||||
import net.minestom.server.entity.metadata.monster.PiglinMeta;
|
||||
import net.minestom.server.entity.metadata.monster.SilverfishMeta;
|
||||
import net.minestom.server.entity.metadata.monster.SpiderMeta;
|
||||
import net.minestom.server.entity.metadata.monster.VexMeta;
|
||||
import net.minestom.server.entity.metadata.monster.WitherMeta;
|
||||
import net.minestom.server.entity.metadata.monster.ZoglinMeta;
|
||||
import net.minestom.server.entity.metadata.monster.raider.EvokerMeta;
|
||||
import net.minestom.server.entity.metadata.monster.raider.IllusionerMeta;
|
||||
import net.minestom.server.entity.metadata.monster.raider.PillagerMeta;
|
||||
import net.minestom.server.entity.metadata.monster.raider.RavagerMeta;
|
||||
import net.minestom.server.entity.metadata.monster.raider.VindicatorMeta;
|
||||
import net.minestom.server.entity.metadata.monster.raider.WitchMeta;
|
||||
import net.minestom.server.entity.metadata.monster.skeleton.SkeletonMeta;
|
||||
import net.minestom.server.entity.metadata.monster.skeleton.StrayMeta;
|
||||
import net.minestom.server.entity.metadata.monster.skeleton.WitherSkeletonMeta;
|
||||
import net.minestom.server.entity.metadata.monster.zombie.DrownedMeta;
|
||||
import net.minestom.server.entity.metadata.monster.zombie.HuskMeta;
|
||||
import net.minestom.server.entity.metadata.monster.zombie.ZombieMeta;
|
||||
import net.minestom.server.entity.metadata.monster.zombie.ZombieVillagerMeta;
|
||||
import net.minestom.server.entity.metadata.monster.zombie.ZombifiedPiglinMeta;
|
||||
import net.minestom.server.entity.metadata.object.EyeOfEnderMeta;
|
||||
import net.minestom.server.entity.metadata.object.FireballMeta;
|
||||
import net.minestom.server.entity.metadata.object.ItemEntityMeta;
|
||||
import net.minestom.server.entity.metadata.object.SmallFireballMeta;
|
||||
import net.minestom.server.entity.metadata.object.SnowballMeta;
|
||||
import net.minestom.server.entity.metadata.object.ThrownEggMeta;
|
||||
import net.minestom.server.entity.metadata.object.ThrownEnderPearlMeta;
|
||||
import net.minestom.server.entity.metadata.object.ThrownExperienceBottleMeta;
|
||||
import net.minestom.server.entity.metadata.object.ThrownPotionMeta;
|
||||
import net.minestom.server.entity.metadata.other.AreaEffectCloudMeta;
|
||||
import net.minestom.server.entity.metadata.other.ArmorStandMeta;
|
||||
import net.minestom.server.entity.metadata.other.BoatMeta;
|
||||
import net.minestom.server.entity.metadata.other.DragonFireballMeta;
|
||||
import net.minestom.server.entity.metadata.other.EndCrystalMeta;
|
||||
import net.minestom.server.entity.metadata.other.EnderDragonMeta;
|
||||
import net.minestom.server.entity.metadata.other.EvokerFangsMeta;
|
||||
import net.minestom.server.entity.metadata.other.ExperienceOrbMeta;
|
||||
import net.minestom.server.entity.metadata.other.FallingBlockMeta;
|
||||
import net.minestom.server.entity.metadata.other.FireworkRocketMeta;
|
||||
import net.minestom.server.entity.metadata.other.FishingHookMeta;
|
||||
import net.minestom.server.entity.metadata.other.ItemFrameMeta;
|
||||
import net.minestom.server.entity.metadata.other.LeashKnotMeta;
|
||||
import net.minestom.server.entity.metadata.other.LightningBoltMeta;
|
||||
import net.minestom.server.entity.metadata.other.LlamaSpitMeta;
|
||||
import net.minestom.server.entity.metadata.other.MagmaCubeMeta;
|
||||
import net.minestom.server.entity.metadata.other.PaintingMeta;
|
||||
import net.minestom.server.entity.metadata.other.PrimedTntMeta;
|
||||
import net.minestom.server.entity.metadata.other.ShulkerBulletMeta;
|
||||
import net.minestom.server.entity.metadata.other.SlimeMeta;
|
||||
import net.minestom.server.entity.metadata.other.TraderLlamaMeta;
|
||||
import net.minestom.server.entity.metadata.other.WitherSkullMeta;
|
||||
import net.minestom.server.entity.metadata.villager.VillagerMeta;
|
||||
import net.minestom.server.entity.metadata.villager.WanderingTraderMeta;
|
||||
import net.minestom.server.entity.metadata.water.DolphinMeta;
|
||||
import net.minestom.server.entity.metadata.water.SquidMeta;
|
||||
import net.minestom.server.entity.metadata.water.fish.CodMeta;
|
||||
import net.minestom.server.entity.metadata.water.fish.PufferfishMeta;
|
||||
import net.minestom.server.entity.metadata.water.fish.SalmonMeta;
|
||||
import net.minestom.server.entity.metadata.water.fish.TropicalFishMeta;
|
||||
import net.minestom.server.registry.Registries;
|
||||
import net.minestom.server.utils.NamespaceID;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -11,221 +121,221 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
@SuppressWarnings({"deprecation"})
|
||||
public enum EntityType {
|
||||
AREA_EFFECT_CLOUD("minecraft:area_effect_cloud", 6.0, 0.5),
|
||||
AREA_EFFECT_CLOUD("minecraft:area_effect_cloud", 6.0, 0.5, AreaEffectCloudMeta::new),
|
||||
|
||||
ARMOR_STAND("minecraft:armor_stand", 0.5, 1.975),
|
||||
ARMOR_STAND("minecraft:armor_stand", 0.5, 1.975, ArmorStandMeta::new),
|
||||
|
||||
ARROW("minecraft:arrow", 0.5, 0.5),
|
||||
ARROW("minecraft:arrow", 0.5, 0.5, ArrowMeta::new),
|
||||
|
||||
BAT("minecraft:bat", 0.5, 0.9),
|
||||
BAT("minecraft:bat", 0.5, 0.9, BatMeta::new),
|
||||
|
||||
BEE("minecraft:bee", 0.7, 0.6),
|
||||
BEE("minecraft:bee", 0.7, 0.6, BeeMeta::new),
|
||||
|
||||
BLAZE("minecraft:blaze", 0.6, 1.8),
|
||||
BLAZE("minecraft:blaze", 0.6, 1.8, BlazeMeta::new),
|
||||
|
||||
BOAT("minecraft:boat", 1.375, 0.5625),
|
||||
BOAT("minecraft:boat", 1.375, 0.5625, BoatMeta::new),
|
||||
|
||||
CAT("minecraft:cat", 0.6, 0.7),
|
||||
CAT("minecraft:cat", 0.6, 0.7, CatMeta::new),
|
||||
|
||||
CAVE_SPIDER("minecraft:cave_spider", 0.7, 0.5),
|
||||
CAVE_SPIDER("minecraft:cave_spider", 0.7, 0.5, CaveSpiderMeta::new),
|
||||
|
||||
CHICKEN("minecraft:chicken", 0.4, 0.7),
|
||||
CHICKEN("minecraft:chicken", 0.4, 0.7, ChickenMeta::new),
|
||||
|
||||
COD("minecraft:cod", 0.5, 0.3),
|
||||
COD("minecraft:cod", 0.5, 0.3, CodMeta::new),
|
||||
|
||||
COW("minecraft:cow", 0.9, 1.4),
|
||||
COW("minecraft:cow", 0.9, 1.4, CowMeta::new),
|
||||
|
||||
CREEPER("minecraft:creeper", 0.6, 1.7),
|
||||
CREEPER("minecraft:creeper", 0.6, 1.7, CreeperMeta::new),
|
||||
|
||||
DOLPHIN("minecraft:dolphin", 0.9, 0.6),
|
||||
DOLPHIN("minecraft:dolphin", 0.9, 0.6, DolphinMeta::new),
|
||||
|
||||
DONKEY("minecraft:donkey", 1.39648, 1.5),
|
||||
DONKEY("minecraft:donkey", 1.39648, 1.5, DonkeyMeta::new),
|
||||
|
||||
DRAGON_FIREBALL("minecraft:dragon_fireball", 1.0, 1.0),
|
||||
DRAGON_FIREBALL("minecraft:dragon_fireball", 1.0, 1.0, DragonFireballMeta::new),
|
||||
|
||||
DROWNED("minecraft:drowned", 0.6, 1.95),
|
||||
DROWNED("minecraft:drowned", 0.6, 1.95, DrownedMeta::new),
|
||||
|
||||
ELDER_GUARDIAN("minecraft:elder_guardian", 1.9975, 1.9975),
|
||||
ELDER_GUARDIAN("minecraft:elder_guardian", 1.9975, 1.9975, ElderGuardianMeta::new),
|
||||
|
||||
END_CRYSTAL("minecraft:end_crystal", 2.0, 2.0),
|
||||
END_CRYSTAL("minecraft:end_crystal", 2.0, 2.0, EndCrystalMeta::new),
|
||||
|
||||
ENDER_DRAGON("minecraft:ender_dragon", 16.0, 8.0),
|
||||
ENDER_DRAGON("minecraft:ender_dragon", 16.0, 8.0, EnderDragonMeta::new),
|
||||
|
||||
ENDERMAN("minecraft:enderman", 0.6, 2.9),
|
||||
ENDERMAN("minecraft:enderman", 0.6, 2.9, EndermanMeta::new),
|
||||
|
||||
ENDERMITE("minecraft:endermite", 0.4, 0.3),
|
||||
ENDERMITE("minecraft:endermite", 0.4, 0.3, EndermiteMeta::new),
|
||||
|
||||
EVOKER("minecraft:evoker", 0.6, 1.95),
|
||||
EVOKER("minecraft:evoker", 0.6, 1.95, EvokerMeta::new),
|
||||
|
||||
EVOKER_FANGS("minecraft:evoker_fangs", 0.5, 0.8),
|
||||
EVOKER_FANGS("minecraft:evoker_fangs", 0.5, 0.8, EvokerFangsMeta::new),
|
||||
|
||||
EXPERIENCE_ORB("minecraft:experience_orb", 0.5, 0.5),
|
||||
EXPERIENCE_ORB("minecraft:experience_orb", 0.5, 0.5, ExperienceOrbMeta::new),
|
||||
|
||||
EYE_OF_ENDER("minecraft:eye_of_ender", 0.25, 0.25),
|
||||
EYE_OF_ENDER("minecraft:eye_of_ender", 0.25, 0.25, EyeOfEnderMeta::new),
|
||||
|
||||
FALLING_BLOCK("minecraft:falling_block", 0.98, 0.98),
|
||||
FALLING_BLOCK("minecraft:falling_block", 0.98, 0.98, FallingBlockMeta::new),
|
||||
|
||||
FIREWORK_ROCKET("minecraft:firework_rocket", 0.25, 0.25),
|
||||
FIREWORK_ROCKET("minecraft:firework_rocket", 0.25, 0.25, FireworkRocketMeta::new),
|
||||
|
||||
FOX("minecraft:fox", 0.6, 0.7),
|
||||
FOX("minecraft:fox", 0.6, 0.7, FoxMeta::new),
|
||||
|
||||
GHAST("minecraft:ghast", 4.0, 4.0),
|
||||
GHAST("minecraft:ghast", 4.0, 4.0, GhastMeta::new),
|
||||
|
||||
GIANT("minecraft:giant", 3.6, 12.0),
|
||||
GIANT("minecraft:giant", 3.6, 12.0, GiantMeta::new),
|
||||
|
||||
GUARDIAN("minecraft:guardian", 0.85, 0.85),
|
||||
GUARDIAN("minecraft:guardian", 0.85, 0.85, GuardianMeta::new),
|
||||
|
||||
HOGLIN("minecraft:hoglin", 1.39648, 1.4),
|
||||
HOGLIN("minecraft:hoglin", 1.39648, 1.4, HoglinMeta::new),
|
||||
|
||||
HORSE("minecraft:horse", 1.39648, 1.6),
|
||||
HORSE("minecraft:horse", 1.39648, 1.6, HorseMeta::new),
|
||||
|
||||
HUSK("minecraft:husk", 0.6, 1.95),
|
||||
HUSK("minecraft:husk", 0.6, 1.95, HuskMeta::new),
|
||||
|
||||
ILLUSIONER("minecraft:illusioner", 0.6, 1.95),
|
||||
ILLUSIONER("minecraft:illusioner", 0.6, 1.95, IllusionerMeta::new),
|
||||
|
||||
IRON_GOLEM("minecraft:iron_golem", 1.4, 2.7),
|
||||
IRON_GOLEM("minecraft:iron_golem", 1.4, 2.7, IronGolemMeta::new),
|
||||
|
||||
ITEM("minecraft:item", 0.25, 0.25),
|
||||
ITEM("minecraft:item", 0.25, 0.25, ItemEntityMeta::new),
|
||||
|
||||
ITEM_FRAME("minecraft:item_frame", 0.5, 0.5),
|
||||
ITEM_FRAME("minecraft:item_frame", 0.5, 0.5, ItemFrameMeta::new),
|
||||
|
||||
FIREBALL("minecraft:fireball", 1.0, 1.0),
|
||||
FIREBALL("minecraft:fireball", 1.0, 1.0, FireballMeta::new),
|
||||
|
||||
LEASH_KNOT("minecraft:leash_knot", 0.5, 0.5),
|
||||
LEASH_KNOT("minecraft:leash_knot", 0.5, 0.5, LeashKnotMeta::new),
|
||||
|
||||
LIGHTNING_BOLT("minecraft:lightning_bolt", 0.0, 0.0),
|
||||
LIGHTNING_BOLT("minecraft:lightning_bolt", 0.0, 0.0, LightningBoltMeta::new),
|
||||
|
||||
LLAMA("minecraft:llama", 0.9, 1.87),
|
||||
LLAMA("minecraft:llama", 0.9, 1.87, LlamaMeta::new),
|
||||
|
||||
LLAMA_SPIT("minecraft:llama_spit", 0.25, 0.25),
|
||||
LLAMA_SPIT("minecraft:llama_spit", 0.25, 0.25, LlamaSpitMeta::new),
|
||||
|
||||
MAGMA_CUBE("minecraft:magma_cube", 2.04, 2.04),
|
||||
MAGMA_CUBE("minecraft:magma_cube", 2.04, 2.04, MagmaCubeMeta::new),
|
||||
|
||||
MINECART("minecraft:minecart", 0.98, 0.7),
|
||||
MINECART("minecraft:minecart", 0.98, 0.7, MinecartMeta::new),
|
||||
|
||||
CHEST_MINECART("minecraft:chest_minecart", 0.98, 0.7),
|
||||
CHEST_MINECART("minecraft:chest_minecart", 0.98, 0.7, ChestMinecartMeta::new),
|
||||
|
||||
COMMAND_BLOCK_MINECART("minecraft:command_block_minecart", 0.98, 0.7),
|
||||
COMMAND_BLOCK_MINECART("minecraft:command_block_minecart", 0.98, 0.7, CommandBlockMinecartMeta::new),
|
||||
|
||||
FURNACE_MINECART("minecraft:furnace_minecart", 0.98, 0.7),
|
||||
FURNACE_MINECART("minecraft:furnace_minecart", 0.98, 0.7, FurnaceMinecartMeta::new),
|
||||
|
||||
HOPPER_MINECART("minecraft:hopper_minecart", 0.98, 0.7),
|
||||
HOPPER_MINECART("minecraft:hopper_minecart", 0.98, 0.7, HopperMinecartMeta::new),
|
||||
|
||||
SPAWNER_MINECART("minecraft:spawner_minecart", 0.98, 0.7),
|
||||
SPAWNER_MINECART("minecraft:spawner_minecart", 0.98, 0.7, SpawnerMinecartMeta::new),
|
||||
|
||||
TNT_MINECART("minecraft:tnt_minecart", 0.98, 0.7),
|
||||
TNT_MINECART("minecraft:tnt_minecart", 0.98, 0.7, TntMinecartMeta::new),
|
||||
|
||||
MULE("minecraft:mule", 1.39648, 1.6),
|
||||
MULE("minecraft:mule", 1.39648, 1.6, MuleMeta::new),
|
||||
|
||||
MOOSHROOM("minecraft:mooshroom", 0.9, 1.4),
|
||||
MOOSHROOM("minecraft:mooshroom", 0.9, 1.4, MooshroomMeta::new),
|
||||
|
||||
OCELOT("minecraft:ocelot", 0.6, 0.7),
|
||||
OCELOT("minecraft:ocelot", 0.6, 0.7, OcelotMeta::new),
|
||||
|
||||
PAINTING("minecraft:painting", 0.5, 0.5),
|
||||
PAINTING("minecraft:painting", 0.5, 0.5, PaintingMeta::new),
|
||||
|
||||
PANDA("minecraft:panda", 1.3, 1.25),
|
||||
PANDA("minecraft:panda", 1.3, 1.25, PandaMeta::new),
|
||||
|
||||
PARROT("minecraft:parrot", 0.5, 0.9),
|
||||
PARROT("minecraft:parrot", 0.5, 0.9, ParrotMeta::new),
|
||||
|
||||
PHANTOM("minecraft:phantom", 0.9, 0.5),
|
||||
PHANTOM("minecraft:phantom", 0.9, 0.5, PhantomMeta::new),
|
||||
|
||||
PIG("minecraft:pig", 0.9, 0.9),
|
||||
PIG("minecraft:pig", 0.9, 0.9, PigMeta::new),
|
||||
|
||||
PIGLIN("minecraft:piglin", 0.6, 1.95),
|
||||
PIGLIN("minecraft:piglin", 0.6, 1.95, PiglinMeta::new),
|
||||
|
||||
PIGLIN_BRUTE("minecraft:piglin_brute", 0.6, 1.95),
|
||||
PIGLIN_BRUTE("minecraft:piglin_brute", 0.6, 1.95, PiglinBruteMeta::new),
|
||||
|
||||
PILLAGER("minecraft:pillager", 0.6, 1.95),
|
||||
PILLAGER("minecraft:pillager", 0.6, 1.95, PillagerMeta::new),
|
||||
|
||||
POLAR_BEAR("minecraft:polar_bear", 1.4, 1.4),
|
||||
POLAR_BEAR("minecraft:polar_bear", 1.4, 1.4, PolarBearMeta::new),
|
||||
|
||||
TNT("minecraft:tnt", 0.98, 0.98),
|
||||
TNT("minecraft:tnt", 0.98, 0.98, PrimedTntMeta::new),
|
||||
|
||||
PUFFERFISH("minecraft:pufferfish", 0.7, 0.7),
|
||||
PUFFERFISH("minecraft:pufferfish", 0.7, 0.7, PufferfishMeta::new),
|
||||
|
||||
RABBIT("minecraft:rabbit", 0.4, 0.5),
|
||||
RABBIT("minecraft:rabbit", 0.4, 0.5, RabbitMeta::new),
|
||||
|
||||
RAVAGER("minecraft:ravager", 1.95, 2.2),
|
||||
RAVAGER("minecraft:ravager", 1.95, 2.2, RavagerMeta::new),
|
||||
|
||||
SALMON("minecraft:salmon", 0.7, 0.4),
|
||||
SALMON("minecraft:salmon", 0.7, 0.4, SalmonMeta::new),
|
||||
|
||||
SHEEP("minecraft:sheep", 0.9, 1.3),
|
||||
SHEEP("minecraft:sheep", 0.9, 1.3, SheepMeta::new),
|
||||
|
||||
SHULKER("minecraft:shulker", 1.0, 1.0),
|
||||
SHULKER("minecraft:shulker", 1.0, 1.0, ShulkerMeta::new),
|
||||
|
||||
SHULKER_BULLET("minecraft:shulker_bullet", 0.3125, 0.3125),
|
||||
SHULKER_BULLET("minecraft:shulker_bullet", 0.3125, 0.3125, ShulkerBulletMeta::new),
|
||||
|
||||
SILVERFISH("minecraft:silverfish", 0.4, 0.3),
|
||||
SILVERFISH("minecraft:silverfish", 0.4, 0.3, SilverfishMeta::new),
|
||||
|
||||
SKELETON("minecraft:skeleton", 0.6, 1.99),
|
||||
SKELETON("minecraft:skeleton", 0.6, 1.99, SkeletonMeta::new),
|
||||
|
||||
SKELETON_HORSE("minecraft:skeleton_horse", 1.39648, 1.6),
|
||||
SKELETON_HORSE("minecraft:skeleton_horse", 1.39648, 1.6, SkeletonHorseMeta::new),
|
||||
|
||||
SLIME("minecraft:slime", 2.04, 2.04),
|
||||
SLIME("minecraft:slime", 2.04, 2.04, SlimeMeta::new),
|
||||
|
||||
SMALL_FIREBALL("minecraft:small_fireball", 0.3125, 0.3125),
|
||||
SMALL_FIREBALL("minecraft:small_fireball", 0.3125, 0.3125, SmallFireballMeta::new),
|
||||
|
||||
SNOW_GOLEM("minecraft:snow_golem", 0.7, 1.9),
|
||||
SNOW_GOLEM("minecraft:snow_golem", 0.7, 1.9, SnowGolemMeta::new),
|
||||
|
||||
SNOWBALL("minecraft:snowball", 0.25, 0.25),
|
||||
SNOWBALL("minecraft:snowball", 0.25, 0.25, SnowballMeta::new),
|
||||
|
||||
SPECTRAL_ARROW("minecraft:spectral_arrow", 0.5, 0.5),
|
||||
SPECTRAL_ARROW("minecraft:spectral_arrow", 0.5, 0.5, SpectralArrowMeta::new),
|
||||
|
||||
SPIDER("minecraft:spider", 1.4, 0.9),
|
||||
SPIDER("minecraft:spider", 1.4, 0.9, SpiderMeta::new),
|
||||
|
||||
SQUID("minecraft:squid", 0.8, 0.8),
|
||||
SQUID("minecraft:squid", 0.8, 0.8, SquidMeta::new),
|
||||
|
||||
STRAY("minecraft:stray", 0.6, 1.99),
|
||||
STRAY("minecraft:stray", 0.6, 1.99, StrayMeta::new),
|
||||
|
||||
STRIDER("minecraft:strider", 0.9, 1.7),
|
||||
STRIDER("minecraft:strider", 0.9, 1.7, StriderMeta::new),
|
||||
|
||||
EGG("minecraft:egg", 0.25, 0.25),
|
||||
EGG("minecraft:egg", 0.25, 0.25, ThrownEggMeta::new),
|
||||
|
||||
ENDER_PEARL("minecraft:ender_pearl", 0.25, 0.25),
|
||||
ENDER_PEARL("minecraft:ender_pearl", 0.25, 0.25, ThrownEnderPearlMeta::new),
|
||||
|
||||
EXPERIENCE_BOTTLE("minecraft:experience_bottle", 0.25, 0.25),
|
||||
EXPERIENCE_BOTTLE("minecraft:experience_bottle", 0.25, 0.25, ThrownExperienceBottleMeta::new),
|
||||
|
||||
POTION("minecraft:potion", 0.25, 0.25),
|
||||
POTION("minecraft:potion", 0.25, 0.25, ThrownPotionMeta::new),
|
||||
|
||||
TRIDENT("minecraft:trident", 0.5, 0.5),
|
||||
TRIDENT("minecraft:trident", 0.5, 0.5, ThrownTridentMeta::new),
|
||||
|
||||
TRADER_LLAMA("minecraft:trader_llama", 0.9, 1.87),
|
||||
TRADER_LLAMA("minecraft:trader_llama", 0.9, 1.87, TraderLlamaMeta::new),
|
||||
|
||||
TROPICAL_FISH("minecraft:tropical_fish", 0.5, 0.4),
|
||||
TROPICAL_FISH("minecraft:tropical_fish", 0.5, 0.4, TropicalFishMeta::new),
|
||||
|
||||
TURTLE("minecraft:turtle", 1.2, 0.4),
|
||||
TURTLE("minecraft:turtle", 1.2, 0.4, TurtleMeta::new),
|
||||
|
||||
VEX("minecraft:vex", 0.4, 0.8),
|
||||
VEX("minecraft:vex", 0.4, 0.8, VexMeta::new),
|
||||
|
||||
VILLAGER("minecraft:villager", 0.6, 1.95),
|
||||
VILLAGER("minecraft:villager", 0.6, 1.95, VillagerMeta::new),
|
||||
|
||||
VINDICATOR("minecraft:vindicator", 0.6, 1.95),
|
||||
VINDICATOR("minecraft:vindicator", 0.6, 1.95, VindicatorMeta::new),
|
||||
|
||||
WANDERING_TRADER("minecraft:wandering_trader", 0.6, 1.95),
|
||||
WANDERING_TRADER("minecraft:wandering_trader", 0.6, 1.95, WanderingTraderMeta::new),
|
||||
|
||||
WITCH("minecraft:witch", 0.6, 1.95),
|
||||
WITCH("minecraft:witch", 0.6, 1.95, WitchMeta::new),
|
||||
|
||||
WITHER("minecraft:wither", 0.9, 3.5),
|
||||
WITHER("minecraft:wither", 0.9, 3.5, WitherMeta::new),
|
||||
|
||||
WITHER_SKELETON("minecraft:wither_skeleton", 0.7, 2.4),
|
||||
WITHER_SKELETON("minecraft:wither_skeleton", 0.7, 2.4, WitherSkeletonMeta::new),
|
||||
|
||||
WITHER_SKULL("minecraft:wither_skull", 0.3125, 0.3125),
|
||||
WITHER_SKULL("minecraft:wither_skull", 0.3125, 0.3125, WitherSkullMeta::new),
|
||||
|
||||
WOLF("minecraft:wolf", 0.6, 0.85),
|
||||
WOLF("minecraft:wolf", 0.6, 0.85, WolfMeta::new),
|
||||
|
||||
ZOGLIN("minecraft:zoglin", 1.39648, 1.4),
|
||||
ZOGLIN("minecraft:zoglin", 1.39648, 1.4, ZoglinMeta::new),
|
||||
|
||||
ZOMBIE("minecraft:zombie", 0.6, 1.95),
|
||||
ZOMBIE("minecraft:zombie", 0.6, 1.95, ZombieMeta::new),
|
||||
|
||||
ZOMBIE_HORSE("minecraft:zombie_horse", 1.39648, 1.6),
|
||||
ZOMBIE_HORSE("minecraft:zombie_horse", 1.39648, 1.6, ZombieHorseMeta::new),
|
||||
|
||||
ZOMBIE_VILLAGER("minecraft:zombie_villager", 0.6, 1.95),
|
||||
ZOMBIE_VILLAGER("minecraft:zombie_villager", 0.6, 1.95, ZombieVillagerMeta::new),
|
||||
|
||||
ZOMBIFIED_PIGLIN("minecraft:zombified_piglin", 0.6, 1.95),
|
||||
ZOMBIFIED_PIGLIN("minecraft:zombified_piglin", 0.6, 1.95, ZombifiedPiglinMeta::new),
|
||||
|
||||
PLAYER("minecraft:player", 0.6, 1.8),
|
||||
PLAYER("minecraft:player", 0.6, 1.8, PlayerMeta::new),
|
||||
|
||||
FISHING_BOBBER("minecraft:fishing_bobber", 0.25, 0.25);
|
||||
FISHING_BOBBER("minecraft:fishing_bobber", 0.25, 0.25, FishingHookMeta::new);
|
||||
|
||||
@NotNull
|
||||
private String namespaceID;
|
||||
@ -234,10 +344,15 @@ public enum EntityType {
|
||||
|
||||
private double height;
|
||||
|
||||
EntityType(@NotNull String namespaceID, double width, double height) {
|
||||
@NotNull
|
||||
private Function<? extends Entity, ? extends EntityMeta> metaConstructor;
|
||||
|
||||
EntityType(@NotNull String namespaceID, double width, double height,
|
||||
@NotNull Function<? extends Entity, ? extends EntityMeta> metaConstructor) {
|
||||
this.namespaceID = namespaceID;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.metaConstructor = metaConstructor;
|
||||
Registries.entityTypes.put(NamespaceID.from(namespaceID), this);
|
||||
}
|
||||
|
||||
@ -257,6 +372,10 @@ public enum EntityType {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public Function<? extends Entity, ? extends EntityMeta> getMetaConstructor() {
|
||||
return this.metaConstructor;
|
||||
}
|
||||
|
||||
public static EntityType fromId(short id) {
|
||||
if(id >= 0 && id < values().length) {
|
||||
return values()[id];
|
||||
|
@ -0,0 +1,16 @@
|
||||
package net.minestom.codegen;
|
||||
|
||||
import com.squareup.javapoet.ClassName;
|
||||
|
||||
public class ConstructorLambda {
|
||||
|
||||
private final ClassName className;
|
||||
|
||||
public ConstructorLambda(ClassName className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public ClassName getClassName() {
|
||||
return className;
|
||||
}
|
||||
}
|
@ -58,17 +58,22 @@ public class EnumGenerator implements CodeGenerator {
|
||||
TypeSpec.Builder enumClass = TypeSpec.enumBuilder(ClassName.get(enumPackage, enumName)).addModifiers(Modifier.PUBLIC);
|
||||
|
||||
enumClass.addJavadoc(COMMENT);
|
||||
for(AnnotationSpec annotation : annotations) {
|
||||
for (AnnotationSpec annotation : annotations) {
|
||||
enumClass.addAnnotation(annotation);
|
||||
}
|
||||
|
||||
for(Instance instance : instances) {
|
||||
for (Instance instance : instances) {
|
||||
StringBuilder format = new StringBuilder();
|
||||
for (int i = 0; i < instance.parameters.length; i++) {
|
||||
if (i != 0) {
|
||||
format.append(", ");
|
||||
}
|
||||
format.append("$L");
|
||||
if (instance.parameters[i] instanceof ConstructorLambda) {
|
||||
instance.parameters[i] = ((ConstructorLambda) instance.parameters[i]).getClassName();
|
||||
format.append("$T::new");
|
||||
} else {
|
||||
format.append("$L");
|
||||
}
|
||||
}
|
||||
|
||||
// generate instances
|
||||
@ -76,7 +81,7 @@ public class EnumGenerator implements CodeGenerator {
|
||||
enumClass.addEnumConstant(instance.name, arguments);
|
||||
}
|
||||
|
||||
if(staticBlock != null) {
|
||||
if (staticBlock != null) {
|
||||
enumClass.addStaticBlock(staticBlock);
|
||||
}
|
||||
|
||||
@ -121,10 +126,10 @@ public class EnumGenerator implements CodeGenerator {
|
||||
}
|
||||
methodBuilder.addModifiers(Modifier.PUBLIC);
|
||||
methodBuilder.returns(m.returnType);
|
||||
if(m.vararg) {
|
||||
if (m.vararg) {
|
||||
methodBuilder.varargs(true);
|
||||
}
|
||||
for(ParameterSpec parameter : m.signature) {
|
||||
for (ParameterSpec parameter : m.signature) {
|
||||
methodBuilder.addParameter(parameter);
|
||||
}
|
||||
|
||||
@ -134,7 +139,6 @@ public class EnumGenerator implements CodeGenerator {
|
||||
|
||||
enumClass.addMethod(methodBuilder.build());
|
||||
}
|
||||
|
||||
JavaFile file = JavaFile.builder(enumPackage, enumClass.build())
|
||||
.skipJavaLangImports(true)
|
||||
.indent(" ")
|
||||
|
@ -1,20 +1,53 @@
|
||||
package net.minestom.codegen.entitytypes;
|
||||
|
||||
import com.google.common.base.CaseFormat;
|
||||
import net.minestom.server.utils.NamespaceID;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
public class EntityTypeContainer implements Comparable<EntityTypeContainer> {
|
||||
|
||||
private int id;
|
||||
private NamespaceID name;
|
||||
private double width;
|
||||
private double height;
|
||||
private Class<?> metaClass;
|
||||
|
||||
public EntityTypeContainer(int id, NamespaceID name, double width, double height) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
String metaClassName = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name.getPath());
|
||||
// special cases
|
||||
switch (metaClassName) {
|
||||
case "Item":
|
||||
metaClassName = "ItemEntity";
|
||||
break;
|
||||
case "Tnt":
|
||||
metaClassName = "PrimedTnt";
|
||||
break;
|
||||
case "FishingBobber":
|
||||
metaClassName = "FishingHook";
|
||||
break;
|
||||
case "Egg":
|
||||
case "EnderPearl":
|
||||
case "ExperienceBottle":
|
||||
case "Potion":
|
||||
case "Trident":
|
||||
metaClassName = "Thrown" + metaClassName;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
metaClassName += "Meta";
|
||||
this.metaClass = findClassIn("net.minestom.server.entity.metadata", metaClassName);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
@ -33,8 +66,66 @@ public class EntityTypeContainer implements Comparable<EntityTypeContainer> {
|
||||
return height;
|
||||
}
|
||||
|
||||
public Class<?> getMetaClass() {
|
||||
return metaClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull EntityTypeContainer o) {
|
||||
return Integer.compare(id, o.id);
|
||||
}
|
||||
|
||||
private static Class<?> findClassIn(String pkg, String className) {
|
||||
try {
|
||||
return getClasses(pkg).stream()
|
||||
.filter(clazz -> clazz.getSimpleName().equals(className))
|
||||
.findAny()
|
||||
.orElseThrow();
|
||||
} catch (Throwable t) {
|
||||
throw new IllegalStateException("Could not find class " + className + " in " + pkg, t);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Class<?>> getClasses(String packageName)
|
||||
throws ClassNotFoundException, IOException {
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
assert classLoader != null;
|
||||
String path = packageName.replace('.', '/');
|
||||
Enumeration<URL> resources = classLoader.getResources(path);
|
||||
List<File> dirs = new ArrayList<>();
|
||||
while (resources.hasMoreElements()) {
|
||||
URL resource = resources.nextElement();
|
||||
dirs.add(new File(resource.getFile()));
|
||||
}
|
||||
List<Class<?>> classes = new ArrayList<>();
|
||||
for (File directory : dirs) {
|
||||
classes.addAll(findClasses(directory, packageName));
|
||||
}
|
||||
return classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive method used to find all classes in a given directory and subdirs.
|
||||
*
|
||||
* @param directory The base directory
|
||||
* @param packageName The package name for classes found inside the base directory
|
||||
* @return The classes
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException {
|
||||
List<Class<?>> classes = new ArrayList<>();
|
||||
if (!directory.exists()) {
|
||||
return classes;
|
||||
}
|
||||
File[] files = directory.listFiles();
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
assert !file.getName().contains(".");
|
||||
classes.addAll(findClasses(file, packageName + "." + file.getName()));
|
||||
} else if (file.getName().endsWith(".class")) {
|
||||
classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));
|
||||
}
|
||||
}
|
||||
return classes;
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,11 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.squareup.javapoet.*;
|
||||
import net.minestom.codegen.ConstructorLambda;
|
||||
import net.minestom.codegen.EnumGenerator;
|
||||
import net.minestom.codegen.MinestomEnumGenerator;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.registry.Registries;
|
||||
import net.minestom.server.registry.ResourceGatherer;
|
||||
import net.minestom.server.utils.NamespaceID;
|
||||
@ -13,9 +16,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Generates an EntityType enum containing all data about entity types
|
||||
@ -101,6 +108,9 @@ public class EntityTypeEnumGenerator extends MinestomEnumGenerator<EntityTypeCon
|
||||
|
||||
TreeSet<EntityTypeContainer> types = new TreeSet<>(EntityTypeContainer::compareTo);
|
||||
for (var burgerEntity : burgerEntities) {
|
||||
if (burgerEntity.name.contains("~")) {
|
||||
continue;
|
||||
}
|
||||
types.add(new EntityTypeContainer(
|
||||
burgerEntity.id,
|
||||
NamespaceID.from("minecraft:" + burgerEntity.name),
|
||||
@ -115,8 +125,16 @@ public class EntityTypeEnumGenerator extends MinestomEnumGenerator<EntityTypeCon
|
||||
protected void prepare(EnumGenerator generator) {
|
||||
ClassName className = ClassName.get(getPackageName(), getClassName());
|
||||
generator.addClassAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "{$S}", "deprecation").build());
|
||||
generator.setParams(ParameterSpec.builder(String.class, "namespaceID").addAnnotation(NotNull.class).build(), ParameterSpec.builder(TypeName.DOUBLE, "width").build(),
|
||||
ParameterSpec.builder(TypeName.DOUBLE, "height").build());
|
||||
generator.setParams(
|
||||
ParameterSpec.builder(String.class, "namespaceID").addAnnotation(NotNull.class).build(),
|
||||
ParameterSpec.builder(TypeName.DOUBLE, "width").build(),
|
||||
ParameterSpec.builder(TypeName.DOUBLE, "height").build(),
|
||||
ParameterSpec.builder(ParameterizedTypeName.get(
|
||||
ClassName.get(Function.class),
|
||||
WildcardTypeName.subtypeOf(ClassName.get(Entity.class)),
|
||||
WildcardTypeName.subtypeOf(ClassName.get(EntityMeta.class))
|
||||
), "metaConstructor").addAnnotation(NotNull.class).build()
|
||||
);
|
||||
generator.appendToConstructor(code -> {
|
||||
code.addStatement("$T.$N.put($T.from(namespaceID), this)", Registries.class, "entityTypes", NamespaceID.class);
|
||||
});
|
||||
@ -133,6 +151,14 @@ public class EntityTypeEnumGenerator extends MinestomEnumGenerator<EntityTypeCon
|
||||
generator.addMethod("getHeight", new ParameterSpec[0], TypeName.DOUBLE, code -> {
|
||||
code.addStatement("return this.height");
|
||||
});
|
||||
generator.addMethod("getMetaConstructor", new ParameterSpec[0],
|
||||
ParameterizedTypeName.get(
|
||||
ClassName.get(Function.class),
|
||||
WildcardTypeName.subtypeOf(ClassName.get(Entity.class)),
|
||||
WildcardTypeName.subtypeOf(ClassName.get(EntityMeta.class))
|
||||
),
|
||||
code -> code.addStatement("return this.metaConstructor")
|
||||
);
|
||||
|
||||
generator.addStaticMethod("fromId", new ParameterSpec[]{ParameterSpec.builder(TypeName.SHORT, "id").build()}, className, code -> {
|
||||
code.beginControlFlow("if(id >= 0 && id < values().length)")
|
||||
@ -148,7 +174,8 @@ public class EntityTypeEnumGenerator extends MinestomEnumGenerator<EntityTypeCon
|
||||
generator.addInstance(instanceName,
|
||||
"\"" + type.getName().toString() + "\"",
|
||||
type.getWidth(),
|
||||
type.getHeight()
|
||||
type.getHeight(),
|
||||
new ConstructorLambda(ClassName.get(type.getMetaClass()))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,166 @@
|
||||
package net.minestom.server.entity.metadata;
|
||||
|
||||
import net.minestom.server.chat.JsonMessage;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class BaseEntityMeta extends EntityMeta {
|
||||
|
||||
private final static byte MASK_INDEX = 0;
|
||||
|
||||
private final static byte ON_FIRE_BIT = 0x01;
|
||||
private final static byte CROUNCHING_BIT = 0x02;
|
||||
private final static byte SPRINTING_BIT = 0x08;
|
||||
private final static byte SWIMMING_BIT = 0x10;
|
||||
private final static byte INVISIBLE_BIT = 0x20;
|
||||
private final static byte HAS_GLOWING_EFFECT_BIT = 0x40;
|
||||
private final static byte FLYING_WITH_ELYTRA_BIT = (byte) 0x80;
|
||||
|
||||
protected BaseEntityMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
public boolean isOnFire() {
|
||||
return getMaskBit(MASK_INDEX, ON_FIRE_BIT);
|
||||
}
|
||||
|
||||
public void setOnFire(boolean value) {
|
||||
setMaskBit(MASK_INDEX, ON_FIRE_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isCrounching() {
|
||||
return getMaskBit(MASK_INDEX, CROUNCHING_BIT);
|
||||
}
|
||||
|
||||
public void setCrounching(boolean value) {
|
||||
setMaskBit(MASK_INDEX, CROUNCHING_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isSprinting() {
|
||||
return getMaskBit(MASK_INDEX, SPRINTING_BIT);
|
||||
}
|
||||
|
||||
public void setSprinting(boolean value) {
|
||||
setMaskBit(MASK_INDEX, SPRINTING_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isSwimming() {
|
||||
return getMaskBit(MASK_INDEX, SWIMMING_BIT);
|
||||
}
|
||||
|
||||
public void setSwimming(boolean value) {
|
||||
setMaskBit(MASK_INDEX, SWIMMING_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isInvisible() {
|
||||
return getMaskBit(MASK_INDEX, INVISIBLE_BIT);
|
||||
}
|
||||
|
||||
public void setInvisible(boolean value) {
|
||||
setMaskBit(MASK_INDEX, INVISIBLE_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isHasGlowingEffect() {
|
||||
return getMaskBit(MASK_INDEX, HAS_GLOWING_EFFECT_BIT);
|
||||
}
|
||||
|
||||
public void setHasGlowingEffect(boolean value) {
|
||||
setMaskBit(MASK_INDEX, HAS_GLOWING_EFFECT_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isFlyingWithElytra() {
|
||||
return getMaskBit(MASK_INDEX, FLYING_WITH_ELYTRA_BIT);
|
||||
}
|
||||
|
||||
public void setFlyingWithElytra(boolean value) {
|
||||
setMaskBit(MASK_INDEX, FLYING_WITH_ELYTRA_BIT, value);
|
||||
}
|
||||
|
||||
public int getAirTicks() {
|
||||
return getMetadata().getIndex((byte) 1, 300);
|
||||
}
|
||||
|
||||
public void setAirTicks(int value) {
|
||||
getMetadata().setIndex((byte) 1, Metadata.VarInt(value));
|
||||
}
|
||||
|
||||
public JsonMessage getCustomName() {
|
||||
return getMetadata().getIndex((byte) 2, null);
|
||||
}
|
||||
|
||||
public void setCustomName(JsonMessage value) {
|
||||
getMetadata().setIndex((byte) 2, Metadata.OptChat(value));
|
||||
}
|
||||
|
||||
public boolean isCustomNameVisible() {
|
||||
return getMetadata().getIndex((byte) 3, false);
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean value) {
|
||||
getMetadata().setIndex((byte) 3, Metadata.Boolean(value));
|
||||
}
|
||||
|
||||
public boolean isSilent() {
|
||||
return getMetadata().getIndex((byte) 4, false);
|
||||
}
|
||||
|
||||
public void setSilent(boolean value) {
|
||||
getMetadata().setIndex((byte) 4, Metadata.Boolean(value));
|
||||
}
|
||||
|
||||
public boolean isHasNoGravity() {
|
||||
return getMetadata().getIndex((byte) 5, false);
|
||||
}
|
||||
|
||||
public void setHasNoGravity(boolean value) {
|
||||
getMetadata().setIndex((byte) 5, Metadata.Boolean(value));
|
||||
}
|
||||
|
||||
public Entity.Pose getPose() {
|
||||
return getMetadata().getIndex((byte) 6, Entity.Pose.STANDING);
|
||||
}
|
||||
|
||||
public void setPose(Entity.Pose value) {
|
||||
getMetadata().setIndex((byte) 6, Metadata.Pose(value));
|
||||
}
|
||||
|
||||
protected Metadata getMetadata() {
|
||||
return this.entity.getMetadata();
|
||||
}
|
||||
|
||||
protected byte getMask(byte index) {
|
||||
return getMetadata().getIndex(index, (byte) 0);
|
||||
}
|
||||
|
||||
protected void setMask(byte index, byte mask) {
|
||||
getMetadata().setIndex(index, Metadata.Byte(mask));
|
||||
}
|
||||
|
||||
protected boolean getMaskBit(byte index, byte bit) {
|
||||
return (getMask(index) & bit) == bit;
|
||||
}
|
||||
|
||||
protected void setMaskBit(byte index, byte bit, boolean value) {
|
||||
byte mask = getMask(index);
|
||||
boolean currentValue = (mask & bit) == bit;
|
||||
if (currentValue == value) {
|
||||
return;
|
||||
}
|
||||
if (value) {
|
||||
mask |= bit;
|
||||
} else {
|
||||
mask &= ~bit;
|
||||
}
|
||||
setMask(index, mask);
|
||||
}
|
||||
|
||||
protected void setBoundingBox(double x, double y, double z) {
|
||||
this.entity.setBoundingBox(x, y, z);
|
||||
}
|
||||
|
||||
protected void setBoundingBox(double width, double height) {
|
||||
setBoundingBox(width, height, width);
|
||||
}
|
||||
|
||||
}
|
@ -1,168 +1,14 @@
|
||||
package net.minestom.server.entity.metadata;
|
||||
|
||||
import net.minestom.server.chat.JsonMessage;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class EntityMeta {
|
||||
|
||||
private final static byte MASK_INDEX = 0;
|
||||
|
||||
private final static byte ON_FIRE_BIT = 0x01;
|
||||
private final static byte CROUNCHING_BIT = 0x02;
|
||||
private final static byte SPRINTING_BIT = 0x08;
|
||||
private final static byte SWIMMING_BIT = 0x10;
|
||||
private final static byte INVISIBLE_BIT = 0x20;
|
||||
private final static byte HAS_GLOWING_EFFECT_BIT = 0x40;
|
||||
private final static byte FLYING_WITH_ELYTRA_BIT = (byte) 0x80;
|
||||
|
||||
protected final Entity entity;
|
||||
|
||||
protected EntityMeta(@NotNull Entity entity) {
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public boolean isOnFire() {
|
||||
return getMaskBit(MASK_INDEX, ON_FIRE_BIT);
|
||||
}
|
||||
|
||||
public void setOnFire(boolean value) {
|
||||
setMaskBit(MASK_INDEX, ON_FIRE_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isCrounching() {
|
||||
return getMaskBit(MASK_INDEX, CROUNCHING_BIT);
|
||||
}
|
||||
|
||||
public void setCrounching(boolean value) {
|
||||
setMaskBit(MASK_INDEX, CROUNCHING_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isSprinting() {
|
||||
return getMaskBit(MASK_INDEX, SPRINTING_BIT);
|
||||
}
|
||||
|
||||
public void setSprinting(boolean value) {
|
||||
setMaskBit(MASK_INDEX, SPRINTING_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isSwimming() {
|
||||
return getMaskBit(MASK_INDEX, SWIMMING_BIT);
|
||||
}
|
||||
|
||||
public void setSwimming(boolean value) {
|
||||
setMaskBit(MASK_INDEX, SWIMMING_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isInvisible() {
|
||||
return getMaskBit(MASK_INDEX, INVISIBLE_BIT);
|
||||
}
|
||||
|
||||
public void setInvisible(boolean value) {
|
||||
setMaskBit(MASK_INDEX, INVISIBLE_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isHasGlowingEffect() {
|
||||
return getMaskBit(MASK_INDEX, HAS_GLOWING_EFFECT_BIT);
|
||||
}
|
||||
|
||||
public void setHasGlowingEffect(boolean value) {
|
||||
setMaskBit(MASK_INDEX, HAS_GLOWING_EFFECT_BIT, value);
|
||||
}
|
||||
|
||||
public boolean isFlyingWithElytra() {
|
||||
return getMaskBit(MASK_INDEX, FLYING_WITH_ELYTRA_BIT);
|
||||
}
|
||||
|
||||
public void setFlyingWithElytra(boolean value) {
|
||||
setMaskBit(MASK_INDEX, FLYING_WITH_ELYTRA_BIT, value);
|
||||
}
|
||||
|
||||
public int getAirTicks() {
|
||||
return getMetadata().getIndex((byte) 1, 300);
|
||||
}
|
||||
|
||||
public void setAirTicks(int value) {
|
||||
getMetadata().setIndex((byte) 1, Metadata.VarInt(value));
|
||||
}
|
||||
|
||||
public JsonMessage getCustomName() {
|
||||
return getMetadata().getIndex((byte) 2, null);
|
||||
}
|
||||
|
||||
public void setCustomName(JsonMessage value) {
|
||||
getMetadata().setIndex((byte) 2, Metadata.OptChat(value));
|
||||
}
|
||||
|
||||
public boolean isCustomNameVisible() {
|
||||
return getMetadata().getIndex((byte) 3, false);
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean value) {
|
||||
getMetadata().setIndex((byte) 3, Metadata.Boolean(value));
|
||||
}
|
||||
|
||||
public boolean isSilent() {
|
||||
return getMetadata().getIndex((byte) 4, false);
|
||||
}
|
||||
|
||||
public void setSilent(boolean value) {
|
||||
getMetadata().setIndex((byte) 4, Metadata.Boolean(value));
|
||||
}
|
||||
|
||||
public boolean isHasNoGravity() {
|
||||
return getMetadata().getIndex((byte) 5, false);
|
||||
}
|
||||
|
||||
public void setHasNoGravity(boolean value) {
|
||||
getMetadata().setIndex((byte) 5, Metadata.Boolean(value));
|
||||
}
|
||||
|
||||
public Entity.Pose getPose() {
|
||||
return getMetadata().getIndex((byte) 6, Entity.Pose.STANDING);
|
||||
}
|
||||
|
||||
public void setPose(Entity.Pose value) {
|
||||
getMetadata().setIndex((byte) 6, Metadata.Pose(value));
|
||||
}
|
||||
|
||||
protected Metadata getMetadata() {
|
||||
return this.entity.getMetadata();
|
||||
}
|
||||
|
||||
protected byte getMask(byte index) {
|
||||
return getMetadata().getIndex(index, (byte) 0);
|
||||
}
|
||||
|
||||
protected void setMask(byte index, byte mask) {
|
||||
getMetadata().setIndex(index, Metadata.Byte(mask));
|
||||
}
|
||||
|
||||
protected boolean getMaskBit(byte index, byte bit) {
|
||||
return (getMask(index) & bit) == bit;
|
||||
}
|
||||
|
||||
protected void setMaskBit(byte index, byte bit, boolean value) {
|
||||
byte mask = getMask(index);
|
||||
boolean currentValue = (mask & bit) == bit;
|
||||
if (currentValue == value) {
|
||||
return;
|
||||
}
|
||||
if (value) {
|
||||
mask |= bit;
|
||||
} else {
|
||||
mask &= ~bit;
|
||||
}
|
||||
setMask(index, mask);
|
||||
}
|
||||
|
||||
protected void setBoundingBox(double x, double y, double z) {
|
||||
this.entity.setBoundingBox(x, y, z);
|
||||
}
|
||||
|
||||
protected void setBoundingBox(double width, double height) {
|
||||
setBoundingBox(width, height, width);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import net.minestom.server.utils.BlockPosition;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class LivingEntityMeta extends EntityMeta {
|
||||
public class LivingEntityMeta extends BaseEntityMeta {
|
||||
|
||||
private final static byte MASK_INDEX = 7;
|
||||
|
||||
|
@ -2,10 +2,10 @@ package net.minestom.server.entity.metadata.arrow;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AbstractArrowMeta extends EntityMeta {
|
||||
public class AbstractArrowMeta extends BaseEntityMeta {
|
||||
|
||||
private final static byte MASK_INDEX = 7;
|
||||
|
||||
|
@ -2,10 +2,10 @@ package net.minestom.server.entity.metadata.arrow;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ArrowMeta extends EntityMeta {
|
||||
public class ArrowMeta extends BaseEntityMeta {
|
||||
|
||||
public ArrowMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -2,10 +2,10 @@ package net.minestom.server.entity.metadata.minecart;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AbstractMinecartMeta extends EntityMeta {
|
||||
public class AbstractMinecartMeta extends BaseEntityMeta {
|
||||
|
||||
protected AbstractMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -3,9 +3,9 @@ package net.minestom.server.entity.metadata.minecart;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MinecartChestMeta extends AbstractMinecartContainerMeta {
|
||||
public class ChestMinecartMeta extends AbstractMinecartContainerMeta {
|
||||
|
||||
public MinecartChestMeta(@NotNull Entity entity) {
|
||||
public ChestMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
@ -6,9 +6,9 @@ import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MinecartCommandBlockMeta extends AbstractMinecartMeta {
|
||||
public class CommandBlockMinecartMeta extends AbstractMinecartMeta {
|
||||
|
||||
public MinecartCommandBlockMeta(@NotNull Entity entity) {
|
||||
public CommandBlockMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
@ -4,9 +4,9 @@ import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MinecartFurnaceMeta extends AbstractMinecartMeta {
|
||||
public class FurnaceMinecartMeta extends AbstractMinecartMeta {
|
||||
|
||||
public MinecartFurnaceMeta(@NotNull Entity entity) {
|
||||
public FurnaceMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ package net.minestom.server.entity.metadata.minecart;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MinecartHopperMeta extends AbstractMinecartContainerMeta {
|
||||
public class HopperMinecartMeta extends AbstractMinecartContainerMeta {
|
||||
|
||||
public MinecartHopperMeta(@NotNull Entity entity) {
|
||||
public HopperMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package net.minestom.server.entity.metadata.minecart;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class SpawnerMinecartMeta extends AbstractMinecartMeta {
|
||||
|
||||
public SpawnerMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -3,9 +3,9 @@ package net.minestom.server.entity.metadata.minecart;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MinecartTntMeta extends AbstractMinecartMeta {
|
||||
public class TntMinecartMeta extends AbstractMinecartMeta {
|
||||
|
||||
public MinecartTntMeta(@NotNull Entity entity) {
|
||||
public TntMinecartMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package net.minestom.server.entity.metadata.monster;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CaveSpiderMeta extends SpiderMeta {
|
||||
|
||||
public CaveSpiderMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -2,12 +2,12 @@ package net.minestom.server.entity.metadata.object;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import net.minestom.server.item.Material;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ObjectEntityMeta extends EntityMeta {
|
||||
public class ObjectEntityMeta extends BaseEntityMeta {
|
||||
|
||||
private final ItemStack defaultItem;
|
||||
|
||||
|
@ -2,12 +2,12 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import net.minestom.server.particle.Particle;
|
||||
import net.minestom.server.particle.ParticleType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AreaEffectCloudMeta extends EntityMeta {
|
||||
public class AreaEffectCloudMeta extends BaseEntityMeta {
|
||||
|
||||
public AreaEffectCloudMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -2,10 +2,10 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class BoatMeta extends EntityMeta {
|
||||
public class BoatMeta extends BaseEntityMeta {
|
||||
|
||||
public BoatMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -1,10 +1,10 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class DragonFireballMeta extends EntityMeta {
|
||||
public class DragonFireballMeta extends BaseEntityMeta {
|
||||
|
||||
public DragonFireballMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -2,12 +2,12 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import net.minestom.server.utils.BlockPosition;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class EndCrystalMeta extends EntityMeta {
|
||||
public class EndCrystalMeta extends BaseEntityMeta {
|
||||
|
||||
public EndCrystalMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -1,10 +1,10 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class EvokerFangsMeta extends EntityMeta {
|
||||
public class EvokerFangsMeta extends BaseEntityMeta {
|
||||
|
||||
public EvokerFangsMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -0,0 +1,13 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ExperienceOrbMeta extends EntityMeta {
|
||||
|
||||
public ExperienceOrbMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -2,11 +2,11 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import net.minestom.server.utils.BlockPosition;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class FallingBlockMeta extends EntityMeta {
|
||||
public class FallingBlockMeta extends BaseEntityMeta {
|
||||
|
||||
public FallingBlockMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -2,12 +2,12 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class FireworkRocketMeta extends EntityMeta {
|
||||
public class FireworkRocketMeta extends BaseEntityMeta {
|
||||
|
||||
private Entity shooter;
|
||||
|
||||
|
@ -2,11 +2,11 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class FishingHookMeta extends EntityMeta {
|
||||
public class FishingHookMeta extends BaseEntityMeta {
|
||||
|
||||
private Entity hooked;
|
||||
|
||||
|
@ -2,11 +2,11 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ItemFrameMeta extends EntityMeta {
|
||||
public class ItemFrameMeta extends BaseEntityMeta {
|
||||
|
||||
public ItemFrameMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -0,0 +1,13 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LeashKnotMeta extends EntityMeta {
|
||||
|
||||
public LeashKnotMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LightningBoltMeta extends EntityMeta {
|
||||
|
||||
public LightningBoltMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LlamaSpitMeta extends EntityMeta {
|
||||
public class LlamaSpitMeta extends BaseEntityMeta {
|
||||
|
||||
public LlamaSpitMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -0,0 +1,13 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PaintingMeta extends EntityMeta {
|
||||
|
||||
public PaintingMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -2,10 +2,10 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PrimedTntMeta extends EntityMeta {
|
||||
public class PrimedTntMeta extends BaseEntityMeta {
|
||||
|
||||
public PrimedTntMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -0,0 +1,13 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ShulkerBulletMeta extends BaseEntityMeta {
|
||||
|
||||
public ShulkerBulletMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class TraderLlamaMeta extends BaseEntityMeta {
|
||||
|
||||
public TraderLlamaMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
}
|
@ -2,10 +2,10 @@ package net.minestom.server.entity.metadata.other;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.metadata.EntityMeta;
|
||||
import net.minestom.server.entity.metadata.BaseEntityMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class WitherSkullMeta extends EntityMeta {
|
||||
public class WitherSkullMeta extends BaseEntityMeta {
|
||||
|
||||
public WitherSkullMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
|
@ -4,9 +4,9 @@ import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PufferFishMeta extends AbstractFishMeta {
|
||||
public class PufferfishMeta extends AbstractFishMeta {
|
||||
|
||||
public PufferFishMeta(@NotNull Entity entity) {
|
||||
public PufferfishMeta(@NotNull Entity entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user