개인 자료란 (JE)

  서버 커뮤니티

Profile 하이라이트|highright 대표칭호 없음

HighRight b32fff82f5cc4636a74b555fffcf34c6

Profile

커뮤니티 소통 개발하기 API

이름은 조금 그렇긴 하지만 쓸만한 라이브러리

2022.10.20 조회 수 613 추천 수 1

이름이 조금 그렇긴 한데 기능만큼은 보장해드립니다 ㅎㅎ

코틀린 유저 전용으로 만든거 참고 해주세유~

https://github.com/highright1234/shotokonoko 

kommand {
  register("command") {
    suspendingExecutes {
      ...
    }
  }
}

papi {
  expansion("placeholder") {
    argument("value") {
      executes {
        val value: String by arguments
        value
      }
    }
  }
}

val players = newPlayerArrayList() // it removes a player who exit
val cooldownData = CoolDownAttribute<UUID>(5000L)

...

val event = listen<PlayerJoinEvent> { it.player.name == "HighRight" }
val player = event.player
// 쿨다운중 아니면 아래 코드들 실행함
cooldownData.withCoolDown(player.uniqueId)
val storage = withContext(plugin.asyncDispatcher) {
    getDataStore("${player.uniqueId}")
}
player.sendMessage("비밀 이야기 해봐")
// 10초 지나면 밑에 코드들 작동 안함
ChatScanner(player).await().onSuccess { component ->
  val chat = component.string // Component to String
  Bukkit.broadcast(text("<${player.name}> $chat"))
  storage.set("secret", chat)
  events<EntityDamageEvent>().filter { it.entity == player }.collect {
    event.player.sendMessage("허접♥")    
  }
}.onFailture { throwable ->
  when (throwable) {
    is TimedOutException {
      ...
    }
    is PlayerQuitException {
      ...
    }
  }
}

자세한건 레포지토리 wiki나 debug 코드에서 보시길~ 하핫




2개의 댓글

명이
2022.11.01

이름좀 제발...

뉴스 및 창작물
/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견

학교가기싫다

2024-05-08

0

/files/thumbnails/384/778/003/262x150.crop.jpg?20240507003327

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1

/files/thumbnails/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

/files/thumbnails/115/774/003/262x150.crop.jpg?20240428135129

업데이트

마인크래프트 1.20.5 정식 업데이트

학교가기싫다

2024-04-24

0