FORGOTTEN TOWNS

FORGOTTEN TOWNS / MODDINGDOCUMENTATIE

Moddingwiki ↗

Java-API-referentie (Javadoc)

MOD API 15

Door de wiki bladeren

Documentatie van de huidige Mod API.

De technische documentatie is beschikbaar in het Engels. Code en veldnamen volgen de huidige Mod API.

MODDINGDOCUMENTATIE

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 publieke types · 468 leden · Content API 15

Wissen

528 gevonden vermeldingen

crafting.infinite()MethodeReturns whether continuous production is enabled.

ColonyWork.Crafting · Voorraad & werk

Signatuur

public boolean infinite()

Returns whether continuous production is enabled.

Voorbeeld van aanroep

crafting.infinite();

ColonyWork.Crafting crafting is an instance of this supported API type.

Returns
whether continuous production is enabled
crafting.minimumStock()MethodeReturns minimum finished output units.

ColonyWork.Crafting · Voorraad & werk

Signatuur

public int minimumStock()

Returns minimum finished output units.

Voorbeeld van aanroep

crafting.minimumStock();

ColonyWork.Crafting crafting is an instance of this supported API type.

Returns
minimum finished output units
crafting.recipeId()MethodeReturns registered recipe identity.

ColonyWork.Crafting · Voorraad & werk

Signatuur

public String recipeId()

Returns registered recipe identity.

Voorbeeld van aanroep

crafting.recipeId();

ColonyWork.Crafting crafting is an instance of this supported API type.

Returns
registered recipe identity
crafting.toString()MethodeReturns a string representation of this record class.

ColonyWork.Crafting · Voorraad & werk

Signatuur

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.

Voorbeeld van aanroep

crafting.toString();

ColonyWork.Crafting crafting is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object
ColonyWork.FacingTypeLogical placeable facings, independent of sprite-sheet cell order.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static enum ColonyWork.Facing extends Enum<ColonyWork.Facing>

Logical placeable facings, independent of sprite-sheet cell order.

All Implemented Interfaces
Serializable, Comparable<ColonyWork.Facing>, Constable
ColonyWork.Facing.EASTConstanteEast-facing placement.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static final ColonyWork.Facing EAST

East-facing placement.

Voorbeeld van aanroep

ColonyWork.Facing.EAST

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

ColonyWork.Facing.NORTHConstanteNorth-facing placement.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static final ColonyWork.Facing NORTH

North-facing placement.

Voorbeeld van aanroep

ColonyWork.Facing.NORTH

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

ColonyWork.Facing.SOUTHConstanteSouth-facing placement.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static final ColonyWork.Facing SOUTH

South-facing placement.

Voorbeeld van aanroep

ColonyWork.Facing.SOUTH

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

ColonyWork.Facing.WESTConstanteWest-facing placement.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static final ColonyWork.Facing WEST

West-facing placement.

Voorbeeld van aanroep

ColonyWork.Facing.WEST

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

ColonyWork.Facing.valueOf(name)MethodeReturns the enum constant of this class with the specified name.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static ColonyWork.Facing 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.)

Voorbeeld van aanroep

ColonyWork.Facing.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.Facing.values()MethodeReturns an array containing the constants of this enum class, in the order they are declared.

ColonyWork.Facing · Voorraad & werk

Signatuur

public static ColonyWork.Facing[] values()

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

Voorbeeld van aanroep

ColonyWork.Facing.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
ColonyWork.JobTypeDetached job metadata.

ColonyWork.Job · Voorraad & werk

Signatuur

public static record ColonyWork.Job(ColonyWork.Queue queue, long id, String kind, String status, ColonyContext.Position position, int priority, Integer citizenId, String definitionId) extends Record

Detached job metadata. Kind and definition are identifiers, never player-facing labels. Completed/cancelled snapshots arrive through ColonyExtension.onWorkFinished(forgottentowns.mod.api.ColonyContext, forgottentowns.mod.api.ColonyWork.Job).

Record Components
queue - identity domain
Record Components
id - persistent native identity
Record Components
kind - native work or blueprint type name; tolerate future values
Record Components
status - PENDING, CLAIMED, COMPLETED or CANCELLED
Record Components
position - anchor coordinates
Record Components
priority - normalized scheduling tier
Record Components
citizenId - assigned citizen, or null
Record Components
definitionId - recipe, placeable, block or zone identity; empty when inapplicable
new ColonyWork.JobConstructorCreates an instance of a Job record class.

ColonyWork.Job · Voorraad & werk

Signatuur

public Job(ColonyWork.Queue queue, long id, String kind, String status, ColonyContext.Position position, int priority, Integer citizenId, String definitionId)

Creates an instance of a Job record class.

Voorbeeld van aanroep

new ColonyWork.Job(queue, id, kind, status, position, priority, citizenId, definitionId);

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

Parameters
queue - identity domain
Parameters
id - persistent native identity
Parameters
kind - native work or blueprint type name; tolerate future values
Parameters
status - PENDING, CLAIMED, COMPLETED or CANCELLED
Parameters
position - anchor coordinates
Parameters
priority - normalized scheduling tier
Parameters
citizenId - assigned citizen, or null
Parameters
definitionId - recipe, placeable, block or zone identity; empty when inapplicable
job.citizenId()MethodeReturns assigned citizen, or null.

ColonyWork.Job · Voorraad & werk

Signatuur

public Integer citizenId()

Returns assigned citizen, or null.

Voorbeeld van aanroep

job.citizenId();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
assigned citizen, or null
job.definitionId()MethodeReturns recipe, placeable, block or zone identity; empty when inapplicable.

ColonyWork.Job · Voorraad & werk

Signatuur

public String definitionId()

Returns recipe, placeable, block or zone identity; empty when inapplicable.

Voorbeeld van aanroep

job.definitionId();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
recipe, placeable, block or zone identity; empty when inapplicable
job.equals(o)MethodeIndicates whether some other object is "equal to" this one.

ColonyWork.Job · Voorraad & werk

Signatuur

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

Voorbeeld van aanroep

job.equals(o);

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

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.
job.hashCode()MethodeReturns a hash code value for this object.

ColonyWork.Job · Voorraad & werk

Signatuur

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.

Voorbeeld van aanroep

job.hashCode();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Specified by
hashCode in class Record
Returns
a hash code value for this object
job.id()MethodeReturns persistent native identity.

ColonyWork.Job · Voorraad & werk

Signatuur

public long id()

Returns persistent native identity.

Voorbeeld van aanroep

job.id();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
persistent native identity
job.kind()MethodeReturns native work or blueprint type name; tolerate future values.

ColonyWork.Job · Voorraad & werk

Signatuur

public String kind()

Returns native work or blueprint type name; tolerate future values.

Voorbeeld van aanroep

job.kind();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
native work or blueprint type name; tolerate future values
job.position()MethodeReturns anchor coordinates.

ColonyWork.Job · Voorraad & werk

Signatuur

public ColonyContext.Position position()

Returns anchor coordinates.

Voorbeeld van aanroep

job.position();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
anchor coordinates
job.priority()MethodeReturns normalized scheduling tier.

ColonyWork.Job · Voorraad & werk

Signatuur

public int priority()

Returns normalized scheduling tier.

Voorbeeld van aanroep

job.priority();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
normalized scheduling tier
job.queue()MethodeReturns identity domain.

ColonyWork.Job · Voorraad & werk

Signatuur

public ColonyWork.Queue queue()

Returns identity domain.

Voorbeeld van aanroep

job.queue();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
identity domain
job.status()MethodeReturns PENDING, CLAIMED, COMPLETED or CANCELLED.

ColonyWork.Job · Voorraad & werk

Signatuur

public String status()

Returns PENDING, CLAIMED, COMPLETED or CANCELLED.

Voorbeeld van aanroep

job.status();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Returns
PENDING, CLAIMED, COMPLETED or CANCELLED
job.toString()MethodeReturns a string representation of this record class.

ColonyWork.Job · Voorraad & werk

Signatuur

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.

Voorbeeld van aanroep

job.toString();

ColonyWork.Job job = context.work().get(queue, id); check for null before reading its values.

Specified by
toString in class Record
Returns
a string representation of this object
ColonyWork.QueueTypeIndependent persistent identity domains.

ColonyWork.Queue · Voorraad & werk

Signatuur

public static enum ColonyWork.Queue extends Enum<ColonyWork.Queue>

Independent persistent identity domains.

All Implemented Interfaces
Serializable, Comparable<ColonyWork.Queue>, Constable

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