Skip to content

Commit

Permalink
Rename location to position
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Nov 15, 2024
1 parent 8932be3 commit 32646bd
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.typewritermc.core.books.pages.Colors
import com.typewritermc.core.extension.annotations.Entry
import com.typewritermc.core.extension.annotations.GenericConstraint
import com.typewritermc.core.extension.annotations.VariableData
import com.typewritermc.core.extension.annotations.WithRotation
import com.typewritermc.core.utils.point.Coordinate
import com.typewritermc.core.utils.point.Position
import com.typewritermc.engine.paper.entry.entries.VarContext
Expand All @@ -13,21 +14,21 @@ import com.typewritermc.engine.paper.utils.position
import kotlin.reflect.safeCast

@Entry(
"relative_location_variable",
"A variable that returns the location relative to the player",
"relative_position_variable",
"A variable that returns the position relative to the player",
Colors.GREEN,
"streamline:target-solid"
)
@GenericConstraint(Position::class)
@VariableData(RelativeLocationVariableData::class)
@VariableData(RelativePositionVariableData::class)
/**
* The `RelativeLocationVariable` is a variable that returns the location relative to the player.
* The location is calculated by adding the coordinate to the player's position.
* The `RelativePositionVariable` is a variable that returns the position relative to the player.
* The position is calculated by adding the coordinate to the player's position.
*
* ## How could this be used?
* This could be used to make a death cinematic that shows at player's location after they die.
* This could be used to make a death cinematic that shows at player's position after they die.
*/
class RelativeLocationVariable(
class RelativePositionVariable(
override val id: String = "",
override val name: String = "",
) : VariableEntry {
Expand All @@ -42,6 +43,7 @@ class RelativeLocationVariable(
}
}

data class RelativeLocationVariableData(
data class RelativePositionVariableData(
@WithRotation
val coordinate: Coordinate = Coordinate.ORIGIN,
)

0 comments on commit 32646bd

Please sign in to comment.