Teknik dokümantasyon İngilizce olarak mevcuttur. Kod ve alan adları mevcut Mod API'sine uygundur.
MOD DOKÜMANTASYONU
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 genel türler · 468 üyeler · Content API 15
528 eşleşen girişler
homeChanged.equals(o)YöntemIndicates whether some other object is "equal to" this one.
ColonyEvent.HomeChanged · Etkinlikler ve paneller
İmza
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 '=='.
Örnek çağrı
homeChanged.equals(o);ColonyEvent.HomeChanged homeChanged 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.
homeChanged.hashCode()YöntemReturns a hash code value for this object.
ColonyEvent.HomeChanged · Etkinlikler ve paneller
İmza
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.
Örnek çağrı
homeChanged.hashCode();ColonyEvent.HomeChanged homeChanged is an instance of this supported API type.
- Specified by
- hashCode in class Record
- Returns
- a hash code value for this object
homeChanged.homeId()YöntemReturns new zone identity, or zero when unassigned.
ColonyEvent.HomeChanged · Etkinlikler ve paneller
İmza
public long homeId()Returns new zone identity, or zero when unassigned.
Örnek çağrı
homeChanged.homeId();ColonyEvent.HomeChanged homeChanged is an instance of this supported API type.
- Returns
- new zone identity, or zero when unassigned
homeChanged.position()YöntemReturns first tile of the new home, or of the former home when unassigned; null for a zone with an empty footprint.
ColonyEvent.HomeChanged · Etkinlikler ve paneller
İmza
public ColonyContext.Position position()Returns first tile of the new home, or of the former home when unassigned; null for a zone with an empty footprint.
Örnek çağrı
homeChanged.position();ColonyEvent.HomeChanged homeChanged is an instance of this supported API type.
- Returns
- first tile of the new home, or of the former home when unassigned; null for a zone with an empty footprint
homeChanged.previousHomeId()YöntemReturns former zone identity, or zero when unassigned.
ColonyEvent.HomeChanged · Etkinlikler ve paneller
İmza
public long previousHomeId()Returns former zone identity, or zero when unassigned.
Örnek çağrı
homeChanged.previousHomeId();ColonyEvent.HomeChanged homeChanged is an instance of this supported API type.
- Returns
- former zone identity, or zero when unassigned
homeChanged.toString()YöntemReturns a string representation of this record class.
ColonyEvent.HomeChanged · Etkinlikler ve paneller
İmza
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.
Örnek çağrı
homeChanged.toString();ColonyEvent.HomeChanged homeChanged is an instance of this supported API type.
- Specified by
- toString in class Record
- Returns
- a string representation of this object
ColonyEvent.PlaceableRemovedTürA placed object left the world, including demolition, destruction, replacement and cleanup.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public static record ColonyEvent.PlaceableRemoved(long id, String definitionId, ColonyContext.Position position, boolean settlementOwned, int day) extends Record implements ColonyEventA placed object left the world, including demolition, destruction, replacement and cleanup. This notification alone does not establish combat damage or a resource refund.
- Record Components
- id - removed placeable identity
- Record Components
- definitionId - removed definition identity
- Record Components
- position - removed object's anchor and support layer
- Record Components
- settlementOwned - whether the object belonged to the settlement
- Record Components
- day - monotonic game day
new ColonyEvent.PlaceableRemovedOluşturucuCreates an instance of a PlaceableRemoved record class.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public PlaceableRemoved(long id, String definitionId, ColonyContext.Position position, boolean settlementOwned, int day)Creates an instance of a PlaceableRemoved record class.
Örnek çağrı
new ColonyEvent.PlaceableRemoved(id, definitionId, position, settlementOwned, day);Use the public API type shown; import forgottentowns.mod.api.*.
- Parameters
- id - removed placeable identity
- Parameters
- definitionId - removed definition identity
- Parameters
- position - removed object's anchor and support layer
- Parameters
- settlementOwned - whether the object belonged to the settlement
- Parameters
- day - monotonic game day
placeableRemoved.day()YöntemReturns monotonic game day.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public int day()Returns monotonic game day.
Örnek çağrı
placeableRemoved.day();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Specified by
- day in interface ColonyEvent
- Returns
- monotonic game day
placeableRemoved.definitionId()YöntemReturns removed definition identity.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public String definitionId()Returns removed definition identity.
Örnek çağrı
placeableRemoved.definitionId();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Returns
- removed definition identity
placeableRemoved.equals(o)YöntemIndicates whether some other object is "equal to" this one.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
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 '=='.
Örnek çağrı
placeableRemoved.equals(o);ColonyEvent.PlaceableRemoved placeableRemoved 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.
placeableRemoved.hashCode()YöntemReturns a hash code value for this object.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
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.
Örnek çağrı
placeableRemoved.hashCode();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Specified by
- hashCode in class Record
- Returns
- a hash code value for this object
placeableRemoved.id()YöntemReturns removed placeable identity.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public long id()Returns removed placeable identity.
Örnek çağrı
placeableRemoved.id();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Returns
- removed placeable identity
placeableRemoved.position()YöntemReturns removed object's anchor and support layer.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public ColonyContext.Position position()Returns removed object's anchor and support layer.
Örnek çağrı
placeableRemoved.position();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Returns
- removed object's anchor and support layer
placeableRemoved.settlementOwned()YöntemReturns whether the object belonged to the settlement.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
public boolean settlementOwned()Returns whether the object belonged to the settlement.
Örnek çağrı
placeableRemoved.settlementOwned();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Returns
- whether the object belonged to the settlement
placeableRemoved.toString()YöntemReturns a string representation of this record class.
ColonyEvent.PlaceableRemoved · Etkinlikler ve paneller
İmza
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.
Örnek çağrı
placeableRemoved.toString();ColonyEvent.PlaceableRemoved placeableRemoved is an instance of this supported API type.
- Specified by
- toString in class Record
- Returns
- a string representation of this object
colonyEvent.day()YöntemReturns the monotonic game day when the change occurred.
ColonyEvent · Etkinlikler ve paneller
İmza
int day()Returns the monotonic game day when the change occurred.
Örnek çağrı
colonyEvent.day();ColonyEvent colonyEvent is an instance of this supported API type.
- Returns
- game day starting at one
ColonyExtensionTürOne mod-owned simulation instance per world, created through ModContext.registerColonyExtension(java.util.function.Supplier<forgottentowns.mod.api.ColonyExtension>).
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
public interface ColonyExtensionOne mod-owned simulation instance per world, created through ModContext.registerColonyExtension(java.util.function.Supplier<forgottentowns.mod.api.ColonyExtension>). Callbacks execute on the simulation thread. Never retain a context or use engine implementation classes. State is a bounded string map inside the atomic save, so loading never deserializes mod classes. Startup validation creates disposable instances and exercises empty-state restore and save/restore. Constructors and persistence callbacks must therefore be free of external side effects.
ColonyExtension.affinities(ColonyContext.View)KancaProjects directed citizen feelings into the native roster, after all extensions update.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default List<ColonyAffinity> affinities(ColonyContext.View world)Projects directed citizen feelings into the native roster, after all extensions update. Called at simulation refresh boundaries, never during drawing. Return at most 16384 unique directed pairs per extension; different providers remain separate. Neutral values and pairs involving missing, dead, or deserting citizens are omitted. Keep persistent relationship state in this mod's save.
Bu kancayı uygula
public List<ColonyAffinity> affinities(ColonyContext.View world);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- world - current read-only colony view, valid only during this callback
- Returns
- nonnull detached list of nonnull directed affinities, or an empty list when this mod supplies none
ColonyExtension.moods(ColonyContext.View, ColonyContext.Person)KancaSupplies current happiness modifiers after all extensions have updated their citizen modifiers.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default List<ColonyContext.Mood> moods(ColonyContext.View world, ColonyContext.Person citizen)Supplies current happiness modifiers after all extensions have updated their citizen modifiers. Effects with the same nonempty stacking key use the greatest absolute value instead of adding. Equal absolute values retain the earlier provider's contribution. Only living, non-deserting recipients are queried; return at most 32 moods for one recipient.
Bu kancayı uygula
public List<ColonyContext.Mood> moods(ColonyContext.View world, ColonyContext.Person citizen);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- world - current read-only colony view
- Parameters
- citizen - recipient snapshot
- Returns
- nonnull list of nonnull localized, finite happiness rates per in-game minute
ColonyExtension.onConversation(ColonyContext, int, int)KancaObserves one newly started social exchange, independent of audio admission, muting or camera position.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default void onConversation(ColonyContext context, int first, int second)Observes one newly started social exchange, independent of audio admission, muting or camera position.
Bu kancayı uygula
public void onConversation(ColonyContext context, int first, int second);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- context - scoped colony queries and commands
- Parameters
- first - first participant's stable citizen identity
- Parameters
- second - second participant's stable citizen identity
ColonyExtension.onEvent(ColonyContext, ColonyEvent)KancaObserves a committed native change, after native accounting finishes.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default void onEvent(ColonyContext context, ColonyEvent event)Observes a committed native change, after native accounting finishes. Events generated by a callback wait until the next delivery boundary. Pending events and their effects are drained before saving; notifications are not replayed after loading. Ignore event types the mod does not use. No callback can cancel the native change.
Bu kancayı uygula
public void onEvent(ColonyContext context, ColonyEvent event);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- context - scoped colony services
- Parameters
- event - detached typed event
ColonyExtension.onPanelAction(ColonyContext, String, String)KancaHandles an enabled button from this extension's latest panel projection.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default void onPanelAction(ColonyContext context, String panelId, String actionId)Handles an enabled button from this extension's latest panel projection. Recheck gameplay prerequisites through the scoped services; other mods may have changed the world. Keep durable action outcomes in the ordinary extension save map. Drawing never calls this method.
Bu kancayı uygula
public void onPanelAction(ColonyContext context, String panelId, String actionId);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- context - scoped world queries and commands, with the usual shared command budget
- Parameters
- panelId - stable mod-local panel identity
- Parameters
- actionId - stable mod-local action identity
ColonyExtension.onWorkFinished(ColonyContext, ColonyWork.Job)KancaObserves completed or cancelled settlement work, including player-created jobs.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default void onWorkFinished(ColonyContext context, ColonyWork.Job job)Observes completed or cancelled settlement work, including player-created jobs. Delivery occurs after a simulation tick, before the next refresh, or before any save data is captured. Native mutation and resource accounting have finished before this callback. Events are not replayed after load; save owned job IDs and any handled outcome in this extension's state. Events caused by callbacks are delivered at the next boundary.
Bu kancayı uygula
public void onWorkFinished(ColonyContext context, ColonyWork.Job job);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- context - scoped colony services
- Parameters
- job - immutable terminal job snapshot
ColonyExtension.panels(ColonyContext.View)KancaProjects up to eight localized native information/action panels.
ColonyExtension · Kancalar ve yaşam döngüsü
İmza
default List<ColonyPanel> panels(ColonyContext.View world)Projects up to eight localized native information/action panels. Called at simulation refresh boundaries and immediately before a panel action, never while drawing. This query must not change persistent state. Return an empty list to hide this mod's panels.
Bu kancayı uygula
public List<ColonyPanel> panels(ColonyContext.View world);The engine calls your implementation; implement this signature in the registered hook.
- Parameters
- world - current callback-scoped read-only view
- Returns
- nonnull list of at most eight nonnull panel descriptions with unique mod-local identities; the host copies the list
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
