Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jhqwqmc committed Oct 24, 2024
2 parents 4608af2 + ed7af0e commit 2d3d133
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package com.typewritermc.engine.paper.entry.entries
import com.typewritermc.core.entries.PriorityEntry
import com.typewritermc.core.entries.Ref
import com.typewritermc.core.entries.ref
import com.typewritermc.core.extension.annotations.Tags
import com.typewritermc.core.extension.annotations.Help
import com.typewritermc.core.extension.annotations.WithRotation
import com.typewritermc.core.extension.annotations.*
import com.typewritermc.core.utils.point.Position
import com.typewritermc.engine.paper.entry.*
import com.typewritermc.engine.paper.entry.entity.*
Expand All @@ -16,6 +14,8 @@ import kotlin.reflect.KClass

@Tags("speaker")
interface SpeakerEntry : PlaceholderEntry {
@Colored
@Placeholder
@Help("将在聊天中显示的实体的名称(例如“Steve”或“Alex”)。")
val displayName: String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.typewritermc.engine.paper.entry.entity.EntityState
import com.typewritermc.engine.paper.entry.entries.EntityProperty
import com.typewritermc.entity.entries.data.minecraft.PoseProperty
import com.typewritermc.entity.entries.data.minecraft.living.AgableProperty
import com.typewritermc.entity.entries.data.minecraft.living.ScaleData
import com.typewritermc.entity.entries.data.minecraft.living.ScaleProperty
import com.typewritermc.entity.entries.data.minecraft.living.SizeProperty
import com.typewritermc.entity.entries.data.minecraft.living.pufferfish.PuffStateProperty
import com.typewritermc.entity.entries.data.minecraft.other.MarkerProperty
Expand Down Expand Up @@ -67,7 +69,7 @@ private fun EntityType.matcher(properties: Map<KClass<*>, EntityProperty>): Enti
fun EntityType.state(properties: Map<KClass<*>, EntityProperty>): EntityState {
val matcher = matcher(properties)
return EntityState(
eyeHeight = matcher.eyeHeight,
eyeHeight = matcher.eyeHeight * (properties.property(ScaleProperty::class)?.scale ?: 1.0),
)
}

Expand Down

0 comments on commit 2d3d133

Please sign in to comment.