본문으로 건너뛰기
버전: Minecraft 26.2

dev.polymodloader.api.data

자동 생성

이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.

형식종류설명
DataMigration함수형 인터페이스Upgrades saved data written by an older version of a mod.
DataTree클래스Typed key-value data that Poly Mod Loader saves with the world: block entity data and world storage use it.

DataMigration​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface DataMigration

Upgrades saved data written by an older version of a mod. Called once when data saved with an older version is loaded, before anything reads it; afterwards the data counts as current.

migrate(DataTree, int)​

void migrate(DataTree data, int fromVersion)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Upgrades data from fromVersion to the current version.

인자타입설명
dataDataTreethe saved data, changed in place
fromVersionintthe version it was saved with (0 for data saved before versions were used)

DataTree​

클래스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public final class DataTree

Typed key-value data that Poly Mod Loader saves with the world: block entity data and world storage use it. Values are int, long, double, boolean, String, byte[], or nested trees. Reading a missing key or a key of another type returns the fallback.

Thread: not thread-safe; use it on the thread that owns the world.

create()​

public static DataTree create()

추가된 버전 0.1.0-alpha.4 또는 그 이전

An empty tree.

반환 DataTree

getInt(String, int)​

public int getInt(String key, int fallback)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The integer under key, or fallback if there is none.

인자타입설명
keyString—
fallbackint—

반환 int

putInt(String, int)​

public DataTree putInt(String key, int value)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Stores an integer under key; returns this tree.

인자타입설명
keyString—
valueint—

반환 DataTree

getLong(String, long)​

public long getLong(String key, long fallback)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The long under key, or fallback if there is none.

인자타입설명
keyString—
fallbacklong—

반환 long

putLong(String, long)​

public DataTree putLong(String key, long value)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Stores a long under key; returns this tree.

인자타입설명
keyString—
valuelong—

반환 DataTree

getDouble(String, double)​

public double getDouble(String key, double fallback)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The double under key, or fallback if there is none.

인자타입설명
keyString—
fallbackdouble—

반환 double

putDouble(String, double)​

public DataTree putDouble(String key, double value)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Stores a double under key; returns this tree.

인자타입설명
keyString—
valuedouble—

반환 DataTree

getBoolean(String, boolean)​

public boolean getBoolean(String key, boolean fallback)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The boolean under key, or fallback if there is none.

인자타입설명
keyString—
fallbackboolean—

반환 boolean

putBoolean(String, boolean)​

public DataTree putBoolean(String key, boolean value)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Stores a boolean under key; returns this tree.

인자타입설명
keyString—
valueboolean—

반환 DataTree

getString(String, String)​

public String getString(String key, String fallback)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The string under key, or fallback if there is none.

인자타입설명
keyString—
fallbackString—

반환 String

putString(String, String)​

public DataTree putString(String key, String value)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Stores a string under key; returns this tree.

인자타입설명
keyString—
valueString—

반환 DataTree

getBytes(String)​

public Optional<byte[]> getBytes(String key)

추가된 버전 0.1.0-alpha.4 또는 그 이전

A copy of the stored bytes.

인자타입설명
keyString—

반환 Optional<byte[]>

putBytes(String, byte[])​

public DataTree putBytes(String key, byte[] value)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Stores a copy of value under key; returns this tree.

인자타입설명
keyString—
valuebyte[]—

반환 DataTree

child(String)​

public DataTree child(String key)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The child tree under key, creating it (and replacing a non-tree value) if needed.

인자타입설명
keyString—

반환 DataTree

findChild(String)​

public Optional<DataTree> findChild(String key)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The child tree under key, without creating it.

인자타입설명
keyString—

반환 Optional<DataTree>

has(String)​

public boolean has(String key)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Whether any value is stored under key.

인자타입설명
keyString—

반환 boolean

remove(String)​

public void remove(String key)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Removes the value under key, if any.

인자타입설명
keyString—

keys()​

public Set<String> keys()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Keys in insertion order.

반환 Set<String>

raw(String)​

public Optional<Object> raw(String key)

추가된 버전 0.1.0-alpha.4 또는 그 이전

The raw value under key: Integer, Long, Double, Boolean, String, byte[] (shared, do not modify), or DataTree; empty when absent.

인자타입설명
keyString—

반환 Optional<Object>

clear()​

public void clear()

추가된 버전 0.1.0-alpha.4 또는 그 이전

Removes every entry.

copy()​

public DataTree copy()

추가된 버전 0.1.0-alpha.4 또는 그 이전

A deep copy.

반환 DataTree

Buy me a coffee