FORGOTTEN TOWNS

FORGOTTEN TOWNS / DOKUMENTACJA MODDOWANIA

Wiki o modowaniu ↗

Java Odniesienie do API (Javadoc)

MOD API 15

Przeglądaj wiki

Aktualna dokumentacja Mod API.

Dokumentacja techniczna dostępna jest w języku angielskim. Nazwy kodów i pól są zgodne z bieżącym API Mod.

DOKUMENTACJA MODDOWANIA

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 typy publiczne · 468 członkowie · Content API 15

Zresetuj

528 pasujące wpisy

collectionInput.equals(o)MetodaIndicates whether some other object is "equal to" this one.

TradeProductionRules.CollectionInput · Handel i mapa

Podpis

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).

Zadzwoń do przykładu

collectionInput.equals(o);

TradeProductionRules.CollectionInput collectionInput 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.
collectionInput.hashCode()MetodaReturns a hash code value for this object.

TradeProductionRules.CollectionInput · Handel i mapa

Podpis

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.

Zadzwoń do przykładu

collectionInput.hashCode();

TradeProductionRules.CollectionInput collectionInput is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
collectionInput.resource()MetodaReturns output resource identity.

TradeProductionRules.CollectionInput · Handel i mapa

Podpis

public String resource()

Returns output resource identity.

Zadzwoń do przykładu

collectionInput.resource();

TradeProductionRules.CollectionInput collectionInput is an instance of this supported API type.

Returns
output resource identity
collectionInput.stations()MetodaReturns all required placeable definition identities.

TradeProductionRules.CollectionInput · Handel i mapa

Podpis

public Set<String> stations()

Returns all required placeable definition identities.

Zadzwoń do przykładu

collectionInput.stations();

TradeProductionRules.CollectionInput collectionInput is an instance of this supported API type.

Returns
all required placeable definition identities
collectionInput.toString()MetodaReturns a string representation of this record class.

TradeProductionRules.CollectionInput · Handel i mapa

Podpis

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.

Zadzwoń do przykładu

collectionInput.toString();

TradeProductionRules.CollectionInput collectionInput is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object
new TradeProductionRulesKonstruktorCopies and bounds the authored collection rules.

TradeProductionRules · Handel i mapa

Podpis

public TradeProductionRules(boolean woodcutting, boolean gathering, boolean digging, List<TradeProductionRules.CollectionInput> collections)

Copies and bounds the authored collection rules.

Zadzwoń do przykładu

new TradeProductionRules(woodcutting, gathering, digging, collections);

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

Parameters
woodcutting - allow naturally present woodcutting drops
Parameters
gathering - allow naturally present gathering drops
Parameters
digging - allow biome digging drops
Parameters
collections - ordered infrastructure rules
Throws
IllegalArgumentException - if more than 64 rules are provided or resources repeat
Throws
NullPointerException - if the list or an entry is null
tradeProductionRules.collections()MetodaReturns ordered infrastructure rules granting free collection inputs.

TradeProductionRules · Handel i mapa

Podpis

public List<TradeProductionRules.CollectionInput> collections()

Returns ordered infrastructure rules granting free collection inputs.

Zadzwoń do przykładu

tradeProductionRules.collections();

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Returns
ordered infrastructure rules granting free collection inputs
tradeProductionRules.digging()MetodaReturns whether biome digging drops are free inputs.

TradeProductionRules · Handel i mapa

Podpis

public boolean digging()

Returns whether biome digging drops are free inputs.

Zadzwoń do przykładu

tradeProductionRules.digging();

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Returns
whether biome digging drops are free inputs
tradeProductionRules.equals(o)MetodaIndicates whether some other object is "equal to" this one.

TradeProductionRules · Handel i mapa

Podpis

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

Zadzwoń do przykładu

tradeProductionRules.equals(o);

TradeProductionRules tradeProductionRules 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.
tradeProductionRules.gathering()MetodaReturns whether present gatherable features supply their basic drops freely.

TradeProductionRules · Handel i mapa

Podpis

public boolean gathering()

Returns whether present gatherable features supply their basic drops freely.

Zadzwoń do przykładu

tradeProductionRules.gathering();

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Returns
whether present gatherable features supply their basic drops freely
tradeProductionRules.hashCode()MetodaReturns a hash code value for this object.

TradeProductionRules · Handel i mapa

Podpis

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.

Zadzwoń do przykładu

tradeProductionRules.hashCode();

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
TradeProductionRules.read(value)MetodaParses a manifest-captured JSON object, rejecting misspelled fields.

TradeProductionRules · Handel i mapa

Podpis

public static TradeProductionRules read(Object value)

Parses a manifest-captured JSON object, rejecting misspelled fields.

Zadzwoń do przykładu

TradeProductionRules.read(value);

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

Parameters
value - captured table returned by the mod context
Returns
validated estimation policy
Throws
IllegalArgumentException - if the table is malformed
Throws
NullPointerException - if an entry contains a null identifier
tradeProductionRules.toString()MetodaReturns a string representation of this record class.

TradeProductionRules · Handel i mapa

Podpis

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.

Zadzwoń do przykładu

tradeProductionRules.toString();

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Specified by
toString in class Record
Returns
a string representation of this object
tradeProductionRules.validate(registries)MetodaValidates resource and placeable references against the composed registries.

TradeProductionRules · Handel i mapa

Podpis

public void validate(RegistryAccess registries)

Validates resource and placeable references against the composed registries.

Zadzwoń do przykładu

tradeProductionRules.validate(registries);

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Parameters
registries - published content snapshot
Throws
IllegalArgumentException - if a referenced definition is missing
tradeProductionRules.woodcutting()MetodaReturns whether present woodcuttable features supply their basic drops freely.

TradeProductionRules · Handel i mapa

Podpis

public boolean woodcutting()

Returns whether present woodcuttable features supply their basic drops freely.

Zadzwoń do przykładu

tradeProductionRules.woodcutting();

TradeProductionRules tradeProductionRules is an instance of this supported API type.

Returns
whether present woodcuttable features supply their basic drops freely
TravelRulesTypShared authored biome travel times for independent trade and recruitment policies.

TravelRules · Handel i mapa

Podpis

public final class TravelRules extends Object

Shared authored biome travel times for independent trade and recruitment policies.

new TravelRulesKonstruktorLegacy convenience reader retained for existing compiled packs.

TravelRules · Handel i mapa

Podpis

public TravelRules(ModSettings settings)

Legacy convenience reader retained for existing compiled packs. New packs should own their setting names and defaults and use TravelRules(int, Map).

Zadzwoń do przykładu

new TravelRules(settings);

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

Parameters
settings - captured typed settings reader
Throws
IllegalArgumentException - if any duration is outside 1..48 whole days
Throws
NullPointerException - if settings is null
new TravelRulesKonstruktorCreates travel rules from values chosen entirely by the registering pack.

TravelRules · Handel i mapa

Podpis

public TravelRules(int fallback, Map<String,Integer> travel)

Creates travel rules from values chosen entirely by the registering pack.

Zadzwoń do przykładu

new TravelRules(fallback, travel);

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

Parameters
fallback - days for a biome without an explicit override
Parameters
travel - authored biome identities mapped to whole travel days
Throws
IllegalArgumentException - if a duration is outside 1..48 or a biome identity is blank
Throws
NullPointerException - if the map or an entry is null
travelRules.days(biome)MetodaResolves an authored journey duration.

TravelRules · Handel i mapa

Podpis

public int days(String biome)

Resolves an authored journey duration.

Zadzwoń do przykładu

travelRules.days(biome);

TravelRules travelRules is an instance of this supported API type.

Parameters
biome - nonnull exact case-sensitive biome identity
Returns
whole days within 1..48, using the configured default for unknown biomes
Throws
NullPointerException - if biome is null
WorldInspectionTypOpts into the host's dedicated middle-click inspectors.

WorldInspection · Sprzęt i inspekcja

Podpis

public record WorldInspection(boolean units, boolean zones, boolean sampleBuildables) extends Record

Opts into the host's dedicated middle-click inspectors. The host owns picking, localized presentation, unlock checks, equipment requests and world-tool selection. Unit inspection also routes roster information buttons to the same dedicated inspector. Registrations are additive; disabling the owning mod removes its opt-in on restart.

Record Components
units - whether citizens, soldiers, heroes, and creatures can be inspected
Record Components
zones - whether zones expose inspection and their available construction tools
Record Components
sampleBuildables - whether middle-click selects an unlocked structural construction tool
new WorldInspectionKonstruktorCreates inspection options without enabling construction sampling.

WorldInspection · Sprzęt i inspekcja

Podpis

public WorldInspection(boolean units, boolean zones)

Creates inspection options without enabling construction sampling.

Zadzwoń do przykładu

new WorldInspection(units, zones);

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

Parameters
units - whether units can be inspected
Parameters
zones - whether zones can be inspected
new WorldInspectionKonstruktorCreates an instance of a WorldInspection record class.

WorldInspection · Sprzęt i inspekcja

Podpis

public WorldInspection(boolean units, boolean zones, boolean sampleBuildables)

Creates an instance of a WorldInspection record class.

Zadzwoń do przykładu

new WorldInspection(units, zones, sampleBuildables);

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

Parameters
units - whether citizens, soldiers, heroes, and creatures can be inspected
Parameters
zones - whether zones expose inspection and their available construction tools
Parameters
sampleBuildables - whether middle-click selects an unlocked structural construction tool
worldInspection.equals(o)MetodaIndicates whether some other object is "equal to" this one.

WorldInspection · Sprzęt i inspekcja

Podpis

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

Zadzwoń do przykładu

worldInspection.equals(o);

WorldInspection worldInspection 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.
worldInspection.hashCode()MetodaReturns a hash code value for this object.

WorldInspection · Sprzęt i inspekcja

Podpis

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.

Zadzwoń do przykładu

worldInspection.hashCode();

WorldInspection worldInspection is an instance of this supported API type.

Specified by
hashCode in class Record
Returns
a hash code value for this object
worldInspection.sampleBuildables()MetodaReturns whether middle-click selects an unlocked structural construction tool.

WorldInspection · Sprzęt i inspekcja

Podpis

public boolean sampleBuildables()

Returns whether middle-click selects an unlocked structural construction tool.

Zadzwoń do przykładu

worldInspection.sampleBuildables();

WorldInspection worldInspection is an instance of this supported API type.

Returns
whether middle-click selects an unlocked structural construction tool

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