factorio-types 1.2.67 → 1.2.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/classes.d.ts CHANGED
@@ -2,7 +2,7 @@
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.1.17
5
+ // Factorio version 2.1.20
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -8676,7 +8676,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8676
8676
  /**
8677
8677
  * The crafting speed of this crafting-machine or character.
8678
8678
  */
8679
- get_crafting_speed(this: void, quality?: QualityID): double;
8679
+ get_crafting_speed(this: void, quality?: QualityID): double | null;
8680
8680
  get_duration(this: void, quality?: QualityID): uint32 | null;
8681
8681
  get_energy_distribution_efficiency(this: void, quality?: QualityID): double | null;
8682
8682
  /**
@@ -8750,7 +8750,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8750
8750
  /**
8751
8751
  * The pumping speed of this offshore pump or normal pump.
8752
8752
  */
8753
- get_pumping_speed(this: void, quality?: QualityID): double;
8753
+ get_pumping_speed(this: void, quality?: QualityID): double | null;
8754
8754
  /**
8755
8755
  * The base researching speed of this lab prototype.
8756
8756
  */
@@ -8758,24 +8758,24 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8758
8758
  /**
8759
8759
  * The supply area of this electric pole or beacon prototype.
8760
8760
  */
8761
- get_supply_area_distance(this: void, quality?: QualityID): double;
8761
+ get_supply_area_distance(this: void, quality?: QualityID): double | null;
8762
8762
  /**
8763
8763
  * The maximum flow rate through this valve.
8764
8764
  */
8765
- get_valve_flow_rate(this: void, quality?: QualityID): double;
8765
+ get_valve_flow_rate(this: void, quality?: QualityID): double | null;
8766
8766
  /**
8767
8767
  * Test whether this entity prototype has a certain flag set.
8768
8768
  * @param flag The flag to test.
8769
8769
  * @returns `true` if this prototype has the given flag set.
8770
8770
  */
8771
8771
  has_flag(this: void, flag: EntityPrototypeFlag): boolean;
8772
- readonly absorptions_per_second: Record<string, EnemySpawnerAbsorption>;
8772
+ readonly absorptions_per_second?: Record<string, EnemySpawnerAbsorption>;
8773
8773
  /**
8774
8774
  * A table of pollutions amounts that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution, indexed by the name of each absorbed pollution type.
8775
8775
  */
8776
8776
  readonly absorptions_to_join_attack?: Record<string, float>;
8777
8777
  readonly acceleration?: double;
8778
- readonly acceleration_rate: double;
8778
+ readonly acceleration_rate?: double;
8779
8779
  readonly accepted_seeds?: string[];
8780
8780
  readonly action?: TriggerItem[];
8781
8781
  readonly action_cooldown?: uint32;
@@ -8802,7 +8802,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8802
8802
  */
8803
8803
  readonly air_resistance?: double;
8804
8804
  readonly alarm_trigger?: TriggerEffectItem[];
8805
- readonly alert_after_time: uint32;
8805
+ readonly alert_after_time?: uint32;
8806
8806
  /**
8807
8807
  * The alert icon scale of this entity prototype.
8808
8808
  */
@@ -8901,11 +8901,11 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8901
8901
  * The attack result of this entity, if any.
8902
8902
  */
8903
8903
  readonly attack_result?: TriggerItem[];
8904
- readonly attack_target_mask: TriggerTargetMask;
8904
+ readonly attack_target_mask?: TriggerTargetMask;
8905
8905
  readonly attacking_speed?: double;
8906
8906
  readonly attractor_hit_effect?: TriggerItem[];
8907
8907
  readonly auto_connect_up_to_n_wires?: uint8;
8908
- readonly auto_setup_collision_box: boolean;
8908
+ readonly auto_setup_collision_box?: boolean;
8909
8909
  readonly auto_sort_inventory?: boolean;
8910
8910
  /**
8911
8911
  * The amount of ammo that inserters automatically insert into this ammo turret, artillery turret or artillery wagon.
@@ -9011,7 +9011,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9011
9011
  readonly color?: Color;
9012
9012
  readonly combat_robot_friction?: double;
9013
9013
  readonly connectable_box?: BoundingBox;
9014
- readonly connection_category: string[];
9014
+ readonly connection_category?: string[];
9015
9015
  readonly connection_distance?: double;
9016
9016
  readonly connects_to_other_radars?: boolean;
9017
9017
  /**
@@ -9037,7 +9037,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9037
9037
  * The value in the dictionary is meaningless and exists just to allow for easy lookup.
9038
9038
  */
9039
9039
  readonly crafting_categories?: Record<string, true>;
9040
- readonly crafting_speed_quality_multiplier: LuaTable<QualityID, double>;
9040
+ readonly crafting_speed_quality_multiplier?: LuaTable<QualityID, double>;
9041
9041
  /**
9042
9042
  * The crane energy usage of this agricultural tower prototype.
9043
9043
  */
@@ -9225,14 +9225,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9225
9225
  * The direct energy usage of this entity, if any.
9226
9226
  */
9227
9227
  readonly energy_usage?: double;
9228
- readonly energy_usage_quality_multiplier: LuaTable<QualityID, double>;
9228
+ readonly energy_usage_quality_multiplier?: LuaTable<QualityID, double>;
9229
9229
  readonly energy_usage_quality_scaling?: float;
9230
9230
  /**
9231
9231
  * The engine starting speed for this rocket silo rocket prototype.
9232
9232
  */
9233
9233
  readonly engine_starting_speed?: double;
9234
9234
  readonly enraged_duration?: MapTick;
9235
- readonly enraged_speed: double;
9235
+ readonly enraged_speed?: double;
9236
9236
  readonly enter_drop_mode_if_held_stack_spoiled?: boolean;
9237
9237
  readonly enter_vehicle_distance?: double;
9238
9238
  readonly erase_contents_when_mined?: boolean;
@@ -9386,7 +9386,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9386
9386
  * The icon positioning for inventories of this entity, if defined.
9387
9387
  */
9388
9388
  readonly icons_positioning?: IconSequencePositioning[];
9389
- readonly ignore_target_mask: TriggerTargetMask;
9389
+ readonly ignore_target_mask?: TriggerTargetMask;
9390
9390
  readonly immune_to_all_impacts?: boolean;
9391
9391
  readonly immune_to_cliff_impacts?: boolean;
9392
9392
  readonly immune_to_rock_impacts?: boolean;
@@ -9713,7 +9713,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9713
9713
  * Returns the inventory size if this entity is of normal quality. Use {@link LuaEntityPrototype::get_inventory_size | runtime:LuaEntityPrototype::get_inventory_size} for other qualities.
9714
9714
  */
9715
9715
  readonly module_inventory_size?: uint32;
9716
- readonly module_slots_quality_bonus: LuaTable<QualityID, ItemStackIndex>;
9716
+ readonly module_slots_quality_bonus?: LuaTable<QualityID, ItemStackIndex>;
9717
9717
  /**
9718
9718
  * Whether this unit prototype can move while shooting.
9719
9719
  */
@@ -9861,7 +9861,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9861
9861
  */
9862
9862
  readonly revenge_attack_parameters?: AttackParameters;
9863
9863
  readonly reversing_power_modifier?: double;
9864
- readonly rewire_neighbours_when_destroying: boolean;
9864
+ readonly rewire_neighbours_when_destroying?: boolean;
9865
9865
  /**
9866
9866
  * The rising speed for this rocket silo rocket prototype.
9867
9867
  */
@@ -9904,7 +9904,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9904
9904
  /**
9905
9905
  * How much science pack durability is required to research one science point.
9906
9906
  */
9907
- readonly science_pack_drain_rate_percent: uint8;
9907
+ readonly science_pack_drain_rate_percent?: uint8;
9908
9908
  readonly search_radius?: double;
9909
9909
  /**
9910
9910
  * The secondary bounding box used for collision checking, if any. This is only used in rails and rail remnants.
@@ -9940,9 +9940,9 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9940
9940
  readonly smoke_count?: uint16;
9941
9941
  readonly smoke_sources?: SmokeSource[];
9942
9942
  readonly snap_to_spots_distance?: float;
9943
- readonly solar_panel_performance_at_day: double;
9944
- readonly solar_panel_performance_at_night: double;
9945
- readonly solar_panel_solar_coefficient_property: LuaSurfacePropertyPrototype;
9943
+ readonly solar_panel_performance_at_day?: double;
9944
+ readonly solar_panel_performance_at_night?: double;
9945
+ readonly solar_panel_solar_coefficient_property?: LuaSurfacePropertyPrototype;
9946
9946
  readonly source_offset?: Vector;
9947
9947
  readonly source_variance?: Vector;
9948
9948
  readonly spawn_blocked_trigger?: TriggerItem[];
@@ -10068,7 +10068,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
10068
10068
  */
10069
10069
  readonly torso_rotation_speed?: double;
10070
10070
  readonly track_coverage_during_drag_building?: boolean;
10071
- readonly track_particle_triggers: LuaTable<LuaTilePrototype, TriggerEffectItem[]>;
10071
+ readonly track_particle_triggers?: LuaTable<LuaTilePrototype, TriggerEffectItem[]>;
10072
10072
  readonly transition_collision_mask?: CollisionMask;
10073
10073
  /**
10074
10074
  * If it is a tree, return the number of colors it supports.
@@ -10086,10 +10086,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
10086
10086
  readonly trigger_radius?: double;
10087
10087
  /**
10088
10088
  * The trigger target mask for this entity prototype type.
10089
- *
10090
- * The values in the dictionary are meaningless and exists just to allow the dictionary type for easy lookup.
10091
10089
  */
10092
- readonly trigger_target_mask: Record<string, boolean>;
10090
+ readonly trigger_target_mask: Record<string, true>;
10093
10091
  readonly turn_radius?: double;
10094
10092
  readonly turn_smoothing?: double;
10095
10093
  readonly turn_speed?: float;
@@ -10131,7 +10129,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
10131
10129
  /**
10132
10130
  * If this lab uses the quality drain modifier when consuming science packs.
10133
10131
  */
10134
- readonly uses_quality_drain_modifier: boolean;
10132
+ readonly uses_quality_drain_modifier?: boolean;
10135
10133
  /**
10136
10134
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
10137
10135
  */
@@ -10912,7 +10910,7 @@ interface LuaForce {
10912
10910
  */
10913
10911
  add_custom_alert(this: void, entity: LuaEntity, icon: SignalID, message: LocalisedString, show_on_map: boolean): void;
10914
10912
  /**
10915
- * Add this technology to the back of the research queue if the queue is enabled. Otherwise, set this technology to be researched now.
10913
+ * Add this technology to the back of the research queue.
10916
10914
  * @returns Whether the technology was successfully added.
10917
10915
  */
10918
10916
  add_research(this: void, technology: TechnologyID): boolean;
@@ -11498,7 +11496,7 @@ interface LuaForce {
11498
11496
  /**
11499
11497
  * The research queue of this force. The first technology in the array is the currently active one. Reading this attribute gives an array of {@link LuaTechnology | runtime:LuaTechnology}.
11500
11498
  *
11501
- * To write to this, the entire table must be written. Providing an empty table or `nil` will empty the research queue and cancel the current research. Writing to this when the research queue is disabled will simply set the last research in the table as the current research.
11499
+ * To write to this, the entire table must be written. Providing an empty table or `nil` will empty the research queue and cancel the current research.
11502
11500
  *
11503
11501
  * This only allows mods to queue research that this force is able to research in the first place. As an example, an already researched technology or one whose prerequisites are not fulfilled will not be queued, but dropped silently instead.
11504
11502
  */
@@ -12261,7 +12259,7 @@ interface LuaGuiElement {
12261
12259
  */
12262
12260
  get_item(this: void, index: uint32): LocalisedString;
12263
12261
  /**
12264
- * The mod that owns this Gui element or `nil` if it's owned by the scenario script.
12262
+ * The mod that owns this GUI element or `nil` if it's owned by the scenario script.
12265
12263
  *
12266
12264
  * This has a not-super-expensive, but non-free cost to get.
12267
12265
  */
@@ -12635,6 +12633,10 @@ interface LuaGuiElement {
12635
12633
  * The tooltip shown on the right switch label.
12636
12634
  */
12637
12635
  right_label_tooltip: LocalisedString;
12636
+ /**
12637
+ * The number to be shown on the right side of this sprite-button, directly above the regular {@link LuaGuiElement::number | runtime:LuaGuiElement::number}, or `nil` to show nothing.
12638
+ */
12639
+ secondary_number?: double;
12638
12640
  /**
12639
12641
  * Whether the contents of this text-box are selectable. Defaults to `true`.
12640
12642
  */
@@ -12648,7 +12650,7 @@ interface LuaGuiElement {
12648
12650
  */
12649
12651
  selected_tab_index?: uint32;
12650
12652
  /**
12651
- * Related to the number to be shown in the bottom right corner of this sprite-button. When set to `true`, numbers that are non-zero and smaller than one are shown as a percentage rather than the value. For example, `0.5` will be shown as `50%` instead.
12653
+ * Related to the numbers to be shown in the bottom right corner of this sprite-button. When set to `true`, numbers that are non-zero and smaller than one are shown as a percentage rather than the value. For example, `0.5` will be shown as `50%` instead.
12652
12654
  */
12653
12655
  show_percent_for_small_numbers: boolean;
12654
12656
  /**
@@ -13201,6 +13203,10 @@ interface LuaGuiElementAddParamsSpriteButton extends BaseLuaGuiElementAddParams
13201
13203
  * The name of the quality shown on the button.
13202
13204
  */
13203
13205
  'quality'?: string;
13206
+ /**
13207
+ * The secondary number shown on the button, above the regular number.
13208
+ */
13209
+ 'secondary_number'?: double;
13204
13210
  /**
13205
13211
  * Formats small numbers as percentages. Defaults to `false`.
13206
13212
  */
@@ -13975,7 +13981,7 @@ interface LuaItemCommon {
13975
13981
  /**
13976
13982
  * Gets the tags for the given blueprint entity index in this blueprint item.
13977
13983
  */
13978
- get_blueprint_entity_tags(this: void, index: uint32): Tags;
13984
+ get_blueprint_entity_tags(this: void, index: uint32): Tags | null;
13979
13985
  /**
13980
13986
  * A list of the tiles in this blueprint.
13981
13987
  */
@@ -14443,9 +14449,9 @@ interface LuaItemPrototype extends LuaPrototypeBase {
14443
14449
  */
14444
14450
  readonly fuel_acceleration_multiplier_quality_bonus: double;
14445
14451
  /**
14446
- * The fuel category, if any.
14452
+ * Fuel categories. Only provided when not empty.
14447
14453
  */
14448
- readonly fuel_category?: string;
14454
+ readonly fuel_categories?: string[];
14449
14455
  /**
14450
14456
  * The emissions multiplier if this is used as fuel.
14451
14457
  */
@@ -14514,6 +14520,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
14514
14520
  */
14515
14521
  readonly provides_flight?: boolean;
14516
14522
  readonly quality_affects_inventory_size?: boolean;
14523
+ readonly quality_affects_spoil_ticks: boolean;
14517
14524
  readonly quality_quality_multiplier?: float;
14518
14525
  readonly radius_color?: Color;
14519
14526
  /**
@@ -14533,6 +14540,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
14533
14540
  * The results of launching this item in a rocket.
14534
14541
  */
14535
14542
  readonly rocket_launch_products: Product[];
14543
+ readonly science_capacity: double;
14536
14544
  /**
14537
14545
  * How this item interacts when being sent to orbit.
14538
14546
  */
@@ -16485,10 +16493,6 @@ interface LuaPlayer extends LuaControl {
16485
16493
  * If `true`, circle and name of given player is rendered on the map/chart.
16486
16494
  */
16487
16495
  show_on_map: boolean;
16488
- /**
16489
- * If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.
16490
- */
16491
- spectator: boolean;
16492
16496
  /**
16493
16497
  * All SpiderVehicles currently selected by the player, if they are holding a spidertron remote.
16494
16498
  */
@@ -17084,7 +17088,7 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
17084
17088
  /**
17085
17089
  * The next higher level of the quality
17086
17090
  */
17087
- readonly next: LuaQualityPrototype;
17091
+ readonly next?: LuaQualityPrototype;
17088
17092
  /**
17089
17093
  * The probability multiplier of getting the next level of quality.
17090
17094
  */
@@ -17093,7 +17097,7 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
17093
17097
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
17094
17098
  */
17095
17099
  readonly object_name: string;
17096
- readonly previous: LuaQualityPrototype;
17100
+ readonly previous?: LuaQualityPrototype;
17097
17101
  /**
17098
17102
  * Probability of additional quality decrease happening after quality was decreased to reach this quality in the same crafting/mining operation.
17099
17103
  */
@@ -17104,6 +17108,7 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
17104
17108
  readonly previous_probability: double;
17105
17109
  readonly range_multiplier: double;
17106
17110
  readonly rolling_stock_max_speed_multiplier: double;
17111
+ readonly science_capacity_multiplier: double;
17107
17112
  readonly science_pack_drain_multiplier: float;
17108
17113
  readonly spoil_ticks_multiplier: float;
17109
17114
  readonly tool_durability_multiplier: double;
@@ -17717,7 +17722,7 @@ interface LuaRecord {
17717
17722
  /**
17718
17723
  * Gets the tags for the given blueprint entity index in this blueprint.
17719
17724
  */
17720
- get_blueprint_entity_tags(this: void, index: uint32): Tags;
17725
+ get_blueprint_entity_tags(this: void, index: uint32): Tags | null;
17721
17726
  /**
17722
17727
  * A list of the tiles in this blueprint.
17723
17728
  */
@@ -18131,6 +18136,10 @@ interface LuaRenderObject {
18131
18136
  * Surface this object is rendered on.
18132
18137
  */
18133
18138
  readonly surface: LuaSurface;
18139
+ /**
18140
+ * If this render object will be translucent when "Hide tall entities" mode is active.
18141
+ */
18142
+ tall: boolean;
18134
18143
  /**
18135
18144
  * Where this object is drawn.
18136
18145
  *
@@ -18220,6 +18229,7 @@ interface LuaRendering {
18220
18229
  * @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
18221
18230
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18222
18231
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18232
+ * @param table.tall Defaults to false.
18223
18233
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18224
18234
  * @param table.light_mode Whether this object should be rendered as a sprite, light or both at once. Defaults to "occluder".
18225
18235
  */
@@ -18243,6 +18253,7 @@ interface LuaRendering {
18243
18253
  players?: PlayerIdentification[];
18244
18254
  visible?: boolean;
18245
18255
  only_in_alt_mode?: boolean;
18256
+ tall?: boolean;
18246
18257
  render_mode?: ScriptRenderMode;
18247
18258
  light_mode?: ScriptSpriteLightMode;
18248
18259
  }): LuaRenderObject;
@@ -18259,6 +18270,7 @@ interface LuaRendering {
18259
18270
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18260
18271
  * @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
18261
18272
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18273
+ * @param table.tall Defaults to false.
18262
18274
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18263
18275
  */
18264
18276
  draw_arc(this: void, table: {
@@ -18276,6 +18288,7 @@ interface LuaRendering {
18276
18288
  visible?: boolean;
18277
18289
  draw_on_ground?: boolean;
18278
18290
  only_in_alt_mode?: boolean;
18291
+ tall?: boolean;
18279
18292
  render_mode?: ScriptRenderMode;
18280
18293
  }): LuaRenderObject;
18281
18294
  /**
@@ -18290,6 +18303,7 @@ interface LuaRendering {
18290
18303
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18291
18304
  * @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
18292
18305
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18306
+ * @param table.tall Defaults to false.
18293
18307
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18294
18308
  */
18295
18309
  draw_circle(this: void, table: {
@@ -18306,6 +18320,7 @@ interface LuaRendering {
18306
18320
  visible?: boolean;
18307
18321
  draw_on_ground?: boolean;
18308
18322
  only_in_alt_mode?: boolean;
18323
+ tall?: boolean;
18309
18324
  render_mode?: ScriptRenderMode;
18310
18325
  }): LuaRenderObject;
18311
18326
  /**
@@ -18325,6 +18340,7 @@ interface LuaRendering {
18325
18340
  * @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
18326
18341
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18327
18342
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18343
+ * @param table.tall Defaults to false.
18328
18344
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18329
18345
  */
18330
18346
  draw_light(this: void, table: {
@@ -18343,6 +18359,7 @@ interface LuaRendering {
18343
18359
  players?: PlayerIdentification[];
18344
18360
  visible?: boolean;
18345
18361
  only_in_alt_mode?: boolean;
18362
+ tall?: boolean;
18346
18363
  render_mode?: ScriptRenderMode;
18347
18364
  }): LuaRenderObject;
18348
18365
  /**
@@ -18358,6 +18375,7 @@ interface LuaRendering {
18358
18375
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18359
18376
  * @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
18360
18377
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18378
+ * @param table.tall Defaults to false.
18361
18379
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18362
18380
  * @example ```
18363
18381
  -- Draw a white and 2 pixel wide line from {0, 0} to {2, 2}.
@@ -18384,6 +18402,7 @@ interface LuaRendering {
18384
18402
  visible?: boolean;
18385
18403
  draw_on_ground?: boolean;
18386
18404
  only_in_alt_mode?: boolean;
18405
+ tall?: boolean;
18387
18406
  render_mode?: ScriptRenderMode;
18388
18407
  }): LuaRenderObject;
18389
18408
  /**
@@ -18399,6 +18418,7 @@ interface LuaRendering {
18399
18418
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18400
18419
  * @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
18401
18420
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18421
+ * @param table.tall Defaults to false.
18402
18422
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18403
18423
  */
18404
18424
  draw_polygon(this: void, table: {
@@ -18416,6 +18436,7 @@ interface LuaRendering {
18416
18436
  visible?: boolean;
18417
18437
  draw_on_ground?: boolean;
18418
18438
  only_in_alt_mode?: boolean;
18439
+ tall?: boolean;
18419
18440
  render_mode?: ScriptRenderMode;
18420
18441
  }): LuaRenderObject;
18421
18442
  /**
@@ -18429,6 +18450,7 @@ interface LuaRendering {
18429
18450
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18430
18451
  * @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
18431
18452
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18453
+ * @param table.tall Defaults to false.
18432
18454
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18433
18455
  * @example ```
18434
18456
  -- Draw a white and 1 pixel wide square outline with the corners {0, 0} and {2, 2}.
@@ -18449,6 +18471,7 @@ interface LuaRendering {
18449
18471
  visible?: boolean;
18450
18472
  draw_on_ground?: boolean;
18451
18473
  only_in_alt_mode?: boolean;
18474
+ tall?: boolean;
18452
18475
  render_mode?: ScriptRenderMode;
18453
18476
  }): LuaRenderObject;
18454
18477
  /**
@@ -18467,6 +18490,7 @@ interface LuaRendering {
18467
18490
  * @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
18468
18491
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
18469
18492
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18493
+ * @param table.tall Defaults to false.
18470
18494
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18471
18495
  * @param table.light_mode Whether this object should be rendered as a sprite, light or both at once. Defaults to "occluder".
18472
18496
  * @example ```
@@ -18496,6 +18520,7 @@ interface LuaRendering {
18496
18520
  players?: PlayerIdentification[];
18497
18521
  visible?: boolean;
18498
18522
  only_in_alt_mode?: boolean;
18523
+ tall?: boolean;
18499
18524
  render_mode?: ScriptRenderMode;
18500
18525
  light_mode?: ScriptSpriteLightMode;
18501
18526
  }): LuaRenderObject;
@@ -18516,6 +18541,7 @@ interface LuaRendering {
18516
18541
  * @param table.vertical_alignment Defaults to "top".
18517
18542
  * @param table.scale_with_zoom Defaults to false. If true, the text scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes.
18518
18543
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
18544
+ * @param table.tall Defaults to false.
18519
18545
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18520
18546
  * @param table.use_rich_text If rich text rendering is enabled. Defaults to false.
18521
18547
  */
@@ -18537,6 +18563,7 @@ interface LuaRendering {
18537
18563
  vertical_alignment?: VerticalTextAlign;
18538
18564
  scale_with_zoom?: boolean;
18539
18565
  only_in_alt_mode?: boolean;
18566
+ tall?: boolean;
18540
18567
  render_mode?: ScriptRenderMode;
18541
18568
  use_rich_text?: boolean;
18542
18569
  }): LuaRenderObject;
@@ -19348,6 +19375,8 @@ interface LuaSpaceConnectionPrototype extends LuaPrototypeBase {
19348
19375
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
19349
19376
  */
19350
19377
  readonly object_name: string;
19378
+ readonly origin: MapPosition;
19379
+ readonly shape: 'arc' | 'line';
19351
19380
  readonly to: LuaSpaceLocationPrototype;
19352
19381
  /**
19353
19382
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
@@ -19378,6 +19407,7 @@ interface LuaSpaceLocationPrototype extends LuaPrototypeBase {
19378
19407
  */
19379
19408
  readonly object_name: string;
19380
19409
  readonly orientation: RealOrientation;
19410
+ readonly origin: MapPosition;
19381
19411
  readonly parked_platforms_orientation: RealOrientation;
19382
19412
  readonly parked_platforms_position: MapPosition;
19383
19413
  readonly player_effects?: TriggerItem[];
@@ -19730,7 +19760,7 @@ interface LuaStyle {
19730
19760
  font: string;
19731
19761
  font_color: Color;
19732
19762
  /**
19733
- * Gui of the {@link LuaGuiElement | runtime:LuaGuiElement} of this style.
19763
+ * GUI of the {@link LuaGuiElement | runtime:LuaGuiElement} of this style.
19734
19764
  */
19735
19765
  readonly gui: LuaGui;
19736
19766
  /**
@@ -22867,6 +22897,16 @@ interface LuaTransportLine {
22867
22897
  * @param item If not specified, count all items.
22868
22898
  */
22869
22899
  get_item_count(this: void, item?: ItemFilter): uint32;
22900
+ /**
22901
+ * Gives position of the selected item on this transport line.
22902
+ * @param index Index of the item. Allowed values are from 1 up to #len.
22903
+ * @returns [0] - Linear position of the item along the transport line
22904
+ * @returns [1] - Map position of the item
22905
+ */
22906
+ get_item_position(this: void, index: uint32): LuaMultiReturn<[
22907
+ float,
22908
+ MapPosition
22909
+ ]>;
22870
22910
  /**
22871
22911
  * Get a map position related to a position on a transport line.
22872
22912
  * @param position Linear position along the transport line. Clamped to the transport line range.
@@ -2,7 +2,7 @@
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.1.17
5
+ // Factorio version 2.1.20
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -1188,6 +1188,22 @@ interface BlueprintEntityWall extends BaseBlueprintEntity {
1188
1188
  interface BlueprintEquipment {
1189
1189
  equipment: EquipmentWithQualityID;
1190
1190
  position: EquipmentPosition;
1191
+ /**
1192
+ * Only used for equipment of type `"electric-energy-interface-equipment"`.
1193
+ */
1194
+ power_production?: double;
1195
+ /**
1196
+ * Only used for equipment of type `"electric-energy-interface-equipment"`.
1197
+ */
1198
+ power_usage?: double;
1199
+ /**
1200
+ * Only used for equipment of type `"electric-energy-interface-equipment"`.
1201
+ */
1202
+ buffer_size?: double;
1203
+ /**
1204
+ * Only used for equipment of type `"generator-equipment"` that has a burner energy source.
1205
+ */
1206
+ burner_fuel_inventory?: BlueprintInventoryWithFilters;
1191
1207
  }
1192
1208
  interface BlueprintInfinityInventorySettings {
1193
1209
  filters?: InfinityInventoryFilter[];
@@ -7084,7 +7100,7 @@ interface MapLocation {
7084
7100
  direction: defines.direction;
7085
7101
  }
7086
7102
  /**
7087
- * Coordinates on a surface, for example of an entity. MapPositions may be specified either as a dictionary with `x`, `y` as keys, or simply as an array with two elements.
7103
+ * Coordinates on a surface, for example of an entity. MapPositions may be specified either as a dictionary with `x`, `y` as keys, or simply as an array with two elements. When reading this is always a dictionary.
7088
7104
  *
7089
7105
  * The coordinates are saved as a fixed-size 32 bit integer, with 8 bits reserved for decimal precision, meaning the smallest value step is `1/2^8 = 0.00390625` tiles.
7090
7106
  * @example ```
@@ -7378,48 +7394,6 @@ interface OldTileAndPosition {
7378
7394
  old_tile: LuaTilePrototype;
7379
7395
  position: TilePosition;
7380
7396
  }
7381
- interface OnRecipeCraftedData {
7382
- /**
7383
- * Identifier of the event.
7384
- */
7385
- name: defines.events;
7386
- /**
7387
- * Tick the event was generated.
7388
- */
7389
- tick: MapTick;
7390
- /**
7391
- * Entity that crafted recipe.
7392
- */
7393
- entity: LuaEntity;
7394
- /**
7395
- * Name of recipe that was crafted.
7396
- */
7397
- recipe: string;
7398
- /**
7399
- * Quality of the recipe crafted.
7400
- */
7401
- recipe_quality: string;
7402
- /**
7403
- * Quality effect used when giving products. Not provided if value is 0. May be different than value obtained from {@link LuaEntity::effects | runtime:LuaEntity::effects} when quality modules were changed between craft starting and products being given.
7404
- */
7405
- quality_effect?: EffectValue;
7406
- /**
7407
- * Random value in range [0, 1) that was used when selecting product quality. Only provided when quality_effect is provided.
7408
- */
7409
- quality_seed?: double;
7410
- /**
7411
- * Quality of products given. May be different than recipe quality if quality modules are present. Always provided even if quality_effect is zero because {@link LuaEntity::result_quality | runtime:LuaEntity::result_quality} may have been used. Only used by products without quality control.
7412
- */
7413
- product_quality: string;
7414
- /**
7415
- * If crafted as part of bonus products.
7416
- */
7417
- bonus: boolean;
7418
- /**
7419
- * Random value in range {@link 0, 1) used as part of shared roll when giving products. Related to [ProductPrototypeBase::shared_probability | prototype:ProductPrototypeBase::shared_probability}.
7420
- */
7421
- shared_roll: double;
7422
- }
7423
7397
  interface OrientedCliffPrototypeSet {
7424
7398
  west_to_east: BoundingBox;
7425
7399
  north_to_south: BoundingBox;
@@ -7868,10 +7842,6 @@ interface PollutionMapSettings {
7868
7842
  * Defaults to `10`.
7869
7843
  */
7870
7844
  pollution_restored_per_tree_damage: double;
7871
- /**
7872
- * Defaults to `20`.
7873
- */
7874
- max_pollution_to_restore_trees: double;
7875
7845
  /**
7876
7846
  * Defaults to `1`.
7877
7847
  */
@@ -7939,9 +7909,11 @@ interface ProcessionTimeline {
7939
7909
  ```
7940
7910
  * @example ```
7941
7911
  -- Products of the "advanced-oil-processing" recipe
7942
- {{type="fluid", name="heavy-oil", amount=1},
7943
- {type="fluid", name="light-oil", amount=4.5},
7944
- {type="fluid", name="petroleum-gas", amount=5.5}}
7912
+ {
7913
+ {type = "fluid", name = "heavy-oil", amount = 25},
7914
+ {type = "fluid", name = "light-oil", amount = 45},
7915
+ {type = "fluid", name = "petroleum-gas", amount = 55}
7916
+ }
7945
7917
  ```
7946
7918
  * @example ```
7947
7919
  -- What a custom recipe would look like that had a probability of 0.5 to return a
@@ -11918,7 +11890,25 @@ interface UndoRedoActionWireRemoved extends BaseUndoRedoAction {
11918
11890
  interface UndoRedoEquipment {
11919
11891
  id: EquipmentWithQualityID;
11920
11892
  position: EquipmentPosition;
11921
- settings: PropertyTree;
11893
+ settings: UndoRedoEquipmentSettings;
11894
+ }
11895
+ interface UndoRedoEquipmentSettings {
11896
+ /**
11897
+ * Only used for equipment of type `"electric-energy-interface-equipment"`.
11898
+ */
11899
+ power_production?: double;
11900
+ /**
11901
+ * Only used for equipment of type `"electric-energy-interface-equipment"`.
11902
+ */
11903
+ power_usage?: double;
11904
+ /**
11905
+ * Only used for equipment of type `"electric-energy-interface-equipment"`.
11906
+ */
11907
+ buffer_size?: double;
11908
+ /**
11909
+ * Only used for equipment of type `"generator-equipment"` that has a burner energy source.
11910
+ */
11911
+ burner_fuel_inventory?: BlueprintInventoryWithFilters;
11922
11912
  }
11923
11913
  interface UnitAISettings {
11924
11914
  /**
@@ -12113,8 +12103,6 @@ interface UtilityConstants {
12113
12103
  logistic_gui_selected_network_highlight_tint: Color;
12114
12104
  chart_search_highlight: Color;
12115
12105
  selected_chart_search_highlight: Color;
12116
- zoom_to_world_can_use_nightvision: boolean;
12117
- zoom_to_world_effect_strength: float;
12118
12106
  max_logistic_filter_count: LogisticFilterIndex;
12119
12107
  /**
12120
12108
  * Will be clamped to the range [1, 100].
@@ -12180,7 +12168,6 @@ interface UtilityConstants {
12180
12168
  */
12181
12169
  merge_bonus_gui_production_bonuses?: boolean;
12182
12170
  daytime_color_lookup: DaytimeColorLookupTable;
12183
- zoom_to_world_daytime_color_lookup: DaytimeColorLookupTable;
12184
12171
  frozen_color_lookup: ColorLookupTable;
12185
12172
  default_platform_surface_render_parameters: SurfaceRenderParameters;
12186
12173
  drop_item_radius: double;