diff --git a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/BreezeEntity.kt b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/BreezeEntity.kt new file mode 100644 index 0000000000..f3d1923e5c --- /dev/null +++ b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/BreezeEntity.kt @@ -0,0 +1,59 @@ +package com.typewritermc.entity.entries.entity.minecraft + +import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes +import com.typewritermc.core.books.pages.Colors +import com.typewritermc.core.entries.Ref +import com.typewritermc.core.entries.emptyRef +import com.typewritermc.core.extension.annotations.Entry +import com.typewritermc.core.extension.annotations.OnlyTags +import com.typewritermc.core.extension.annotations.Tags +import com.typewritermc.core.utils.point.Position +import com.typewritermc.engine.paper.entry.entity.FakeEntity +import com.typewritermc.engine.paper.entry.entity.SimpleEntityDefinition +import com.typewritermc.engine.paper.entry.entity.SimpleEntityInstance +import com.typewritermc.engine.paper.entry.entries.* +import com.typewritermc.engine.paper.utils.Sound +import com.typewritermc.entity.entries.data.minecraft.applyGenericEntityData +import com.typewritermc.entity.entries.data.minecraft.living.applyLivingEntityData +import com.typewritermc.entity.entries.entity.WrapperFakeEntity +import org.bukkit.entity.Player + +@Entry("breeze_definition", "A breeze entity", Colors.BLUE, "solar:wind-bold") +@Tags("breeze_definition") +/** + * The `BreezeDefinition` class is an entry that shows up as a breeze in-game. + * + * ## How could this be used? + * This could be used to create a breeze entity. + */ +class BreezeDefinition( + override val id: String = "", + override val name: String = "", + override val displayName: Var = ConstVar(""), + override val sound: Sound = Sound.EMPTY, + @OnlyTags("generic_entity_data", "living_entity_data", "mob_data", "breeze_data") + override val data: List>> = emptyList(), +) : SimpleEntityDefinition { + override fun create(player: Player): FakeEntity = BreezeEntity(player) +} + +@Entry("breeze_instance", "An instance of a breeze entity", Colors.CYAN, "solar:wind-bold") +class BreezeInstance( + override val id: String = "", + override val name: String = "", + override val definition: Ref = emptyRef(), + override val spawnLocation: Position = Position.ORIGIN, + @OnlyTags("generic_entity_data", "living_entity_data", "mob_data", "breeze_data") + override val data: List>> = emptyList(), + override val activity: Ref = emptyRef(), +) : SimpleEntityInstance + +private class BreezeEntity(player: Player) : WrapperFakeEntity( + EntityTypes.BREEZE, + player, +) { + override fun applyProperty(property: EntityProperty) { + if (applyGenericEntityData(entity, property)) return + if (applyLivingEntityData(entity, property)) return + } +} \ No newline at end of file diff --git a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SkeletonEntity.kt b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SkeletonEntity.kt index 1451691e74..f8fa137502 100644 --- a/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SkeletonEntity.kt +++ b/extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SkeletonEntity.kt @@ -31,7 +31,7 @@ class SkeletonDefinition( override val name: String = "", override val displayName: Var = ConstVar(""), override val sound: Sound = Sound.EMPTY, - @OnlyTags("generic_entity_data", "living_entity_data", "mob_data") + @OnlyTags("generic_entity_data", "living_entity_data", "mob_data", "skeleton_data") override val data: List>> = emptyList(), ) : SimpleEntityDefinition { override fun create(player: Player): FakeEntity = SkeletonEntity(player) @@ -43,7 +43,7 @@ class SkeletonInstance( override val name: String = "", override val definition: Ref = emptyRef(), override val spawnLocation: Position = Position.ORIGIN, - @OnlyTags("generic_entity_data", "living_entity_data", "mob_data") + @OnlyTags("generic_entity_data", "living_entity_data", "mob_data", "skeleton_data") override val data: List>> = emptyList(), override val activity: Ref = emptyRef(), ) : SimpleEntityInstance