Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch statement only allows string type #623

Open
asheswook opened this issue Nov 2, 2023 · 1 comment · Fixed by #625
Open

Switch statement only allows string type #623

asheswook opened this issue Nov 2, 2023 · 1 comment · Fixed by #625
Assignees
Labels
bug Entire or partly plugin is not working as intended.

Comments

@asheswook
Copy link

asheswook commented Nov 2, 2023

Describe the bug/버그 증상
Switch문에서 변수를 string만 허용합니다. 아래와 같이 사용했을 때 문제가 발생합니다

itemName = $helditemdisplayname
SWITCH itemName
    CASE color("&25XP 수표")    => value = 5
    CASE color("&210XP 수표")   => value = 10
    CASE color("&250XP 수표")   => value = 50
    CASE color("&2100XP 수표")  => value = 100
    CASE color("&2500XP 수표")  => value = 500
    CASE color("&21000XP 수표") => value = 1000
    CASE color("&25000XP 수표") => value = 5000
ENDSWITCH

해당 switch문 case번째 줄에서 Mismatched type for parameter [type: EPS, value: '5XP 수표']. Expected STRING but found EPS Exception을 뱉습니다.

만약 위 코드를 아래처럼 IF ELSEIF로 처리하면 정상적으로 작동합니다.

IF itemName == color("&25XP 수표")
  value = 5
ELSEIF ...

Server information/서버 정보

  • Paper version git-Paper-169 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: b4e3b3d)
  • TriggerReactor 3.4.3-Release

Error message/에러 메시지

image

@asheswook asheswook added the bug Entire or partly plugin is not working as intended. label Nov 2, 2023
@Sayakie Sayakie self-assigned this Nov 2, 2023
@Sayakie Sayakie linked a pull request Nov 2, 2023 that will close this issue
@asheswook
Copy link
Author

#625 문제 없이 잘 작동합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Entire or partly plugin is not working as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants