8000 Import · TriggerReactor/TriggerReactor Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Felleus edited this page Jul 27, 2023 · 2 revisions

Please always download latest version! this feature might not work in the previous version!

Import

Import statement allows a shortcut to access Java class directly. Sometimes, you need to access static method or create a new instance, then you had to use specific function in the CommonFunctions. By using IMPORT, you don't have to do such tedious work!


Basic Structure

IMPORT <full class name>

For internal classes, you need to use the symbol $

IMPORT some.class.name$internal.class

In order to use the imported class, you just provide the class name at the very end of full class name.

Creating new instance

You can create new instance with brackets.

IMPORT java.util.Random
rand = Random()

If the constructor accepts parameters, you just provide appropriate ones in the bracket

IMPORT java.util.Random
rand = Random(1) //providing seed

Accessing static method

IMPORT org.bukkit.GameMode
player.setGameMode(GameMode.valueOf("CREATIVE"))

Accessing static field(or Enum, as Enum is in fact static field)

IMPORT org.bukkit.GameMode
player.setGameMode(GameMode.CREATIVE)

Simple Example

IMPORT java.util.Random
rand = Random()
#MESSAGE "Some random integer: "+rand.nextInt()

Ordering matters

Depends on where you use IMPORT statement, you may or may not be able to use the class. For example,

rand = Random()
#MESSAGE "Some random integer: "+rand.nextInt()
IMPORT java.util.Random

This will cause error as TR does not know what Random is yet.

What if class name duplicates?

The rather IMPORT statement always overwrite the one previously imported. For example, if you are importing two classes with different package with same name,

IMPORT a.b.MyClass
IMPORT c.d.MyClass

c.d.MyClass would be used.

Plugin Description / 목차

1. Getting Started () (рус)

S.L. In-game Editor () (рус)

2. Triggers () (рус)

List and usage of Triggers / 트리거 목록과 사용 방법:

  • List of Executors / 실행자(Executor) 목록

4. Placeholders () (рус)

  • Using PlaceholderAPI / PlaceholderAPI 사용법
  • List of Placeholders / 플레이스 홀더(Placeholder) 목록

5. Conditions () (рус)

  • Creating Conditions / 조건식 만들기
    • Boolean Expressions / 부울 (Boolean) 표현 방법
  • Logical Operators / 연산자 사용법
  • IF statement / IF 조건문
  • Null Checking / Null 검사법
  • Switch Case / Switch Case 조건

6. Variables () (рус)

  • Local Variables / 지역 변수
  • Global Variables / 전역 변수

Advanced

Timings () (рус)

7. Methods () (рус)

  • Using Methods / 메소드 사용법
  • Special Data Types / 특수한 데이터 형식
  • Reading Javadocs / Javadoc 읽기
  • Handling Enum / Enum 데이터 처리
  • Lambda Expresion / Lambda(람다) 식 사용법

8. Array () (рус)

  • Creating an empty array / 빈 배열 만들기
  • Storing data into array / 배열에 데이터값 저장하기
  • Read data from array / 배열에서 데이터 읽기(불러오기)

9. Loops () (рус)

  • WHILE loop / WHILE 반복문
  • FOR loop / FOR 반복문
    • Iterating Collection / Collection 형식의 변수 순회법
    • #BREAK executor / #BREAK 실행자
    • #CONTINUE executor / #CONTINUE 실행자

10. Sync Mode () (рус)

  • #CANCELEVENT executor / #CANCELEVENT 실행자
  • Setting Sync/Async Mode / 동기, 비동기 모드 전환
    • Custom Trigger
    • Area Trigger

11. Custom Executors () (рус)

12. Plugin Access () (рус)

  • Check And Use / 플러그인 존재여부 확인
    • Get Third Party Plugin / 제 3자 플러그인 불러오기
    • Check Eligibility / 호환성 확인하기
    • Use the Plugin / 플러그인 사용하기

13. IMPORT Statement () (рус)

  • Creating new instance / 새 인스턴스 생성하기
  • Accessing static method / 종속 메소드 불러오기
  • Accessing static field / 종속 Enum 불러오기

14. IS Statement () (рус)

  • Understanding / 이해하기
    • Understanding Instance / 인스턴스 이해하기
    • Understanding Superclass / 부모클래스 이해하기
    • Understanding Subclass / 자식클래스 이해하기
  • Using IS Statement / IS조건연산자 사용하기

15. TRY-CATCH Statement () (рус)

  • Understanding TRY-CATCH Exception Handling / TRY-CATCH 예외처리 이해하기

Misc

16. Interface Casting () (рус)

module x.x does not "opens x.x" problem

  • List of Custom Events

Examples

Trigger

Trigger Example () (рус)

More Examples: Bukkit, Sponge

Case Specific

Clone this wiki locally
0