FORGOTTEN TOWNS

FORGOTTEN TOWNS / 문서 수정

모딩 위키 ↗

Java API 참조(Javadoc)

MOD API 15

위키 찾아보기

현재 Mod API 문서.

기술 문서는 영어로 제공됩니다. 코드 및 필드 이름은 현재 Mod API를 따릅니다.

문서 수정

Java reference

Search the types, functions and callbacks available to a Java mod. This reference is generated from the SDK Javadocs; each entry links to its full Java documentation.

Find a type or member

60 공개 유형 · 468 회원 · Content API 15

재설정

528 일치하는 항목

ColonyWork.Queue.CONSTRUCTION상수Native construction blueprints.

ColonyWork.Queue · 재고 및 작업

서명

public static final ColonyWork.Queue CONSTRUCTION

Native construction blueprints.

통화 예시

ColonyWork.Queue.CONSTRUCTION

Use the public API type shown; import forgottentowns.mod.api.*.

ColonyWork.Queue.WORK상수Native work orders.

ColonyWork.Queue · 재고 및 작업

서명

public static final ColonyWork.Queue WORK

Native work orders.

통화 예시

ColonyWork.Queue.WORK

Use the public API type shown; import forgottentowns.mod.api.*.

ColonyWork.Queue.valueOf(name)방법Returns the enum constant of this class with the specified name.

ColonyWork.Queue · 재고 및 작업

서명

public static ColonyWork.Queue valueOf(String name)

Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)

통화 예시

ColonyWork.Queue.valueOf(name);

Use the public API type shown; import forgottentowns.mod.api.*.

Parameters
name - the name of the enum constant to be returned.
Returns
the enum constant with the specified name
Throws
IllegalArgumentException - if this enum class has no constant with the specified name
Throws
NullPointerException - if the argument is null
ColonyWork.Queue.values()방법Returns an array containing the constants of this enum class, in the order they are declared.

ColonyWork.Queue · 재고 및 작업

서명

public static ColonyWork.Queue[] values()

Returns an array containing the constants of this enum class, in the order they are declared.

통화 예시

ColonyWork.Queue.values();

Use the public API type shown; import forgottentowns.mod.api.*.

Returns
an array containing the constants of this enum class, in the order they are declared
context.work().at(position)방법Queries work anchored at a tile and construction occupying it, using native spatial indexes.

ColonyWork · 재고 및 작업

서명

List<ColonyWork.Job> at(ColonyContext.Position position)

Queries work anchored at a tile and construction occupying it, using native spatial indexes.

통화 예시

context.work().at(position);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
position - tile coordinates (z increases downward), or null
Returns
immutable local job snapshots; empty for null or outside the world
Throws
IllegalStateException - outside the owning callback or thread
context.work().cancel(queue, id)방법Cancels active work with native reservation release and linked-plan/refund semantics.

ColonyWork · 재고 및 작업

서명

boolean cancel(ColonyWork.Queue queue, long id)

Cancels active work with native reservation release and linked-plan/refund semantics. Cancelling a bridge may cancel its complete plan. No materials are created on repeated calls.

통화 예시

context.work().cancel(queue, id);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
queue - identity domain
Parameters
id - active job identity
Returns
whether cancellation removed any work
Throws
NullPointerException - if queue is null
Throws
IllegalStateException - outside the callback/thread or after its command budget
context.work().crafting(recipeId)방법Reads a native recipe bill without queuing work.

ColonyWork · 재고 및 작업

서명

default ColonyWork.Crafting crafting(String recipeId)

Reads a native recipe bill without queuing work.

통화 예시

context.work().crafting(recipeId);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
recipeId - registered recipe identity
Returns
current shared bill, or null for an unknown recipe
Throws
IllegalStateException - outside the callback/thread
Throws
UnsupportedOperationException - if this context does not implement this operation
context.work().craftingRequest(recipeId, batches)방법Adds complete batches to the normal recipe bill, after discovery, biome and station gates.

ColonyWork · 재고 및 작업

서명

default ColonyWork.Crafting craftingRequest(String recipeId, int batches)

Adds complete batches to the normal recipe bill, after discovery, biome and station gates. Native workers reserve ingredients and issue ordinary CRAFTING completion events. This is additive: persist a handled action or inspect crafting(java.lang.String) before retrying after a save/load.

통화 예시

context.work().craftingRequest(recipeId, batches);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
recipeId - registered recipe identity
Parameters
batches - complete recipe batches, 1..4096
Returns
updated bill, or null if unavailable
Throws
IllegalArgumentException - if batches is outside its bounds
Throws
IllegalStateException - outside the callback/thread or after its command budget
Throws
UnsupportedOperationException - if this context does not implement this operation
context.work().get(queue, id)방법Looks up active settlement work by its stable identity.

ColonyWork · 재고 및 작업

서명

ColonyWork.Job get(ColonyWork.Queue queue, long id)

Looks up active settlement work by its stable identity.

통화 예시

context.work().get(queue, id);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
queue - identity domain
Parameters
id - persistent work or blueprint identity
Returns
detached snapshot, or null after removal or for an unknown/foreign identity
Throws
NullPointerException - if queue is null
Throws
IllegalStateException - outside the owning callback or thread
context.work().haulPlaceable(placeableId, destination, priority)방법Requests workers to pick up settlement-owned furniture and haul it to a physical store.

ColonyWork · 재고 및 작업

서명

default ColonyWork.Job haulPlaceable(long placeableId, String destination, int priority)

Requests workers to pick up settlement-owned furniture and haul it to a physical store. Normal pickup eligibility, filters, capacity and worker access still apply. Repeated identical pending requests return the existing order. Cancel through the WORK queue. Completion reports the native pickup into real citizen inventory; subsequent stock delivery follows native hauling.

통화 예시

context.work().haulPlaceable(placeableId, destination, priority);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
placeableId - stable placed-object identity
Parameters
destination - exact physical store key from ColonyInventory.stores()
Parameters
priority - -1, 0 or 1
Returns
pending pickup order, or null on rejection/conflict
Throws
IllegalArgumentException - if priority is outside its bounds
Throws
IllegalStateException - outside the callback/thread or after its command budget
Throws
UnsupportedOperationException - if this context does not implement this operation
context.work().planPlaceable(definitionId, position, facing, priority)방법Plans a registered placeable through normal discovery, room, support, collision, campaign, preparation-station and crafted-item gates.

ColonyWork · 재고 및 작업

서명

ColonyWork.Job planPlaceable(String definitionId, ColonyContext.Position position, ColonyWork.Facing facing, int priority)

Plans a registered placeable through normal discovery, room, support, collision, campaign, preparation-station and crafted-item gates. Workers acquire and consume the authored cost. An exact repeated plan returns its existing identity without charging twice.

통화 예시

context.work().planPlaceable(definitionId, position, facing, priority);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
definitionId - placeable registry identity, including namespaced mod definitions
Parameters
position - exact anchor and construction support z; coffins use their buried support z; null is rejected with no blueprint
Parameters
facing - logical facing, resolved through the definition's supported facings
Parameters
priority - -1 (low), 0 (normal), or 1 (high)
Returns
accepted blueprint, or null when normal construction rules reject it
Throws
NullPointerException - if facing is null
Throws
IllegalArgumentException - if priority is outside -1..1
Throws
IllegalStateException - outside the callback/thread or after its command budget
context.work().planZone(definitionId, tiles, priority)방법Plans a registered room or stockpile through native zone construction.

ColonyWork · 재고 및 작업

서명

default List<ColonyWork.Job> planZone(String definitionId, List<ColonyContext.Position> tiles, int priority)

Plans a registered room or stockpile through native zone construction. Checks discovery, progression, exploration, support and conflicts before creating work. The request is all-or-nothing; all tiles share one layer and duplicate tiles are ignored. An entirely repeated pending plan returns existing jobs without allocating or charging twice.

통화 예시

context.work().planZone(definitionId, tiles, priority);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
definitionId - registered native zone category
Parameters
tiles - at most 256 construction supports before duplicate removal; empty creates no work
Parameters
priority - -1, 0 or 1
Returns
construction jobs, empty on rejection
Throws
NullPointerException - if tiles or a member is null
Throws
IllegalArgumentException - if footprint or priority exceeds its bounds
Throws
IllegalStateException - outside the callback/thread or after its command budget
Throws
UnsupportedOperationException - if this context does not implement this operation
context.work().queue(action, position, priority)방법Queues exposed terrain/vegetation work using normal target and protected-support rules.

ColonyWork · 재고 및 작업

서명

ColonyWork.Job queue(ColonyWork.Action action, ColonyContext.Position position, int priority)

Queues exposed terrain/vegetation work using normal target and protected-support rules. Repeating the same action returns its existing job; a different order is not replaced.

통화 예시

context.work().queue(action, position, priority);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
action - supported labor command
Parameters
position - exposed target tile; features resolve to their anchor; null is rejected with no job
Parameters
priority - -1 (low), 0 (normal), or 1 (high)
Returns
accepted job, or null for an invalid, unexplored or conflicting target
Throws
NullPointerException - if action is null
Throws
IllegalArgumentException - if priority is outside -1..1
Throws
IllegalStateException - outside the callback/thread or after its command budget
context.work().setPriority(queue, id, priority)방법Changes scheduling priority through the native queue.

ColonyWork · 재고 및 작업

서명

ColonyWork.Job setPriority(ColonyWork.Queue queue, long id, int priority)

Changes scheduling priority through the native queue.

통화 예시

context.work().setPriority(queue, id, priority);

Obtain this service from the active ColonyContext; it shares the callback lifetime and command budget.

Parameters
queue - identity domain
Parameters
id - active job identity
Parameters
priority - -1, 0 or 1
Returns
updated snapshot, or null when absent or foreign-owned
Throws
NullPointerException - if queue is null
Throws
IllegalArgumentException - if priority is outside -1..1
Throws
IllegalStateException - outside the callback/thread or after its command budget
EquipmentTransform유형Pure conversion hook.

EquipmentTransform · 장비 및 검사

서명

@FunctionalInterface public interface EquipmentTransform

Pure conversion hook. The engine owns input consumption, output identity and persistence.

Functional Interface
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
EquipmentTransform.Input유형Selected equipment and its conversion rule, validated by the host before invoking a handler.

EquipmentTransform.Input · 장비 및 검사

서명

public static record EquipmentTransform.Input(String equipmentResourceId, String baseResourceId, String essenceKey, String outputResourceId, int successPercent) extends Record

Selected equipment and its conversion rule, validated by the host before invoking a handler. Direct record construction does not validate resource identities or the chance range.

Record Components
equipmentResourceId - exact imbued input resource
Record Components
baseResourceId - unimbued equipment identity
Record Components
essenceKey - applied essence identity
Record Components
outputResourceId - configured single output identity
Record Components
successPercent - configured chance in the inclusive range 0 to 100
new EquipmentTransform.Input생성자Creates an instance of a Input record class.

EquipmentTransform.Input · 장비 및 검사

서명

public Input(String equipmentResourceId, String baseResourceId, String essenceKey, String outputResourceId, int successPercent)

Creates an instance of a Input record class.

통화 예시

new EquipmentTransform.Input(equipmentResourceId, baseResourceId, essenceKey, outputResourceId, successPercent);

Use the public API type shown; import forgottentowns.mod.api.*.

Parameters
equipmentResourceId - exact imbued input resource
Parameters
baseResourceId - unimbued equipment identity
Parameters
essenceKey - applied essence identity
Parameters
outputResourceId - configured single output identity
Parameters
successPercent - configured chance in the inclusive range 0 to 100
input.baseResourceId()방법Returns unimbued equipment identity.

EquipmentTransform.Input · 장비 및 검사

서명

public String baseResourceId()

Returns unimbued equipment identity.

통화 예시

input.baseResourceId();

EquipmentTransform.Input input is an instance of this supported API type.

Returns
unimbued equipment identity
input.equals(o)방법Indicates whether some other object is "equal to" this one.

EquipmentTransform.Input · 장비 및 검사

서명

public final boolean equals(Object o)

Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.

통화 예시

input.equals(o);

EquipmentTransform.Input input is an instance of this supported API type.

Specified by
equals in class Record
Parameters
o - the object with which to compare
Returns
true if this object is the same as the o argument; false otherwise.
input.equipmentResourceId()방법Returns exact imbued input resource.

EquipmentTransform.Input · 장비 및 검사

서명

public String equipmentResourceId()

Returns exact imbued input resource.

통화 예시

input.equipmentResourceId();

EquipmentTransform.Input input is an instance of this supported API type.

Returns
exact imbued input resource
input.essenceKey()방법Returns applied essence identity.

EquipmentTransform.Input · 장비 및 검사

서명

public String essenceKey()

Returns applied essence identity.

통화 예시

input.essenceKey();

EquipmentTransform.Input input is an instance of this supported API type.

Returns
applied essence identity
input.hashCode()방법Returns a hash code value for this object.

EquipmentTransform.Input · 장비 및 검사

서명

public final int hashCode()

Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

통화 예시

input.hashCode();

EquipmentTransform.Input input is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
input.outputResourceId()방법Returns configured single output identity.

EquipmentTransform.Input · 장비 및 검사

서명

public String outputResourceId()

Returns configured single output identity.

통화 예시

input.outputResourceId();

EquipmentTransform.Input input is an instance of this supported API type.

Returns
configured single output identity
input.successPercent()방법Returns configured chance in the inclusive range 0 to 100.

EquipmentTransform.Input · 장비 및 검사

서명

public int successPercent()

Returns configured chance in the inclusive range 0 to 100.

통화 예시

input.successPercent();

EquipmentTransform.Input input is an instance of this supported API type.

Returns
configured chance in the inclusive range 0 to 100
input.toString()방법Returns a string representation of this record class.

EquipmentTransform.Input · 장비 및 검사

서명

public final String toString()

Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

통화 예시

input.toString();

EquipmentTransform.Input input is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object

Read an entry

  • Method: a function your mod calls on the supplied service or value.
  • Hook: a callback the game calls on your registered implementation.
  • Constructor: creates an API value.
  • Constant: a fixed value, such as a facing or work queue.

Expand an entry for its signature, parameters, return value, exceptions and call shape. Call shapes show the real parameter names as placeholders; supply values of the declared types. Read the lifetime and ownership rules before retaining an object or issuing a command.

Java setup · Registration and lifecycle · Task guides · Full generated Javadocs