factorio-types 1.2.33 → 1.2.35

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.0.47
5
+ // Factorio version 2.0.50
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -4714,7 +4714,7 @@ interface LuaCommandable {
4714
4714
  */
4715
4715
  readonly is_entity: boolean;
4716
4716
  /**
4717
- * Whether this unit group is controlled by a script or by the game engine. This can be changed using {@link LuaCommandable::set_autonomous | runtime:LuaCommandable::set_autonomous}.
4717
+ * Whether this unit group is controlled by a script or by the game engine. This can be changed using {@link LuaCommandable::set_autonomous | runtime:LuaCommandable::set_autonomous}. Units created by {@link LuaSurface::create_unit_group | runtime:LuaSurface::create_unit_group} are considered script-driven.
4718
4718
  */
4719
4719
  readonly is_script_driven: boolean;
4720
4720
  /**
@@ -4899,6 +4899,10 @@ interface LuaControl {
4899
4899
  * @returns The inventory or `nil` if none with the given index was found.
4900
4900
  */
4901
4901
  get_inventory(this: void, inventory: defines.inventory): LuaInventory | null;
4902
+ /**
4903
+ * Get name of inventory. Names match keys of {@link defines.inventory | runtime:defines.inventory}.
4904
+ */
4905
+ get_inventory_name(this: void, inventory: defines.inventory): string | null;
4902
4906
  /**
4903
4907
  * Get the number of all or some items in this entity.
4904
4908
  * @param item The item to count. If not specified, count all items.
@@ -5957,6 +5961,15 @@ interface LuaEntity extends LuaControl {
5957
5961
  * @param fluid Prototype name of the fluid to count. If not specified, count all fluids.
5958
5962
  */
5959
5963
  get_fluid_count(this: void, fluid?: string): double;
5964
+ /**
5965
+ * Checks what is expected fluid to be produced from the offshore pump's source tile. It accounts for visible tile, hidden tile and double hidden tile. It ignores currently set fluid box filter.
5966
+ * @returns Name of fluid that should be produced by this offshore pump based on existing tiles.
5967
+ */
5968
+ get_fluid_source_fluid(this: void): string | null;
5969
+ /**
5970
+ * Gives TilePosition of a tile which this offshore pump uses to check what fluid should be produced.
5971
+ */
5972
+ get_fluid_source_tile(this: void): TilePosition;
5960
5973
  /**
5961
5974
  * The fuel inventory for this entity or `nil` if this entity doesn't have a fuel inventory.
5962
5975
  */
@@ -5983,6 +5996,10 @@ interface LuaEntity extends LuaControl {
5983
5996
  * Gets the filter for this infinity pipe, or `nil` if the filter is empty.
5984
5997
  */
5985
5998
  get_infinity_pipe_filter(this: void): InfinityPipeFilter | null;
5999
+ /**
6000
+ * Gets the inventory size override of the selected inventory if size override was set using {@link set_inventory_size_override | runtime:LuaEntity::set_inventory_size_override}.
6001
+ */
6002
+ get_inventory_size_override(this: void, inventory_index: defines.inventory): uint16 | null;
5986
6003
  /**
5987
6004
  * Get an item insert specification onto a belt connectable: for a given map position provides into which line at what position item should be inserted to be closest to the provided position.
5988
6005
  * @param position Position where the item is to be inserted.
@@ -6239,9 +6256,10 @@ interface LuaEntity extends LuaControl {
6239
6256
  */
6240
6257
  is_registered_for_upgrade(this: void): boolean;
6241
6258
  /**
6259
+ * @param character If provided, must be of `character` type.
6242
6260
  * @returns `true` if the rocket was successfully launched. Return value of `false` means the silo is not ready for launch.
6243
6261
  */
6244
- launch_rocket(this: void, destination?: CargoDestination): boolean;
6262
+ launch_rocket(this: void, destination?: CargoDestination, character?: LuaEntity): boolean;
6245
6263
  /**
6246
6264
  * Mines this entity.
6247
6265
  *
@@ -6394,6 +6412,11 @@ interface LuaEntity extends LuaControl {
6394
6412
  * @param filter The new filter, or `nil` to clear the filter.
6395
6413
  */
6396
6414
  set_infinity_pipe_filter(this: void, filter: InfinityPipeFilter | nil): void;
6415
+ /**
6416
+ * Sets inventory size override. When set, supported entity will ignore inventory size from prototype and will instead keep inventory size equal to the override. Setting `nil` will restore default inventory size.
6417
+ * @param overflow Items that would be deleted due to change of inventory size will be transferred to this inventory. Must be a script inventory or inventory of other entity. Inventory references obtained from proxy container are not allowed.
6418
+ */
6419
+ set_inventory_size_override(this: void, inventory_index: defines.inventory, size_override: uint16 | nil, overflow?: LuaInventory): void;
6397
6420
  /**
6398
6421
  * Sets the passenger of this car or spidertron.
6399
6422
  *
@@ -6503,11 +6526,18 @@ interface LuaEntity extends LuaControl {
6503
6526
  *
6504
6527
  * The player will be automatically disassociated when a controller is set on the character. Also, all characters associated to a player will be logged off when the player logs off in multiplayer.
6505
6528
  *
6506
- * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
6529
+ * A character associated with a player is not directly controlled by any player.
6530
+ */
6531
+ readonly associated_player?: LuaPlayer;
6532
+ /**
6533
+ * The player this character is associated with, if any. Set to `nil` to clear.
6534
+ *
6535
+ * The player will be automatically disassociated when a controller is set on the character. Also, all characters associated to a player will be logged off when the player logs off in multiplayer.
6507
6536
  *
6508
6537
  * A character associated with a player is not directly controlled by any player.
6538
+ * @customName associated_player
6509
6539
  */
6510
- associated_player?: LuaPlayer | PlayerIdentification;
6540
+ associated_player_write?: PlayerIdentification;
6511
6541
  /**
6512
6542
  * The cargo pod attached to this rocket silo rocket if any.
6513
6543
  */
@@ -6571,6 +6601,10 @@ interface LuaEntity extends LuaControl {
6571
6601
  * The burner energy source for this entity, if any.
6572
6602
  */
6573
6603
  readonly burner?: LuaBurner;
6604
+ /**
6605
+ * The space platform hub or cargo landing pad this cargo bay is connected to if any.
6606
+ */
6607
+ readonly cargo_bay_connection_owner?: LuaEntity;
6574
6608
  /**
6575
6609
  * The cargo hatches owned by this entity if any.
6576
6610
  */
@@ -6673,6 +6707,10 @@ interface LuaEntity extends LuaControl {
6673
6707
  * Destination of the crane of this entity in 3D. Throws when trying to set the destination out of range.
6674
6708
  */
6675
6709
  crane_destination_3d: Vector3D;
6710
+ /**
6711
+ * Returns current position in 3D for the end of the crane of this entity.
6712
+ */
6713
+ readonly crane_end_position_3d: Vector3D;
6676
6714
  /**
6677
6715
  * Will set destination for the grappler of crane of this entity. The crane grappler will start moving to reach the destination, but the rest of the arm will remain stationary. Throws when trying to set the destination out of range.
6678
6716
  */
@@ -6957,10 +6995,13 @@ interface LuaEntity extends LuaControl {
6957
6995
  kills: uint;
6958
6996
  /**
6959
6997
  * The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. `nil` if the last user is not part of the save anymore.
6960
- *
6961
- * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
6962
6998
  */
6963
- last_user?: LuaPlayer | PlayerIdentification;
6999
+ readonly last_user?: LuaPlayer;
7000
+ /**
7001
+ * The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. `nil` if the last user is not part of the save anymore.
7002
+ * @customName last_user
7003
+ */
7004
+ last_user_write?: PlayerIdentification;
6964
7005
  /**
6965
7006
  * The link ID this linked container is using.
6966
7007
  */
@@ -7076,6 +7117,10 @@ interface LuaEntity extends LuaControl {
7076
7117
  * The smooth orientation of this entity.
7077
7118
  */
7078
7119
  orientation: RealOrientation;
7120
+ /**
7121
+ * Plants registered by this agricultural tower. One plant can be registered in multiple agricultural towers.
7122
+ */
7123
+ readonly owned_plants: LuaEntity[];
7079
7124
  parameters: ProgrammableSpeakerParameters;
7080
7125
  /**
7081
7126
  * Where the inserter will pick up items from.
@@ -7179,10 +7224,13 @@ interface LuaEntity extends LuaControl {
7179
7224
  remove_unfiltered_items: boolean;
7180
7225
  /**
7181
7226
  * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, or `highlight-box` is visible to. `nil` when this entity is rendered for all players.
7182
- *
7183
- * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
7184
7227
  */
7185
- render_player?: LuaPlayer | PlayerIdentification;
7228
+ readonly render_player?: LuaPlayer;
7229
+ /**
7230
+ * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, or `highlight-box` is visible to. `nil` when this entity is rendered for all players.
7231
+ * @customName render_player
7232
+ */
7233
+ render_player_write?: PlayerIdentification;
7186
7234
  /**
7187
7235
  * The forces that this `simple-entity-with-owner` or `simple-entity-with-force` is visible to. `nil` or an empty array when this entity is rendered for all forces.
7188
7236
  *
@@ -7438,10 +7486,22 @@ interface LuaEntity extends LuaControl {
7438
7486
  * This has no effect if the prototype does not support filters.
7439
7487
  */
7440
7488
  use_filters: boolean;
7489
+ /**
7490
+ * When true, the rocket silo will request items for space platforms in orbit.
7491
+ *
7492
+ * Setting the value will have no effect when the silo doesn't support logistics.
7493
+ */
7494
+ use_transitional_requests: boolean;
7441
7495
  /**
7442
7496
  * 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.
7443
7497
  */
7444
7498
  readonly valid: boolean;
7499
+ /**
7500
+ * The threshold override of this valve, or `nil` if an override is not defined.
7501
+ *
7502
+ * If no override is defined, the threshold is taken from {@link LuaEntityPrototype::valve_threshold | runtime:LuaEntityPrototype::valve_threshold}.
7503
+ */
7504
+ valve_threshold_override?: float;
7445
7505
  /**
7446
7506
  * Read when this spidertron auto-targets enemies
7447
7507
  */
@@ -7519,6 +7579,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7519
7579
  * The supply area of this electric pole or beacon prototype.
7520
7580
  */
7521
7581
  get_supply_area_distance(this: void, quality?: QualityID): double;
7582
+ /**
7583
+ * The maximum flow rate through this valve.
7584
+ */
7585
+ get_valve_flow_rate(this: void, quality?: QualityID): double;
7522
7586
  /**
7523
7587
  * Test whether this entity prototype has a certain flag set.
7524
7588
  * @param flag The flag to test.
@@ -7529,6 +7593,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7529
7593
  * 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.
7530
7594
  */
7531
7595
  readonly absorptions_to_join_attack?: Record<string, float>;
7596
+ readonly accepted_seeds?: string[];
7532
7597
  /**
7533
7598
  * The active energy usage of this rocket silo or combinator prototype.
7534
7599
  */
@@ -7541,6 +7606,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7541
7606
  * Whether this unit prototype is affected by tile walking speed modifiers.
7542
7607
  */
7543
7608
  readonly affected_by_tiles?: boolean;
7609
+ readonly agricultural_tower_radius?: double;
7544
7610
  /**
7545
7611
  * The air resistance of this rolling stock prototype.
7546
7612
  */
@@ -7731,6 +7797,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7731
7797
  * The value in the dictionary is meaningless and exists just to allow for easy lookup.
7732
7798
  */
7733
7799
  readonly crafting_categories?: Record<string, true>;
7800
+ /**
7801
+ * The crane energy usage of this agricultural tower prototype.
7802
+ */
7803
+ readonly crane_energy_usage?: double;
7734
7804
  /**
7735
7805
  * If this prototype will attempt to create a ghost of itself on death.
7736
7806
  *
@@ -7884,6 +7954,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7884
7954
  * The fluid energy source prototype this entity uses, if any.
7885
7955
  */
7886
7956
  readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype;
7957
+ readonly fluid_source_offset?: Vector;
7887
7958
  /**
7888
7959
  * 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.
7889
7960
  */
@@ -7912,6 +7983,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7912
7983
  * The equipment grid prototype for this entity, if any.
7913
7984
  */
7914
7985
  readonly grid_prototype?: LuaEquipmentGridPrototype;
7986
+ readonly growth_area_radius?: double;
7915
7987
  readonly growth_grid_tile_size?: uint;
7916
7988
  readonly growth_ticks?: uint;
7917
7989
  /**
@@ -8055,6 +8127,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8055
8127
  * The lamp energy usage of this rocket silo prototype.
8056
8128
  */
8057
8129
  readonly lamp_energy_usage?: double;
8130
+ readonly launch_to_space_platforms?: boolean;
8058
8131
  /**
8059
8132
  * The rocket launch delay for this rocket silo prototype.
8060
8133
  */
@@ -8342,6 +8415,9 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8342
8415
  * The cursor size used when shooting at this entity.
8343
8416
  */
8344
8417
  readonly shooting_cursor_size: float;
8418
+ readonly solar_panel_performance_at_day: double;
8419
+ readonly solar_panel_performance_at_night: double;
8420
+ readonly solar_panel_solar_coefficient_property: LuaSurfacePropertyPrototype;
8345
8421
  /**
8346
8422
  * The spawning cooldown for this enemy spawner prototype.
8347
8423
  */
@@ -8456,6 +8532,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8456
8532
  * 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.
8457
8533
  */
8458
8534
  readonly valid: boolean;
8535
+ /**
8536
+ * The mode of operation of this valve.
8537
+ */
8538
+ readonly valve_mode?: ValveMode;
8539
+ /**
8540
+ * The default threshold of this valve.
8541
+ */
8542
+ readonly valve_threshold?: float;
8459
8543
  readonly vector_to_place_result?: Vector;
8460
8544
  /**
8461
8545
  * Vertical selection shift used by rolling stocks. It affects selection box vertical position but is also used to shift rolling stock graphics along the rails to fine tune train's look.
@@ -8513,7 +8597,7 @@ interface LuaEquipment {
8513
8597
  */
8514
8598
  readonly max_energy: double;
8515
8599
  /**
8516
- * Maximum shield value.
8600
+ * Maximum shield value. `0` if this equipment doesn't have a shield.
8517
8601
  */
8518
8602
  readonly max_shield: double;
8519
8603
  /**
@@ -8549,9 +8633,9 @@ interface LuaEquipment {
8549
8633
  height: uint;
8550
8634
  };
8551
8635
  /**
8552
- * Current shield value of the equipment.
8636
+ * Current shield value of the equipment. Can't be set higher than {@link LuaEquipment::max_shield | runtime:LuaEquipment::max_shield}.
8553
8637
  *
8554
- * Can't be set higher than {@link LuaEquipment::max_shield | runtime:LuaEquipment::max_shield}.
8638
+ * Trying to write this value on non-shield equipment will throw an error.
8555
8639
  */
8556
8640
  shield: double;
8557
8641
  /**
@@ -8997,7 +9081,7 @@ interface LuaFluidBox {
8997
9081
  */
8998
9082
  flush(this: void, index: uint, fluid?: FluidID): Record<string, float>;
8999
9083
  /**
9000
- * The capacity of the given fluidbox index.
9084
+ * The capacity of the given fluidbox segment.
9001
9085
  */
9002
9086
  get_capacity(this: void, index: uint): double;
9003
9087
  /**
@@ -9012,6 +9096,8 @@ interface LuaFluidBox {
9012
9096
  get_filter(this: void, index: uint): FluidBoxFilter | null;
9013
9097
  /**
9014
9098
  * Gets counts of all fluids in the fluid segment. May return `nil` for fluid wagon, fluid turret's internal buffer, or a fluidbox which does not belong to a fluid segment.
9099
+ *
9100
+ * Note that this method only ever returns one fluid, since fluids can't be mixed anymore.
9015
9101
  * @returns The counts, indexed by fluid name.
9016
9102
  */
9017
9103
  get_fluid_segment_contents(this: void, index: uint): Record<string, uint> | null;
@@ -9482,17 +9568,9 @@ interface LuaForce {
9482
9568
  * Play a sound for every player in this force.
9483
9569
  *
9484
9570
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this force.
9485
- * @param table.path The sound to play.
9486
- * @param table.position Where the sound should be played. If not given, it's played globally on each player's controller's surface.
9487
- * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
9488
- * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
9571
+ * @param sound_specification The sound to play.
9489
9572
  */
9490
- play_sound(this: void, table: {
9491
- path: SoundPath;
9492
- position?: MapPosition;
9493
- volume_modifier?: double;
9494
- override_sound_type?: SoundType;
9495
- }): void;
9573
+ play_sound(this: void, sound_specification: PlaySoundSpecification): void;
9496
9574
  /**
9497
9575
  * Print text to the chat console of all players on this force.
9498
9576
  *
@@ -10028,17 +10106,9 @@ interface LuaGameScript {
10028
10106
  * Play a sound for every player in the game.
10029
10107
  *
10030
10108
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
10031
- * @param table.path The sound to play.
10032
- * @param table.position Where the sound should be played. If not given, it's played globally on each player's controller's surface.
10033
- * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
10034
- * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
10109
+ * @param sound_specification The sound to play.
10035
10110
  */
10036
- play_sound(this: void, table: {
10037
- path: SoundPath;
10038
- position?: MapPosition;
10039
- volume_modifier?: double;
10040
- override_sound_type?: SoundType;
10041
- }): void;
10111
+ play_sound(this: void, sound_specification: PlaySoundSpecification): void;
10042
10112
  /**
10043
10113
  * Print text to the chat console all players.
10044
10114
  *
@@ -10356,10 +10426,10 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
10356
10426
  * @example ```
10357
10427
  -- Tell an entity to be active (for example a lamp to be lit) when it receives a
10358
10428
  -- circuit signal of more than 4 chain signals.
10359
- a_behavior.circuit_condition = {condition={
10429
+ a_behavior.circuit_condition = {
10360
10430
  comparator=">",
10361
10431
  first_signal={type="item", name="rail-chain-signal"},
10362
- constant=4}
10432
+ constant=4
10363
10433
  }
10364
10434
  ```
10365
10435
  */
@@ -10381,10 +10451,10 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
10381
10451
  * @example ```
10382
10452
  -- Tell an entity to be active (for example a lamp to be lit) when the logistics
10383
10453
  -- network it's connected to has more than four chain signals.
10384
- a_behavior.logistic_condition = {condition={
10454
+ a_behavior.logistic_condition = {
10385
10455
  comparator=">",
10386
10456
  first_signal={type="item", name="rail-chain-signal"},
10387
- constant=4}
10457
+ constant=4
10388
10458
  }
10389
10459
  ```
10390
10460
  */
@@ -10889,6 +10959,15 @@ interface LuaGuiElement {
10889
10959
  * The position this camera or minimap is focused on, if any.
10890
10960
  */
10891
10961
  position: MapPosition;
10962
+ /**
10963
+ * The quality to be shown in the bottom left corner of this sprite-button, or `nil` to show nothing.
10964
+ */
10965
+ readonly quality?: LuaQualityPrototype;
10966
+ /**
10967
+ * The quality to be shown in the bottom left corner of this sprite-button, or `nil` to show nothing.
10968
+ * @customName quality
10969
+ */
10970
+ quality_write?: QualityID;
10892
10971
  /**
10893
10972
  * Whether this element will raise {@link on_gui_hover | runtime:on_gui_hover} and {@link on_gui_leave | runtime:on_gui_leave}.
10894
10973
  */
@@ -11438,6 +11517,10 @@ interface LuaGuiElementAddParamsSpriteButton extends BaseLuaGuiElementAddParams
11438
11517
  * The number shown on the button.
11439
11518
  */
11440
11519
  'number'?: double;
11520
+ /**
11521
+ * The name of the quality shown on the button.
11522
+ */
11523
+ 'quality'?: string;
11441
11524
  /**
11442
11525
  * Formats small numbers as percentages. Defaults to `false`.
11443
11526
  */
@@ -11903,6 +11986,10 @@ interface LuaInventory {
11903
11986
  * The mod that owns this inventory, if any.
11904
11987
  */
11905
11988
  readonly mod_owner?: string;
11989
+ /**
11990
+ * Name of this inventory, if any. Names match keys of {@link defines.inventory | runtime:defines.inventory}.
11991
+ */
11992
+ readonly name?: string;
11906
11993
  /**
11907
11994
  * 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.
11908
11995
  */
@@ -12160,7 +12247,7 @@ interface LuaItemCommon {
12160
12247
  *
12161
12248
  * In contrast to {@link LuaItemCommon::get_mapper | runtime:LuaItemCommon::get_mapper}, indices past the upgrade item's current size are valid and expand the list of mappings accordingly, if within reasonable bounds.
12162
12249
  * @param index The index of the mapper to set.
12163
- * @param mapper The mapper to set or `nil`
12250
+ * @param mapper The mapper to set. Set `nil` to clear the mapper.
12164
12251
  */
12165
12252
  set_mapper(this: void, index: uint, type: 'from' | 'to', mapper: UpgradeMapperSource | UpgradeMapperDestination | nil): void;
12166
12253
  /**
@@ -13855,17 +13942,9 @@ interface LuaPlayer extends LuaControl {
13855
13942
  * Play a sound for this player.
13856
13943
  *
13857
13944
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this player.
13858
- * @param table.path The sound to play.
13859
- * @param table.position Where the sound should be played. If not given, it's played globally on the player's controller's surface.
13860
- * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
13861
- * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
13945
+ * @param sound_specification The sound to play.
13862
13946
  */
13863
- play_sound(this: void, table: {
13864
- path: SoundPath;
13865
- position?: MapPosition;
13866
- volume_modifier?: double;
13867
- override_sound_type?: SoundType;
13868
- }): void;
13947
+ play_sound(this: void, sound_specification: PlaySoundSpecification): void;
13869
13948
  /**
13870
13949
  * Print text to the chat console.
13871
13950
  *
@@ -14942,10 +15021,19 @@ interface LuaReactorControlBehavior extends LuaControlBehavior {
14942
15021
  * A crafting recipe. Recipes belong to forces (see {@link LuaForce | runtime:LuaForce}) because some recipes are unlocked by research, and researches are per-force.
14943
15022
  */
14944
15023
  interface LuaRecipe {
15024
+ /**
15025
+ * Checks if recipe has given category
15026
+ * @returns `true` if recipe has this category.
15027
+ */
15028
+ has_category(this: void, category: RecipeCategoryID): boolean;
14945
15029
  /**
14946
15030
  * Reload the recipe from the prototype.
14947
15031
  */
14948
15032
  reload(this: void): void;
15033
+ /**
15034
+ * Additional categories of this recipe.
15035
+ */
15036
+ readonly additional_categories: string[];
14949
15037
  /**
14950
15038
  * Category of the recipe.
14951
15039
  */
@@ -15041,6 +15129,15 @@ interface LuaRecipeCategoryPrototype extends LuaPrototypeBase {
15041
15129
  * A crafting recipe prototype.
15042
15130
  */
15043
15131
  interface LuaRecipePrototype extends LuaPrototypeBase {
15132
+ /**
15133
+ * Checks if recipe has given category
15134
+ * @returns `true` if recipe has this category.
15135
+ */
15136
+ has_category(this: void, category: RecipeCategoryID): boolean;
15137
+ /**
15138
+ * Additional categories of the recipe.
15139
+ */
15140
+ readonly additional_categories: string[];
15044
15141
  /**
15045
15142
  * If this recipe is enabled for the purpose of intermediate hand-crafting.
15046
15143
  */
@@ -15151,6 +15248,8 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
15151
15248
  * The multiplier used when this recipe is copied from an assembling machine to a requester chest. For each item in the recipe the item count * this value is set in the requester chest.
15152
15249
  */
15153
15250
  readonly request_paste_multiplier: uint;
15251
+ readonly reset_freshness_on_craft: boolean;
15252
+ readonly result_is_always_fresh: boolean;
15154
15253
  /**
15155
15254
  * If the amount is shown in the recipe tooltip title when the recipe produces more than 1 product.
15156
15255
  */
@@ -15305,9 +15404,8 @@ interface LuaRecord {
15305
15404
  *
15306
15405
  * In contrast to {@link LuaRecord::set_mapper | runtime:LuaRecord::set_mapper}, indices past the upgrade item's current size are considered to be out of bounds.
15307
15406
  * @param index The index of the mapper to read.
15308
- * @param type `"from"` or `"to"`.
15309
15407
  */
15310
- get_mapper(this: void, index: uint, type: string): UpgradeMapperSource | UpgradeMapperDestination;
15408
+ get_mapper(this: void, index: uint, type: 'from' | 'to'): UpgradeMapperSource | UpgradeMapperDestination;
15311
15409
  /**
15312
15410
  * Gets the tile filter at the given index for this deconstruction planner.
15313
15411
  */
@@ -15349,10 +15447,9 @@ interface LuaRecord {
15349
15447
  *
15350
15448
  * In contrast to {@link LuaRecord::get_mapper | runtime:LuaRecord::get_mapper}, indices past the upgrade item's current size are valid and expand the list of mappings accordingly, if within reasonable bounds.
15351
15449
  * @param index The index of the mapper to set.
15352
- * @param type `"from"` or `"to"`.
15353
- * @param mapper The mapper to set or `nil`
15450
+ * @param mapper The mapper to set. Set `nil` to clear the mapper.
15354
15451
  */
15355
- set_mapper(this: void, index: uint, type: string, mapper: UpgradeMapperSource | UpgradeMapperDestination): void;
15452
+ set_mapper(this: void, index: uint, type: 'from' | 'to', mapper: UpgradeMapperSource | UpgradeMapperDestination | nil): void;
15356
15453
  /**
15357
15454
  * Sets the tile filter at the given index for this deconstruction planner.
15358
15455
  * @param filter Setting to nil erases the filter.
@@ -16372,6 +16469,7 @@ interface LuaSimulation {
16372
16469
  */
16373
16470
  deactivate_rail_planner(this: void): void;
16374
16471
  /**
16472
+ * @param table.slot_index This index is 0-based, unlike other inventory indices.
16375
16473
  * @param table.inventory Defaults to `"character"`.
16376
16474
  * @returns Position of the GUI slot on the screen, if successfully found.
16377
16475
  */
@@ -16513,6 +16611,10 @@ interface LuaSpacePlatform {
16513
16611
  * Cancels deletion of this space platform if it was scheduled for deletion.
16514
16612
  */
16515
16613
  cancel_deletion(this: void): void;
16614
+ /**
16615
+ * Removes all ejected items from this space platform.
16616
+ */
16617
+ clear_ejected_items(this: void): void;
16516
16618
  /**
16517
16619
  * Creates the given asteroid chunks on this platform.
16518
16620
  */
@@ -16541,6 +16643,13 @@ interface LuaSpacePlatform {
16541
16643
  limit?: uint;
16542
16644
  invert?: boolean;
16543
16645
  }): void;
16646
+ /**
16647
+ * Ejects an item into space on this space platform.
16648
+ *
16649
+ * If a LuaItemStack is provided, the actual item is ejected and removed from the source.
16650
+ * @param movement When inserters drop items into space, the {@link InserterPrototype::insert_position | prototype:InserterPrototype::insert_position} rotated to the inserter direction is used.
16651
+ */
16652
+ eject_item(this: void, item: ItemStackIdentification, position: MapPosition, movement: Vector): void;
16544
16653
  /**
16545
16654
  * Find asteroid chunks of a given name in a given area.
16546
16655
  *
@@ -16576,6 +16685,10 @@ interface LuaSpacePlatform {
16576
16685
  * It is represented as a number in range `[0, 1]`, with 0 being {@link LuaSpaceConnectionPrototype::from | runtime:LuaSpaceConnectionPrototype::from} and 1 being {@link LuaSpaceConnectionPrototype::to | runtime:LuaSpaceConnectionPrototype::to}.
16577
16686
  */
16578
16687
  distance?: double;
16688
+ /**
16689
+ * All items that have been thrown overboard.
16690
+ */
16691
+ readonly ejected_items: EjectedItem[];
16579
16692
  /**
16580
16693
  * The force of this space platform.
16581
16694
  */
@@ -17111,6 +17224,28 @@ interface LuaSurface {
17111
17224
  check_collision?: boolean;
17112
17225
  decoratives: Decorative[];
17113
17226
  }): void;
17227
+ /**
17228
+ * This method only works when used in simulations.
17229
+ *
17230
+ * Places entities via the given blueprint string. These entities are force-built.
17231
+ * @param table.string The blueprint string to import.
17232
+ * @param table.position The position to place the blueprint at.
17233
+ * @param table.force The force to place the blueprint for. Defaults to the player force.
17234
+ * @param table.direction The direction to place the blueprint in. Defaults to north.
17235
+ * @param table.flip_horizontal Whether to flip the blueprint horizontally. Defaults to `false`.
17236
+ * @param table.flip_vertical Whether to flip the blueprint vertically. Defaults to `false`.
17237
+ * @param table.by_player The player that placed the blueprint. Defaults to `nil`.
17238
+ * @returns If the blueprint string was invalid, `1` is returned. Otherwise, `nil` is returned.
17239
+ */
17240
+ create_entities_from_blueprint_string(this: void, table: {
17241
+ string: string;
17242
+ position: MapPosition;
17243
+ force?: ForceID;
17244
+ direction?: defines.direction;
17245
+ flip_horizontal?: boolean;
17246
+ flip_vertical?: boolean;
17247
+ by_player?: PlayerIdentification;
17248
+ }): int | null;
17114
17249
  /**
17115
17250
  * Create an entity on this surface.
17116
17251
  * @example ```
@@ -17530,17 +17665,9 @@ interface LuaSurface {
17530
17665
  * Play a sound for every player on this surface.
17531
17666
  *
17532
17667
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
17533
- * @param table.path The sound to play.
17534
- * @param table.position Where the sound should be played. If not given, it's played globally on this surface.
17535
- * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
17536
- * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
17668
+ * @param sound_specification The sound to play.
17537
17669
  */
17538
- play_sound(this: void, table: {
17539
- path: SoundPath;
17540
- position?: MapPosition;
17541
- volume_modifier?: double;
17542
- override_sound_type?: SoundType;
17543
- }): void;
17670
+ play_sound(this: void, sound_specification: PlaySoundSpecification): void;
17544
17671
  /**
17545
17672
  * Spawn pollution at the given position.
17546
17673
  * @param source Where to spawn the pollution.
@@ -17651,6 +17778,14 @@ interface LuaSurface {
17651
17778
  force?: ForceID;
17652
17779
  unit_search_distance?: uint;
17653
17780
  }): uint;
17781
+ /**
17782
+ * Set the pollution for a given position.
17783
+ *
17784
+ * Pollution changes by this are not included in pollution statistics and do not affect evolution factors (as opposed to {@link LuaSurface::pollute | runtime:LuaSurface::pollute}).
17785
+ * @param position The position to set the chunk's pollution
17786
+ * @param amount New amount of pollution to be set on the chunk. Must be >= 0.
17787
+ */
17788
+ set_pollution(this: void, position: MapPosition, amount: double): void;
17654
17789
  /**
17655
17790
  * Sets the value of surface property on this surface.
17656
17791
  * @param property Property to change.
@@ -17680,6 +17815,7 @@ interface LuaSurface {
17680
17815
  * @param table.allow_belts Whether items can be spilled onto belts. Defaults to `true`.
17681
17816
  * @param table.max_radius Max radius from the specified `position` to spill items.
17682
17817
  * @param table.use_start_position_on_failure Allow spilling items at `position` if no non-colliding position is found. Note: Setting to false might cause some items not to be spilled. Defaults to `true`.
17818
+ * @param table.drop_full_stack If item on ground should be made out of an entire provided stack. Defaults to `false`.
17683
17819
  * @returns The created item-on-ground entities.
17684
17820
  */
17685
17821
  spill_item_stack(this: void, table: {
@@ -17690,6 +17826,7 @@ interface LuaSurface {
17690
17826
  allow_belts?: boolean;
17691
17827
  max_radius?: double;
17692
17828
  use_start_position_on_failure?: boolean;
17829
+ drop_full_stack?: boolean;
17693
17830
  }): LuaEntity[];
17694
17831
  /**
17695
17832
  * Place an upgrade request.
@@ -17734,6 +17871,29 @@ interface LuaSurface {
17734
17871
  * Current time of day, as a number in range `[0, 1)`.
17735
17872
  */
17736
17873
  daytime: double;
17874
+ /**
17875
+ * Parameters of daytime. Equivalent as reading {@link dusk | runtime:LuaSurface::dusk}, {@link evening | runtime:LuaSurface::evening}, {@link morning | runtime:LuaSurface::morning} and {@link dawn | runtime:LuaSurface::dawn} at the same time.
17876
+ *
17877
+ * In order for a write to take place, a new table needs to be written in one go: changing individual members of the returned table has no effect as those are value copies.
17878
+ */
17879
+ daytime_parameters: {
17880
+ /**
17881
+ * Must be < evening.
17882
+ */
17883
+ dusk: double;
17884
+ /**
17885
+ * Must be > dusk and < morning.
17886
+ */
17887
+ evening: double;
17888
+ /**
17889
+ * Must be > evening and < dawn.
17890
+ */
17891
+ morning: double;
17892
+ /**
17893
+ * Must be > morning.
17894
+ */
17895
+ dawn: double;
17896
+ };
17737
17897
  /**
17738
17898
  * If this surface can be deleted.
17739
17899
  */
@@ -17755,9 +17915,13 @@ interface LuaSurface {
17755
17915
  */
17756
17916
  generate_with_lab_tiles: boolean;
17757
17917
  /**
17758
- * Surface-wide effects applied to entities with effect receivers. May be `nil` if surface is not using surface-wide effect source.
17918
+ * Surface-wide effects applied to entities with effect receivers. `nil` if this surface is not using surface-wide effect source.
17759
17919
  */
17760
17920
  global_effect?: ModuleEffects;
17921
+ /**
17922
+ * The global electric network statistics for this surface.
17923
+ */
17924
+ readonly global_electric_network_statistics?: LuaFlowStatistics;
17761
17925
  /**
17762
17926
  * Whether this surface currently has a global electric network.
17763
17927
  */
@@ -17817,6 +17981,10 @@ interface LuaSurface {
17817
17981
  * The type of pollutant enabled on the surface, or `nil` if no pollutant is enabled.
17818
17982
  */
17819
17983
  readonly pollutant_type?: LuaAirbornePollutantPrototype;
17984
+ /**
17985
+ * The pollution statistics for this surface.
17986
+ */
17987
+ readonly pollution_statistics: LuaFlowStatistics;
17820
17988
  /**
17821
17989
  * If clouds are shown on this surface. If false, clouds are never shown. If true the player must also have clouds enabled in graphics settings for them to be shown.
17822
17990
  */
@@ -18418,7 +18586,7 @@ interface LuaTechnology {
18418
18586
  /**
18419
18587
  * The types of ingredients that labs will require to research this technology.
18420
18588
  */
18421
- readonly research_unit_ingredients: Ingredient[];
18589
+ readonly research_unit_ingredients: ResearchIngredient[];
18422
18590
  /**
18423
18591
  * Has this technology been researched? Switching from `false` to `true` will trigger the technology advancement perks; switching from `true` to `false` will reverse them.
18424
18592
  */