factorio-types 1.2.24 → 1.2.26

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.33
5
+ // Factorio version 2.0.38
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -196,6 +196,10 @@ interface LuaAirbornePollutantPrototype extends LuaPrototypeBase {
196
196
  */
197
197
  interface LuaAmmoCategoryPrototype extends LuaPrototypeBase {
198
198
  readonly bonus_gui_order: string;
199
+ /**
200
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
201
+ */
202
+ readonly factoriopedia_alternative?: LuaAmmoCategoryPrototype;
199
203
  /**
200
204
  * 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.
201
205
  */
@@ -292,6 +296,10 @@ interface LuaAssemblingMachineControlBehavior extends LuaGenericOnOffControlBeha
292
296
  * Prototype of an asteroid chunk.
293
297
  */
294
298
  interface LuaAsteroidChunkPrototype extends LuaPrototypeBase {
299
+ /**
300
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
301
+ */
302
+ readonly factoriopedia_alternative?: LuaAsteroidChunkPrototype;
295
303
  readonly hide_from_signal_gui: boolean;
296
304
  readonly item_signal_alias?: LuaItemPrototype;
297
305
  readonly mineable_properties: MineableProperties;
@@ -563,6 +571,24 @@ interface LuaBootstrap {
563
571
  script.on_event(defines.events.on_built_entity,
564
572
  function(event) game.print("Gotta go fast!") end,
565
573
  {{filter = "name", name = "fast-inserter"}})
574
+ ```
575
+ */
576
+ on_event(this: void, event: defines.events.on_cargo_pod_delivered_cargo, handler: ((this: void, arg0: runtime.on_cargo_pod_delivered_cargo) => any) | nil, filters?: EventFilter): void;
577
+ /**
578
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
579
+ * @param event The event(s) or custom-input to invoke the handler on.
580
+ * @param handler The handler for this event. Passing `nil` will unregister it.
581
+ * @param filters The filters for this event. Can only be used when registering for individual events.
582
+ * @example ```
583
+ -- Register for the on_tick event to print the current tick to console each tick
584
+ script.on_event(defines.events.on_tick,
585
+ function(event) game.print(event.tick) end)
586
+ ```
587
+ * @example ```
588
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
589
+ script.on_event(defines.events.on_built_entity,
590
+ function(event) game.print("Gotta go fast!") end,
591
+ {{filter = "name", name = "fast-inserter"}})
566
592
  ```
567
593
  */
568
594
  on_event(this: void, event: defines.events.on_cargo_pod_finished_ascending, handler: ((this: void, arg0: runtime.on_cargo_pod_finished_ascending) => any) | nil, filters?: EventFilter): void;
@@ -581,6 +607,24 @@ interface LuaBootstrap {
581
607
  script.on_event(defines.events.on_built_entity,
582
608
  function(event) game.print("Gotta go fast!") end,
583
609
  {{filter = "name", name = "fast-inserter"}})
610
+ ```
611
+ */
612
+ on_event(this: void, event: defines.events.on_cargo_pod_finished_descending, handler: ((this: void, arg0: runtime.on_cargo_pod_finished_descending) => any) | nil, filters?: EventFilter): void;
613
+ /**
614
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
615
+ * @param event The event(s) or custom-input to invoke the handler on.
616
+ * @param handler The handler for this event. Passing `nil` will unregister it.
617
+ * @param filters The filters for this event. Can only be used when registering for individual events.
618
+ * @example ```
619
+ -- Register for the on_tick event to print the current tick to console each tick
620
+ script.on_event(defines.events.on_tick,
621
+ function(event) game.print(event.tick) end)
622
+ ```
623
+ * @example ```
624
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
625
+ script.on_event(defines.events.on_built_entity,
626
+ function(event) game.print("Gotta go fast!") end,
627
+ {{filter = "name", name = "fast-inserter"}})
584
628
  ```
585
629
  */
586
630
  on_event(this: void, event: defines.events.on_character_corpse_expired, handler: ((this: void, arg0: runtime.on_character_corpse_expired) => any) | nil, filters?: EventFilter): void;
@@ -1499,6 +1543,24 @@ interface LuaBootstrap {
1499
1543
  script.on_event(defines.events.on_built_entity,
1500
1544
  function(event) game.print("Gotta go fast!") end,
1501
1545
  {{filter = "name", name = "fast-inserter"}})
1546
+ ```
1547
+ */
1548
+ on_event(this: void, event: defines.events.on_multiplayer_init, handler: ((this: void, arg0: runtime.on_multiplayer_init) => any) | nil, filters?: EventFilter): void;
1549
+ /**
1550
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
1551
+ * @param event The event(s) or custom-input to invoke the handler on.
1552
+ * @param handler The handler for this event. Passing `nil` will unregister it.
1553
+ * @param filters The filters for this event. Can only be used when registering for individual events.
1554
+ * @example ```
1555
+ -- Register for the on_tick event to print the current tick to console each tick
1556
+ script.on_event(defines.events.on_tick,
1557
+ function(event) game.print(event.tick) end)
1558
+ ```
1559
+ * @example ```
1560
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
1561
+ script.on_event(defines.events.on_built_entity,
1562
+ function(event) game.print("Gotta go fast!") end,
1563
+ {{filter = "name", name = "fast-inserter"}})
1502
1564
  ```
1503
1565
  */
1504
1566
  on_event(this: void, event: defines.events.on_object_destroyed, handler: ((this: void, arg0: runtime.on_object_destroyed) => any) | nil, filters?: EventFilter): void;
@@ -3425,6 +3487,24 @@ interface LuaBootstrap {
3425
3487
  script.on_event(defines.events.on_built_entity,
3426
3488
  function(event) game.print("Gotta go fast!") end,
3427
3489
  {{filter = "name", name = "fast-inserter"}})
3490
+ ```
3491
+ */
3492
+ on_event(this: void, event: defines.events.on_singleplayer_init, handler: ((this: void, arg0: runtime.on_singleplayer_init) => any) | nil, filters?: EventFilter): void;
3493
+ /**
3494
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
3495
+ * @param event The event(s) or custom-input to invoke the handler on.
3496
+ * @param handler The handler for this event. Passing `nil` will unregister it.
3497
+ * @param filters The filters for this event. Can only be used when registering for individual events.
3498
+ * @example ```
3499
+ -- Register for the on_tick event to print the current tick to console each tick
3500
+ script.on_event(defines.events.on_tick,
3501
+ function(event) game.print(event.tick) end)
3502
+ ```
3503
+ * @example ```
3504
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
3505
+ script.on_event(defines.events.on_built_entity,
3506
+ function(event) game.print("Gotta go fast!") end,
3507
+ {{filter = "name", name = "fast-inserter"}})
3428
3508
  ```
3429
3509
  */
3430
3510
  on_event(this: void, event: defines.events.on_space_platform_built_entity, handler: ((this: void, arg0: runtime.on_space_platform_built_entity) => any) | nil, filters?: EventFilter): void;
@@ -4163,7 +4243,8 @@ interface LuaBootstrap {
4163
4243
  * The metatable first needs to be defined in the mod's root scope, then registered using this method. From then on, it will be properly restored for tables in {@link storage | runtime:storage}.
4164
4244
  *
4165
4245
  * ```
4166
- * local metatable = {
4246
+ * local metatable =
4247
+ * {
4167
4248
  * __index = function(key)
4168
4249
  * return "no value for key " .. key
4169
4250
  * end
@@ -4393,6 +4474,28 @@ interface LuaBurnerUsagePrototype extends LuaPrototypeBase {
4393
4474
  */
4394
4475
  readonly valid: boolean;
4395
4476
  }
4477
+ /**
4478
+ * A cargo hatch.
4479
+ */
4480
+ interface LuaCargoHatch {
4481
+ /**
4482
+ * Creates a cargo pod for output at the owning entity hatch location.
4483
+ */
4484
+ create_cargo_pod(this: void): LuaEntity;
4485
+ readonly busy: boolean;
4486
+ readonly is_input_compatible: boolean;
4487
+ readonly is_output_compatible: boolean;
4488
+ /**
4489
+ * 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.
4490
+ */
4491
+ readonly object_name: string;
4492
+ readonly owner: LuaEntity;
4493
+ readonly reserved: boolean;
4494
+ /**
4495
+ * 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.
4496
+ */
4497
+ readonly valid: boolean;
4498
+ }
4396
4499
  /**
4397
4500
  * Control behavior for cargo landing pad.
4398
4501
  */
@@ -5664,6 +5767,13 @@ interface LuaEntity extends LuaControl {
5664
5767
  * You can play the building sound to go with it by using {@link LuaSurface::play_sound | runtime:LuaSurface::play_sound}, eg: `entity.surface.play_sound{path="entity-build/"..entity.prototype.name, position=entity.position}`
5665
5768
  */
5666
5769
  create_build_effect_smoke(this: void): void;
5770
+ /**
5771
+ * Creates a cargo pod if possible.
5772
+ *
5773
+ * Cargo pod will be created with {@link invalid | runtime:defines.cargo_destination.invalid} destination type. Setting {@link cargo_pod_destination | runtime:LuaEntity::cargo_pod_destination} will cause it to launch.
5774
+ * @param cargo_hatch The hatch to create the pod at. A random (available) one is picked if not provided.
5775
+ */
5776
+ create_cargo_pod(this: void, cargo_hatch?: LuaCargoHatch): LuaEntity | null;
5667
5777
  /**
5668
5778
  * Damages the entity.
5669
5779
  * @param damage The amount of damage to be done.
@@ -5746,6 +5856,10 @@ interface LuaEntity extends LuaControl {
5746
5856
  * The burnt result inventory for this entity or `nil` if this entity doesn't have a burnt result inventory.
5747
5857
  */
5748
5858
  get_burnt_result_inventory(this: void): LuaInventory | null;
5859
+ /**
5860
+ * Gets the cargo bays connected to this cargo landing pad or space platform hub.
5861
+ */
5862
+ get_cargo_bays(this: void): LuaEntity[];
5749
5863
  /**
5750
5864
  * Returns all child signals. Child signals can be either RailSignal or RailChainSignal. Child signals are signals which are checked by this signal to determine a chain state.
5751
5865
  */
@@ -6159,7 +6273,7 @@ interface LuaEntity extends LuaControl {
6159
6273
  * Plays a note with the given instrument and note.
6160
6274
  * @returns Whether the request is valid. The sound may or may not be played depending on polyphony settings.
6161
6275
  */
6162
- play_note(this: void, instrument: uint, note: uint): boolean;
6276
+ play_note(this: void, instrument: uint, note: uint, stop_playing_sounds?: boolean): boolean;
6163
6277
  /**
6164
6278
  * Release the unit from the spawner which spawned it. This allows the spawner to continue spawning additional units.
6165
6279
  */
@@ -6381,6 +6495,10 @@ interface LuaEntity extends LuaControl {
6381
6495
  * A character associated with a player is not directly controlled by any player.
6382
6496
  */
6383
6497
  associated_player?: LuaPlayer | PlayerIdentification;
6498
+ /**
6499
+ * The cargo pod attached to this rocket silo rocket if any.
6500
+ */
6501
+ readonly attached_cargo_pod?: LuaEntity;
6384
6502
  /**
6385
6503
  * Destination of this spidertron's autopilot, if any. Writing `nil` clears all destinations.
6386
6504
  */
@@ -6438,6 +6556,20 @@ interface LuaEntity extends LuaControl {
6438
6556
  * The burner energy source for this entity, if any.
6439
6557
  */
6440
6558
  readonly burner?: LuaBurner;
6559
+ /**
6560
+ * The cargo hatches owned by this entity if any.
6561
+ */
6562
+ readonly cargo_hatches: LuaCargoHatch[];
6563
+ /**
6564
+ * The destination of this cargo pod entity.
6565
+ *
6566
+ * Use {@link force_finish_ascending | runtime:LuaEntity::force_finish_ascending} if you want it to only descend from orbit.
6567
+ */
6568
+ cargo_pod_destination: CargoDestination;
6569
+ /**
6570
+ * The state of this cargo pod entity.
6571
+ */
6572
+ readonly cargo_pod_state: 'awaiting_launch' | 'ascending' | 'surface_transition' | 'descending' | 'parking';
6441
6573
  /**
6442
6574
  * The state of this chain signal.
6443
6575
  */
@@ -6826,6 +6958,10 @@ interface LuaEntity extends LuaControl {
6826
6958
  * Can also be used on entity ghost if it contains linked-belt.
6827
6959
  */
6828
6960
  linked_belt_type: 'input' | 'output';
6961
+ /**
6962
+ * The belt stack size override for this loader. Set to `0` to disable. Writing this value requires {@link LoaderPrototype::adjustable_belt_stack_size | prototype:LoaderPrototype::adjustable_belt_stack_size} to be `true`.
6963
+ */
6964
+ loader_belt_stack_size_override: uint8;
6829
6965
  /**
6830
6966
  * The container entity this loader is pointing at/pulling from depending on the {@link LuaEntity::loader_type | runtime:LuaEntity::loader_type}, if any.
6831
6967
  */
@@ -6974,6 +7110,14 @@ interface LuaEntity extends LuaControl {
6974
7110
  * The target entity for this item-request-proxy, if any.
6975
7111
  */
6976
7112
  readonly proxy_target?: LuaEntity;
7113
+ /**
7114
+ * Entity of which inventory is exposed by this ProxyContainer
7115
+ */
7116
+ proxy_target_entity?: LuaEntity;
7117
+ /**
7118
+ * Inventory index of the inventory that is exposed by this ProxyContainer
7119
+ */
7120
+ proxy_target_inventory: defines.inventory;
6977
7121
  /**
6978
7122
  * The rail target of this pump, if any.
6979
7123
  */
@@ -7045,6 +7189,10 @@ interface LuaEntity extends LuaControl {
7045
7189
  * Get the current queue of robot orders.
7046
7190
  */
7047
7191
  readonly robot_order_queue: WorkerRobotOrder[];
7192
+ /**
7193
+ * The rocket silo rocket this cargo pod is attached to, or rocket silo rocket attached to this rocket silo - if any.
7194
+ */
7195
+ readonly rocket?: LuaEntity;
7048
7196
  /**
7049
7197
  * Number of rocket parts in the silo.
7050
7198
  */
@@ -7150,7 +7298,7 @@ interface LuaEntity extends LuaControl {
7150
7298
  */
7151
7299
  readonly supports_direction: boolean;
7152
7300
  /**
7153
- * The tags associated with this entity ghost. `nil` if this is not an entity ghost.
7301
+ * The tags associated with this entity ghost. `nil` if this is not an entity ghost or when the ghost has no tags.
7154
7302
  */
7155
7303
  tags?: Tags;
7156
7304
  /**
@@ -7678,6 +7826,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7678
7826
  * Whether this explosion rotates.
7679
7827
  */
7680
7828
  readonly explosion_rotate?: double;
7829
+ /**
7830
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
7831
+ */
7832
+ readonly factoriopedia_alternative?: LuaEntityPrototype;
7681
7833
  /**
7682
7834
  * The group of mutually fast-replaceable entities, if any.
7683
7835
  */
@@ -7887,6 +8039,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7887
8039
  * The light blinking speed for this rocket silo prototype.
7888
8040
  */
7889
8041
  readonly light_blinking_speed?: double;
8042
+ /**
8043
+ * True if this loader supports a runtime-adjustable belt stack size.
8044
+ */
8045
+ readonly loader_adjustable_belt_stack_size?: boolean;
8046
+ /**
8047
+ * The max belt stack size for this loader.
8048
+ */
8049
+ readonly loader_max_belt_stack_size?: uint8;
7890
8050
  /**
7891
8051
  * The logistic mode of this logistic container.
7892
8052
  */
@@ -7953,6 +8113,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7953
8113
  * How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.
7954
8114
  */
7955
8115
  readonly max_friends_around_to_spawn?: double;
8116
+ /**
8117
+ * The max number of item products this crafting machine prototype supports.
8118
+ */
8119
+ readonly max_item_product_count?: uint;
7956
8120
  /**
7957
8121
  * The max payload size of this logistics or construction robot.
7958
8122
  */
@@ -8986,6 +9150,10 @@ interface LuaFluidPrototype extends LuaPrototypeBase {
8986
9150
  * A multiplier on the amount of emissions produced when this fluid is burnt in a generator. A value above `1.0` increases emissions and vice versa. The multiplier can't be negative.
8987
9151
  */
8988
9152
  readonly emissions_multiplier: double;
9153
+ /**
9154
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
9155
+ */
9156
+ readonly factoriopedia_alternative?: LuaFluidPrototype;
8989
9157
  readonly flow_color: Color;
8990
9158
  /**
8991
9159
  * The amount of energy in Joules one unit of this fluid will produce when burnt in a generator. A value of `0` means this fluid can't be used for energy generation. The value can't be negative.
@@ -9282,7 +9450,7 @@ interface LuaForce {
9282
9450
  *
9283
9451
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this force.
9284
9452
  * @param table.path The sound to play.
9285
- * @param table.position Where the sound should be played. If not given, it's played at the current position of each player.
9453
+ * @param table.position Where the sound should be played. If not given, it's played globally on each player's controller's surface.
9286
9454
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
9287
9455
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
9288
9456
  */
@@ -9624,6 +9792,51 @@ interface LuaFuelCategoryPrototype extends LuaPrototypeBase {
9624
9792
  */
9625
9793
  readonly valid: boolean;
9626
9794
  }
9795
+ /**
9796
+ * Control behavior for furnaces.
9797
+ */
9798
+ interface LuaFurnaceControlBehavior extends LuaGenericOnOffControlBehavior {
9799
+ /**
9800
+ * `true` if the furnace reads its ingredients contents, product contents and materials in crafting.
9801
+ */
9802
+ circuit_read_contents: boolean;
9803
+ /**
9804
+ * `true` if the furnace outputs ingredients of current recipe as a signals to circuit network.
9805
+ */
9806
+ circuit_read_ingredients: boolean;
9807
+ /**
9808
+ * `true` if the the furnace sends a signal when the recipe finishes.
9809
+ */
9810
+ circuit_read_recipe_finished: boolean;
9811
+ /**
9812
+ * `true` if the the furnace sends a signal when it is working.
9813
+ */
9814
+ circuit_read_working: boolean;
9815
+ /**
9816
+ * The signal sent when the furnace finishes a recipe.
9817
+ */
9818
+ circuit_recipe_finished_signal?: SignalID;
9819
+ /**
9820
+ * The signal sent when the furnace is working.
9821
+ */
9822
+ circuit_working_signal?: SignalID;
9823
+ /**
9824
+ * `true` if the read contents should include fuel (content of energy source)
9825
+ */
9826
+ include_fuel: boolean;
9827
+ /**
9828
+ * `true` if the read contents should include items in crafting.
9829
+ */
9830
+ include_in_crafting: boolean;
9831
+ /**
9832
+ * 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.
9833
+ */
9834
+ readonly object_name: string;
9835
+ /**
9836
+ * 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.
9837
+ */
9838
+ readonly valid: boolean;
9839
+ }
9627
9840
  /**
9628
9841
  * Main toplevel type, provides access to most of the API though its members. An instance of LuaGameScript is available as the global object named `game`.
9629
9842
  */
@@ -9783,7 +9996,7 @@ interface LuaGameScript {
9783
9996
  *
9784
9997
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
9785
9998
  * @param table.path The sound to play.
9786
- * @param table.position Where the sound should be played. If not given, it's played at the current position of each player.
9999
+ * @param table.position Where the sound should be played. If not given, it's played globally on each player's controller's surface.
9787
10000
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
9788
10001
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
9789
10002
  */
@@ -12206,6 +12419,10 @@ interface LuaItemPrototype extends LuaPrototypeBase {
12206
12419
  * The prototype of this armor's equipment grid, if any.
12207
12420
  */
12208
12421
  readonly equipment_grid?: LuaEquipmentGridPrototype;
12422
+ /**
12423
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
12424
+ */
12425
+ readonly factoriopedia_alternative?: LuaItemPrototype;
12209
12426
  /**
12210
12427
  * The durability message key used when displaying the durability of this tool in Factoriopedia.
12211
12428
  */
@@ -12352,7 +12569,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
12352
12569
  */
12353
12570
  readonly valid: boolean;
12354
12571
  /**
12355
- * Weight of this item
12572
+ * Weight of this item. More information on how item weight is determined can be found on its {@link auxiliary page | runtime:item-weight}.
12356
12573
  */
12357
12574
  readonly weight: double;
12358
12575
  }
@@ -13316,6 +13533,19 @@ interface LuaPlayer extends LuaControl {
13316
13533
  * @param entity If the alert is clicked, the map will open at the position of this entity.
13317
13534
  */
13318
13535
  add_custom_alert(this: void, entity: LuaEntity, icon: SignalID, message: LocalisedString, show_on_map: boolean): void;
13536
+ /**
13537
+ * Adds a pin to this player for the given pin specification. Either entity, player, or surface and position must be defined.
13538
+ * @param table.entity The entity to pin.
13539
+ * @param table.player The player to pin.
13540
+ * @param table.surface The surface to create the pin on.
13541
+ * @param table.position Where to create the pin. Required when surface is defined.
13542
+ */
13543
+ add_pin(this: void, table: {
13544
+ entity?: LuaEntity;
13545
+ player?: PlayerIdentification;
13546
+ surface?: SurfaceIdentification;
13547
+ position?: MapPosition;
13548
+ }): void;
13319
13549
  /**
13320
13550
  * Adds the given recipe to the list of recipe notifications for this player.
13321
13551
  * @param recipe Recipe to add.
@@ -13590,7 +13820,7 @@ interface LuaPlayer extends LuaControl {
13590
13820
  *
13591
13821
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this player.
13592
13822
  * @param table.path The sound to play.
13593
- * @param table.position Where the sound should be played. If not given, it's played at the current position of the player.
13823
+ * @param table.position Where the sound should be played. If not given, it's played globally on the player's controller's surface.
13594
13824
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
13595
13825
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
13596
13826
  */
@@ -14038,6 +14268,10 @@ interface LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior {
14038
14268
  * Base for all prototype classes.
14039
14269
  */
14040
14270
  interface LuaPrototypeBase {
14271
+ /**
14272
+ * Provides additional description used in factoriopedia.
14273
+ */
14274
+ readonly factoriopedia_description: LocalisedString;
14041
14275
  /**
14042
14276
  * Group of this prototype.
14043
14277
  */
@@ -14334,6 +14568,23 @@ interface LuaPrototypes {
14334
14568
  */
14335
14569
  readonly virtual_signal: Record<string, LuaVirtualSignalPrototype>;
14336
14570
  }
14571
+ /**
14572
+ * Control behavior for proxy container.
14573
+ */
14574
+ interface LuaProxyContainerControlBehavior extends LuaControlBehavior {
14575
+ /**
14576
+ * 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.
14577
+ */
14578
+ readonly object_name: string;
14579
+ /**
14580
+ * `true` if this proxy container is sending inventory contents to a circuit network
14581
+ */
14582
+ read_contents: boolean;
14583
+ /**
14584
+ * 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.
14585
+ */
14586
+ readonly valid: boolean;
14587
+ }
14337
14588
  /**
14338
14589
  * Control behavior for pumps.
14339
14590
  */
@@ -14754,6 +15005,10 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
14754
15005
  * Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one.
14755
15006
  */
14756
15007
  readonly energy: double;
15008
+ /**
15009
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
15010
+ */
15011
+ readonly factoriopedia_alternative?: LuaRecipePrototype;
14757
15012
  /**
14758
15013
  * Is the recipe hidden from flow statistics (item/fluid production statistics)?
14759
15014
  */
@@ -15027,9 +15282,13 @@ interface LuaRecord {
15027
15282
  */
15028
15283
  blueprint_snap_to_grid?: TilePosition;
15029
15284
  /**
15030
- * The contents of this BlueprintBookRecord.
15285
+ * The contents of this BlueprintBookRecord. This is sparse array - it may have gaps, so using `#` will not be reliable. Use {@link LuaRecord::contents_size | runtime:LuaRecord::contents_size} or `pairs()` to iterate this table.
15286
+ */
15287
+ readonly contents: LuaTable<ItemStackIndex, LuaRecord>;
15288
+ /**
15289
+ * The highest populated index in the contents of this BlueprintBookRecord.
15031
15290
  */
15032
- readonly contents: LuaRecord[];
15291
+ readonly contents_size: ItemStackIndex;
15033
15292
  /**
15034
15293
  * List of raw materials required to build this blueprint.
15035
15294
  */
@@ -15062,6 +15321,10 @@ interface LuaRecord {
15062
15321
  * 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.
15063
15322
  */
15064
15323
  readonly object_name: string;
15324
+ /**
15325
+ * The preview icons for this record.
15326
+ */
15327
+ preview_icons: BlueprintSignalIcon[];
15065
15328
  /**
15066
15329
  * The number of tile filters this deconstruction planner supports.
15067
15330
  */
@@ -15752,6 +16015,141 @@ interface LuaRocketSiloControlBehavior extends LuaControlBehavior {
15752
16015
  */
15753
16016
  readonly valid: boolean;
15754
16017
  }
16018
+ /**
16019
+ * The schedule of a particular {@link LuaTrain | runtime:LuaTrain} or {@link LuaSpacePlatform | runtime:LuaSpacePlatform}.
16020
+ */
16021
+ interface LuaSchedule {
16022
+ /**
16023
+ * Activates the interrupt at the given index, if the index is valid.
16024
+ */
16025
+ activate_interrupt(this: void, index: uint): void;
16026
+ /**
16027
+ * Adds the given interrupt to the schedule if an interrupt with the given name does not already exist.
16028
+ */
16029
+ add_interrupt(this: void, interrupt: ScheduleInterrupt): void;
16030
+ /**
16031
+ * Adds the given record to the end of the current schedule or at the given index using the provided data.
16032
+ * @returns The index the record was added at.
16033
+ */
16034
+ add_record(this: void, data: AddRecordData): uint | null;
16035
+ /**
16036
+ * Adds the given wait condition to the given record.
16037
+ */
16038
+ add_wait_condition(this: void, record_index: ScheduleRecordPosition, condition_index: uint, type: WaitConditionType): void;
16039
+ /**
16040
+ * Changes the interrupt at the given index to the provided values. Note, the names must match.
16041
+ */
16042
+ change_interrupt(this: void, index: uint, interrupt: ScheduleInterrupt): void;
16043
+ /**
16044
+ * Changes the wait condition on the given record to the new values.
16045
+ */
16046
+ change_wait_condition(this: void, record_index: ScheduleRecordPosition, condition_index: uint, wait_condition: WaitCondition): void;
16047
+ /**
16048
+ * Removes all interrupts.
16049
+ */
16050
+ clear_interrupts(this: void): void;
16051
+ /**
16052
+ * @param uint If provided, clears the records for this interrupt.
16053
+ */
16054
+ clear_records(this: void, interrupt_index?: uint): void;
16055
+ /**
16056
+ * Copies the record from the given schedule at the given index into this schedule at the given index.
16057
+ */
16058
+ copy_record(this: void, source_schedule: LuaSchedule, source_index: uint, destination_index: uint): void;
16059
+ drag_interrupt(this: void, from: uint, to: uint): void;
16060
+ /**
16061
+ * @param interrupt_index The interrupt to operate on, if any.
16062
+ */
16063
+ drag_record(this: void, from: uint, to: uint, interrupt_index?: uint): void;
16064
+ /**
16065
+ * @param index The record to change.
16066
+ */
16067
+ drag_wait_condition(this: void, index: ScheduleRecordPosition, from: uint, to: uint): void;
16068
+ get_interrupt(this: void, index: uint): ScheduleInterrupt | null;
16069
+ get_interrupts(this: void): ScheduleInterrupt[];
16070
+ get_record(this: void, index: ScheduleRecordPosition): ScheduleRecord | null;
16071
+ /**
16072
+ * If the given index is invalid, `nil` is returned.
16073
+ * @param interrupt_index If provided, the record count in this interrupt is read.
16074
+ */
16075
+ get_record_count(this: void, interrupt_index?: uint): uint | null;
16076
+ /**
16077
+ * @param uint If provided, gets the records for this interrupt.
16078
+ */
16079
+ get_records(this: void, interrupt_index?: uint): ScheduleRecord[] | null;
16080
+ /**
16081
+ * Gets the wait condition at the given index if one exists.
16082
+ */
16083
+ get_wait_condition(this: void, schedule_index: ScheduleRecordPosition, condition_index: uint): WaitCondition | null;
16084
+ /**
16085
+ * The number of wait conditions in the given schedule record.
16086
+ */
16087
+ get_wait_condition_count(this: void, index: ScheduleRecordPosition): uint | null;
16088
+ /**
16089
+ * Gets the wait conditions at the given index if they exist.
16090
+ */
16091
+ get_wait_conditions(this: void, schedule_index: ScheduleRecordPosition): WaitCondition[] | null;
16092
+ /**
16093
+ * @param schedule_index The schedule index
16094
+ */
16095
+ go_to_station(this: void, schedule_index: uint): void;
16096
+ /**
16097
+ * Removes the interrupt at the given index, if the index is valid.
16098
+ */
16099
+ remove_interrupt(this: void, index: uint): void;
16100
+ /**
16101
+ * Removes the record at the given index, if the index is valid.
16102
+ */
16103
+ remove_record(this: void, index: ScheduleRecordPosition): void;
16104
+ /**
16105
+ * Removes the given wait condition from the given record.
16106
+ */
16107
+ remove_wait_condition(this: void, record_index: ScheduleRecordPosition, condition_index: uint): void;
16108
+ /**
16109
+ * @param old_name The interrupt to rename
16110
+ * @param new_name The new name - if it already exists, does nothing.
16111
+ */
16112
+ rename_interrupt(this: void, old_name: string, new_name: string): void;
16113
+ /**
16114
+ * Sets if unloading is allowed at the given schedule index.
16115
+ */
16116
+ set_allow_unloading(this: void, index: ScheduleRecordPosition, allow: boolean): void;
16117
+ set_interrupts(this: void, interrupts: ScheduleInterrupt[]): void;
16118
+ /**
16119
+ * @param uint If provided, the records will be set on this interrupt.
16120
+ */
16121
+ set_records(this: void, records: ScheduleRecord[], interrupt_index?: uint): void;
16122
+ set_stopped(this: void, stopped: boolean): void;
16123
+ /**
16124
+ * Sets the comparison on the given wait condition.
16125
+ * @param mode `"and"`, or `"or"`
16126
+ */
16127
+ set_wait_condition_mode(this: void, record_index: ScheduleRecordPosition, condition_index: uint, mode: string): void;
16128
+ readonly current: uint;
16129
+ /**
16130
+ * The group this schedule is part of, if any.
16131
+ */
16132
+ group?: string;
16133
+ readonly interrupt_count: uint;
16134
+ /**
16135
+ * 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.
16136
+ */
16137
+ readonly object_name: string;
16138
+ /**
16139
+ * The owner of this schedule.
16140
+ */
16141
+ readonly owner?: LuaTrain | LuaSpacePlatform;
16142
+ /**
16143
+ * Note: when writing, value must not be larger than LuaGameScript::tick
16144
+ */
16145
+ tick_of_last_activity: MapTick;
16146
+ readonly tick_of_last_schedule_change: MapTick;
16147
+ readonly ticks_in_station: MapTick;
16148
+ /**
16149
+ * 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.
16150
+ */
16151
+ readonly valid: boolean;
16152
+ }
15755
16153
  /**
15756
16154
  * Control behavior for selector combinators.
15757
16155
  */
@@ -15961,6 +16359,10 @@ interface LuaSimulation {
15961
16359
  */
15962
16360
  interface LuaSpaceConnectionPrototype extends LuaPrototypeBase {
15963
16361
  readonly asteroid_spawn_definitions?: SpaceConnectionAsteroidSpawnDefinition[];
16362
+ /**
16363
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
16364
+ */
16365
+ readonly factoriopedia_alternative?: LuaSpaceConnectionPrototype;
15964
16366
  readonly from: LuaSpaceLocationPrototype;
15965
16367
  readonly length: uint;
15966
16368
  /**
@@ -15980,6 +16382,10 @@ interface LuaSpaceLocationPrototype extends LuaPrototypeBase {
15980
16382
  readonly asteroid_spawn_definitions?: SpaceLocationAsteroidSpawnDefinition[];
15981
16383
  readonly asteroid_spawn_influence: double;
15982
16384
  readonly entities_require_heating?: boolean;
16385
+ /**
16386
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
16387
+ */
16388
+ readonly factoriopedia_alternative?: LuaSpaceLocationPrototype;
15983
16389
  readonly map_gen_settings?: MapGenSettings;
15984
16390
  readonly map_seed_offset?: uint;
15985
16391
  /**
@@ -16009,6 +16415,10 @@ interface LuaSpacePlatform {
16009
16415
  * @returns The platform hub.
16010
16416
  */
16011
16417
  apply_starter_pack(this: void): LuaEntity | null;
16418
+ /**
16419
+ * Returns `true` when the space platform isn't waiting on any delivery from the planet.
16420
+ */
16421
+ can_leave_current_location(this: void): boolean;
16012
16422
  /**
16013
16423
  * Cancels deletion of this space platform if it was scheduled for deletion.
16014
16424
  */
@@ -16058,6 +16468,7 @@ interface LuaSpacePlatform {
16058
16468
  limit?: uint;
16059
16469
  invert?: boolean;
16060
16470
  }): AsteroidChunk[];
16471
+ get_schedule(this: void): LuaSchedule;
16061
16472
  /**
16062
16473
  * Repairs the given tile if it's damaged.
16063
16474
  */
@@ -16069,6 +16480,12 @@ interface LuaSpacePlatform {
16069
16480
  position: TilePosition;
16070
16481
  damage: float;
16071
16482
  }[];
16483
+ /**
16484
+ * The point on space connection this platform is at or `nil`.
16485
+ *
16486
+ * 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}.
16487
+ */
16488
+ distance?: double;
16072
16489
  /**
16073
16490
  * The force of this space platform.
16074
16491
  */
@@ -16111,10 +16528,18 @@ interface LuaSpacePlatform {
16111
16528
  * Returns how many ticks are left before the platform will be deleted. 0 if not scheduled for deletion.
16112
16529
  */
16113
16530
  readonly scheduled_for_deletion: uint;
16531
+ /**
16532
+ * The space connection this space platform is traveling through or `nil`.
16533
+ *
16534
+ * Write operation requires a valid space connection and it sets the distance to 0.5.
16535
+ */
16536
+ space_connection?: LuaSpaceConnectionPrototype;
16114
16537
  /**
16115
16538
  * The space location this space platform is stopped at or `nil`.
16539
+ *
16540
+ * Write operation requires a valid space location and will cancel pending item requests.
16116
16541
  */
16117
- readonly space_location?: LuaSpaceLocationPrototype;
16542
+ space_location?: LuaSpaceLocationPrototype;
16118
16543
  speed: double;
16119
16544
  /**
16120
16545
  * The starter pack used to create this space platform.
@@ -17016,7 +17441,7 @@ interface LuaSurface {
17016
17441
  *
17017
17442
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
17018
17443
  * @param table.path The sound to play.
17019
- * @param table.position Where the sound should be played. If not given, it's played at the current position of each player.
17444
+ * @param table.position Where the sound should be played. If not given, it's played globally on this surface.
17020
17445
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
17021
17446
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
17022
17447
  */
@@ -17815,6 +18240,10 @@ interface LuaSurfacePropertyPrototype extends LuaPrototypeBase {
17815
18240
  * Prototype of a surface.
17816
18241
  */
17817
18242
  interface LuaSurfacePrototype extends LuaPrototypeBase {
18243
+ /**
18244
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
18245
+ */
18246
+ readonly factoriopedia_alternative?: LuaSurfacePrototype;
17818
18247
  /**
17819
18248
  * 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.
17820
18249
  */
@@ -17934,6 +18363,10 @@ interface LuaTechnologyPrototype extends LuaPrototypeBase {
17934
18363
  * If this technology prototype is essential, meaning it is shown in the condensed technology graph.
17935
18364
  */
17936
18365
  readonly essential: boolean;
18366
+ /**
18367
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
18368
+ */
18369
+ readonly factoriopedia_alternative?: LuaTechnologyPrototype;
17937
18370
  /**
17938
18371
  * If this technology ignores the technology cost multiplier setting.
17939
18372
  *
@@ -18109,6 +18542,10 @@ interface LuaTilePrototype extends LuaPrototypeBase {
18109
18542
  readonly default_cover_tile?: LuaTilePrototype;
18110
18543
  readonly default_destroyed_dropped_item_trigger?: TriggerItem[];
18111
18544
  readonly destroys_dropped_items?: boolean;
18545
+ /**
18546
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
18547
+ */
18548
+ readonly factoriopedia_alternative?: LuaTilePrototype;
18112
18549
  /**
18113
18550
  * The fluid offshore pump produces on this tile, if any.
18114
18551
  */
@@ -18207,6 +18644,7 @@ interface LuaTrain {
18207
18644
  * Gets all rails under the train.
18208
18645
  */
18209
18646
  get_rails(this: void): LuaEntity[];
18647
+ get_schedule(this: void): LuaSchedule;
18210
18648
  /**
18211
18649
  * Go to the station specified by the index in the train's schedule.
18212
18650
  */
@@ -18522,6 +18960,13 @@ interface LuaTransportLine {
18522
18960
  * Remove all items from this transport line.
18523
18961
  */
18524
18962
  clear(this: void): void;
18963
+ /**
18964
+ * Force insert item at a given position. Inserts item onto a transport line. If a position is out of range, it is clamped to a closest valid position on the transport line. Item will be inserted regardless of other items nearby, possibly forcing items to become squashed.
18965
+ * @param position Where on the line to insert the items.
18966
+ * @param items Items to insert.
18967
+ * @param belt_stack_size Maximum size of stack created on belt
18968
+ */
18969
+ force_insert_at(this: void, position: float, items: ItemStackIdentification, belt_stack_size?: uint8): void;
18525
18970
  /**
18526
18971
  * Get counts of all items on this line, similar to how {@link LuaInventory::get_contents | runtime:LuaInventory::get_contents} does.
18527
18972
  * @returns List of all items on this line.
@@ -18779,6 +19224,10 @@ interface LuaUndoRedoStack {
18779
19224
  * Prototype of a virtual signal.
18780
19225
  */
18781
19226
  interface LuaVirtualSignalPrototype extends LuaPrototypeBase {
19227
+ /**
19228
+ * An alternative prototype that will be used to display info about this prototype in Factoriopedia.
19229
+ */
19230
+ readonly factoriopedia_alternative?: LuaVirtualSignalPrototype;
18782
19231
  /**
18783
19232
  * 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.
18784
19233
  */