FORGOTTEN TOWNS

FORGOTTEN TOWNS / МОДИНГОВАЯ ДОКУМЕНТАЦИЯ

Моддинг вики ↗

Java Ссылка на API (Javadoc)

MOD API 15

Просмотрите вики

Текущая документация 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 соответствующие записи

colonyNotice.focus()МетодReturns optional tile to center when the player clicks the alert or log entry.

ColonyNotice · Мероприятия и панели

Подпись

public ColonyContext.Position focus()

Returns optional tile to center when the player clicks the alert or log entry.

Пример звонка

colonyNotice.focus();

ColonyNotice colonyNotice is an instance of this supported API type.

Returns
optional tile to center when the player clicks the alert or log entry
colonyNotice.hashCode()МетодReturns a hash code value for this object.

ColonyNotice · Мероприятия и панели

Подпись

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.

Пример звонка

colonyNotice.hashCode();

ColonyNotice colonyNotice is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
colonyNotice.key()МетодReturns translation key in the sending mod's namespace.

ColonyNotice · Мероприятия и панели

Подпись

public String key()

Returns translation key in the sending mod's namespace.

Пример звонка

colonyNotice.key();

ColonyNotice colonyNotice is an instance of this supported API type.

Returns
translation key in the sending mod's namespace
colonyNotice.toString()МетодReturns a string representation of this record class.

ColonyNotice · Мероприятия и панели

Подпись

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.

Пример звонка

colonyNotice.toString();

ColonyNotice colonyNotice is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object
colonyNotice.tone()МетодReturns visual emphasis; all tones use the game's existing general notification sound.

ColonyNotice · Мероприятия и панели

Подпись

public ColonyNotice.Tone tone()

Returns visual emphasis; all tones use the game's existing general notification sound.

Пример звонка

colonyNotice.tone();

ColonyNotice colonyNotice is an instance of this supported API type.

Returns
visual emphasis; all tones use the game's existing general notification sound
ColonyPanelТипDetached information and action panel rendered with the native game's controls.

ColonyPanel · Мероприятия и панели

Подпись

public record ColonyPanel(String id, ColonyPanel.Message title, List<ColonyPanel.Row> rows, List<ColonyPanel.Action> actions) extends Record

Detached information and action panel rendered with the native game's controls. A provider may publish at most eight panels, each with 128 rows and sixteen actions. All text keys belong to the provider's translation namespace. Arguments carry runtime values, such as numbers or citizen names; authored prose belongs in the translation catalogs.

Record Components
id - stable mod-local panel identity
Record Components
title - localized panel heading
Record Components
rows - ordered information rows
Record Components
actions - ordered buttons; use stable identities across refreshes
ColonyPanel.ActionТипA native button routed only to its owning extension.

ColonyPanel.Action · Мероприятия и панели

Подпись

public static record ColonyPanel.Action(String id, ColonyPanel.Message label, boolean enabled) extends Record

A native button routed only to its owning extension.

Record Components
id - stable mod-local action identity
Record Components
label - localized button label
Record Components
enabled - whether the action is currently available
new ColonyPanel.ActionКонструкторValidates an action identity and label.

ColonyPanel.Action · Мероприятия и панели

Подпись

public Action(String id, ColonyPanel.Message label, boolean enabled)

Validates an action identity and label.

Пример звонка

new ColonyPanel.Action(id, label, enabled);

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

Parameters
id - lowercase mod-local identity
Parameters
label - localized button text
Parameters
enabled - current availability
Throws
NullPointerException - if id or label is null
Throws
IllegalArgumentException - if the identity is malformed
action.enabled()МетодReturns whether the action is currently available.

ColonyPanel.Action · Мероприятия и панели

Подпись

public boolean enabled()

Returns whether the action is currently available.

Пример звонка

action.enabled();

ColonyPanel.Action action is an instance of this supported API type.

Returns
whether the action is currently available
action.equals(o)МетодIndicates whether some other object is "equal to" this one.

ColonyPanel.Action · Мероприятия и панели

Подпись

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 '=='.

Пример звонка

action.equals(o);

ColonyPanel.Action action 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.
action.hashCode()МетодReturns a hash code value for this object.

ColonyPanel.Action · Мероприятия и панели

Подпись

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.

Пример звонка

action.hashCode();

ColonyPanel.Action action is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
action.id()МетодReturns stable mod-local action identity.

ColonyPanel.Action · Мероприятия и панели

Подпись

public String id()

Returns stable mod-local action identity.

Пример звонка

action.id();

ColonyPanel.Action action is an instance of this supported API type.

Returns
stable mod-local action identity
action.label()МетодReturns localized button label.

ColonyPanel.Action · Мероприятия и панели

Подпись

public ColonyPanel.Message label()

Returns localized button label.

Пример звонка

action.label();

ColonyPanel.Action action is an instance of this supported API type.

Returns
localized button label
action.toString()МетодReturns a string representation of this record class.

ColonyPanel.Action · Мероприятия и панели

Подпись

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.

Пример звонка

action.toString();

ColonyPanel.Action action is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object
new ColonyPanelКонструкторDefensively captures a bounded native panel.

ColonyPanel · Мероприятия и панели

Подпись

public ColonyPanel(String id, ColonyPanel.Message title, List<ColonyPanel.Row> rows, List<ColonyPanel.Action> actions)

Defensively captures a bounded native panel.

Пример звонка

new ColonyPanel(id, title, rows, actions);

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

Parameters
id - mod-local identifier using lowercase letters, digits and underscores
Parameters
title - localized heading
Parameters
rows - information rows
Parameters
actions - action buttons
Throws
NullPointerException - if any component or list member is null
Throws
IllegalArgumentException - if an identity is malformed, a collection exceeds its bounds, or two actions share an identity
ColonyPanel.MessageТипLocalized text resolved by the host in the player's current language.

ColonyPanel.Message · Мероприятия и панели

Подпись

public static record ColonyPanel.Message(String key, List<String> arguments) extends Record

Localized text resolved by the host in the player's current language.

Record Components
key - owning-mod translation key
Record Components
arguments - up to eight runtime values, each at most 256 characters
new ColonyPanel.MessageКонструкторCaptures a bounded translation request.

ColonyPanel.Message · Мероприятия и панели

Подпись

public Message(String key, List<String> arguments)

Captures a bounded translation request.

Пример звонка

new ColonyPanel.Message(key, arguments);

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

Parameters
key - nonblank translation key, at most 256 characters
Parameters
arguments - immutable runtime substitution values
Throws
NullPointerException - if a component or argument is null
Throws
IllegalArgumentException - if a component exceeds its bounds
message.arguments()МетодReturns up to eight runtime values, each at most 256 characters.

ColonyPanel.Message · Мероприятия и панели

Подпись

public List<String> arguments()

Returns up to eight runtime values, each at most 256 characters.

Пример звонка

message.arguments();

ColonyPanel.Message message is an instance of this supported API type.

Returns
up to eight runtime values, each at most 256 characters
message.equals(o)МетодIndicates whether some other object is "equal to" this one.

ColonyPanel.Message · Мероприятия и панели

Подпись

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. All components in this record class are compared with Objects::equals(Object,Object).

Пример звонка

message.equals(o);

ColonyPanel.Message message 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.
message.hashCode()МетодReturns a hash code value for this object.

ColonyPanel.Message · Мероприятия и панели

Подпись

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.

Пример звонка

message.hashCode();

ColonyPanel.Message message is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
message.key()МетодReturns owning-mod translation key.

ColonyPanel.Message · Мероприятия и панели

Подпись

public String key()

Returns owning-mod translation key.

Пример звонка

message.key();

ColonyPanel.Message message is an instance of this supported API type.

Returns
owning-mod translation key
message.toString()МетодReturns a string representation of this record class.

ColonyPanel.Message · Мероприятия и панели

Подпись

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.

Пример звонка

message.toString();

ColonyPanel.Message message is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object
ColonyPanel.RowТипOne native information row, with its label and value in separate columns.

ColonyPanel.Row · Мероприятия и панели

Подпись

public static record ColonyPanel.Row(ColonyPanel.Message label, ColonyPanel.Message value) extends Record

One native information row, with its label and value in separate columns.

Record Components
label - localized description
Record Components
value - localized value, including any runtime substitutions
new ColonyPanel.RowКонструкторRequires both localized cells.

ColonyPanel.Row · Мероприятия и панели

Подпись

public Row(ColonyPanel.Message label, ColonyPanel.Message value)

Requires both localized cells.

Пример звонка

new ColonyPanel.Row(label, value);

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

Parameters
label - description
Parameters
value - current value
Throws
NullPointerException - if either cell is null
row.equals(o)МетодIndicates whether some other object is "equal to" this one.

ColonyPanel.Row · Мероприятия и панели

Подпись

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. All components in this record class are compared with Objects::equals(Object,Object).

Пример звонка

row.equals(o);

ColonyPanel.Row row 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.

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