File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
surf-npc-api/src/main/kotlin/dev/slne/surf/npc/api/npc
surf-npc-bukkit/src/main/kotlin/dev/slne/surf/npc/bukkit Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11kotlin.code.style =official
22kotlin.stdlib.default.dependency =false
33org.gradle.parallel =true
4- version =1.21.7-1.4.1 -SNAPSHOT
4+ version =1.21.7-1.4.2 -SNAPSHOT
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ sealed class NpcCreatorType() {
1010 *
1111 * @property name The name of the player who created the NPC.
1212 */
13- data class Player (val name : String ) : NpcCreatorType()
13+ data class Client (val name : String ) : NpcCreatorType()
1414
1515 /* *
1616 * Represents a plugin as the creator of the NPC.
@@ -24,8 +24,8 @@ sealed class NpcCreatorType() {
2424 *
2525 * @return `true` if the creator is a player, otherwise `false`.
2626 */
27- fun isPlayer (): Boolean {
28- return this is Player
27+ fun isClient (): Boolean {
28+ return this is Client
2929 }
3030
3131 /* *
@@ -45,7 +45,7 @@ sealed class NpcCreatorType() {
4545
4646 fun name (): String {
4747 return when (this ) {
48- is Player -> name
48+ is Client -> name
4949 is Plugin -> name
5050 }
5151 }
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class NpcCreateCommand(commandName: String) : CommandAPICommand(commandName) {
6060 BukkitNpcRotation (location.yaw, location.pitch),
6161 true ,
6262 persistent = true ,
63- npcCreatorType = NpcCreatorType .Player (createdBy)
63+ npcCreatorType = NpcCreatorType .Client (createdBy)
6464 )
6565
6666 if (npcResult.isFailure()) {
Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ import dev.slne.surf.npc.api.npc.property.NpcPropertyType
66class NpcCreatorTypePropertyType (override val id : String ) : NpcPropertyType {
77 override fun encode (value : Any ): String {
88 require(value is NpcCreatorType ) { " Expected NpcCreatorType, got ${value::class } " }
9- return " ${if (value.isPlayer ()) " player" else " plugin" } :${value.name()} "
9+ return " ${if (value.isClient ()) " player" else " plugin" } :${value.name()} "
1010 }
1111
1212 override fun decode (value : String ): NpcCreatorType {
1313 val parts = value.split(" :" )
1414 require(parts.size == 2 ) { " Invalid creator type format: $value " }
1515
1616 return when (parts[0 ]) {
17- " player" -> NpcCreatorType .Player (parts[1 ])
17+ " player" -> NpcCreatorType .Client (parts[1 ])
1818 " plugin" -> NpcCreatorType .Plugin (parts[1 ])
1919 else -> throw IllegalArgumentException (" Unknown creator type: ${parts[0 ]} " )
2020 }
You can’t perform that action at this time.
0 commit comments