|
2 | 2 | // Factorio API reference https://lua-api.factorio.com/latest/index.html
|
3 | 3 | // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
4 | 4 | // Definition source https://github.com/sguest/factorio-types
|
5 |
| -// Factorio version 2.0.28 |
| 5 | +// Factorio version 2.0.29 |
6 | 6 | // API version 6
|
7 | 7 |
|
8 | 8 | declare namespace runtime {
|
@@ -4080,7 +4080,7 @@ interface LuaBootstrap {
|
4080 | 4080 | script.raise_event(defines.events.on_console_chat, data)
|
4081 | 4081 | ```
|
4082 | 4082 | */
|
4083 |
| - raise_event(this: void, event: uint | string, data: table): void; |
| 4083 | + raise_event(this: void, event: LuaEventType, data: table): void; |
4084 | 4084 | /**
|
4085 | 4085 | * @param table.player_index The player who did the purchasing.
|
4086 | 4086 | * @param table.market The market entity.
|
@@ -4895,6 +4895,10 @@ interface LuaControl {
|
4895 | 4895 | * The build distance of this character or max uint when not a character or player connected to a character.
|
4896 | 4896 | */
|
4897 | 4897 | readonly build_distance: uint;
|
| 4898 | + /** |
| 4899 | + * The cargo pod the player is currently sitting in or the cargo pod attached to this rocket silo. |
| 4900 | + */ |
| 4901 | + readonly cargo_pod?: LuaEntity; |
4898 | 4902 | /**
|
4899 | 4903 | * When called on a {@link LuaPlayer | runtime:LuaPlayer}, it must be associated with a character (see {@link LuaPlayer::character | runtime:LuaPlayer::character}).
|
4900 | 4904 | */
|
@@ -5030,6 +5034,10 @@ interface LuaControl {
|
5030 | 5034 | * Unique {@link index | runtime:LuaForce::index} (ID) associated with the force of this entity.
|
5031 | 5035 | */
|
5032 | 5036 | readonly force_index: uint;
|
| 5037 | + /** |
| 5038 | + * The space platform hub the player is currently sitting in. |
| 5039 | + */ |
| 5040 | + readonly hub?: LuaEntity; |
5033 | 5041 | /**
|
5034 | 5042 | * Whether this character entity is in combat.
|
5035 | 5043 | */
|
@@ -5797,11 +5805,11 @@ interface LuaEntity extends LuaControl {
|
5797 | 5805 | */
|
5798 | 5806 | get_electric_output_flow_limit(this: void, quality?: QualityID): double | null;
|
5799 | 5807 | /**
|
5800 |
| - * Get the filter for a slot in an inserter, loader, or logistic storage container. The entity must allow filters. |
| 5808 | + * Get the filter for a slot in an inserter, loader, mining drill, asteroid collector, or logistic storage container. The entity must allow filters. |
5801 | 5809 | * @param slot_index Index of the slot to get the filter for.
|
5802 | 5810 | * @returns The filter, or `nil` if the given slot has no filter.
|
5803 | 5811 | */
|
5804 |
| - get_filter(this: void, slot_index: uint): ItemFilter | null; |
| 5812 | + get_filter(this: void, slot_index: uint): (ItemFilter | EntityID | AsteroidChunkID) | null; |
5805 | 5813 | /**
|
5806 | 5814 | * Gets fluid of the i-th fluid storage.
|
5807 | 5815 | * @param index Fluid storage index. Valid values are from 1 up to {@link LuaEntity::fluids_count | runtime:LuaEntity::fluids_count}.
|
@@ -5906,9 +5914,9 @@ interface LuaEntity extends LuaControl {
|
5906 | 5914 | */
|
5907 | 5915 | get_parent_signals(this: void): LuaEntity[];
|
5908 | 5916 | /**
|
5909 |
| - * Gets the passenger of this car or spidertron if any. |
| 5917 | + * Gets the passenger of this car, spidertron, or cargo pod if any. |
5910 | 5918 | *
|
5911 |
| - * This differs over {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver} in that the passenger can't drive the car. |
| 5919 | + * This differs over {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver} in that for cars, the passenger can't drive the car. |
5912 | 5920 | * @returns `nil` if the vehicle contains no passenger. To check if there's a driver see {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver}.
|
5913 | 5921 | */
|
5914 | 5922 | get_passenger(this: void): (LuaEntity | LuaPlayer) | null;
|
@@ -6229,11 +6237,11 @@ interface LuaEntity extends LuaControl {
|
6229 | 6237 | */
|
6230 | 6238 | set_driver(this: void, driver?: LuaEntity | PlayerIdentification): void;
|
6231 | 6239 | /**
|
6232 |
| - * Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID) or logistic storage container (ItemWithQualityID). The entity must allow filters. |
| 6240 | + * Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID), asteroid collector (AsteroidChunkID) or logistic storage container (ItemWithQualityID). The entity must allow filters. |
6233 | 6241 | * @param index Index of the slot to set the filter for.
|
6234 | 6242 | * @param filter The item or entity to filter, or `nil` to clear the filter.
|
6235 | 6243 | */
|
6236 |
| - set_filter(this: void, index: uint, filter?: ItemFilter | ItemWithQualityID | EntityID): void; |
| 6244 | + set_filter(this: void, index: uint, filter?: ItemFilter | ItemWithQualityID | EntityID | AsteroidChunkID): void; |
6237 | 6245 | /**
|
6238 | 6246 | * Sets fluid to the i-th fluid storage.
|
6239 | 6247 | *
|
@@ -6430,10 +6438,6 @@ interface LuaEntity extends LuaControl {
|
6430 | 6438 | * The burner energy source for this entity, if any.
|
6431 | 6439 | */
|
6432 | 6440 | readonly burner?: LuaBurner;
|
6433 |
| - /** |
6434 |
| - * Gets the cargo pod attached to this rocket silo rocket if one exists. |
6435 |
| - */ |
6436 |
| - readonly cargo_pod?: LuaEntity; |
6437 | 6441 | /**
|
6438 | 6442 | * The state of this chain signal.
|
6439 | 6443 | */
|
@@ -6633,7 +6637,7 @@ interface LuaEntity extends LuaControl {
|
6633 | 6637 | */
|
6634 | 6638 | entity_label?: string;
|
6635 | 6639 | /**
|
6636 |
| - * The number of filter slots this inserter, loader, mining drill or logistic storage container has. 0 if not one of those entities. |
| 6640 | + * The number of filter slots this inserter, loader, mining drill, asteroid collector or logistic storage container has. 0 if not one of those entities. |
6637 | 6641 | */
|
6638 | 6642 | readonly filter_slot_count: uint;
|
6639 | 6643 | /**
|
@@ -7276,6 +7280,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
7276 | 7280 | * The crafting speed of this crafting-machine.
|
7277 | 7281 | */
|
7278 | 7282 | get_crafting_speed(this: void, quality?: QualityID): double;
|
| 7283 | + /** |
| 7284 | + * The fluid usage of this generator prototype. |
| 7285 | + */ |
| 7286 | + get_fluid_usage_per_tick(this: void, quality?: QualityID): LuaQualityPrototype | null; |
7279 | 7287 | /**
|
7280 | 7288 | * The extension speed of this inserter.
|
7281 | 7289 | */
|
@@ -7316,6 +7324,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
7316 | 7324 | * Max health of this entity. Will be `0` if this is not an entity with health.
|
7317 | 7325 | */
|
7318 | 7326 | get_max_health(this: void, quality?: QualityID): float;
|
| 7327 | + /** |
| 7328 | + * The maximum power output of this burner generator or generator prototype. |
| 7329 | + */ |
| 7330 | + get_max_power_output(this: void, quality?: QualityID): double | null; |
7319 | 7331 | /**
|
7320 | 7332 | * The maximum wire distance for this entity. 0 if the entity doesn't support wires.
|
7321 | 7333 | */
|
@@ -7689,7 +7701,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
7689 | 7701 | */
|
7690 | 7702 | readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype;
|
7691 | 7703 | /**
|
7692 |
| - * The fluid usage of this generator prototype. |
| 7704 | + * The fluid usage of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_fluid_usage_per_tick | runtime:LuaEntityPrototype::get_fluid_usage_per_tick} and should not be used. |
7693 | 7705 | */
|
7694 | 7706 | readonly fluid_usage_per_tick?: double;
|
7695 | 7707 | /**
|
@@ -7942,7 +7954,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
7942 | 7954 | */
|
7943 | 7955 | readonly max_polyphony?: uint;
|
7944 | 7956 | /**
|
7945 |
| - * The default maximum power output of this generator prototype. |
| 7957 | + * The default maximum power output of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_max_power_output | runtime:LuaEntityPrototype::get_max_power_output} and should not be used. |
7946 | 7958 | */
|
7947 | 7959 | readonly max_power_output?: double;
|
7948 | 7960 | /**
|
@@ -8105,6 +8117,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
8105 | 8117 | * Whether this generator prototype scales fluid usage.
|
8106 | 8118 | */
|
8107 | 8119 | readonly scale_fluid_usage?: boolean;
|
| 8120 | + /** |
| 8121 | + * How much science pack durability is required to research one science point. |
| 8122 | + */ |
| 8123 | + readonly science_pack_drain_rate_percent: uint8; |
8108 | 8124 | /**
|
8109 | 8125 | * The secondary bounding box used for collision checking, if any. This is only used in rails and rail remnants.
|
8110 | 8126 | */
|
@@ -13373,6 +13389,11 @@ interface LuaPlayer extends LuaControl {
|
13373 | 13389 | * Clear any active flying texts for this player.
|
13374 | 13390 | */
|
13375 | 13391 | clear_local_flying_texts(this: void): void;
|
| 13392 | + /** |
| 13393 | + * Clears the given recipe from the list of recipe notifications for this player. |
| 13394 | + * @param recipe Recipe to clear. |
| 13395 | + */ |
| 13396 | + clear_recipe_notification(this: void, recipe: RecipeID): void; |
13376 | 13397 | /**
|
13377 | 13398 | * Clears all recipe notifications for this player.
|
13378 | 13399 | */
|
@@ -14894,6 +14915,10 @@ interface LuaRecord {
|
14894 | 14915 | by_player?: PlayerIdentification;
|
14895 | 14916 | super_forced?: boolean;
|
14896 | 14917 | }): void;
|
| 14918 | + /** |
| 14919 | + * The active index of this BlueprintBookRecord. For records in "my blueprints", the result will be the same regardless of the player, but records in "game blueprints" may have different active indices per player. |
| 14920 | + */ |
| 14921 | + get_active_index(this: void, player: PlayerIdentification): uint; |
14897 | 14922 | /**
|
14898 | 14923 | * The entities in this blueprint.
|
14899 | 14924 | */
|
|
0 commit comments