Skip to content

Commit 2209799

Browse files
Merge pull request #29 from SLNE-Development/pre/development
Development (1.6.0)
2 parents 56e2530 + 68d8dd0 commit 2209799

File tree

19 files changed

+543
-195
lines changed

19 files changed

+543
-195
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
maven("https://repo.slne.dev/repository/maven-public/") { name = "maven-public" }
77
}
88
dependencies {
9-
classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.7+")
9+
classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.11+")
1010
}
1111
}
1212

@@ -19,7 +19,7 @@ subprojects {
1919
afterEvaluate {
2020
plugins.withType<PublishingPlugin> {
2121
configure<PublishingExtension> {
22-
repositories{
22+
repositories {
2323
slneReleases()
2424
}
2525
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
kotlin.code.style=official
22
kotlin.stdlib.default.dependency=false
33
org.gradle.parallel=true
4-
version=1.21.7-1.5.0-SNAPSHOT
4+
version=1.21.11-1.5.3-SNAPSHOT

surf-npc-api/src/main/kotlin/dev/slne/surf/npc/api/npc/Npc.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ interface Npc {
5858
*/
5959
val viewers: ObjectSet<UUID>?
6060

61+
/**
62+
* Represents the unique identifier for the NPC's sitting state.
63+
*
64+
* This identifier corresponds to the NPC's sitting entity, such as an invisible armor stand.
65+
* It is used to manage and reference the sitting state of the NPC.
66+
*/
67+
val npcSittingId: Int
68+
69+
/**
70+
* Represents the unique identifier (UUID) associated with an NPC's sitting entity.
71+
* This UUID is primarily used to manage and interact with the sitting entity of the NPC,
72+
* such as spawning or assigning specific behaviors or properties.
73+
*/
74+
val npcSittingUuid: UUID
75+
6176
/**
6277
* Spawns the NPC for a specific player.
6378
*
@@ -231,4 +246,11 @@ interface Npc {
231246
* @param animationType The type of animation to play.
232247
*/
233248
fun playAnimation(animationType: NpcAnimationType)
249+
250+
/**
251+
* Updates the pose of the NPC to the specified pose.
252+
*
253+
* @param pose The new pose to set for the NPC. Acceptable values are defined in the [NpcPose] enum.
254+
*/
255+
fun setPose(pose: NpcPose)
234256
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package dev.slne.surf.npc.api.npc
2+
3+
enum class NpcPose(val id: Int, val usable: Boolean = false) {
4+
STANDING(0, true),
5+
FALL_FLYING(1, true),
6+
SLEEPING(2, true),
7+
SWIMMING(3, true),
8+
9+
@Deprecated("No effect")
10+
SPIN_ATTACK(4),
11+
SNEAKING(5, true),
12+
13+
@Deprecated("No effect")
14+
LONG_JUMPING(6),
15+
16+
@Deprecated("No effect")
17+
DYING(7),
18+
19+
@Deprecated("No effect")
20+
CROAKING(8),
21+
22+
@Deprecated("No effect")
23+
USING_TONGUE(9),
24+
25+
SITTING(10, true),
26+
27+
@Deprecated("No effect")
28+
ROARING(11),
29+
30+
@Deprecated("No effect")
31+
SNIFFING(12),
32+
33+
@Deprecated("No effect")
34+
EMERGING(13),
35+
36+
@Deprecated("No effect")
37+
DIGGING(14),
38+
39+
@Deprecated("No effect")
40+
SLIDING(15),
41+
42+
@Deprecated("No effect")
43+
SHOOTING(16),
44+
45+
@Deprecated("No effect")
46+
INHALING(17);
47+
48+
companion object {
49+
private val BY_ID = entries.associateBy(NpcPose::id)
50+
51+
fun fromId(id: Int): NpcPose? = BY_ID[id]
52+
operator fun get(id: Int): NpcPose? = fromId(id)
53+
}
54+
}

0 commit comments

Comments
 (0)