factorio-types 0.0.25 → 0.0.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,8 +2,8 @@
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 1.1.61
6
- // API version 2
5
+ // Factorio version 1.1.65
6
+ // API version 3
7
7
 
8
8
  /**
9
9
  * Collection of settings for overriding default ai behavior.
@@ -256,7 +256,7 @@ interface LuaBootstrap {
256
256
  * @param f - The handler for this event. Passing `nil` will unregister it.
257
257
  */
258
258
  on_configuration_changed(this: void,
259
- f: (this: void, arg0: ConfigurationChangedData) => any): void
259
+ f: (this: void, arg0: ConfigurationChangedData) => any | null): void
260
260
 
261
261
  /**
262
262
  * 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.
@@ -281,8 +281,8 @@ interface LuaBootstrap {
281
281
  */
282
282
  on_event<T extends event>(this: void,
283
283
  event: defines.events | defines.events[] | string,
284
- f: (this: void, arg0: T) => any,
285
- filters?: EventFilter[]): void
284
+ f: (this: void, arg0: T) => any | null,
285
+ filters?: EventFilter): void
286
286
 
287
287
  /**
288
288
  * Register a function to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript | LuaGameScript} and the {@link global | global} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
@@ -300,7 +300,7 @@ interface LuaBootstrap {
300
300
  *
301
301
  */
302
302
  on_init(this: void,
303
- f: (this: void) => any): void
303
+ f: (this: void) => any | null): void
304
304
 
305
305
  /**
306
306
  * Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript | LuaGameScript} is not available. The {@link global | global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
@@ -317,7 +317,7 @@ interface LuaBootstrap {
317
317
  * @param f - The handler for this event. Passing `nil` will unregister it.
318
318
  */
319
319
  on_load(this: void,
320
- f: (this: void) => any): void
320
+ f: (this: void) => any | null): void
321
321
 
322
322
  /**
323
323
  * Register a handler to run every nth-tick(s). When the game is on tick 0 it will trigger all registered handlers.
@@ -325,8 +325,8 @@ interface LuaBootstrap {
325
325
  * @param tick - The nth-tick(s) to invoke the handler on. Passing `nil` as the only parameter will unregister all nth-tick handlers.
326
326
  */
327
327
  on_nth_tick(this: void,
328
- tick: number | number[],
329
- f: (this: void, arg0: NthTickEventData) => any): void
328
+ tick: number | number[] | null,
329
+ f: (this: void, arg0: NthTickEventData) => any | null): void
330
330
 
331
331
  /**
332
332
  * @param table.entity - The entity that was built.
@@ -446,6 +446,18 @@ interface LuaBootstrap {
446
446
  tiles: Tile[]
447
447
  }): void
448
448
 
449
+ /**
450
+ * Register a metatable to have linkage recorded and restored when saving/loading. The metatable itself will not be saved. Instead, only the linkage to a registered metatable is saved, and the metatable registered under that name will be used when loading the table.
451
+ * @remarks
452
+ * `register_metatable()` can not be used in the console, in event listeners or during a `remote.call()`.
453
+ *
454
+ * @param metatable - The metatable to register.
455
+ * @param name - The name of this metatable. Names must be unique per mod.
456
+ */
457
+ register_metatable(this: void,
458
+ name: string,
459
+ metatable: Table): void
460
+
449
461
  /**
450
462
  * Registers an entity so that after it's destroyed, {@link on_entity_destroyed | on_entity_destroyed} is called. Once an entity is registered, it stays registered until it is actually destroyed, even through save/load cycles. The registration is global across all mods, meaning once one mod registers an entity, all mods listening to {@link on_entity_destroyed | on_entity_destroyed} will receive the event when it is destroyed. Registering the same entity multiple times will still only fire the destruction event once, and will return the same registration number.
451
463
  * @remarks
@@ -481,7 +493,7 @@ interface LuaBootstrap {
481
493
  */
482
494
  set_event_filter(this: void,
483
495
  event: number,
484
- filters?: EventFilter[]): void
496
+ filters?: EventFilter): void
485
497
 
486
498
  /**
487
499
  * A dictionary listing the names of all currently active mods and mapping them to their version.
@@ -499,7 +511,33 @@ interface LuaBootstrap {
499
511
  /**
500
512
  * Information about the currently running scenario/campaign/tutorial.
501
513
  */
502
- readonly level: { campaign_name?: string, is_simulation?: boolean, is_tutorial?: boolean, level_name: string, mod_name?: string }
514
+ readonly level: {
515
+
516
+ /**
517
+ * The campaign name if any.
518
+ */
519
+ campaign_name?: string,
520
+
521
+ /**
522
+ * Is this level a simulation? (The main menu and 'Tips and tricks' use simulations)
523
+ */
524
+ is_simulation?: boolean,
525
+
526
+ /**
527
+ * Is this level a tutorial?
528
+ */
529
+ is_tutorial?: boolean,
530
+
531
+ /**
532
+ * The level name.
533
+ */
534
+ level_name: string,
535
+
536
+ /**
537
+ * The mod name if any.
538
+ */
539
+ mod_name?: string
540
+ }
503
541
 
504
542
  /**
505
543
  * The name of the mod from the environment this is used in.
@@ -528,7 +566,7 @@ interface LuaBurner {
528
566
  readonly burnt_result_inventory: LuaInventory
529
567
 
530
568
  /**
531
- * The currently burning item, or `nil` if no item is burning.
569
+ * The currently burning item.
532
570
  * @remarks
533
571
  * Writing to this automatically handles correcting {@link LuaBurner::remaining_burning_fuel | LuaBurner::remaining_burning_fuel}.
534
572
  *
@@ -538,7 +576,7 @@ interface LuaBurner {
538
576
  /**
539
577
  * The fuel categories this burner uses.
540
578
  * @remarks
541
- * The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup.
579
+ * The value in the dictionary is meaningless and exists just to allow for easy lookup.
542
580
  *
543
581
  */
544
582
  readonly fuel_categories: {[key: string]: boolean}
@@ -600,7 +638,7 @@ interface LuaBurnerPrototype {
600
638
 
601
639
  /**
602
640
  * @remarks
603
- * The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup.
641
+ * The value in the dictionary is meaningless and exists just to allow for easy lookup.
604
642
  *
605
643
  */
606
644
  readonly fuel_categories: {[key: string]: boolean}
@@ -608,9 +646,18 @@ interface LuaBurnerPrototype {
608
646
  readonly fuel_inventory_size: number
609
647
 
610
648
  /**
611
- * The light flicker definition for this burner prototype if any.
649
+ * The light flicker definition for this burner prototype.
612
650
  */
613
- readonly light_flicker: { border_fix_speed: number, color: Color, derivation_change_deviation: number, derivation_change_frequency: number, light_intensity_to_size_coefficient: number, maximum_intensity: number, minimum_intensity: number, minimum_light_size: number }
651
+ readonly light_flicker?: {
652
+ border_fix_speed: number,
653
+ color: Color,
654
+ derivation_change_deviation: number,
655
+ derivation_change_frequency: number,
656
+ light_intensity_to_size_coefficient: number,
657
+ maximum_intensity: number,
658
+ minimum_intensity: number,
659
+ minimum_light_size: number
660
+ }
614
661
 
615
662
  /**
616
663
  * 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.
@@ -622,9 +669,9 @@ interface LuaBurnerPrototype {
622
669
  readonly render_no_power_icon: boolean
623
670
 
624
671
  /**
625
- * The smoke sources for this burner prototype if any.
672
+ * The smoke sources for this burner prototype.
626
673
  */
627
- readonly smoke: SmokeSource[]
674
+ readonly smoke?: SmokeSource[]
628
675
 
629
676
  /**
630
677
  * 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.
@@ -695,7 +742,7 @@ interface LuaCircuitNetwork {
695
742
  readonly connected_circuit_count: number
696
743
 
697
744
  /**
698
- * The entity this circuit network reference is associated with
745
+ * The entity this circuit network reference is associated with.
699
746
  */
700
747
  readonly entity: LuaEntity
701
748
 
@@ -710,9 +757,9 @@ interface LuaCircuitNetwork {
710
757
  readonly object_name: string
711
758
 
712
759
  /**
713
- * The circuit network signals last tick. `nil` if there are no signals.
760
+ * The circuit network signals last tick. `nil` if there were no signals last tick.
714
761
  */
715
- readonly signals: Signal[]
762
+ readonly signals?: Signal[]
716
763
 
717
764
  /**
718
765
  * 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.
@@ -828,10 +875,9 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
828
875
  readonly object_name: string
829
876
 
830
877
  /**
831
- * This constant combinator's parameters, or `nil` if the {@link item_slot_count | LuaEntityPrototype::item_slot_count} of the combinator's prototype is `0`.
832
- * @remarks
878
+ * This constant combinator's parameters. `nil` if the {@link item_slot_count | LuaEntityPrototype::item_slot_count} of the combinator's prototype is `0`.
879
+ *
833
880
  * Writing `nil` clears the combinator's parameters.
834
- *
835
881
  */
836
882
  parameters?: ConstantCombinatorParameters[]
837
883
 
@@ -1179,7 +1225,7 @@ interface LuaControl {
1179
1225
  character_maximum_following_robot_count_bonus: number
1180
1226
 
1181
1227
  /**
1182
- * Gets the current mining progress between 0 and 1 of this character, or 0 if they aren't mining.
1228
+ * The current mining progress between 0 and 1 of this character, or 0 if they aren't mining.
1183
1229
  */
1184
1230
  readonly character_mining_progress: number
1185
1231
 
@@ -1210,7 +1256,7 @@ interface LuaControl {
1210
1256
  character_resource_reach_distance_bonus: number
1211
1257
 
1212
1258
  /**
1213
- * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
1259
+ * The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
1214
1260
  */
1215
1261
  readonly character_running_speed: number
1216
1262
 
@@ -1230,17 +1276,17 @@ interface LuaControl {
1230
1276
  character_trash_slot_count_bonus: number
1231
1277
 
1232
1278
  /**
1233
- * When `true` hand crafting is free and instant
1279
+ * When `true` hand crafting is free and instant.
1234
1280
  */
1235
1281
  cheat_mode: boolean
1236
1282
 
1237
1283
  /**
1238
- * Gets the current crafting queue items.
1284
+ * The current crafting queue items.
1239
1285
  */
1240
1286
  readonly crafting_queue: CraftingQueueItem[]
1241
1287
 
1242
1288
  /**
1243
- * The crafting queue progress [0-1] 0 when no recipe is being crafted.
1289
+ * The crafting queue progress in the range `[0-1]`. `0` when no recipe is being crafted.
1244
1290
  */
1245
1291
  crafting_queue_progress: number
1246
1292
 
@@ -1250,17 +1296,17 @@ interface LuaControl {
1250
1296
  readonly crafting_queue_size: number
1251
1297
 
1252
1298
  /**
1253
- * The ghost prototype in the player's cursor.
1299
+ * The ghost prototype in the player's cursor. When read, it will be a {@link LuaItemPrototype | LuaItemPrototype}.
1254
1300
  * @remarks
1255
- * When read, it will be a {@link LuaItemPrototype | LuaItemPrototype}.
1256
1301
  * Items in the cursor stack will take priority over the cursor ghost.
1257
1302
  *
1258
1303
  */
1259
- cursor_ghost: ItemPrototypeIdentification
1304
+ cursor_ghost?: ItemPrototypeIdentification
1260
1305
 
1261
1306
  /**
1262
- * The player's cursor stack, or `nil` if the player controller is a spectator. Even though this property is marked as read-only, it returns a {@link LuaItemStack | LuaItemStack}, meaning it can be manipulated like so:
1307
+ * The player's cursor stack. `nil` if the player controller is a spectator.
1263
1308
  * @example
1309
+ * Even though this property is marked as read-only, it returns a [LuaItemStack](LuaItemStack), meaning it can be manipulated like so:
1264
1310
  * ```
1265
1311
  * player.cursor_stack.clear()
1266
1312
  * ```
@@ -1279,7 +1325,7 @@ interface LuaControl {
1279
1325
  readonly drop_item_distance: number
1280
1326
 
1281
1327
  /**
1282
- * The current combat robots following the character
1328
+ * The current combat robots following the character.
1283
1329
  * @remarks
1284
1330
  * When called on a {@link LuaPlayer | LuaPlayer}, it must be associated with a character(see {@link LuaPlayer::character | LuaPlayer::character}).
1285
1331
  *
@@ -1292,7 +1338,7 @@ interface LuaControl {
1292
1338
  force: ForceIdentification
1293
1339
 
1294
1340
  /**
1295
- * If this character entity is in combat.
1341
+ * Whether this character entity is in combat.
1296
1342
  */
1297
1343
  readonly in_combat: boolean
1298
1344
 
@@ -1312,21 +1358,29 @@ interface LuaControl {
1312
1358
  * When the player isn't mining tiles the player will mine what ever entity is currently selected. See {@link LuaControl::selected | LuaControl::selected} and {@link LuaControl::update_selected_entity | LuaControl::update_selected_entity}.
1313
1359
  *
1314
1360
  */
1315
- mining_state: { mining: boolean, position?: MapPosition }
1361
+ mining_state: {
1362
+
1363
+ /**
1364
+ * Whether the player is mining at all
1365
+ */
1366
+ mining: boolean,
1367
+
1368
+ /**
1369
+ * What tiles the player is mining; only used when the player is mining tiles (holding a tile in the cursor).
1370
+ */
1371
+ position?: MapPosition
1372
+ }
1316
1373
 
1317
1374
  /**
1318
- * The GUI the player currently has open, or `nil` if no GUI is open.
1375
+ * The GUI the player currently has open.
1319
1376
  *
1320
1377
  * This is the GUI that will asked to close (by firing the {@link on_gui_closed | on_gui_closed} event) when the `Esc` or `E` keys are pressed. If this attribute is not `nil`, and a new GUI is written to it, the existing one will be asked to close.
1321
1378
  * @remarks
1322
- * Write supports any of the types. Read will return the `entity`, `equipment`, `equipment-grid`, `player`, `element` or `nil`.
1379
+ * Write supports any of the types. Read will return the `entity`, `equipment`, `equipment-grid`, `player`, `element`, `inventory` or `nil`.
1323
1380
  *
1324
1381
  */
1325
- opened?: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | defines.gui_type
1382
+ opened?: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | LuaInventory | defines.gui_type
1326
1383
 
1327
- /**
1328
- * Returns the {@link defines.gui_type | defines.gui_type} or `nil`.
1329
- */
1330
1384
  readonly opened_gui_type?: defines.gui_type
1331
1385
 
1332
1386
  /**
@@ -1335,7 +1389,7 @@ interface LuaControl {
1335
1389
  picking_state: boolean
1336
1390
 
1337
1391
  /**
1338
- * Current position of the entity.
1392
+ * The current position of the entity.
1339
1393
  */
1340
1394
  readonly position: MapPosition
1341
1395
 
@@ -1347,7 +1401,18 @@ interface LuaControl {
1347
1401
  /**
1348
1402
  * Current repair state.
1349
1403
  */
1350
- repair_state: { position: MapPosition, repairing: boolean }
1404
+ repair_state: {
1405
+
1406
+ /**
1407
+ * The position being repaired
1408
+ */
1409
+ position: MapPosition,
1410
+
1411
+ /**
1412
+ * The current state
1413
+ */
1414
+ repairing: boolean
1415
+ }
1351
1416
 
1352
1417
  /**
1353
1418
  * The resource reach distance of this character or max double when not a character or player connected to a character.
@@ -1360,14 +1425,25 @@ interface LuaControl {
1360
1425
  riding_state: RidingState
1361
1426
 
1362
1427
  /**
1363
- * The currently selected entity; `nil` if none. Assigning an entity will select it if selectable otherwise clears selection.
1428
+ * The currently selected entity. Assigning an entity will select it if is selectable, otherwise the selection is cleared.
1364
1429
  */
1365
- selected: LuaEntity
1430
+ selected?: LuaEntity
1366
1431
 
1367
1432
  /**
1368
1433
  * Current shooting state.
1369
1434
  */
1370
- shooting_state: { position: MapPosition, state: defines.shooting }
1435
+ shooting_state: {
1436
+
1437
+ /**
1438
+ * The position being shot at
1439
+ */
1440
+ position: MapPosition,
1441
+
1442
+ /**
1443
+ * The current state
1444
+ */
1445
+ state: defines.shooting
1446
+ }
1371
1447
 
1372
1448
  /**
1373
1449
  * The surface this entity is currently on.
@@ -1375,9 +1451,9 @@ interface LuaControl {
1375
1451
  readonly surface: LuaSurface
1376
1452
 
1377
1453
  /**
1378
- * The vehicle the player is currently sitting in; `nil` if none.
1454
+ * The vehicle the player is currently sitting in.
1379
1455
  */
1380
- readonly vehicle: LuaEntity
1456
+ readonly vehicle?: LuaEntity
1381
1457
 
1382
1458
  /**
1383
1459
  * If personal logistic requests are enabled for this vehicle (spidertron).
@@ -1393,7 +1469,18 @@ interface LuaControl {
1393
1469
  * ```
1394
1470
  *
1395
1471
  */
1396
- walking_state: { direction: defines.direction, walking: boolean }
1472
+ walking_state: {
1473
+
1474
+ /**
1475
+ * Direction where the player is walking
1476
+ */
1477
+ direction: defines.direction,
1478
+
1479
+ /**
1480
+ * If `false`, the player is currently not walking; otherwise it's going somewhere
1481
+ */
1482
+ walking: boolean
1483
+ }
1397
1484
 
1398
1485
  }
1399
1486
 
@@ -1451,7 +1538,7 @@ interface LuaCustomChartTag {
1451
1538
  /**
1452
1539
  * The player who last edited this tag.
1453
1540
  */
1454
- last_user: LuaPlayer
1541
+ last_user?: LuaPlayer
1455
1542
 
1456
1543
  /**
1457
1544
  * 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.
@@ -1497,9 +1584,9 @@ interface LuaCustomInputPrototype {
1497
1584
  readonly action: string
1498
1585
 
1499
1586
  /**
1500
- * The default alternative key sequence for this custom input. `nil` when not defined.
1587
+ * The default alternative key sequence for this custom input, if any
1501
1588
  */
1502
- readonly alternative_key_sequence: string
1589
+ readonly alternative_key_sequence?: string
1503
1590
 
1504
1591
  /**
1505
1592
  * The consuming type: `"none"` or `"game-only"`.
@@ -1527,7 +1614,7 @@ interface LuaCustomInputPrototype {
1527
1614
  readonly include_selected_prototype: boolean
1528
1615
 
1529
1616
  /**
1530
- * The item that gets spawned when this custom input is fired or `nil`.
1617
+ * The item that gets spawned when this custom input is fired, if any.
1531
1618
  */
1532
1619
  readonly item_to_spawn?: LuaItemPrototype
1533
1620
 
@@ -1537,7 +1624,7 @@ interface LuaCustomInputPrototype {
1537
1624
  readonly key_sequence: string
1538
1625
 
1539
1626
  /**
1540
- * The linked game control name or `nil`.
1627
+ * The linked game control name, if any.
1541
1628
  */
1542
1629
  readonly linked_game_control?: string
1543
1630
 
@@ -1706,9 +1793,9 @@ interface LuaDecorativePrototype {
1706
1793
  help(this: void): void
1707
1794
 
1708
1795
  /**
1709
- * Autoplace specification for this decorative prototype. `nil` if none.
1796
+ * Autoplace specification for this decorative prototype, if any.
1710
1797
  */
1711
- readonly autoplace_specification: AutoplaceSpecification
1798
+ readonly autoplace_specification?: AutoplaceSpecification
1712
1799
 
1713
1800
  /**
1714
1801
  * The bounding box used for collision checking.
@@ -2040,6 +2127,14 @@ interface LuaEntity extends LuaControl {
2040
2127
  */
2041
2128
  get_burnt_result_inventory(this: void): void
2042
2129
 
2130
+ /**
2131
+ * 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.
2132
+ * @remarks
2133
+ * Applies to subclasses: RailChainSignal
2134
+ *
2135
+ */
2136
+ get_child_signals(this: void): void
2137
+
2043
2138
  /**
2044
2139
  * @param circuit_connector - The connector to get circuit network for. Must be specified for entities with more than one circuit network connector.
2045
2140
  * @param wire - Wire color of the network connected to this entity.
@@ -2137,6 +2232,14 @@ interface LuaEntity extends LuaControl {
2137
2232
  */
2138
2233
  get_heat_setting(this: void): void
2139
2234
 
2235
+ /**
2236
+ * Returns all signals guarding entrance to a rail block this rail belongs to.
2237
+ * @remarks
2238
+ * Applies to subclasses: Rail
2239
+ *
2240
+ */
2241
+ get_inbound_signals(this: void): void
2242
+
2140
2243
  /**
2141
2244
  * Gets the filter for this infinity container at the given index or `nil` if the filter index doesn't exist or is empty.
2142
2245
  * @remarks
@@ -2207,11 +2310,27 @@ interface LuaEntity extends LuaControl {
2207
2310
  */
2208
2311
  get_or_create_control_behavior(this: void): void
2209
2312
 
2313
+ /**
2314
+ * Returns all signals guarding exit from a rail block this rail belongs to.
2315
+ * @remarks
2316
+ * Applies to subclasses: Rail
2317
+ *
2318
+ */
2319
+ get_outbound_signals(this: void): void
2320
+
2210
2321
  /**
2211
2322
  * Gets the entity's output inventory if it has one.
2212
2323
  */
2213
2324
  get_output_inventory(this: void): void
2214
2325
 
2326
+ /**
2327
+ * Returns all parent signals. Parent signals are always RailChainSignal. Parent signals are those signals that are checking state of this signal to determine their own chain state.
2328
+ * @remarks
2329
+ * Applies to subclasses: RailSignal,RailChainSignal
2330
+ *
2331
+ */
2332
+ get_parent_signals(this: void): void
2333
+
2215
2334
  /**
2216
2335
  * Gets the passenger of this car or spidertron if any.
2217
2336
  * @remarks
@@ -2267,6 +2386,17 @@ interface LuaEntity extends LuaControl {
2267
2386
  */
2268
2387
  get_rail_segment_overlaps(this: void): void
2269
2388
 
2389
+ /**
2390
+ * Get all rails of a rail segment this rail is in
2391
+ * @remarks
2392
+ * A rail segment is a continuous section of rail with no branches, signals, nor train stops.
2393
+ * Applies to subclasses: Rail
2394
+ *
2395
+ * @param direction - Selects end of this rail that points to a rail segment end from which to start returning rails
2396
+ */
2397
+ get_rail_segment_rails(this: void,
2398
+ direction: defines.rail_direction): void
2399
+
2270
2400
  /**
2271
2401
  * Current recipe being assembled by this machine or `nil` if no recipe is set.
2272
2402
  * @remarks
@@ -2294,7 +2424,7 @@ interface LuaEntity extends LuaControl {
2294
2424
  get_spider_legs(this: void): void
2295
2425
 
2296
2426
  /**
2297
- * The train currently stopped at this train stop or `nil` if none.
2427
+ * The train currently stopped at this train stop, if any.
2298
2428
  * @remarks
2299
2429
  * Applies to subclasses: TrainStop
2300
2430
  *
@@ -2410,6 +2540,24 @@ interface LuaEntity extends LuaControl {
2410
2540
  */
2411
2541
  is_opening(this: void): void
2412
2542
 
2543
+ /**
2544
+ * Checks if this rail and other rail both belong to the same rail block.
2545
+ * @remarks
2546
+ * Applies to subclasses: Rail
2547
+ *
2548
+ */
2549
+ is_rail_in_same_rail_block_as(this: void,
2550
+ other_rail: LuaEntity): void
2551
+
2552
+ /**
2553
+ * Checks if this rail and other rail both belong to the same rail segment.
2554
+ * @remarks
2555
+ * Applies to subclasses: Rail
2556
+ *
2557
+ */
2558
+ is_rail_in_same_rail_segment_as(this: void,
2559
+ other_rail: LuaEntity): void
2560
+
2413
2561
  /**
2414
2562
  * Is this entity or tile ghost or item request proxy registered for construction? If false, it means a construction robot has been dispatched to build the entity, or it is not an entity that can be constructed.
2415
2563
  */
@@ -2789,7 +2937,7 @@ interface LuaEntity extends LuaControl {
2789
2937
  amount: number
2790
2938
 
2791
2939
  /**
2792
- * If this land mine is armed.
2940
+ * Whether this land mine is armed.
2793
2941
  * @remarks
2794
2942
  * Applies to subclasses: LandMine
2795
2943
  *
@@ -2797,7 +2945,7 @@ interface LuaEntity extends LuaControl {
2797
2945
  readonly armed: boolean
2798
2946
 
2799
2947
  /**
2800
- * The player this character is associated with, or `nil` if there isn't one. Set to `nil` to clear.
2948
+ * The player this character is associated with, if any. Set to `nil` to clear.
2801
2949
  *
2802
2950
  * 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.
2803
2951
  *
@@ -2818,7 +2966,7 @@ interface LuaEntity extends LuaControl {
2818
2966
  auto_launch: boolean
2819
2967
 
2820
2968
  /**
2821
- * Destination position of spidertron's autopilot. Returns `nil` if autopilot doesn't have destination set.
2969
+ * Destination of this spidertron's autopilot, if any.
2822
2970
  * @remarks
2823
2971
  * Applies to subclasses: SpiderVehicle
2824
2972
  *
@@ -2834,7 +2982,7 @@ interface LuaEntity extends LuaControl {
2834
2982
  readonly autopilot_destinations: MapPosition[]
2835
2983
 
2836
2984
  /**
2837
- * The backer name assigned to this entity, or `nil` if this entity doesn't support backer names. Entities that support backer names are labs, locomotives, radars, roboports, and train stops.
2985
+ * The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
2838
2986
  * @remarks
2839
2987
  * While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
2840
2988
  *
@@ -2858,7 +3006,7 @@ interface LuaEntity extends LuaControl {
2858
3006
  readonly belt_to_ground_type: string
2859
3007
 
2860
3008
  /**
2861
- * The bonus mining progress for this mining drill or `nil` if this isn't a mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time]
3009
+ * The bonus mining progress for this mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time]. `nil` if this isn't a mining drill.
2862
3010
  */
2863
3011
  bonus_mining_progress?: number
2864
3012
 
@@ -2876,7 +3024,7 @@ interface LuaEntity extends LuaControl {
2876
3024
  readonly bounding_box: BoundingBox
2877
3025
 
2878
3026
  /**
2879
- * The burner energy source for this entity or `nil` if there isn't one.
3027
+ * The burner energy source for this entity, if any.
2880
3028
  */
2881
3029
  readonly burner?: LuaBurner
2882
3030
 
@@ -2889,7 +3037,7 @@ interface LuaEntity extends LuaControl {
2889
3037
  readonly chain_signal_state: defines.chain_signal_state
2890
3038
 
2891
3039
  /**
2892
- * The reason this character corpse character died (if any).
3040
+ * The reason this character corpse character died. `""` if there is no reason.
2893
3041
  * @remarks
2894
3042
  * Applies to subclasses: CharacterCorpse
2895
3043
  *
@@ -2914,14 +3062,25 @@ interface LuaEntity extends LuaControl {
2914
3062
  character_corpse_tick_of_death: number
2915
3063
 
2916
3064
  /**
2917
- * Entities that are directly connected to this entity via the circuit network.
3065
+ * Entities that are directly connected to this entity via the circuit network. `nil` if this entity can't be connected to the circuit network.
2918
3066
  */
2919
- readonly circuit_connected_entities: { green: LuaEntity[], red: LuaEntity[] }
3067
+ readonly circuit_connected_entities?: {
3068
+
3069
+ /**
3070
+ * Entities connected via the green wire.
3071
+ */
3072
+ green: LuaEntity[],
3073
+
3074
+ /**
3075
+ * Entities connected via the red wire.
3076
+ */
3077
+ red: LuaEntity[]
3078
+ }
2920
3079
 
2921
3080
  /**
2922
- * The connection definition for entities that are directly connected to this entity via the circuit network.
3081
+ * The connection definition for entities that are directly connected to this entity via the circuit network. `nil` if this entity can't be connected to the circuit network.
2923
3082
  */
2924
- readonly circuit_connection_definitions: CircuitConnectionDefinition[]
3083
+ readonly circuit_connection_definitions?: CircuitConnectionDefinition[]
2925
3084
 
2926
3085
  /**
2927
3086
  * The orientation of this cliff.
@@ -2929,7 +3088,7 @@ interface LuaEntity extends LuaControl {
2929
3088
  readonly cliff_orientation: CliffOrientation
2930
3089
 
2931
3090
  /**
2932
- * The character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner color. Returns `nil` if this entity doesn't use custom colors.
3091
+ * The color of this character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner. `nil` if this entity doesn't use custom colors.
2933
3092
  * @remarks
2934
3093
  * Car color is overridden by the color of the current driver/passenger, if there is one.
2935
3094
  *
@@ -2937,12 +3096,12 @@ interface LuaEntity extends LuaControl {
2937
3096
  color?: Color
2938
3097
 
2939
3098
  /**
2940
- * The owner of this combat robot if any.
3099
+ * The owner of this combat robot, if any.
2941
3100
  */
2942
- combat_robot_owner: LuaEntity
3101
+ combat_robot_owner?: LuaEntity
2943
3102
 
2944
3103
  /**
2945
- * The command given to this unit or `nil` is the unit has no command.
3104
+ * The command given to this unit, if any.
2946
3105
  * @remarks
2947
3106
  * Applies to subclasses: Unit
2948
3107
  *
@@ -2950,7 +3109,7 @@ interface LuaEntity extends LuaControl {
2950
3109
  readonly command?: Command
2951
3110
 
2952
3111
  /**
2953
- * The rail entity this train stop is connected to or `nil` if there is none.
3112
+ * The rail entity this train stop is connected to, if any.
2954
3113
  * @remarks
2955
3114
  * Applies to subclasses: TrainStop
2956
3115
  *
@@ -3032,7 +3191,7 @@ interface LuaEntity extends LuaControl {
3032
3191
  direction: defines.direction
3033
3192
 
3034
3193
  /**
3035
- * The distraction command given to this unit or `nil` is the unit currently isn't distracted.
3194
+ * The distraction command given to this unit, if any.
3036
3195
  * @remarks
3037
3196
  * Applies to subclasses: Unit
3038
3197
  *
@@ -3040,9 +3199,9 @@ interface LuaEntity extends LuaControl {
3040
3199
  readonly distraction_command?: Command
3041
3200
 
3042
3201
  /**
3043
- * Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner.
3202
+ * Whether the driver of this car or spidertron is the gunner. If `false`, the passenger is the gunner. `nil` if this is neither a car or a spidertron.
3044
3203
  */
3045
- driver_is_gunner: boolean
3204
+ driver_is_gunner?: boolean
3046
3205
 
3047
3206
  /**
3048
3207
  * Position where the entity puts its stuff.
@@ -3053,23 +3212,20 @@ interface LuaEntity extends LuaControl {
3053
3212
  drop_position: MapPosition
3054
3213
 
3055
3214
  /**
3056
- * The entity this entity is putting its items to, or `nil` if there is no such entity. If there are multiple possible entities at the drop-off point, writing to this attribute allows a mod to choose which one to drop off items to. The entity needs to collide with the tile box under the drop-off position.
3057
- * @remarks
3058
- * Meaningful only for entities that put items somewhere, such as mining drills or inserters. Returns `nil` for any other entity.
3059
- *
3215
+ * The entity this entity is putting its items to. If there are multiple possible entities at the drop-off point, writing to this attribute allows a mod to choose which one to drop off items to. The entity needs to collide with the tile box under the drop-off position. `nil` if there is no entity to put items to, or if this is not an entity that puts items somewhere.
3060
3216
  */
3061
3217
  drop_target?: LuaEntity
3062
3218
 
3063
3219
  /**
3064
- * The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on.
3220
+ * The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on. `nil` if this is not a unit.
3065
3221
  * @remarks
3066
3222
  * Applies to subclasses: Unit
3067
3223
  *
3068
3224
  */
3069
- readonly effective_speed: number
3225
+ readonly effective_speed?: number
3070
3226
 
3071
3227
  /**
3072
- * Multiplies the acceleration the vehicle can create for one unit of energy. By default is `1`.
3228
+ * Multiplies the acceleration the vehicle can create for one unit of energy. Defaults to `1`.
3073
3229
  * @remarks
3074
3230
  * Applies to subclasses: Car
3075
3231
  *
@@ -3077,35 +3233,35 @@ interface LuaEntity extends LuaControl {
3077
3233
  effectivity_modifier: number
3078
3234
 
3079
3235
  /**
3080
- * The effects being applied to this entity or `nil`. For beacons this is the effect the beacon is broadcasting.
3236
+ * The effects being applied to this entity, if any. For beacons, this is the effect the beacon is broadcasting.
3081
3237
  */
3082
3238
  readonly effects?: ModuleEffects
3083
3239
 
3084
3240
  /**
3085
- * The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source.
3241
+ * The buffer size for the electric energy source. `nil` if the entity doesn't have an electric energy source.
3086
3242
  * @remarks
3087
3243
  * Write access is limited to the ElectricEnergyInterface type
3088
3244
  *
3089
3245
  */
3090
- electric_buffer_size: number
3246
+ electric_buffer_size?: number
3091
3247
 
3092
3248
  /**
3093
- * The electric drain for the electric energy source or nil if the entity doesn't have an electric energy source.
3249
+ * The electric drain for the electric energy source. `nil` if the entity doesn't have an electric energy source.
3094
3250
  */
3095
- readonly electric_drain: number
3251
+ readonly electric_drain?: number
3096
3252
 
3097
3253
  /**
3098
- * The emissions for the electric energy source or nil if the entity doesn't have an electric energy source.
3254
+ * The emissions for the electric energy source. `nil` if the entity doesn't have an electric energy source.
3099
3255
  */
3100
- readonly electric_emissions: number
3256
+ readonly electric_emissions?: number
3101
3257
 
3102
3258
  /**
3103
- * The input flow limit for the electric energy source or nil if the entity doesn't have an electric energy source.
3259
+ * The input flow limit for the electric energy source. `nil` if the entity doesn't have an electric energy source.
3104
3260
  */
3105
- readonly electric_input_flow_limit: number
3261
+ readonly electric_input_flow_limit?: number
3106
3262
 
3107
3263
  /**
3108
- * Returns the id of the electric network that this entity is connected to or `nil`.
3264
+ * Returns the id of the electric network that this entity is connected to, if any.
3109
3265
  */
3110
3266
  readonly electric_network_id?: number
3111
3267
 
@@ -3118,12 +3274,12 @@ interface LuaEntity extends LuaControl {
3118
3274
  readonly electric_network_statistics: LuaFlowStatistics
3119
3275
 
3120
3276
  /**
3121
- * The output flow limit for the electric energy source or nil if the entity doesn't have an electric energy source.
3277
+ * The output flow limit for the electric energy source. `nil` if the entity doesn't have an electric energy source.
3122
3278
  */
3123
- readonly electric_output_flow_limit: number
3279
+ readonly electric_output_flow_limit?: number
3124
3280
 
3125
3281
  /**
3126
- * If equipment grid logistics are enabled while this vehicle is moving.
3282
+ * Whether equipment grid logistics are enabled while this vehicle is moving.
3127
3283
  * @remarks
3128
3284
  * Applies to subclasses: Vehicle
3129
3285
  *
@@ -3150,10 +3306,7 @@ interface LuaEntity extends LuaControl {
3150
3306
  readonly energy_generated_last_tick: number
3151
3307
 
3152
3308
  /**
3153
- * The label of this entity if it has one or `nil`. Changing the value will trigger on_entity_renamed event
3154
- * @remarks
3155
- * only usable on entities that have labels (currently only spider-vehicles).
3156
- *
3309
+ * The label on this entity, if any. `nil` if this is not a spider-vehicule.
3157
3310
  */
3158
3311
  entity_label?: string
3159
3312
 
@@ -3168,20 +3321,20 @@ interface LuaEntity extends LuaControl {
3168
3321
  fluidbox: LuaFluidBox
3169
3322
 
3170
3323
  /**
3171
- * The follow offset of this spidertron if any. If it is not following an entity this will be nil. This is randomized each time the follow entity is set.
3324
+ * The follow offset of this spidertron, if any entity is being followed. This is randomized each time the follow entity is set.
3172
3325
  * @remarks
3173
3326
  * Applies to subclasses: SpiderVehicle
3174
3327
  *
3175
3328
  */
3176
- follow_offset: Vector
3329
+ follow_offset?: Vector
3177
3330
 
3178
3331
  /**
3179
- * The follow target of this spidertron if any.
3332
+ * The follow target of this spidertron, if any.
3180
3333
  * @remarks
3181
3334
  * Applies to subclasses: SpiderVehicle
3182
3335
  *
3183
3336
  */
3184
- follow_target: LuaEntity
3337
+ follow_target?: LuaEntity
3185
3338
 
3186
3339
  /**
3187
3340
  * Multiplies the car friction rate.
@@ -3237,25 +3390,25 @@ interface LuaEntity extends LuaControl {
3237
3390
  readonly ghost_type: string
3238
3391
 
3239
3392
  /**
3240
- * The {@link unit_number | LuaEntity::unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@link EntityWithOwner | https://wiki.factorio.com/Prototype/EntityWithOwner} that was destroyed to create this ghost. If it was created by other means, or if the inner entity doesn not support unit numbers, this property is `nil`.
3393
+ * The {@link unit_number | LuaEntity::unit_number} of the entity contained in this ghost. It is the same as the unit number of the {@link EntityWithOwner | https://wiki.factorio.com/Prototype/EntityWithOwner} that was destroyed to create this ghost. If it was created by other means, or if the inner entity does not support unit numbers, this property is `nil`.
3241
3394
  * @remarks
3242
3395
  * Applies to subclasses: EntityGhost
3243
3396
  *
3244
3397
  */
3245
- readonly ghost_unit_number: number
3398
+ readonly ghost_unit_number?: number
3246
3399
 
3247
3400
  /**
3248
- * The graphics variation for this entity or `nil` if this entity doesn't use graphics variations.
3401
+ * The graphics variation for this entity. `nil` if this entity doesn't use graphics variations.
3249
3402
  */
3250
3403
  graphics_variation?: number
3251
3404
 
3252
3405
  /**
3253
- * The equipment grid or `nil` if this entity doesn't have an equipment grid.
3406
+ * This entity's equipment grid, if any.
3254
3407
  */
3255
3408
  readonly grid?: LuaEquipmentGrid
3256
3409
 
3257
3410
  /**
3258
- * The current health of the entity, or `nil` if it doesn't have health. Health is automatically clamped to be between `0` and max health (inclusive). Entities with a health of `0` can not be attacked.
3411
+ * The current health of the entity, if any. Health is automatically clamped to be between `0` and max health (inclusive). Entities with a health of `0` can not be attacked.
3259
3412
  * @remarks
3260
3413
  * To get the maximum possible health of this entity, see {@link LuaEntityPrototype::max_health | LuaEntityPrototype::max_health} on its prototype.
3261
3414
  *
@@ -3303,16 +3456,16 @@ interface LuaEntity extends LuaControl {
3303
3456
  infinity_container_filters: InfinityInventoryFilter[]
3304
3457
 
3305
3458
  /**
3306
- * Count of initial resource units contained.
3459
+ * Count of initial resource units contained. `nil` if this is not an infinite resource.
3307
3460
  * @remarks
3308
- * If this is not an infinite resource reading will give `nil` and writing will give an error.
3461
+ * If this is not an infinite resource, writing will produce an error.
3309
3462
  * Applies to subclasses: ResourceEntity
3310
3463
  *
3311
3464
  */
3312
- initial_amount: number
3465
+ initial_amount?: number
3313
3466
 
3314
3467
  /**
3315
- * The filter mode for this filter inserter: "whitelist", "blacklist", or `nil` if this inserter doesn't use filters.
3468
+ * The filter mode for this filter inserter. Either `"whitelist"` or `"blacklist"`. `nil` if this inserter doesn't use filters.
3316
3469
  * @remarks
3317
3470
  * Applies to subclasses: Inserter
3318
3471
  *
@@ -3343,7 +3496,7 @@ interface LuaEntity extends LuaControl {
3343
3496
  readonly is_entity_with_owner: boolean
3344
3497
 
3345
3498
  /**
3346
- * If this entity is a MilitaryTarget. Can be written to if LuaEntityPrototype::allow_run_time_change_of_is_military_target returns true
3499
+ * Whether this entity is a MilitaryTarget. Can be written to if {@link LuaEntityPrototype::allow_run_time_change_of_is_military_target | LuaEntityPrototype::allow_run_time_change_of_is_military_target} returns `true`.
3347
3500
  */
3348
3501
  is_military_target: boolean
3349
3502
 
@@ -3361,14 +3514,14 @@ interface LuaEntity extends LuaControl {
3361
3514
  kills: number
3362
3515
 
3363
3516
  /**
3364
- * The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. Can be `nil` if the last user is not part of the save anymore.
3517
+ * 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.
3365
3518
  *
3366
3519
  * Reading this property will return a {@link LuaPlayer | LuaPlayer}, while {@link PlayerIdentification | PlayerIdentification} can be used when writing.
3367
3520
  * @remarks
3368
3521
  * Applies to subclasses: EntityWithOwner
3369
3522
  *
3370
3523
  */
3371
- last_user: LuaPlayer | PlayerIdentification
3524
+ last_user?: LuaPlayer | PlayerIdentification
3372
3525
 
3373
3526
  /**
3374
3527
  * The link ID this linked container is using.
@@ -3376,14 +3529,14 @@ interface LuaEntity extends LuaControl {
3376
3529
  link_id: number
3377
3530
 
3378
3531
  /**
3379
- * Neighbour to which this linked belt is connected to. Returns nil if not connected.
3532
+ * Neighbour to which this linked belt is connected to, if any.
3380
3533
  * @remarks
3381
3534
  * Can also be used on entity ghost if it contains linked-belt
3382
3535
  * May return entity ghost which contains linked belt to which connection is made
3383
3536
  * Applies to subclasses: LinkedBelt
3384
3537
  *
3385
3538
  */
3386
- readonly linked_belt_neighbour: LuaEntity
3539
+ readonly linked_belt_neighbour?: LuaEntity
3387
3540
 
3388
3541
  /**
3389
3542
  * Type of linked belt: it is either `"input"` or `"output"`. Changing type will also flip direction so the belt is out of the same side
@@ -3396,12 +3549,12 @@ interface LuaEntity extends LuaControl {
3396
3549
  linked_belt_type: string
3397
3550
 
3398
3551
  /**
3399
- * The container entity this loader is pointing at/pulling from depending on the {@link LuaEntity::loader_type | LuaEntity::loader_type}.
3552
+ * The container entity this loader is pointing at/pulling from depending on the {@link LuaEntity::loader_type | LuaEntity::loader_type}, if any.
3400
3553
  * @remarks
3401
3554
  * Applies to subclasses: Loader
3402
3555
  *
3403
3556
  */
3404
- readonly loader_container: LuaEntity
3557
+ readonly loader_container?: LuaEntity
3405
3558
 
3406
3559
  /**
3407
3560
  * `"input"` or `"output"`, depending on whether this loader puts to or gets from a container.
@@ -3437,12 +3590,12 @@ interface LuaEntity extends LuaControl {
3437
3590
  minable: boolean
3438
3591
 
3439
3592
  /**
3440
- * The mining progress for this mining drill or `nil` if this isn't a mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time]
3593
+ * The mining progress for this mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time]. `nil` if this isn't a mining drill.
3441
3594
  */
3442
3595
  mining_progress?: number
3443
3596
 
3444
3597
  /**
3445
- * The mining target or `nil` if none
3598
+ * The mining target, if any.
3446
3599
  * @remarks
3447
3600
  * Applies to subclasses: MiningDrill
3448
3601
  *
@@ -3492,7 +3645,7 @@ interface LuaEntity extends LuaControl {
3492
3645
  operable: boolean
3493
3646
 
3494
3647
  /**
3495
- * The smooth orientation of this entity, if it supports orientation.
3648
+ * The smooth orientation of this entity.
3496
3649
  */
3497
3650
  orientation: RealOrientation
3498
3651
 
@@ -3513,7 +3666,7 @@ interface LuaEntity extends LuaControl {
3513
3666
  pickup_position: MapPosition
3514
3667
 
3515
3668
  /**
3516
- * The entity this inserter will attempt to pick up items from, or `nil` if there is no such entity. If there are multiple possible entities at the pick-up point, writing to this attribute allows a mod to choose which one to pick up items from. The entity needs to collide with the tile box under the pick-up position.
3669
+ * The entity this inserter will attempt to pick up items from. If there are multiple possible entities at the pick-up point, writing to this attribute allows a mod to choose which one to pick up items from. The entity needs to collide with the tile box under the pick-up position. `nil` if there is no entity to pull items from.
3517
3670
  * @remarks
3518
3671
  * Applies to subclasses: Inserter
3519
3672
  *
@@ -3521,7 +3674,7 @@ interface LuaEntity extends LuaControl {
3521
3674
  pickup_target?: LuaEntity
3522
3675
 
3523
3676
  /**
3524
- * The player connected to this character or `nil` if none.
3677
+ * The player connected to this character, if any.
3525
3678
  * @remarks
3526
3679
  * Applies to subclasses: Character
3527
3680
  *
@@ -3555,12 +3708,12 @@ interface LuaEntity extends LuaControl {
3555
3708
  power_usage: number
3556
3709
 
3557
3710
  /**
3558
- * The previous recipe this furnace was using or nil if the furnace had no previous recipe.
3711
+ * The previous recipe this furnace was using, if any.
3559
3712
  * @remarks
3560
3713
  * Applies to subclasses: Furnace
3561
3714
  *
3562
3715
  */
3563
- readonly previous_recipe: LuaRecipe
3716
+ readonly previous_recipe?: LuaRecipe
3564
3717
 
3565
3718
  /**
3566
3719
  * The productivity bonus of this entity.
@@ -3584,12 +3737,12 @@ interface LuaEntity extends LuaControl {
3584
3737
  readonly prototype: LuaEntityPrototype
3585
3738
 
3586
3739
  /**
3587
- * The target entity for this item-request-proxy or `nil`
3740
+ * The target entity for this item-request-proxy, if any.
3588
3741
  */
3589
3742
  readonly proxy_target?: LuaEntity
3590
3743
 
3591
3744
  /**
3592
- * The rail target of this pump or `nil`.
3745
+ * The rail target of this pump, if any.
3593
3746
  * @remarks
3594
3747
  * Applies to subclasses: Pump
3595
3748
  *
@@ -3613,7 +3766,7 @@ interface LuaEntity extends LuaControl {
3613
3766
  recipe_locked: boolean
3614
3767
 
3615
3768
  /**
3616
- * The relative orientation of the vehicle turret, artillery turret, artillery wagon or `nil` if this entity isn't a vehicle with a vehicle turret or artillery turret/wagon.
3769
+ * The relative orientation of the vehicle turret, artillery turret, artillery wagon. `nil` if this entity isn't a vehicle with a vehicle turret or artillery turret/wagon.
3617
3770
  * @remarks
3618
3771
  * Writing does nothing if the vehicle doesn't have a turret.
3619
3772
  *
@@ -3621,7 +3774,7 @@ interface LuaEntity extends LuaControl {
3621
3774
  relative_turret_orientation?: RealOrientation
3622
3775
 
3623
3776
  /**
3624
- * If items not included in this infinity container filters should be removed from the container.
3777
+ * Whether items not included in this infinity container filters should be removed from the container.
3625
3778
  * @remarks
3626
3779
  * Applies to subclasses: InfinityContainer
3627
3780
  *
@@ -3629,19 +3782,19 @@ interface LuaEntity extends LuaControl {
3629
3782
  remove_unfiltered_items: boolean
3630
3783
 
3631
3784
  /**
3632
- * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, `flying-text`, or `highlight-box` is visible to. `nil` means it is rendered for every player.
3785
+ * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, `flying-text`, or `highlight-box` is visible to. `nil` when this entity is rendered for all players.
3633
3786
  *
3634
3787
  * Reading this property will return a {@link LuaPlayer | LuaPlayer}, while {@link PlayerIdentification | PlayerIdentification} can be used when writing.
3635
3788
  */
3636
- render_player: LuaPlayer | PlayerIdentification
3789
+ render_player?: LuaPlayer | PlayerIdentification
3637
3790
 
3638
3791
  /**
3639
- * The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. `nil` or an empty array means it is rendered for every force.
3792
+ * The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. `nil` or an empty array when this entity is rendered for all forces.
3640
3793
  * @remarks
3641
3794
  * Reading will always give an array of {@link LuaForce | LuaForce}
3642
3795
  *
3643
3796
  */
3644
- render_to_forces: ForceIdentification[]
3797
+ render_to_forces?: ForceIdentification[]
3645
3798
 
3646
3799
  /**
3647
3800
  * Whether this requester chest is set to also request from buffer chests.
@@ -3664,6 +3817,11 @@ interface LuaEntity extends LuaControl {
3664
3817
  */
3665
3818
  rocket_parts: number
3666
3819
 
3820
+ /**
3821
+ * The status of this rocket silo entity.
3822
+ */
3823
+ readonly rocket_silo_status: defines.rocket_silo_status
3824
+
3667
3825
  /**
3668
3826
  * When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key.
3669
3827
  * @remarks
@@ -3683,7 +3841,7 @@ interface LuaEntity extends LuaControl {
3683
3841
  readonly secondary_selection_box?: BoundingBox
3684
3842
 
3685
3843
  /**
3686
- * Index of the currently selected weapon slot of this character, car, or spidertron, or `nil` if the car/spidertron doesn't have guns.
3844
+ * Index of the currently selected weapon slot of this character, car, or spidertron. `nil` if this entity doesn't have guns.
3687
3845
  * @remarks
3688
3846
  * Applies to subclasses: Character,Car
3689
3847
  *
@@ -3696,7 +3854,7 @@ interface LuaEntity extends LuaControl {
3696
3854
  readonly selection_box: BoundingBox
3697
3855
 
3698
3856
  /**
3699
- * The shooting target for this turret or `nil`.
3857
+ * The shooting target for this turret, if any.
3700
3858
  */
3701
3859
  shooting_target?: LuaEntity
3702
3860
 
@@ -3709,14 +3867,16 @@ interface LuaEntity extends LuaControl {
3709
3867
  readonly signal_state: defines.signal_state
3710
3868
 
3711
3869
  /**
3712
- * The spawner associated with this unit entity or `nil` if the unit has no associated spawner.
3870
+ * The spawner associated with this unit entity, if any.
3713
3871
  */
3714
3872
  readonly spawner?: LuaEntity
3715
3873
 
3716
3874
  /**
3717
- * The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max speed of the unit. Only the speed of units, cars, and projectiles are writable.
3875
+ * The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a unit. The speed is in tiles per tick. `nil` if this is not a car, rolling stock, unit, projectile or spidertron.
3876
+ *
3877
+ * Only the speed of units, cars, and projectiles are writable.
3718
3878
  */
3719
- speed: number
3879
+ speed?: number
3720
3880
 
3721
3881
  /**
3722
3882
  * The speed bonus of this entity.
@@ -3727,7 +3887,7 @@ interface LuaEntity extends LuaControl {
3727
3887
  readonly speed_bonus: number
3728
3888
 
3729
3889
  /**
3730
- * The filter for this splitter or `nil` if no filter is set.
3890
+ * The filter for this splitter, if any is set.
3731
3891
  * @remarks
3732
3892
  * Applies to subclasses: Splitter
3733
3893
  *
@@ -3735,7 +3895,7 @@ interface LuaEntity extends LuaControl {
3735
3895
  splitter_filter?: LuaItemPrototype
3736
3896
 
3737
3897
  /**
3738
- * The input priority for this splitter : "left", "none", or "right".
3898
+ * The input priority for this splitter. Either `"left"`, `"none"`, or `"right"`.
3739
3899
  * @remarks
3740
3900
  * Applies to subclasses: Splitter
3741
3901
  *
@@ -3743,7 +3903,7 @@ interface LuaEntity extends LuaControl {
3743
3903
  splitter_input_priority: string
3744
3904
 
3745
3905
  /**
3746
- * The output priority for this splitter : "left", "none", or "right".
3906
+ * The output priority for this splitter. Either `"left"`, `"none"`, or `"right"`.
3747
3907
  * @remarks
3748
3908
  * Applies to subclasses: Splitter
3749
3909
  *
@@ -3758,7 +3918,7 @@ interface LuaEntity extends LuaControl {
3758
3918
  readonly stack: LuaItemStack
3759
3919
 
3760
3920
  /**
3761
- * The status of this entity or `nil` if no status.
3921
+ * The status of this entity, if any.
3762
3922
  */
3763
3923
  readonly status?: defines.entity_status
3764
3924
 
@@ -3768,7 +3928,7 @@ interface LuaEntity extends LuaControl {
3768
3928
  readonly sticked_to: LuaEntity
3769
3929
 
3770
3930
  /**
3771
- * The sticker entities attached to this entity or `nil` if none.
3931
+ * The sticker entities attached to this entity, if any.
3772
3932
  */
3773
3933
  readonly stickers?: LuaEntity[]
3774
3934
 
@@ -3783,12 +3943,12 @@ interface LuaEntity extends LuaControl {
3783
3943
  readonly supports_direction: boolean
3784
3944
 
3785
3945
  /**
3786
- * The tags associated with this entity ghost or `nil` if not an entity ghost.
3946
+ * The tags associated with this entity ghost. `nil` if this is not an entity ghost.
3787
3947
  */
3788
3948
  tags?: Tags
3789
3949
 
3790
3950
  /**
3791
- * The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`.
3951
+ * The temperature of this entity's heat energy source. `nil` if this entity does not use a heat energy source.
3792
3952
  */
3793
3953
  temperature?: number
3794
3954
 
@@ -3816,6 +3976,16 @@ interface LuaEntity extends LuaControl {
3816
3976
  */
3817
3977
  tick_of_last_damage: number
3818
3978
 
3979
+ /**
3980
+ * Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). Uses the current direction of the entity.
3981
+ */
3982
+ readonly tile_height: number
3983
+
3984
+ /**
3985
+ * Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). Uses the current direction of the entity.
3986
+ */
3987
+ readonly tile_width: number
3988
+
3819
3989
  /**
3820
3990
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
3821
3991
  *
@@ -3857,9 +4027,9 @@ interface LuaEntity extends LuaControl {
3857
4027
  torso_orientation: RealOrientation
3858
4028
 
3859
4029
  /**
3860
- * The train this rolling stock belongs to or nil if not rolling stock.
4030
+ * The train this rolling stock belongs to, if any. `nil` if this is not a rolling stock.
3861
4031
  */
3862
- readonly train: LuaTrain
4032
+ readonly train?: LuaTrain
3863
4033
 
3864
4034
  /**
3865
4035
  * Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint. Writing nil will disable the limit (will set a maximum possible value).
@@ -3924,7 +4094,7 @@ interface LuaEntity extends LuaControl {
3924
4094
  readonly type: string
3925
4095
 
3926
4096
  /**
3927
- * The unit group this unit is a member of, or `nil` if none.
4097
+ * The unit group this unit is a member of, if any.
3928
4098
  * @remarks
3929
4099
  * Applies to subclasses: Unit
3930
4100
  *
@@ -3932,9 +4102,9 @@ interface LuaEntity extends LuaControl {
3932
4102
  readonly unit_group?: LuaUnitGroup
3933
4103
 
3934
4104
  /**
3935
- * A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@link EntityWithOwner | https://wiki.factorio.com/Prototype/EntityWithOwner}, as well as {@link ItemRequestProxy | https://wiki.factorio.com/Prototype/ItemRequestProxy} and {@link EntityGhost | https://wiki.factorio.com/Prototype/EntityGhost} entities, are assigned a unit number. This property is `nil` for entities without unit number.
4105
+ * A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from {@link EntityWithOwner | https://wiki.factorio.com/Prototype/EntityWithOwner}, as well as {@link ItemRequestProxy | https://wiki.factorio.com/Prototype/ItemRequestProxy} and {@link EntityGhost | https://wiki.factorio.com/Prototype/EntityGhost} are assigned a unit number. `nil` if this entity doesn't have a unit number.
3936
4106
  */
3937
- readonly unit_number: number
4107
+ readonly unit_number?: number
3938
4108
 
3939
4109
  /**
3940
4110
  * The units associated with this spawner entity.
@@ -3978,6 +4148,14 @@ interface LuaEntityPrototype {
3978
4148
  */
3979
4149
  help(this: void): void
3980
4150
 
4151
+ /**
4152
+ * The active energy usage of this rocket silo or combinator prototype.
4153
+ * @remarks
4154
+ * Applies to subclasses: RocketSilo,Combinator
4155
+ *
4156
+ */
4157
+ readonly active_energy_usage?: number
4158
+
3981
4159
  /**
3982
4160
  * Entities this entity can be pasted onto in addition to the normal allowed ones.
3983
4161
  */
@@ -3989,7 +4167,7 @@ interface LuaEntityPrototype {
3989
4167
  * Applies to subclasses: OffshorePump
3990
4168
  *
3991
4169
  */
3992
- readonly adjacent_tile_collision_box: BoundingBox
4170
+ readonly adjacent_tile_collision_box?: BoundingBox
3993
4171
 
3994
4172
  /**
3995
4173
  * Tiles adjacent to the offshore pump must not collide with this collision mask.
@@ -3997,7 +4175,7 @@ interface LuaEntityPrototype {
3997
4175
  * Applies to subclasses: OffshorePump
3998
4176
  *
3999
4177
  */
4000
- readonly adjacent_tile_collision_mask: CollisionMask
4178
+ readonly adjacent_tile_collision_mask?: CollisionMask
4001
4179
 
4002
4180
  /**
4003
4181
  * If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask.
@@ -4005,15 +4183,21 @@ interface LuaEntityPrototype {
4005
4183
  * Applies to subclasses: OffshorePump
4006
4184
  *
4007
4185
  */
4008
- readonly adjacent_tile_collision_test: CollisionMask
4186
+ readonly adjacent_tile_collision_test?: CollisionMask
4009
4187
 
4010
4188
  /**
4011
- * Whether this unit prototype is affected by tile walking speed modifiers or `nil`.
4189
+ * Whether this unit prototype is affected by tile walking speed modifiers.
4190
+ * @remarks
4191
+ * Applies to subclasses: Unit
4192
+ *
4012
4193
  */
4013
4194
  readonly affected_by_tiles?: boolean
4014
4195
 
4015
4196
  /**
4016
- * The air resistance of this rolling stock prototype or `nil` if not a rolling stock prototype.
4197
+ * The air resistance of this rolling stock prototype.
4198
+ * @remarks
4199
+ * Applies to subclasses: RollingStock
4200
+ *
4017
4201
  */
4018
4202
  readonly air_resistance?: number
4019
4203
 
@@ -4023,24 +4207,36 @@ interface LuaEntityPrototype {
4023
4207
  readonly alert_icon_shift: Vector
4024
4208
 
4025
4209
  /**
4026
- * Does this turret prototype alert when attacking? or `nil` if not turret prototype.
4210
+ * Whether this turret raises an alert when attacking
4211
+ * @remarks
4212
+ * Applies to subclasses: Turret
4213
+ *
4027
4214
  */
4028
4215
  readonly alert_when_attacking?: boolean
4029
4216
 
4030
4217
  /**
4031
- * Does this entity with health prototype alert when damaged? or `nil` if not entity with health prototype.
4218
+ * Whether this entity raises an alert when damaged.
4219
+ * @remarks
4220
+ * Applies to subclasses: EntityWithHealth
4221
+ *
4032
4222
  */
4033
4223
  readonly alert_when_damaged?: boolean
4034
4224
 
4035
4225
  /**
4036
- * If this market allows access to all forces or just friendly ones.
4226
+ * Whether this market allows access to all forces or just friendly ones.
4227
+ * @remarks
4228
+ * Applies to subclasses: Market
4229
+ *
4037
4230
  */
4038
- readonly allow_access_to_all_forces: boolean
4231
+ readonly allow_access_to_all_forces?: boolean
4039
4232
 
4040
4233
  /**
4041
- * If this inserter allows burner leeching.
4234
+ * Whether this inserter allows burner leeching.
4235
+ * @remarks
4236
+ * Applies to subclasses: Inserter
4237
+ *
4042
4238
  */
4043
- readonly allow_burner_leech: boolean
4239
+ readonly allow_burner_leech?: boolean
4044
4240
 
4045
4241
  /**
4046
4242
  * When false copy-paste is not allowed for this entity.
@@ -4048,65 +4244,86 @@ interface LuaEntityPrototype {
4048
4244
  readonly allow_copy_paste: boolean
4049
4245
 
4050
4246
  /**
4051
- * If this inserter allows custom pickup and drop vectors.
4247
+ * Whether this inserter allows custom pickup and drop vectors.
4248
+ * @remarks
4249
+ * Applies to subclasses: Inserter
4250
+ *
4052
4251
  */
4053
- readonly allow_custom_vectors: boolean
4252
+ readonly allow_custom_vectors?: boolean
4054
4253
 
4055
4254
  /**
4056
- * If this vehicle allows passengers.
4255
+ * Whether this vehicle allows passengers.
4256
+ * @remarks
4257
+ * Applies to subclasses: Vehicle
4258
+ *
4057
4259
  */
4058
- readonly allow_passengers: boolean
4260
+ readonly allow_passengers?: boolean
4059
4261
 
4060
4262
  /**
4061
4263
  * True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)
4062
4264
  * @remarks
4063
- * Applies to subclasses: EntityWithOwnerPrototype
4265
+ * Applies to subclasses: EntityWithOwner
4064
4266
  *
4065
4267
  */
4066
- readonly allow_run_time_change_of_is_military_target: boolean
4268
+ readonly allow_run_time_change_of_is_military_target?: boolean
4067
4269
 
4068
4270
  /**
4069
- * The allowed module effects for this entity or `nil`.
4271
+ * The allowed module effects for this entity, if any.
4070
4272
  */
4071
4273
  readonly allowed_effects?: {[key: string]: boolean}
4072
4274
 
4073
4275
  /**
4074
- * Whether the lamp is always on (except when out of power or turned off by the circuit network) or `nil`.
4276
+ * Whether the lamp is always on (except when out of power or turned off by the circuit network).
4277
+ * @remarks
4278
+ * Applies to subclasses: Lamp
4279
+ *
4075
4280
  */
4076
4281
  readonly always_on?: boolean
4077
4282
 
4078
4283
  /**
4079
- * Gets the animation speed coefficient of this belt . `nil` if this is not transport belt connectable.
4284
+ * The animation speed coefficient of this belt connectable prototype.
4285
+ * @remarks
4286
+ * Applies to subclasses: BeltConnectable
4287
+ *
4080
4288
  */
4081
- readonly animation_speed_coefficient: number
4289
+ readonly animation_speed_coefficient?: number
4082
4290
 
4083
4291
  /**
4084
- * The attack parameters for this entity or `nil` if the entity doesn't use attack parameters.
4292
+ * The attack parameters for this entity, if any.
4085
4293
  */
4086
4294
  readonly attack_parameters?: AttackParameters
4087
4295
 
4088
4296
  /**
4089
- * The attack result of this entity if the entity has one, else `nil`.
4297
+ * The attack result of this entity, if any.
4090
4298
  */
4091
- readonly attack_result: TriggerItem[]
4299
+ readonly attack_result?: TriggerItem[]
4092
4300
 
4093
4301
  /**
4094
- * The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret or `nil`.
4302
+ * The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret.
4303
+ * @remarks
4304
+ * Applies to subclasses: ArtilleryTurret,AmmoTurret
4305
+ *
4095
4306
  */
4096
4307
  readonly automated_ammo_count?: number
4097
4308
 
4098
4309
  /**
4099
- * Does this prototoype automaticly cycle weapons. `nil` if this is not a spider vechicle.
4310
+ * Whether this spider vehicle prototoype automatically cycles weapons.
4311
+ * @remarks
4312
+ * Applies to subclasses: SpiderVehicle
4313
+ *
4100
4314
  */
4101
- readonly automatic_weapon_cycling: boolean
4315
+ readonly automatic_weapon_cycling?: boolean
4102
4316
 
4103
4317
  /**
4104
- * Autoplace specification for this entity prototype. `nil` if none.
4318
+ * Autoplace specification for this entity prototype, if any.
4105
4319
  */
4106
- readonly autoplace_specification: AutoplaceSpecification
4320
+ readonly autoplace_specification?: AutoplaceSpecification
4107
4321
 
4108
4322
  /**
4109
- * The base productivity of this crafting machine, lab, or mining drill, or `nil`.
4323
+ * The base productivity of this crafting machine, lab, or mining drill.
4324
+ * @remarks
4325
+ * Applies to subclasses: CraftingMachine,Lab,MiningDrill
4326
+ *
4110
4327
  */
4111
4328
  readonly base_productivity?: number
4112
4329
 
@@ -4115,22 +4332,28 @@ interface LuaEntityPrototype {
4115
4332
  * Applies to subclasses: Loader
4116
4333
  *
4117
4334
  */
4118
- readonly belt_distance: number
4335
+ readonly belt_distance?: number
4119
4336
 
4120
4337
  /**
4121
4338
  * @remarks
4122
4339
  * Applies to subclasses: Loader
4123
4340
  *
4124
4341
  */
4125
- readonly belt_length: number
4342
+ readonly belt_length?: number
4126
4343
 
4127
4344
  /**
4128
- * The speed of this transport belt or `nil` if this isn't a transport belt related prototype.
4345
+ * The speed of this transport belt.
4346
+ * @remarks
4347
+ * Applies to subclasses: TransportBeltConnectable
4348
+ *
4129
4349
  */
4130
4350
  readonly belt_speed?: number
4131
4351
 
4132
4352
  /**
4133
- * The braking force of this vehicle prototype or `nil` if not a vehicle prototype.
4353
+ * The braking force of this vehicle prototype.
4354
+ * @remarks
4355
+ * Applies to subclasses: Vehicle
4356
+ *
4134
4357
  */
4135
4358
  readonly braking_force?: number
4136
4359
 
@@ -4144,7 +4367,7 @@ interface LuaEntityPrototype {
4144
4367
  * Applies to subclasses: Character
4145
4368
  *
4146
4369
  */
4147
- readonly build_distance: number
4370
+ readonly build_distance?: number
4148
4371
 
4149
4372
  /**
4150
4373
  * The log2 of grid size of the building
@@ -4152,19 +4375,30 @@ interface LuaEntityPrototype {
4152
4375
  readonly building_grid_bit_shift: number
4153
4376
 
4154
4377
  /**
4155
- * The burner energy source prototype this entity uses or `nil`.
4378
+ * The burner energy source prototype this entity uses, if any.
4156
4379
  */
4157
4380
  readonly burner_prototype?: LuaBurnerPrototype
4158
4381
 
4159
4382
  /**
4160
- * If this generator prototype burns fluid.
4383
+ * Whether this generator prototype burns fluid.
4384
+ * @remarks
4385
+ * Applies to subclasses: Generator
4386
+ *
4161
4387
  */
4162
- readonly burns_fluid: boolean
4388
+ readonly burns_fluid?: boolean
4163
4389
 
4164
- readonly call_for_help_radius: number
4390
+ /**
4391
+ * @remarks
4392
+ * Applies to subclasses: Spawner
4393
+ *
4394
+ */
4395
+ readonly call_for_help_radius?: number
4165
4396
 
4166
4397
  /**
4167
- * Whether this unit prototype can open gates or `nil`.
4398
+ * Whether this unit prototype can open gates.
4399
+ * @remarks
4400
+ * Applies to subclasses: Unit
4401
+ *
4168
4402
  */
4169
4403
  readonly can_open_gates?: boolean
4170
4404
 
@@ -4174,27 +4408,36 @@ interface LuaEntityPrototype {
4174
4408
  * Applies to subclasses: OffshorePump
4175
4409
  *
4176
4410
  */
4177
- readonly center_collision_mask: CollisionMask
4411
+ readonly center_collision_mask?: CollisionMask
4178
4412
 
4179
4413
  /**
4180
- * Gets the chain shooting cooldown modifier of this prototype. `nil` if this is not a spider vechicle.
4414
+ * The chain shooting cooldown modifier of this spider vehicle prototype.
4415
+ * @remarks
4416
+ * Applies to subclasses: SpiderVehicle
4417
+ *
4181
4418
  */
4182
- readonly chain_shooting_cooldown_modifier: number
4419
+ readonly chain_shooting_cooldown_modifier?: number
4183
4420
 
4184
4421
  /**
4185
4422
  * @remarks
4186
4423
  * Applies to subclasses: Character
4187
4424
  *
4188
4425
  */
4189
- readonly character_corpse: LuaEntityPrototype
4426
+ readonly character_corpse?: LuaEntityPrototype
4190
4427
 
4191
4428
  /**
4192
- * Gets the chunk exploration radius of this prototype. `nil` if this is not a spider vechicle.
4429
+ * The chunk exploration radius of this spider vehicle prototype.
4430
+ * @remarks
4431
+ * Applies to subclasses: SpiderVehicle
4432
+ *
4193
4433
  */
4194
- readonly chunk_exploration_radius: number
4434
+ readonly chunk_exploration_radius?: number
4195
4435
 
4196
4436
  /**
4197
- * The item prototype name used to destroy this cliff or `nil`.
4437
+ * The item prototype name used to destroy this cliff.
4438
+ * @remarks
4439
+ * Applies to subclasses: Cliff
4440
+ *
4198
4441
  */
4199
4442
  readonly cliff_explosive_prototype?: string
4200
4443
 
@@ -4226,17 +4469,23 @@ interface LuaEntityPrototype {
4226
4469
  readonly collision_mask_with_flags: CollisionMaskWithFlags
4227
4470
 
4228
4471
  /**
4229
- * The color of the prototype, or `nil` if the prototype doesn't have color.
4472
+ * The color of the prototype, if any.
4230
4473
  */
4231
4474
  readonly color?: Color
4232
4475
 
4233
4476
  /**
4234
- * The construction radius for this roboport prototype or `nil`.
4477
+ * The construction radius for this roboport prototype.
4478
+ * @remarks
4479
+ * Applies to subclasses: Roboport
4480
+ *
4235
4481
  */
4236
4482
  readonly construction_radius?: number
4237
4483
 
4238
4484
  /**
4239
- * The energy consumption of this car prototype or `nil` if not a car prototype.
4485
+ * The energy consumption of this car prototype.
4486
+ * @remarks
4487
+ * Applies to subclasses: Car
4488
+ *
4240
4489
  */
4241
4490
  readonly consumption?: number
4242
4491
 
@@ -4245,28 +4494,38 @@ interface LuaEntityPrototype {
4245
4494
  * Applies to subclasses: Loader
4246
4495
  *
4247
4496
  */
4248
- readonly container_distance: number
4497
+ readonly container_distance?: number
4249
4498
 
4250
4499
  /**
4251
4500
  * Corpses used when this entity is destroyed. It is a dictionary indexed by the corpse's prototype name.
4501
+ * @remarks
4502
+ * Applies to subclasses: EntityWithHealth
4503
+ *
4252
4504
  */
4253
- readonly corpses: {[key: string]: LuaEntityPrototype}
4505
+ readonly corpses?: {[key: string]: LuaEntityPrototype}
4254
4506
 
4255
4507
  /**
4256
4508
  * If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter.
4509
+ * @remarks
4510
+ * Applies to subclasses: SimpleEntity
4511
+ *
4257
4512
  */
4258
- readonly count_as_rock_for_filtered_deconstruction: boolean
4513
+ readonly count_as_rock_for_filtered_deconstruction?: boolean
4259
4514
 
4260
4515
  /**
4261
- * The crafting categories this entity supports. Only meaningful when this is a crafting-machine or player entity type.
4516
+ * The crafting categories this entity prototype supports.
4262
4517
  * @remarks
4263
- * The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup.
4518
+ * The value in the dictionary is meaningless and exists just to allow for easy lookup.
4519
+ * Applies to subclasses: CraftingMachine Character
4264
4520
  *
4265
4521
  */
4266
- readonly crafting_categories: {[key: string]: boolean}
4522
+ readonly crafting_categories?: {[key: string]: boolean}
4267
4523
 
4268
4524
  /**
4269
- * The crafting speed of this crafting-machine or `nil`.
4525
+ * The crafting speed..
4526
+ * @remarks
4527
+ * Applies to subclasses: CraftingMachine
4528
+ *
4270
4529
  */
4271
4530
  readonly crafting_speed?: number
4272
4531
 
@@ -4279,29 +4538,50 @@ interface LuaEntityPrototype {
4279
4538
  readonly create_ghost_on_death: boolean
4280
4539
 
4281
4540
  /**
4282
- * The trigger run when this entity is created or `nil`.
4541
+ * The trigger to run when this entity is created, if any.
4283
4542
  */
4284
4543
  readonly created_effect?: TriggerItem[]
4285
4544
 
4286
4545
  /**
4287
- * The smoke trigger run when this entity is built or `nil`.
4546
+ * The smoke trigger run when this entity is built, if any.
4288
4547
  */
4289
- readonly created_smoke?: { initial_height: number, max_radius?: number, offset_deviation: BoundingBox, offsets: Vector[], smoke_name: string, speed: Vector, speed_from_center: number, speed_from_center_deviation: number, speed_multiplier: number, speed_multiplier_deviation: number, starting_frame: number, starting_frame_deviation: number, starting_frame_speed: number, starting_frame_speed_deviation: number }
4548
+ readonly created_smoke?: {
4549
+ initial_height: number,
4550
+ max_radius?: number,
4551
+ offset_deviation: BoundingBox,
4552
+ offsets: Vector[],
4553
+ smoke_name: string,
4554
+ speed: Vector,
4555
+ speed_from_center: number,
4556
+ speed_from_center_deviation: number,
4557
+ speed_multiplier: number,
4558
+ speed_multiplier_deviation: number,
4559
+ starting_frame: number,
4560
+ starting_frame_deviation: number,
4561
+ starting_frame_speed: number,
4562
+ starting_frame_speed_deviation: number
4563
+ }
4290
4564
 
4291
4565
  /**
4292
4566
  * @remarks
4293
4567
  * Applies to subclasses: Character
4294
4568
  *
4295
4569
  */
4296
- readonly damage_hit_tint: Color
4570
+ readonly damage_hit_tint?: Color
4297
4571
 
4298
4572
  /**
4299
- * Value between 0 and 1 darkness where all lamps of this lamp prototype are off or `nil`.
4573
+ * Value between 0 and 1 darkness where all lamps of this lamp prototype are off.
4574
+ * @remarks
4575
+ * Applies to subclasses: Lamp
4576
+ *
4300
4577
  */
4301
4578
  readonly darkness_for_all_lamps_off?: number
4302
4579
 
4303
4580
  /**
4304
- * Value between 0 and 1 darkness where all lamps of this lamp prototype are on or `nil`.
4581
+ * Value between 0 and 1 darkness where all lamps of this lamp prototype are on.
4582
+ * @remarks
4583
+ * Applies to subclasses: Lamp
4584
+ *
4305
4585
  */
4306
4586
  readonly darkness_for_all_lamps_on?: number
4307
4587
 
@@ -4311,27 +4591,42 @@ interface LuaEntityPrototype {
4311
4591
  readonly default_collision_mask_with_flags: CollisionMaskWithFlags
4312
4592
 
4313
4593
  /**
4314
- * If this generator prototype destroys non fuel fluids.
4594
+ * Whether this generator prototype destroys non-fuel fluids.
4595
+ * @remarks
4596
+ * Applies to subclasses: Generator
4597
+ *
4315
4598
  */
4316
- readonly destroy_non_fuel_fluid: boolean
4599
+ readonly destroy_non_fuel_fluid?: boolean
4317
4600
 
4318
4601
  /**
4319
- * The distraction cooldown of this unit prototype or `nil`.
4602
+ * The distraction cooldown of this unit prototype.
4603
+ * @remarks
4604
+ * Applies to subclasses: Unit
4605
+ *
4320
4606
  */
4321
4607
  readonly distraction_cooldown?: number
4322
4608
 
4323
4609
  /**
4324
- * The distribution effectivity for this beacon prototype or `nil` if not a beacon prototype.
4610
+ * The distribution effectivity for this beacon prototype.
4611
+ * @remarks
4612
+ * Applies to subclasses: Beacon
4613
+ *
4325
4614
  */
4326
4615
  readonly distribution_effectivity?: number
4327
4616
 
4328
4617
  /**
4329
- * The door opening speed for this rocket silo prototype or `nil`.
4618
+ * The door opening speed for this rocket silo prototype.
4619
+ * @remarks
4620
+ * Applies to subclasses: RocketSilo
4621
+ *
4330
4622
  */
4331
4623
  readonly door_opening_speed?: number
4332
4624
 
4333
4625
  /**
4334
- * Whether this logistics or construction robot renders its cargo when flying or `nil`.
4626
+ * Whether this logistics or construction robot renders its cargo when flying.
4627
+ * @remarks
4628
+ * Applies to subclasses: RobotWithLogisticsInterface
4629
+ *
4335
4630
  */
4336
4631
  readonly draw_cargo?: boolean
4337
4632
 
@@ -4345,23 +4640,26 @@ interface LuaEntityPrototype {
4345
4640
  * Applies to subclasses: Character
4346
4641
  *
4347
4642
  */
4348
- readonly drop_item_distance: number
4643
+ readonly drop_item_distance?: number
4349
4644
 
4350
4645
  /**
4351
- * The dying time of this corpse prototype. `nil` if not a corpse prototype.
4646
+ * The dying time of this corpse prototype.
4352
4647
  * @remarks
4353
4648
  * Applies to subclasses: Corpse
4354
4649
  *
4355
4650
  */
4356
- readonly dying_speed: number
4651
+ readonly dying_speed?: number
4357
4652
 
4358
4653
  /**
4359
- * The effectivity of this car prototype, generator prototype or `nil`.
4654
+ * The effectivity of this car prototype, generator prototype.
4655
+ * @remarks
4656
+ * Applies to subclasses: Car,Generator
4657
+ *
4360
4658
  */
4361
4659
  readonly effectivity?: number
4362
4660
 
4363
4661
  /**
4364
- * The electric energy source prototype this entity uses or `nil`.
4662
+ * The electric energy source prototype this entity uses, if any.
4365
4663
  */
4366
4664
  readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype
4367
4665
 
@@ -4376,27 +4674,39 @@ interface LuaEntityPrototype {
4376
4674
  readonly enemy_map_color: Color
4377
4675
 
4378
4676
  /**
4379
- * The energy used per hitpoint taken for this vehicle during collisions or `nil`.
4677
+ * The energy used per hitpoint taken for this vehicle during collisions.
4678
+ * @remarks
4679
+ * Applies to subclasses: Vehicle
4680
+ *
4380
4681
  */
4381
4682
  readonly energy_per_hit_point?: number
4382
4683
 
4383
4684
  /**
4384
- * The energy consumed per tile moved for this flying robot or `nil`.
4685
+ * The energy consumed per tile moved for this flying robot.
4686
+ * @remarks
4687
+ * Applies to subclasses: FlyingRobot
4688
+ *
4385
4689
  */
4386
4690
  readonly energy_per_move?: number
4387
4691
 
4388
4692
  /**
4389
- * The energy consumed per tick for this flying robot or `nil`.
4693
+ * The energy consumed per tick for this flying robot.
4694
+ * @remarks
4695
+ * Applies to subclasses: FlyingRobot
4696
+ *
4390
4697
  */
4391
4698
  readonly energy_per_tick?: number
4392
4699
 
4393
4700
  /**
4394
- * The direct energy usage of this entity or `nil` if this entity doesn't have a direct energy usage.
4701
+ * The direct energy usage of this entity, if any.
4395
4702
  */
4396
4703
  readonly energy_usage?: number
4397
4704
 
4398
4705
  /**
4399
- * The engine starting speed for this rocket silo rocket prototype or `nil`.
4706
+ * The engine starting speed for this rocket silo rocket prototype.
4707
+ * @remarks
4708
+ * Applies to subclasses: RocketSiloRocket
4709
+ *
4400
4710
  */
4401
4711
  readonly engine_starting_speed?: number
4402
4712
 
@@ -4405,35 +4715,50 @@ interface LuaEntityPrototype {
4405
4715
  * Applies to subclasses: Character
4406
4716
  *
4407
4717
  */
4408
- readonly enter_vehicle_distance: number
4718
+ readonly enter_vehicle_distance?: number
4409
4719
 
4410
4720
  /**
4411
- * Does this explosion have a beam or `nil` if not an explosion prototype.
4721
+ * Whether this explosion has a beam.
4722
+ * @remarks
4723
+ * Applies to subclasses: Explosion
4724
+ *
4412
4725
  */
4413
4726
  readonly explosion_beam?: number
4414
4727
 
4415
4728
  /**
4416
- * Does this explosion rotate or `nil` if not an explosion prototype.
4729
+ * Whether this explosion rotates.
4730
+ * @remarks
4731
+ * Applies to subclasses: Explosion
4732
+ *
4417
4733
  */
4418
4734
  readonly explosion_rotate?: number
4419
4735
 
4420
4736
  /**
4421
- * The group of mutually fast-replaceable entities. Possibly `nil`.
4737
+ * The group of mutually fast-replaceable entities, if any.
4422
4738
  */
4423
- readonly fast_replaceable_group: string
4739
+ readonly fast_replaceable_group?: string
4424
4740
 
4425
4741
  /**
4426
- * The filter count of this inserter, loader, or logistic chest or `nil`. For logistic containers, `nil` means no limit.
4742
+ * The filter count of this inserter, loader, or logistic chest. For logistic containers, `nil` means no limit.
4743
+ * @remarks
4744
+ * Applies to subclasses: Inserter,Loader,LogisticContainer
4745
+ *
4427
4746
  */
4428
4747
  readonly filter_count?: number
4429
4748
 
4430
4749
  /**
4431
- * The final attack result for projectiles `nil` if not a projectile
4750
+ * The final attack result for this projectile.
4751
+ * @remarks
4752
+ * Applies to subclasses: Projectile
4753
+ *
4432
4754
  */
4433
- readonly final_attack_result: TriggerItem[]
4755
+ readonly final_attack_result?: TriggerItem[]
4434
4756
 
4435
4757
  /**
4436
- * The fixed recipe name for this assembling machine prototype or `nil`.
4758
+ * The fixed recipe name for this assembling machine prototype, if any.
4759
+ * @remarks
4760
+ * Applies to subclasses: AssemblingMachine
4761
+ *
4437
4762
  */
4438
4763
  readonly fixed_recipe?: string
4439
4764
 
@@ -4443,7 +4768,10 @@ interface LuaEntityPrototype {
4443
4768
  readonly flags: EntityPrototypeFlags
4444
4769
 
4445
4770
  /**
4446
- * The fluid this offshore pump produces or `nil`.
4771
+ * The fluid this offshore pump produces.
4772
+ * @remarks
4773
+ * Applies to subclasses: OffshorePump
4774
+ *
4447
4775
  */
4448
4776
  readonly fluid?: LuaFluidPrototype
4449
4777
 
@@ -4456,12 +4784,15 @@ interface LuaEntityPrototype {
4456
4784
  readonly fluid_capacity: number
4457
4785
 
4458
4786
  /**
4459
- * The fluid energy source prototype this entity uses or `nil`.
4787
+ * The fluid energy source prototype this entity uses, if any.
4460
4788
  */
4461
4789
  readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype
4462
4790
 
4463
4791
  /**
4464
- * The fluid usage of this generator prototype or `nil`.
4792
+ * The fluid usage of this generator prototype.
4793
+ * @remarks
4794
+ * Applies to subclasses: Generator
4795
+ *
4465
4796
  */
4466
4797
  readonly fluid_usage_per_tick?: number
4467
4798
 
@@ -4471,17 +4802,26 @@ interface LuaEntityPrototype {
4471
4802
  readonly fluidbox_prototypes: LuaFluidBoxPrototype[]
4472
4803
 
4473
4804
  /**
4474
- * The flying acceleration for this rocket silo rocket prototype or `nil`.
4805
+ * The flying acceleration for this rocket silo rocket prototype.
4806
+ * @remarks
4807
+ * Applies to subclasses: RocketSiloRocket
4808
+ *
4475
4809
  */
4476
4810
  readonly flying_acceleration?: number
4477
4811
 
4478
4812
  /**
4479
- * The flying speed for this rocket silo rocket prototype or `nil`.
4813
+ * The flying speed for this rocket silo rocket prototype.
4814
+ * @remarks
4815
+ * Applies to subclasses: RocketSiloRocket
4816
+ *
4480
4817
  */
4481
4818
  readonly flying_speed?: number
4482
4819
 
4483
4820
  /**
4484
- * The friction of this vehicle prototype or `nil` if not a vehicle prototype.
4821
+ * The friction of this vehicle prototype.
4822
+ * @remarks
4823
+ * Applies to subclasses: Vehicle
4824
+ *
4485
4825
  */
4486
4826
  readonly friction_force?: number
4487
4827
 
@@ -4491,7 +4831,7 @@ interface LuaEntityPrototype {
4491
4831
  readonly friendly_map_color: Color
4492
4832
 
4493
4833
  /**
4494
- * The equipment grid prototype for this entity or `nil`.
4834
+ * The equipment grid prototype for this entity, if any.
4495
4835
  */
4496
4836
  readonly grid_prototype?: LuaEquipmentGridPrototype
4497
4837
 
@@ -4501,87 +4841,134 @@ interface LuaEntityPrototype {
4501
4841
  readonly group: LuaGroup
4502
4842
 
4503
4843
  /**
4504
- * A mapping of the gun name to the gun prototype this prototype uses, or `nil`.
4844
+ * A mapping of the gun name to the gun prototype this prototype uses. `nil` if this entity prototype doesn't use guns.
4505
4845
  */
4506
4846
  readonly guns?: {[key: string]: LuaItemPrototype}
4507
4847
 
4508
4848
  /**
4509
- * Whether this unit, car, or character prototype has belt immunity, `nil` if not car, unit, or character prototype.
4849
+ * Whether this unit, car, or character prototype has belt immunity.
4850
+ * @remarks
4851
+ * Applies to subclasses: Unit,Car,Character
4852
+ *
4510
4853
  */
4511
- readonly has_belt_immunity: boolean
4854
+ readonly has_belt_immunity?: boolean
4512
4855
 
4513
4856
  /**
4514
- * Amount this entity can heal per tick.
4857
+ * Amount this entity can heal per tick, if any.
4515
4858
  */
4516
- readonly healing_per_tick: number
4859
+ readonly healing_per_tick?: number
4517
4860
 
4518
4861
  /**
4519
- * The heat buffer prototype this entity uses or `nil`.
4862
+ * The heat buffer prototype this entity uses, if any.
4520
4863
  */
4521
4864
  readonly heat_buffer_prototype?: LuaHeatBufferPrototype
4522
4865
 
4523
4866
  /**
4524
- * The heat energy source prototype this entity uses or `nil`.
4867
+ * The heat energy source prototype this entity uses, if any.
4525
4868
  */
4526
4869
  readonly heat_energy_source_prototype?: LuaHeatEnergySourcePrototype
4527
4870
 
4528
4871
  /**
4529
- * Gets the height of this prototype. `nil` if this is not a spider vechicle.
4872
+ * The height of this spider vehicle prototype.
4873
+ * @remarks
4874
+ * Applies to subclasses: SpiderVehicle
4875
+ *
4530
4876
  */
4531
- readonly height: number
4877
+ readonly height?: number
4532
4878
 
4533
4879
  /**
4534
- * A vector of the gun prototypes this prototype uses, or `nil`.
4880
+ * The idle energy usage of this rocket silo prototype.
4881
+ * @remarks
4882
+ * Applies to subclasses: RocketSilo
4883
+ *
4884
+ */
4885
+ readonly idle_energy_usage?: number
4886
+
4887
+ /**
4888
+ * A vector of the gun prototypes of this car, spider vehicule, or artillery wagon or turret.
4889
+ * @remarks
4890
+ * Applies to subclasses: Car,SpiderVehicle,ArtilleryTurret,ArtilleryWagon
4891
+ *
4535
4892
  */
4536
4893
  readonly indexed_guns?: LuaItemPrototype[]
4537
4894
 
4538
4895
  /**
4539
- * Every time this infinite resource 'ticks' down it is reduced by this amount. `nil` when not a resource. Meaningless if this isn't an infinite type resource.
4896
+ * Every time this infinite resource 'ticks' down, it is reduced by this amount. Meaningless if this isn't an infinite resource.
4897
+ * @remarks
4898
+ * Applies to subclasses: ResourceEntity
4899
+ *
4540
4900
  */
4541
- readonly infinite_depletion_resource_amount: number
4901
+ readonly infinite_depletion_resource_amount?: number
4542
4902
 
4543
4903
  /**
4544
- * Is this resource infinite? Will be `nil` when used on a non-resource.
4904
+ * Whether this resource is infinite.
4905
+ * @remarks
4906
+ * Applies to subclasses: ResourceEntity
4907
+ *
4545
4908
  */
4546
- readonly infinite_resource: boolean
4909
+ readonly infinite_resource?: boolean
4547
4910
 
4548
4911
  /**
4549
- * The max number of ingredients this crafting-machine prototype supports or `nil` if this isn't a crafting-machine prototype.
4912
+ * The max number of ingredients this crafting machine prototype supports.
4913
+ * @remarks
4914
+ * Applies to subclasses: CraftingMachine
4915
+ *
4550
4916
  */
4551
4917
  readonly ingredient_count?: number
4552
4918
 
4553
4919
  /**
4554
- * True if this inserter chases items on belts for pickup or `nil`.
4920
+ * True if this inserter chases items on belts for pickup.
4921
+ * @remarks
4922
+ * Applies to subclasses: Inserter
4923
+ *
4555
4924
  */
4556
4925
  readonly inserter_chases_belt_items?: boolean
4557
4926
 
4558
4927
  /**
4559
- * The drop position for this inserter or `nil`.
4928
+ * The drop position for this inserter.
4929
+ * @remarks
4930
+ * Applies to subclasses: Inserter
4931
+ *
4560
4932
  */
4561
4933
  readonly inserter_drop_position?: Vector
4562
4934
 
4563
4935
  /**
4564
- * The extension speed of this inserter or `nil`.
4936
+ * The extension speed of this inserter.
4937
+ * @remarks
4938
+ * Applies to subclasses: Inserter
4939
+ *
4565
4940
  */
4566
4941
  readonly inserter_extension_speed?: number
4567
4942
 
4568
4943
  /**
4569
- * The pickup position for this inserter or `nil`.
4944
+ * The pickup position for this inserter.
4945
+ * @remarks
4946
+ * Applies to subclasses: Inserter
4947
+ *
4570
4948
  */
4571
4949
  readonly inserter_pickup_position?: Vector
4572
4950
 
4573
4951
  /**
4574
- * The rotation speed of this inserter or `nil`.
4952
+ * The rotation speed of this inserter.
4953
+ * @remarks
4954
+ * Applies to subclasses: Inserter
4955
+ *
4575
4956
  */
4576
4957
  readonly inserter_rotation_speed?: number
4577
4958
 
4578
4959
  /**
4579
- * Gets the built-in stack size bonus of this inserter prototype. `nil` if this is not an inserter.
4960
+ * The built-in stack size bonus of this inserter prototype.
4961
+ * @remarks
4962
+ * Applies to subclasses: Inserter
4963
+ *
4580
4964
  */
4581
- readonly inserter_stack_size_bonus: number
4965
+ readonly inserter_stack_size_bonus?: number
4582
4966
 
4583
4967
  /**
4584
- * The instruments for this programmable speaker or `nil`.
4968
+ * The instruments for this programmable speaker.
4969
+ * @remarks
4970
+ * Applies to subclasses: ProgrammableSpeaker
4971
+ *
4585
4972
  */
4586
4973
  readonly instruments?: ProgrammableSpeakerInstrument[]
4587
4974
 
@@ -4595,40 +4982,60 @@ interface LuaEntityPrototype {
4595
4982
  /**
4596
4983
  * True if this entity-with-owner is military target
4597
4984
  * @remarks
4598
- * Applies to subclasses: EntityWithOwnerPrototype
4985
+ * Applies to subclasses: EntityWithOwner
4599
4986
  *
4600
4987
  */
4601
- readonly is_military_target: boolean
4988
+ readonly is_military_target?: boolean
4602
4989
 
4603
4990
  /**
4604
4991
  * @remarks
4605
4992
  * Applies to subclasses: Character
4606
4993
  *
4607
4994
  */
4608
- readonly item_pickup_distance: number
4995
+ readonly item_pickup_distance?: number
4609
4996
 
4610
4997
  /**
4611
- * The item slot count of this constant combinator prototype or `nil`.
4998
+ * The item slot count of this constant combinator prototype.
4999
+ * @remarks
5000
+ * Applies to subclasses: ConstantCombinator
5001
+ *
4612
5002
  */
4613
5003
  readonly item_slot_count?: number
4614
5004
 
4615
5005
  /**
4616
- * Items that, when placed, will produce this entity. It is an array of items, or `nil` if no items place this entity. Construction bots will always choose the first item in this list to build this entity.
5006
+ * Items that when placed will produce this entity, if any. Construction bots will always choose the first item in this list to build this entity.
4617
5007
  */
4618
5008
  readonly items_to_place_this?: SimpleItemStack[]
4619
5009
 
4620
5010
  /**
4621
- * The item prototype names that are the inputs of this lab prototype or `nil`.
5011
+ * The item prototype names that are the inputs of this lab prototype.
5012
+ * @remarks
5013
+ * Applies to subclasses: Lab
5014
+ *
4622
5015
  */
4623
5016
  readonly lab_inputs?: string[]
4624
5017
 
4625
5018
  /**
4626
- * The rocket launch delay for this rocket silo prototype or `nil`.
5019
+ * The lamp energy usage of this rocket silo prototype.
5020
+ * @remarks
5021
+ * Applies to subclasses: RocketSilo
5022
+ *
5023
+ */
5024
+ readonly lamp_energy_usage?: number
5025
+
5026
+ /**
5027
+ * The rocket launch delay for this rocket silo prototype.
5028
+ * @remarks
5029
+ * Applies to subclasses: RocketSilo
5030
+ *
4627
5031
  */
4628
5032
  readonly launch_wait_time?: number
4629
5033
 
4630
5034
  /**
4631
- * The light blinking speed for this rocket silo prototype or `nil`.
5035
+ * The light blinking speed for this rocket silo prototype.
5036
+ * @remarks
5037
+ * Applies to subclasses: RocketSilo
5038
+ *
4632
5039
  */
4633
5040
  readonly light_blinking_speed?: number
4634
5041
 
@@ -4637,44 +5044,70 @@ interface LuaEntityPrototype {
4637
5044
  readonly localised_name: LocalisedString
4638
5045
 
4639
5046
  /**
4640
- * The logistic mode of this logistic container or `nil` if this isn't a logistic container prototype. One of `"requester"`, `"active-provider"`, `"passive-provider"`, `"buffer"`, `"storage"`, `"none"`.
5047
+ * The logistic mode of this logistic container. One of `"requester"`, `"active-provider"`, `"passive-provider"`, `"buffer"`, `"storage"`, `"none"`.
5048
+ * @remarks
5049
+ * Applies to subclasses: LogisticContainer
5050
+ *
4641
5051
  */
4642
5052
  readonly logistic_mode?: string
4643
5053
 
4644
5054
  /**
4645
- * The logistic parameters for this roboport. or `nil`.
5055
+ * The logistic parameters for this roboport.
4646
5056
  * @remarks
4647
5057
  * Both the `charging_station_shift` and `stationing_offset` vectors are tables with `x` and `y` keys instead of an array.
5058
+ * Applies to subclasses: Roboport
4648
5059
  *
4649
5060
  */
4650
- readonly logistic_parameters?: { charge_approach_distance: number, charging_distance: number, charging_energy: number, charging_station_count: number, charging_station_shift: Vector, charging_threshold_distance: number, construction_radius: number, logistic_radius: number, logistics_connection_distance: number, robot_limit: number, robot_vertical_acceleration: number, robots_shrink_when_entering_and_exiting: boolean, spawn_and_station_height: number, spawn_and_station_shadow_height_offset: number, stationing_offset: Vector }
5061
+ readonly logistic_parameters?: {
5062
+ charge_approach_distance: number,
5063
+ charging_distance: number,
5064
+ charging_energy: number,
5065
+ charging_station_count: number,
5066
+ charging_station_shift: Vector,
5067
+ charging_threshold_distance: number,
5068
+ construction_radius: number,
5069
+ logistic_radius: number,
5070
+ logistics_connection_distance: number,
5071
+ robot_limit: number,
5072
+ robot_vertical_acceleration: number,
5073
+ robots_shrink_when_entering_and_exiting: boolean,
5074
+ spawn_and_station_height: number,
5075
+ spawn_and_station_shadow_height_offset: number,
5076
+ stationing_offset: Vector
5077
+ }
4651
5078
 
4652
5079
  /**
4653
- * The logistic radius for this roboport prototype or `nil`.
5080
+ * The logistic radius for this roboport prototype.
5081
+ * @remarks
5082
+ * Applies to subclasses: Roboport
5083
+ *
4654
5084
  */
4655
5085
  readonly logistic_radius?: number
4656
5086
 
4657
5087
  /**
4658
- * Loot that will be dropped when this entity is killed. `nil` if there is no loot.
5088
+ * Loot that will be dropped when this entity is killed, if any.
5089
+ * @remarks
5090
+ * Applies to subclasses: EntityWithHealth
5091
+ *
4659
5092
  */
4660
- readonly loot: Loot[]
5093
+ readonly loot?: Loot[]
4661
5094
 
4662
5095
  /**
4663
5096
  * @remarks
4664
5097
  * Applies to subclasses: Character
4665
5098
  *
4666
5099
  */
4667
- readonly loot_pickup_distance: number
5100
+ readonly loot_pickup_distance?: number
4668
5101
 
4669
5102
  /**
4670
- * Get the manual range modifier for artillery turret and artillery wagon prototypes. `nil` if not artillery type prototype
5103
+ * The manual range modifier for this artillery turret or wagon prototype.
4671
5104
  *
4672
5105
  * subclass(ArtilleryWagon, ArtilleryTurret)
4673
5106
  */
4674
- readonly manual_range_modifier: number
5107
+ readonly manual_range_modifier?: number
4675
5108
 
4676
5109
  /**
4677
- * The map color used when charting this entity if a friendly or enemy color isn't defined or `nil`.
5110
+ * The map color used when charting this entity if a friendly or enemy color isn't defined, if any.
4678
5111
  */
4679
5112
  readonly map_color?: Color
4680
5113
 
@@ -4684,32 +5117,47 @@ interface LuaEntityPrototype {
4684
5117
  readonly map_generator_bounding_box: BoundingBox
4685
5118
 
4686
5119
  /**
4687
- * The maximum circuit wire distance for this entity. 0 when the entity doesn't support circuit wires.
5120
+ * The maximum circuit wire distance for this entity. 0 if the entity doesn't support circuit wires.
4688
5121
  */
4689
5122
  readonly max_circuit_wire_distance: number
4690
5123
 
4691
5124
  /**
4692
5125
  * Count of enemies this spawner can sustain.
5126
+ * @remarks
5127
+ * Applies to subclasses: Spawner
5128
+ *
4693
5129
  */
4694
- readonly max_count_of_owned_units: number
5130
+ readonly max_count_of_owned_units?: number
4695
5131
 
4696
5132
  /**
4697
5133
  * The maximum darkness at which this unit spawner can spawn entities.
5134
+ * @remarks
5135
+ * Applies to subclasses: Spawner
5136
+ *
4698
5137
  */
4699
- readonly max_darkness_to_spawn: number
5138
+ readonly max_darkness_to_spawn?: number
4700
5139
 
4701
5140
  /**
4702
5141
  * The radius of the area constantly revealed by this radar, in chunks.
5142
+ * @remarks
5143
+ * Applies to subclasses: Radar
5144
+ *
4703
5145
  */
4704
- readonly max_distance_of_nearby_sector_revealed: number
5146
+ readonly max_distance_of_nearby_sector_revealed?: number
4705
5147
 
4706
5148
  /**
4707
5149
  * The radius of the area this radar can chart, in chunks.
5150
+ * @remarks
5151
+ * Applies to subclasses: Radar
5152
+ *
4708
5153
  */
4709
- readonly max_distance_of_sector_revealed: number
5154
+ readonly max_distance_of_sector_revealed?: number
4710
5155
 
4711
5156
  /**
4712
- * The max energy for this flying robot or `nil`.
5157
+ * The max energy for this flying robot.
5158
+ * @remarks
5159
+ * Applies to subclasses: FlyingRobot
5160
+ *
4713
5161
  */
4714
5162
  readonly max_energy?: number
4715
5163
 
@@ -4725,8 +5173,11 @@ interface LuaEntityPrototype {
4725
5173
 
4726
5174
  /**
4727
5175
  * How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.
5176
+ * @remarks
5177
+ * Applies to subclasses: Spawner
5178
+ *
4728
5179
  */
4729
- readonly max_friends_around_to_spawn: number
5180
+ readonly max_friends_around_to_spawn?: number
4730
5181
 
4731
5182
  /**
4732
5183
  * Max health of this entity. Will be `0` if this is not an entity with health.
@@ -4734,42 +5185,63 @@ interface LuaEntityPrototype {
4734
5185
  readonly max_health: number
4735
5186
 
4736
5187
  /**
4737
- * The max payload size of this logistics or construction robot or `nil`.
5188
+ * The max payload size of this logistics or construction robot.
5189
+ * @remarks
5190
+ * Applies to subclasses: RobotWithLogisticsInterface
5191
+ *
4738
5192
  */
4739
5193
  readonly max_payload_size?: number
4740
5194
 
4741
5195
  /**
4742
- * The maximum polyphony for this programmable speaker or `nil`.
5196
+ * The maximum polyphony for this programmable speaker.
5197
+ * @remarks
5198
+ * Applies to subclasses: ProgrammableSpeaker
5199
+ *
4743
5200
  */
4744
5201
  readonly max_polyphony?: number
4745
5202
 
4746
5203
  /**
4747
- * The default maximum power output of this generator prototype or `nil`.
5204
+ * The default maximum power output of this generator prototype.
5205
+ * @remarks
5206
+ * Applies to subclasses: Generator
5207
+ *
4748
5208
  */
4749
5209
  readonly max_power_output?: number
4750
5210
 
4751
5211
  /**
4752
- * The maximum pursue distance of this unit prototype or `nil`.
5212
+ * The maximum pursue distance of this unit prototype.
5213
+ * @remarks
5214
+ * Applies to subclasses: Unit
5215
+ *
4753
5216
  */
4754
5217
  readonly max_pursue_distance?: number
4755
5218
 
4756
5219
  /**
4757
- * The max speed of this projectile prototype or flying robot prototype or `nil`.
5220
+ * The max speed of this projectile or flying robot prototype.
5221
+ * @remarks
5222
+ * Applies to subclasses: Projectile,FlyingRobot
5223
+ *
4758
5224
  */
4759
5225
  readonly max_speed?: number
4760
5226
 
4761
5227
  /**
4762
- * The maximum energy for this flying robot above which it won't try to recharge when stationing or `nil`.
5228
+ * The maximum energy for this flying robot above which it won't try to recharge when stationing.
5229
+ * @remarks
5230
+ * Applies to subclasses: FlyingRobot
5231
+ *
4763
5232
  */
4764
5233
  readonly max_to_charge?: number
4765
5234
 
4766
5235
  /**
4767
- * The max underground distance for underground belts and underground pipes or `nil` if this isn't one of those prototypes.
5236
+ * The max underground distance for underground belts and underground pipes.
5237
+ * @remarks
5238
+ * Applies to subclasses: UndergroundBelt,PipeToGround
5239
+ *
4768
5240
  */
4769
5241
  readonly max_underground_distance?: number
4770
5242
 
4771
5243
  /**
4772
- * The maximum wire distance for this entity. 0 when the entity doesn't support wires.
5244
+ * The maximum wire distance for this entity. 0 if the entity doesn't support wires.
4773
5245
  */
4774
5246
  readonly max_wire_distance: number
4775
5247
 
@@ -4778,55 +5250,115 @@ interface LuaEntityPrototype {
4778
5250
  * Applies to subclasses: Character
4779
5251
  *
4780
5252
  */
4781
- readonly maximum_corner_sliding_distance: number
5253
+ readonly maximum_corner_sliding_distance?: number
4782
5254
 
4783
5255
  /**
4784
- * The maximum fluid temperature of this generator prototype or `nil`.
5256
+ * The maximum fluid temperature of this generator prototype.
5257
+ * @remarks
5258
+ * Applies to subclasses: Generator
5259
+ *
4785
5260
  */
4786
5261
  readonly maximum_temperature?: number
4787
5262
 
4788
5263
  /**
4789
5264
  * The minimum darkness at which this unit spawner can spawn entities.
5265
+ * @remarks
5266
+ * Applies to subclasses: Spawner
5267
+ *
4790
5268
  */
4791
- readonly min_darkness_to_spawn: number
5269
+ readonly min_darkness_to_spawn?: number
4792
5270
 
4793
5271
  /**
4794
- * The minimum pursue time of this unit prototype or `nil`.
5272
+ * The minimum pursue time of this unit prototype.
5273
+ * @remarks
5274
+ * Applies to subclasses: Unit
5275
+ *
4795
5276
  */
4796
5277
  readonly min_pursue_time?: number
4797
5278
 
4798
5279
  /**
4799
- * The minimum energy for this flying robot before it tries to recharge or `nil`.
5280
+ * The minimum energy for this flying robot before it tries to recharge.
5281
+ * @remarks
5282
+ * Applies to subclasses: FlyingRobot
5283
+ *
4800
5284
  */
4801
5285
  readonly min_to_charge?: number
4802
5286
 
4803
5287
  /**
4804
5288
  * Whether this entity is minable and what can be obtained by mining it.
4805
5289
  */
4806
- readonly mineable_properties: { fluid_amount?: number, minable: boolean, mining_particle?: string, mining_time: number, mining_trigger?: TriggerItem[], products?: Product[], required_fluid?: string }
4807
-
4808
- /**
4809
- * Minimum amount of this resource. Will be `nil` when used on a non-resource.
5290
+ readonly mineable_properties: {
5291
+
5292
+ /**
5293
+ * The required fluid amount if any.
5294
+ */
5295
+ fluid_amount?: number,
5296
+
5297
+ /**
5298
+ * Is this entity mineable at all?
5299
+ */
5300
+ minable: boolean,
5301
+
5302
+ /**
5303
+ * Prototype name of the particle produced when mining this entity. Will only be present if this entity produces any particle during mining.
5304
+ */
5305
+ mining_particle?: string,
5306
+
5307
+ /**
5308
+ * Energy required to mine an entity.
5309
+ */
5310
+ mining_time: number,
5311
+
5312
+ /**
5313
+ * The mining trigger if any.
5314
+ */
5315
+ mining_trigger?: TriggerItem[],
5316
+
5317
+ /**
5318
+ * Products obtained by mining this entity.
5319
+ */
5320
+ products?: Product[],
5321
+
5322
+ /**
5323
+ * The prototype name of the required fluid if any.
5324
+ */
5325
+ required_fluid?: string
5326
+ }
5327
+
5328
+ /**
5329
+ * Minimum amount of this resource.
5330
+ * @remarks
5331
+ * Applies to subclasses: ResourceEntity
5332
+ *
4810
5333
  */
4811
- readonly minimum_resource_amount: number
5334
+ readonly minimum_resource_amount?: number
4812
5335
 
4813
5336
  /**
4814
- * The mining radius of this mining drill prototype or `nil` if this isn't a mining drill prototype.
5337
+ * The mining radius of this mining drill prototype.
5338
+ * @remarks
5339
+ * Applies to subclasses: MiningDrill
5340
+ *
4815
5341
  */
4816
5342
  readonly mining_drill_radius?: number
4817
5343
 
4818
5344
  /**
4819
- * The mining speed of this mining drill/character prototype or `nil`.
5345
+ * The mining speed of this mining drill/character prototype.
5346
+ * @remarks
5347
+ * Applies to subclasses: MiningDrill,Character
5348
+ *
4820
5349
  */
4821
5350
  readonly mining_speed?: number
4822
5351
 
4823
5352
  /**
4824
- * The module inventory size or `nil` if this entity doesn't support modules.
5353
+ * The module inventory size. `nil` if this entity doesn't support modules.
4825
5354
  */
4826
5355
  readonly module_inventory_size?: number
4827
5356
 
4828
5357
  /**
4829
- * Whether this unit prototype can move while shooting or `nil`.
5358
+ * Whether this unit prototype can move while shooting.
5359
+ * @remarks
5360
+ * Applies to subclasses: Unit
5361
+ *
4830
5362
  */
4831
5363
  readonly move_while_shooting?: boolean
4832
5364
 
@@ -4840,17 +5372,20 @@ interface LuaEntityPrototype {
4840
5372
  * Applies to subclasses: Reactor
4841
5373
  *
4842
5374
  */
4843
- readonly neighbour_bonus: number
5375
+ readonly neighbour_bonus?: number
4844
5376
 
4845
5377
  /**
4846
- * The next upgrade for this entity or `nil`.
5378
+ * The next upgrade for this entity, if any.
4847
5379
  */
4848
5380
  readonly next_upgrade?: LuaEntityPrototype
4849
5381
 
4850
5382
  /**
4851
- * The normal amount for this resource. `nil` when not a resource.
5383
+ * The normal amount for this resource.
5384
+ * @remarks
5385
+ * Applies to subclasses: ResourceEntity
5386
+ *
4852
5387
  */
4853
- readonly normal_resource_amount: number
5388
+ readonly normal_resource_amount?: number
4854
5389
 
4855
5390
  /**
4856
5391
  * 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.
@@ -4863,9 +5398,12 @@ interface LuaEntityPrototype {
4863
5398
  readonly order: string
4864
5399
 
4865
5400
  /**
4866
- * The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution. `nil` when prototype is not a unit prototype.
5401
+ * The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.
5402
+ * @remarks
5403
+ * Applies to subclasses: Unit
5404
+ *
4867
5405
  */
4868
- readonly pollution_to_join_attack: number
5406
+ readonly pollution_to_join_attack?: number
4869
5407
 
4870
5408
  /**
4871
5409
  * True if this entity prototype should be included during tile collision checks with {@link LuaTilePrototype::check_collision_with_entities | LuaTilePrototype::check_collision_with_entities} enabled.
@@ -4873,12 +5411,18 @@ interface LuaEntityPrototype {
4873
5411
  readonly protected_from_tile_building: boolean
4874
5412
 
4875
5413
  /**
4876
- * The pumping speed of this offshore pump, normal pump, or `nil`.
5414
+ * The pumping speed of this offshore or normal pump.
5415
+ * @remarks
5416
+ * Applies to subclasses: OffshorePump,Pump
5417
+ *
4877
5418
  */
4878
5419
  readonly pumping_speed?: number
4879
5420
 
4880
5421
  /**
4881
- * The radar range of this unit prototype or `nil`.
5422
+ * The radar range of this unit prototype.
5423
+ * @remarks
5424
+ * Applies to subclasses: Unit
5425
+ *
4882
5426
  */
4883
5427
  readonly radar_range?: number
4884
5428
 
@@ -4892,21 +5436,21 @@ interface LuaEntityPrototype {
4892
5436
  * Applies to subclasses: Character
4893
5437
  *
4894
5438
  */
4895
- readonly reach_distance: number
5439
+ readonly reach_distance?: number
4896
5440
 
4897
5441
  /**
4898
5442
  * @remarks
4899
5443
  * Applies to subclasses: Character
4900
5444
  *
4901
5445
  */
4902
- readonly reach_resource_distance: number
5446
+ readonly reach_resource_distance?: number
4903
5447
 
4904
5448
  /**
4905
5449
  * @remarks
4906
5450
  * Applies to subclasses: TransportBelt
4907
5451
  *
4908
5452
  */
4909
- readonly related_underground_belt: LuaEntityPrototype
5453
+ readonly related_underground_belt?: LuaEntityPrototype
4910
5454
 
4911
5455
  /**
4912
5456
  * The remains left behind when this entity is mined.
@@ -4916,32 +5460,43 @@ interface LuaEntityPrototype {
4916
5460
  readonly remove_decoratives: string
4917
5461
 
4918
5462
  /**
4919
- * Repair-speed modifier for this entity. Actual repair speed will be `tool_repair_speed * entity_repair_speed_modifier`. May be `nil`.
5463
+ * Repair-speed modifier for this entity, if any. Actual repair speed will be `tool_repair_speed * entity_repair_speed_modifier`.
5464
+ * @remarks
5465
+ * Applies to subclasses: EntityWithHealth
5466
+ *
4920
5467
  */
4921
- readonly repair_speed_modifier: number
5468
+ readonly repair_speed_modifier?: number
4922
5469
 
4923
5470
  /**
4924
- * The base researching speed of this lab prototype or `nil`.
5471
+ * The base researching speed of this lab prototype.
5472
+ * @remarks
5473
+ * Applies to subclasses: Lab
5474
+ *
4925
5475
  */
4926
5476
  readonly researching_speed?: number
4927
5477
 
4928
5478
  /**
4929
5479
  * List of resistances towards each damage type. It is a dictionary indexed by damage type names (see `data/base/prototypes/damage-type.lua`).
5480
+ * @remarks
5481
+ * Applies to subclasses: EntityWithHealth
5482
+ *
4930
5483
  */
4931
- readonly resistances: {[key: string]: Resistance}
5484
+ readonly resistances?: {[key: string]: Resistance}
4932
5485
 
4933
5486
  /**
4934
- * The resource categories this character or mining drill supports, or `nil` if not a character or mining dill.
5487
+ * The resource categories this character or mining drill supports.
4935
5488
  * @remarks
4936
- * The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup.
5489
+ * The value in the dictionary is meaningless and exists just to allow for easy lookup.
5490
+ * Applies to subclasses: MiningDrill,Character
4937
5491
  *
4938
5492
  */
4939
5493
  readonly resource_categories?: {[key: string]: boolean}
4940
5494
 
4941
5495
  /**
4942
- * Name of the category of this resource or `nil` when not a resource.
5496
+ * Name of the category of this resource.
4943
5497
  * @remarks
4944
- * During data stage this property is named "category".
5498
+ * During data stage, this property is named "category".
5499
+ * Applies to subclasses: ResourceEntity
4945
5500
  *
4946
5501
  */
4947
5502
  readonly resource_category?: string
@@ -4951,53 +5506,74 @@ interface LuaEntityPrototype {
4951
5506
  * Applies to subclasses: Character
4952
5507
  *
4953
5508
  */
4954
- readonly respawn_time: number
5509
+ readonly respawn_time?: number
4955
5510
 
4956
5511
  /**
4957
5512
  * The result units and spawn points with weight and evolution factor for a biter spawner entity.
5513
+ * @remarks
5514
+ * Applies to subclasses: Spawner
5515
+ *
4958
5516
  */
4959
- readonly result_units: UnitSpawnDefinition[]
5517
+ readonly result_units?: UnitSpawnDefinition[]
4960
5518
 
4961
5519
  /**
4962
- * The rising speed for this rocket silo rocket prototype or `nil`.
5520
+ * The rising speed for this rocket silo rocket prototype.
5521
+ * @remarks
5522
+ * Applies to subclasses: RocketSiloRocket
5523
+ *
4963
5524
  */
4964
5525
  readonly rising_speed?: number
4965
5526
 
4966
5527
  /**
4967
- * The rocket entity prototype associated with this rocket silo prototype or `nil`.
5528
+ * The rocket entity prototype associated with this rocket silo prototype.
5529
+ * @remarks
5530
+ * Applies to subclasses: RocketSilo
5531
+ *
4968
5532
  */
4969
5533
  readonly rocket_entity_prototype?: LuaEntityPrototype
4970
5534
 
4971
5535
  /**
4972
- * The rocket parts required for this rocket silo prototype or `nil`.
5536
+ * The rocket parts required for this rocket silo prototype.
5537
+ * @remarks
5538
+ * Applies to subclasses: RocketSilo
5539
+ *
4973
5540
  */
4974
5541
  readonly rocket_parts_required?: number
4975
5542
 
4976
5543
  /**
4977
- * The rocket rising delay for this rocket silo prototype or `nil`.
5544
+ * The rocket rising delay for this rocket silo prototype.
5545
+ * @remarks
5546
+ * Applies to subclasses: RocketSilo
5547
+ *
4978
5548
  */
4979
5549
  readonly rocket_rising_delay?: number
4980
5550
 
4981
5551
  /**
4982
- * The rotation speed of this car prototype or `nil` if not a car prototype.
5552
+ * The rotation speed of this car prototype.
5553
+ * @remarks
5554
+ * Applies to subclasses: Car
5555
+ *
4983
5556
  */
4984
5557
  readonly rotation_speed?: number
4985
5558
 
4986
5559
  /**
4987
- * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
5560
+ * The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
4988
5561
  * @remarks
4989
5562
  * Applies to subclasses: Character
4990
5563
  *
4991
5564
  */
4992
- readonly running_speed: number
5565
+ readonly running_speed?: number
4993
5566
 
4994
5567
  /**
4995
- * If this generator prototype scales fluid usage.
5568
+ * Whether this generator prototype scales fluid usage.
5569
+ * @remarks
5570
+ * Applies to subclasses: Generator
5571
+ *
4996
5572
  */
4997
- readonly scale_fluid_usage: boolean
5573
+ readonly scale_fluid_usage?: boolean
4998
5574
 
4999
5575
  /**
5000
- * The secondary bounding box used for collision checking, or `nil` if it doesn't have one. This is only used in rails and rail remnants.
5576
+ * The secondary bounding box used for collision checking, if any. This is only used in rails and rail remnants.
5001
5577
  */
5002
5578
  readonly secondary_collision_box?: BoundingBox
5003
5579
 
@@ -5022,42 +5598,63 @@ interface LuaEntityPrototype {
5022
5598
  readonly shooting_cursor_size: number
5023
5599
 
5024
5600
  /**
5025
- * The spawning cooldown for this enemy spawner prototype or `nil`.
5601
+ * The spawning cooldown for this enemy spawner prototype.
5602
+ * @remarks
5603
+ * Applies to subclasses: Spawner
5604
+ *
5026
5605
  */
5027
- readonly spawn_cooldown?: { max: number, min: number }
5606
+ readonly spawn_cooldown?: {
5607
+ max: number,
5608
+ min: number
5609
+ }
5028
5610
 
5029
5611
  /**
5030
5612
  * How far from the spawner can the units be spawned.
5613
+ * @remarks
5614
+ * Applies to subclasses: Spawner
5615
+ *
5031
5616
  */
5032
- readonly spawning_radius: number
5617
+ readonly spawning_radius?: number
5033
5618
 
5034
5619
  /**
5035
5620
  * What spaces should be between the spawned units.
5621
+ * @remarks
5622
+ * Applies to subclasses: Spawner
5623
+ *
5036
5624
  */
5037
- readonly spawning_spacing: number
5625
+ readonly spawning_spacing?: number
5038
5626
 
5039
5627
  /**
5040
- * The spawning time modifier of this unit prototype or `nil`.
5628
+ * The spawning time modifier of this unit prototype.
5629
+ * @remarks
5630
+ * Applies to subclasses: Unit
5631
+ *
5041
5632
  */
5042
5633
  readonly spawning_time_modifier?: number
5043
5634
 
5044
5635
  /**
5045
- * The default speed of this flying robot, rolling stock or unit, `nil` if not one of these.
5636
+ * The default speed of this flying robot, rolling stock or unit. For rolling stocks, this is their `max_speed`.
5046
5637
  * @remarks
5047
- * For rolling stocks, this is their `max_speed`.
5638
+ * Applies to subclasses: FlyingRobot,RollingStock,Unit
5048
5639
  *
5049
5640
  */
5050
- readonly speed: number
5641
+ readonly speed?: number
5051
5642
 
5052
5643
  /**
5053
- * The speed multiplier when this flying robot is out of energy or `nil`.
5644
+ * The speed multiplier when this flying robot is out of energy.
5645
+ * @remarks
5646
+ * Applies to subclasses: FlyingRobot
5647
+ *
5054
5648
  */
5055
5649
  readonly speed_multiplier_when_out_of_energy?: number
5056
5650
 
5057
5651
  /**
5058
- * If this inserter is a stack-type.
5652
+ * Whether this inserter is a stack-type.
5653
+ * @remarks
5654
+ * Applies to subclasses: Inserter
5655
+ *
5059
5656
  */
5060
- readonly stack: boolean
5657
+ readonly stack?: boolean
5061
5658
 
5062
5659
  /**
5063
5660
  * The bounding box used to attach sticker type entities.
@@ -5070,50 +5667,72 @@ interface LuaEntityPrototype {
5070
5667
  readonly subgroup: LuaGroup
5071
5668
 
5072
5669
  /**
5073
- * The supply area of this electric pole, beacon, or `nil` if this is neither.
5670
+ * The supply area of this electric pole or beacon prototype.
5671
+ * @remarks
5672
+ * Applies to subclasses: ElectricPole,Beacon
5673
+ *
5074
5674
  */
5075
5675
  readonly supply_area_distance?: number
5076
5676
 
5077
5677
  /**
5078
- * If this entity prototype could possibly ever be rotated.
5678
+ * Whether this entity prototype could possibly ever be rotated.
5079
5679
  */
5080
5680
  readonly supports_direction: boolean
5081
5681
 
5082
5682
  /**
5083
- * If this car prototype uses tank controls to drive or `nil` if this is not a car prototype.
5683
+ * If this car prototype uses tank controls to drive.
5684
+ * @remarks
5685
+ * Applies to subclasses: Car
5686
+ *
5084
5687
  */
5085
5688
  readonly tank_driving?: boolean
5086
5689
 
5087
5690
  /**
5088
- * The target temperature of this boiler prototype or `nil`.
5691
+ * The target temperature of this boiler prototype.
5692
+ * @remarks
5693
+ * Applies to subclasses: Boiler
5694
+ *
5089
5695
  */
5090
5696
  readonly target_temperature?: number
5091
5697
 
5092
5698
  /**
5093
5699
  * The terrain friction modifier for this vehicle.
5700
+ * @remarks
5701
+ * Applies to subclasses: Vehicle
5702
+ *
5094
5703
  */
5095
- readonly terrain_friction_modifier: number
5704
+ readonly terrain_friction_modifier?: number
5096
5705
 
5097
5706
  /**
5098
5707
  * @remarks
5099
5708
  * Applies to subclasses: Character
5100
5709
  *
5101
5710
  */
5102
- readonly ticks_to_keep_aiming_direction: number
5711
+ readonly ticks_to_keep_aiming_direction?: number
5103
5712
 
5104
5713
  /**
5105
5714
  * @remarks
5106
5715
  * Applies to subclasses: Character
5107
5716
  *
5108
5717
  */
5109
- readonly ticks_to_keep_gun: number
5718
+ readonly ticks_to_keep_gun?: number
5110
5719
 
5111
5720
  /**
5112
5721
  * @remarks
5113
5722
  * Applies to subclasses: Character
5114
5723
  *
5115
5724
  */
5116
- readonly ticks_to_stay_in_combat: number
5725
+ readonly ticks_to_stay_in_combat?: number
5726
+
5727
+ /**
5728
+ * Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)
5729
+ */
5730
+ readonly tile_height: number
5731
+
5732
+ /**
5733
+ * Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)
5734
+ */
5735
+ readonly tile_width: number
5117
5736
 
5118
5737
  /**
5119
5738
  * The time to live for this prototype or `0` if prototype doesn't have time_to_live or time_before_removed.
@@ -5122,31 +5741,49 @@ interface LuaEntityPrototype {
5122
5741
 
5123
5742
  /**
5124
5743
  * The time it takes this land mine to arm.
5744
+ * @remarks
5745
+ * Applies to subclasses: LandMine
5746
+ *
5125
5747
  */
5126
- readonly timeout: number
5748
+ readonly timeout?: number
5127
5749
 
5128
5750
  /**
5129
- * Gets the torso rotation speed of this prototype. `nil` if this is not a spider vechicle.
5751
+ * The torso rotation speed of this spider vehicle prototype.
5752
+ * @remarks
5753
+ * Applies to subclasses: SpiderVehicle
5754
+ *
5130
5755
  */
5131
- readonly torso_rotation_speed: number
5756
+ readonly torso_rotation_speed?: number
5132
5757
 
5133
5758
  /**
5134
- * If it is a tree, return the number of colors it supports. `nil` otherwise.
5759
+ * If it is a tree, return the number of colors it supports.
5760
+ * @remarks
5761
+ * Applies to subclasses: Tree
5762
+ *
5135
5763
  */
5136
- readonly tree_color_count: number
5764
+ readonly tree_color_count?: number
5137
5765
 
5138
5766
  /**
5139
- * Collision mask entity must collide with to make landmine blowup
5767
+ * The collision mask entities must collide with to make this landmine blow up.
5768
+ * @remarks
5769
+ * Applies to subclasses: LandMine
5770
+ *
5140
5771
  */
5141
- readonly trigger_collision_mask: CollisionMaskWithFlags
5772
+ readonly trigger_collision_mask?: CollisionMaskWithFlags
5142
5773
 
5143
5774
  /**
5144
- * The range of this turret or `nil` if this isn't a turret related prototype.
5775
+ * The range of this turret.
5776
+ * @remarks
5777
+ * Applies to subclasses: Turret
5778
+ *
5145
5779
  */
5146
5780
  readonly turret_range?: number
5147
5781
 
5148
5782
  /**
5149
- * The turret rotation speed of this car prototype or `nil` if not a car prototype.
5783
+ * The turret rotation speed of this car prototype.
5784
+ * @remarks
5785
+ * Applies to subclasses: Car
5786
+ *
5150
5787
  */
5151
5788
  readonly turret_rotation_speed?: number
5152
5789
 
@@ -5155,23 +5792,37 @@ interface LuaEntityPrototype {
5155
5792
  */
5156
5793
  readonly type: string
5157
5794
 
5795
+ /**
5796
+ * Whether this logistic container prototype uses exact mode
5797
+ * @remarks
5798
+ * Applies to subclasses: LogisticContainer
5799
+ *
5800
+ */
5801
+ readonly use_exact_mode?: boolean
5802
+
5158
5803
  /**
5159
5804
  * 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.
5160
5805
  */
5161
5806
  readonly valid: boolean
5162
5807
 
5163
5808
  /**
5164
- * The vision distance of this unit prototype or `nil`.
5809
+ * The vision distance of this unit prototype.
5810
+ * @remarks
5811
+ * Applies to subclasses: Unit
5812
+ *
5165
5813
  */
5166
5814
  readonly vision_distance?: number
5167
5815
 
5168
5816
  /**
5169
- * The void energy source prototype this entity uses or `nil`.
5817
+ * The void energy source prototype this entity uses, if any.
5170
5818
  */
5171
5819
  readonly void_energy_source_prototype?: LuaVoidEnergySourcePrototype
5172
5820
 
5173
5821
  /**
5174
- * The weight of this vehicle prototype or `nil` if not a vehicle prototype.
5822
+ * The weight of this vehicle prototype.
5823
+ * @remarks
5824
+ * Applies to subclasses: Vehicle
5825
+ *
5175
5826
  */
5176
5827
  readonly weight?: number
5177
5828
 
@@ -5189,7 +5840,7 @@ interface LuaEquipment {
5189
5840
  help(this: void): void
5190
5841
 
5191
5842
  /**
5192
- * The burner energy source for this equipment or `nil` if there isn't one.
5843
+ * The burner energy source for this equipment, if any.
5193
5844
  */
5194
5845
  readonly burner?: LuaBurner
5195
5846
 
@@ -5243,7 +5894,10 @@ interface LuaEquipment {
5243
5894
  /**
5244
5895
  * Shape of this equipment.
5245
5896
  */
5246
- readonly shape: { height: number, width: number }
5897
+ readonly shape: {
5898
+ height: number,
5899
+ width: number
5900
+ }
5247
5901
 
5248
5902
  /**
5249
5903
  * Current shield value of the equipment.
@@ -5322,6 +5976,20 @@ interface LuaEquipmentGrid {
5322
5976
  clear(this: void,
5323
5977
  by_player?: PlayerIdentification): void
5324
5978
 
5979
+ /**
5980
+ * Get the number of all or some equipment in this grid.
5981
+ * @param equipment - Prototype name of the equipment to count. If not specified, count all equipment.
5982
+ */
5983
+ count(this: void,
5984
+ equipment?: string): void
5985
+
5986
+ /**
5987
+ * Find equipment by name.
5988
+ * @param equipment - Prototype name of the equipment to find.
5989
+ */
5990
+ find(this: void,
5991
+ equipment: string): void
5992
+
5325
5993
  /**
5326
5994
  * Find equipment in the Equipment Grid based off a position.
5327
5995
  * @param position - The position
@@ -5435,6 +6103,11 @@ interface LuaEquipmentGrid {
5435
6103
  */
5436
6104
  readonly shield: number
5437
6105
 
6106
+ /**
6107
+ * Unique identifier of this equipment grid.
6108
+ */
6109
+ readonly unique_id: number
6110
+
5438
6111
  /**
5439
6112
  * 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.
5440
6113
  */
@@ -5506,12 +6179,15 @@ interface LuaEquipmentPrototype {
5506
6179
  help(this: void): void
5507
6180
 
5508
6181
  /**
5509
- * The equipment attack parameters or `nil`.
6182
+ * The equipment attack parameters.
6183
+ * @remarks
6184
+ * Applies to subclasses: ActiveDefenseEquipment
6185
+ *
5510
6186
  */
5511
6187
  readonly attack_parameters?: AttackParameters
5512
6188
 
5513
6189
  /**
5514
- * Is this active defense equipment automatic. Returns false if not active defense equipment.
6190
+ * Whether this active defense equipment is automatic. Returns false if not active defense equipment.
5515
6191
  */
5516
6192
  readonly automatic: boolean
5517
6193
 
@@ -5521,12 +6197,12 @@ interface LuaEquipmentPrototype {
5521
6197
  readonly background_color: Color
5522
6198
 
5523
6199
  /**
5524
- * The burner energy source prototype this equipment uses or `nil`.
6200
+ * The burner energy source prototype this equipment uses, if any.
5525
6201
  */
5526
6202
  readonly burner_prototype?: LuaBurnerPrototype
5527
6203
 
5528
6204
  /**
5529
- * The electric energy source prototype this equipment uses or `nil`.
6205
+ * The electric energy source prototype this equipment uses, if any.
5530
6206
  */
5531
6207
  readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype
5532
6208
 
@@ -5562,7 +6238,23 @@ interface LuaEquipmentPrototype {
5562
6238
  * Both the `charging_station_shift` and `stationing_offset` vectors are tables with `x` and `y` keys instead of an array.
5563
6239
  *
5564
6240
  */
5565
- readonly logistic_parameters: { charge_approach_distance: number, charging_distance: number, charging_energy: number, charging_station_count: number, charging_station_shift: Vector, charging_threshold_distance: number, construction_radius: number, logistic_radius: number, logistics_connection_distance: number, robot_limit: number, robot_vertical_acceleration: number, robots_shrink_when_entering_and_exiting: boolean, spawn_and_station_height: number, spawn_and_station_shadow_height_offset: number, stationing_offset: Vector }
6241
+ readonly logistic_parameters: {
6242
+ charge_approach_distance: number,
6243
+ charging_distance: number,
6244
+ charging_energy: number,
6245
+ charging_station_count: number,
6246
+ charging_station_shift: Vector,
6247
+ charging_threshold_distance: number,
6248
+ construction_radius: number,
6249
+ logistic_radius: number,
6250
+ logistics_connection_distance: number,
6251
+ robot_limit: number,
6252
+ robot_vertical_acceleration: number,
6253
+ robots_shrink_when_entering_and_exiting: boolean,
6254
+ spawn_and_station_height: number,
6255
+ spawn_and_station_shadow_height_offset: number,
6256
+ stationing_offset: Vector
6257
+ }
5566
6258
 
5567
6259
  /**
5568
6260
  * @remarks
@@ -5589,7 +6281,15 @@ interface LuaEquipmentPrototype {
5589
6281
  /**
5590
6282
  * Shape of this equipment prototype.
5591
6283
  */
5592
- readonly shape: { height: number, points?: EquipmentPoint[], width: number }
6284
+ readonly shape: {
6285
+ height: number,
6286
+
6287
+ /**
6288
+ * Only set when the shape is "manual"
6289
+ */
6290
+ points?: EquipmentPoint[],
6291
+ width: number
6292
+ }
5593
6293
 
5594
6294
  /**
5595
6295
  * The shield value of this equipment. 0 for non-shield equipment.
@@ -5597,9 +6297,9 @@ interface LuaEquipmentPrototype {
5597
6297
  readonly shield: number
5598
6298
 
5599
6299
  /**
5600
- * The result item when taking this equipment out of an equipment grid. `nil` if there is no result item.
6300
+ * The result item when taking this equipment out of an equipment grid, if any.
5601
6301
  */
5602
- readonly take_result: LuaItemPrototype
6302
+ readonly take_result?: LuaItemPrototype
5603
6303
 
5604
6304
  /**
5605
6305
  * Type of this equipment prototype.
@@ -5695,7 +6395,7 @@ interface LuaFlowStatistics {
5695
6395
  count: number): void
5696
6396
 
5697
6397
  /**
5698
- * The force these statistics belong to or `nil` for pollution statistics.
6398
+ * The force these statistics belong to. `nil` for pollution statistics.
5699
6399
  */
5700
6400
  readonly force?: LuaForce
5701
6401
 
@@ -5722,9 +6422,7 @@ interface LuaFlowStatistics {
5722
6422
  }
5723
6423
 
5724
6424
  /**
5725
- * An array of fluid boxes of an entity. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe.
5726
- *
5727
- * See {@link Fluid | Fluid}
6425
+ * An array of fluid boxes of an entity. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe. See {@link Fluid | Fluid}.
5728
6426
  *
5729
6427
  * Do note that reading from a {@link LuaFluidBox | LuaFluidBox} creates a new table and writing will copy the given fields from the table into the engine's own fluid box structure. Therefore, the correct way to update a fluidbox of an entity is to read it first, modify the table, then write the modified table back. Directly accessing the returned table's attributes won't have the desired effect.
5730
6428
  * @example
@@ -5824,7 +6522,9 @@ interface LuaFluidBox {
5824
6522
  readonly valid: boolean
5825
6523
 
5826
6524
  /**
5827
- * Access, set or clear a fluid box. The index must always be in bounds (see {@link LuaFluidBox::operator # | LuaFluidBox::operator #}). New fluidboxes may not be added or removed using this operator. If the given fluid box doesn't contain any fluid, `nil` is returned. Similarly, `nil` can be written to a fluid box to remove all fluid from it.
6525
+ * Access, set or clear a fluid box. The index must always be in bounds (see {@link LuaFluidBox::index | LuaFluidBox::index}). New fluidboxes may not be added or removed using this operator.
6526
+ *
6527
+ * Is `nil` if the given fluid box does not contain any fluid. Writing `nil` removes all fluid from the fluid box.
5828
6528
  * @remarks
5829
6529
  * This will return a {@link Fluid | Fluid}. The return type is any due to typescript limitations.
5830
6530
  *
@@ -5857,7 +6557,7 @@ interface LuaFluidBoxPrototype {
5857
6557
  readonly entity: LuaEntityPrototype
5858
6558
 
5859
6559
  /**
5860
- * The filter or `nil` if no filter is set.
6560
+ * The filter, if any is set.
5861
6561
  */
5862
6562
  readonly filter?: LuaFluidPrototype
5863
6563
 
@@ -5869,12 +6569,12 @@ interface LuaFluidBoxPrototype {
5869
6569
  readonly index: number
5870
6570
 
5871
6571
  /**
5872
- * The maximum temperature or `nil` if none is set.
6572
+ * The maximum temperature, if any is set.
5873
6573
  */
5874
6574
  readonly maximum_temperature?: number
5875
6575
 
5876
6576
  /**
5877
- * The minimum temperature or `nil` if none is set.
6577
+ * The minimum temperature, if any is set.
5878
6578
  */
5879
6579
  readonly minimum_temperature?: number
5880
6580
 
@@ -5950,7 +6650,7 @@ interface LuaFluidEnergySourcePrototype {
5950
6650
  readonly scale_fluid_usage: boolean
5951
6651
 
5952
6652
  /**
5953
- * The smoke sources for this prototype if any.
6653
+ * The smoke sources for this prototype, if any.
5954
6654
  */
5955
6655
  readonly smoke: SmokeSource[]
5956
6656
 
@@ -6057,7 +6757,7 @@ interface LuaFontPrototype {
6057
6757
  readonly border: boolean
6058
6758
 
6059
6759
  /**
6060
- * The border color or `nil` if not set.
6760
+ * The border color, if any.
6061
6761
  */
6062
6762
  readonly border_color?: Color
6063
6763
 
@@ -6502,6 +7202,11 @@ interface LuaForce {
6502
7202
  */
6503
7203
  character_trash_slot_count: number
6504
7204
 
7205
+ /**
7206
+ * Effective color of this force.
7207
+ */
7208
+ readonly color: Color
7209
+
6505
7210
  /**
6506
7211
  * The connected players belonging to this force.
6507
7212
  *
@@ -6513,10 +7218,15 @@ interface LuaForce {
6513
7218
  readonly connected_players: LuaPlayer[]
6514
7219
 
6515
7220
  /**
6516
- * The current technology in research, or `nil` if no research is currently ongoing.
7221
+ * The currently ongoing technology research, if any.
6517
7222
  */
6518
7223
  readonly current_research?: LuaTechnology
6519
7224
 
7225
+ /**
7226
+ * Custom color for this force. If specified, will take priority over other sources of the force color. Writing nil clears custom color. Will return nil if it was not specified or if was set to {0,0,0,0}
7227
+ */
7228
+ custom_color?: Color
7229
+
6520
7230
  /**
6521
7231
  * The time, in ticks, before a deconstruction order is removed.
6522
7232
  */
@@ -6647,9 +7357,9 @@ interface LuaForce {
6647
7357
  readonly players: LuaPlayer[]
6648
7358
 
6649
7359
  /**
6650
- * The previous research if any.
7360
+ * The previous research, if any.
6651
7361
  */
6652
- previous_research: LuaTechnology
7362
+ previous_research?: LuaTechnology
6653
7363
 
6654
7364
  /**
6655
7365
  * Recipes available to this force, indexed by `name`.
@@ -7083,9 +7793,6 @@ interface LuaGameScript {
7083
7793
 
7084
7794
  /**
7085
7795
  * Gets the given player or returns `nil` if no player is found.
7086
- * @remarks
7087
- * This is a shortcut for game.players[...]
7088
- *
7089
7796
  * @param player - The player index or name.
7090
7797
  */
7091
7798
  get_player(this: void,
@@ -7647,10 +8354,12 @@ interface LuaGameScript {
7647
8354
  *
7648
8355
  * See {@link LuaGameScript::players | LuaGameScript::players} for accessing all players.
7649
8356
  */
7650
- readonly player: LuaPlayer
8357
+ readonly player?: LuaPlayer
7651
8358
 
7652
8359
  /**
7653
8360
  * Get a table of all the players that currently exist. This sparse table allows you to find players by indexing it with either their `name` or `index`. Iterating this table with `pairs()` will only iterate the array part of the table. Iterating with `ipairs()` will not work at all.
8361
+ *
8362
+ * If only a single player is required, {@link LuaGameScript::get_player | LuaGameScript::get_player} should be used instead, as it avoids the unnecessary overhead of passing the whole table to Lua.
7654
8363
  */
7655
8364
  readonly players: {[key: string]: LuaPlayer}
7656
8365
 
@@ -7753,10 +8462,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
7753
8462
  help(this: void): void
7754
8463
 
7755
8464
  /**
7756
- * The circuit condition.
7757
- * @remarks
7758
- * `condition` may be `nil` in order to clear the circuit condition.
7759
- *
8465
+ * The circuit condition. Writing `nil` clears the circuit condition.
7760
8466
  * @example
7761
8467
  * Tell an entity to be active (e.g. a lamp to be lit) when it receives a circuit signal of more than 4 chain signals.
7762
8468
  * ```
@@ -7779,10 +8485,7 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
7779
8485
  readonly disabled: boolean
7780
8486
 
7781
8487
  /**
7782
- * The logistic condition.
7783
- * @remarks
7784
- * `condition` may be `nil` in order to clear the logistic condition.
7785
- *
8488
+ * The logistic condition. Writing `nil` clears the logistic condition.
7786
8489
  * @example
7787
8490
  * Tell an entity to be active (e.g. a lamp to be lit) when the logistics network it's connected to has more than four chain signals.
7788
8491
  * ```
@@ -7816,16 +8519,16 @@ interface LuaGroup {
7816
8519
  help(this: void): void
7817
8520
 
7818
8521
  /**
7819
- * The parent group if any; `nil` if none.
8522
+ * The parent group, if any.
7820
8523
  */
7821
- readonly group: LuaGroup
8524
+ readonly group?: LuaGroup
7822
8525
 
7823
8526
  /**
7824
8527
  * Localised name of the group.
7825
8528
  */
7826
- readonly localised_name: LocalisedString
8529
+ readonly localised_name?: LocalisedString
7827
8530
 
7828
- readonly name: string
8531
+ readonly name?: string
7829
8532
 
7830
8533
  /**
7831
8534
  * 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.
@@ -7853,7 +8556,7 @@ interface LuaGroup {
7853
8556
  */
7854
8557
  readonly subgroups: LuaGroup[]
7855
8558
 
7856
- readonly type: string
8559
+ readonly type?: string
7857
8560
 
7858
8561
  /**
7859
8562
  * 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.
@@ -8300,9 +9003,9 @@ interface LuaGuiElement {
8300
9003
  allow_none_state: boolean
8301
9004
 
8302
9005
  /**
8303
- * Sets the anchor for this relative widget. Setting `nil` clears the anchor.
9006
+ * The anchor for this relative widget, if any. Setting `nil` clears the anchor.
8304
9007
  */
8305
- anchor: GuiAnchor
9008
+ anchor?: GuiAnchor
8306
9009
 
8307
9010
  /**
8308
9011
  * Whether this frame auto-centers on window resize when stored in {@link LuaGui::screen | LuaGui::screen}.
@@ -8368,7 +9071,7 @@ interface LuaGuiElement {
8368
9071
  readonly direction: string
8369
9072
 
8370
9073
  /**
8371
- * The `frame` that is being moved when dragging this GUI element, or `nil`. This element needs to be a child of the `drag_target` at some level.
9074
+ * The `frame` that is being moved when dragging this GUI element, if any. This element needs to be a child of the `drag_target` at some level.
8372
9075
  * @remarks
8373
9076
  * Only top-level elements in {@link LuaGui::screen | LuaGui::screen} can be `drag_target`s.
8374
9077
  * Applies to subclasses: flow,frame,label,table,empty-widget
@@ -8410,7 +9113,7 @@ interface LuaGuiElement {
8410
9113
  draw_vertical_lines: boolean
8411
9114
 
8412
9115
  /**
8413
- * The elem filters of this choose-elem-button, or `nil` if there are no filters. The compatible type of filter is determined by `elem_type`.
9116
+ * The elem filters of this choose-elem-button, if any. The compatible type of filter is determined by `elem_type`.
8414
9117
  * @remarks
8415
9118
  * Writing to this field does not change or clear the currently selected element.
8416
9119
  * Applies to subclasses: choose-elem-button
@@ -8434,7 +9137,7 @@ interface LuaGuiElement {
8434
9137
  * ```
8435
9138
  *
8436
9139
  */
8437
- elem_filters?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
9140
+ elem_filters?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter
8438
9141
 
8439
9142
  /**
8440
9143
  * The elem type of this choose-elem-button.
@@ -8445,7 +9148,7 @@ interface LuaGuiElement {
8445
9148
  readonly elem_type: string
8446
9149
 
8447
9150
  /**
8448
- * The elem value of this choose-elem-button or `nil` if there is no value.
9151
+ * The elem value of this choose-elem-button, if any.
8449
9152
  * @remarks
8450
9153
  * The `"signal"` type operates with {@link SignalID | SignalID}, while all other types use strings.
8451
9154
  * Applies to subclasses: choose-elem-button
@@ -8459,12 +9162,12 @@ interface LuaGuiElement {
8459
9162
  enabled: boolean
8460
9163
 
8461
9164
  /**
8462
- * The entity associated with this entity-preview, camera, minimap or `nil` if no entity is associated.
9165
+ * The entity associated with this entity-preview, camera, minimap, if any.
8463
9166
  */
8464
9167
  entity?: LuaEntity
8465
9168
 
8466
9169
  /**
8467
- * The force this minimap is using or `nil` if no force is set.
9170
+ * The force this minimap is using, if any.
8468
9171
  */
8469
9172
  force?: string
8470
9173
 
@@ -8529,7 +9232,7 @@ interface LuaGuiElement {
8529
9232
  left_label_tooltip: LocalisedString
8530
9233
 
8531
9234
  /**
8532
- * The location of this widget when stored in {@link LuaGui::screen | LuaGui::screen}, or `nil` if not set or not in {@link LuaGui::screen | LuaGui::screen}.
9235
+ * The location of this widget when stored in {@link LuaGui::screen | LuaGui::screen}. `nil` if not set or not in {@link LuaGui::screen | LuaGui::screen}.
8533
9236
  */
8534
9237
  location?: GuiLocation
8535
9238
 
@@ -8591,9 +9294,9 @@ interface LuaGuiElement {
8591
9294
  readonly object_name: string
8592
9295
 
8593
9296
  /**
8594
- * The direct parent of this element; `nil` if this is a top-level element.
9297
+ * The direct parent of this element. `nil` if this is a top-level element.
8595
9298
  */
8596
- readonly parent: LuaGuiElement
9299
+ readonly parent?: LuaGuiElement
8597
9300
 
8598
9301
  /**
8599
9302
  * Index into {@link LuaGameScript::players | LuaGameScript::players} specifying the player who owns this element.
@@ -8648,7 +9351,7 @@ interface LuaGuiElement {
8648
9351
  selected_index: number
8649
9352
 
8650
9353
  /**
8651
- * The selected tab index for this tabbed pane or `nil` if no tab is selected.
9354
+ * The selected tab index for this tabbed pane, if any.
8652
9355
  * @remarks
8653
9356
  * Applies to subclasses: tabbed-pane
8654
9357
  *
@@ -8958,7 +9661,7 @@ interface LuaInventory {
8958
9661
  item?: string): void
8959
9662
 
8960
9663
  /**
8961
- * Gets the first LuaItemStack in the inventory that matches the given item name.
9664
+ * Finds the first LuaItemStack in the inventory that matches the given item name.
8962
9665
  * @param item - The item name to find
8963
9666
  */
8964
9667
  find_item_stack(this: void,
@@ -9058,12 +9761,12 @@ interface LuaInventory {
9058
9761
  * @remarks
9059
9762
  * Some inventory slots don't allow some filters (gun ammo can't be filtered for non-ammo).
9060
9763
  *
9061
- * @param filter - The new filter or nil to erase the filter
9062
- * @param index - The item stack index
9764
+ * @param filter - The new filter. `nil` erases any existing filter.
9765
+ * @param index - The item stack index.
9063
9766
  */
9064
9767
  set_filter(this: void,
9065
9768
  index: number,
9066
- filter: string): void
9769
+ filter: string | null): void
9067
9770
 
9068
9771
  /**
9069
9772
  * Sorts and merges the items in this inventory.
@@ -9084,22 +9787,22 @@ interface LuaInventory {
9084
9787
  supports_filters(this: void): void
9085
9788
 
9086
9789
  /**
9087
- * The entity that owns this inventory or `nil` if this isn't owned by an entity.
9790
+ * The entity that owns this inventory, if any.
9088
9791
  */
9089
9792
  readonly entity_owner?: LuaEntity
9090
9793
 
9091
9794
  /**
9092
- * The equipment that owns this inventory or `nil` if this isn't owned by an equipment.
9795
+ * The equipment that owns this inventory, if any.
9093
9796
  */
9094
9797
  readonly equipment_owner?: LuaEquipment
9095
9798
 
9096
9799
  /**
9097
- * The inventory index this inventory uses, or `nil` if the inventory doesn't have an index.
9800
+ * The inventory index this inventory uses, if any.
9098
9801
  */
9099
9802
  readonly index?: defines.inventory
9100
9803
 
9101
9804
  /**
9102
- * The mod that owns this inventory or `nil` if this isn't owned by a mod.
9805
+ * The mod that owns this inventory, if any.
9103
9806
  */
9104
9807
  readonly mod_owner?: string
9105
9808
 
@@ -9109,7 +9812,7 @@ interface LuaInventory {
9109
9812
  readonly object_name: string
9110
9813
 
9111
9814
  /**
9112
- * The player that owns this inventory or `nil` if this isn't owned by a player.
9815
+ * The player that owns this inventory, if any.
9113
9816
  */
9114
9817
  readonly player_owner?: LuaPlayer
9115
9818
 
@@ -9155,7 +9858,10 @@ interface LuaInventory {
9155
9858
  */
9156
9859
  interface LuaItemPrototype {
9157
9860
  /**
9158
- * Type of this ammo prototype or `nil` if this is not an ammo prototype.
9861
+ * The type of this ammo prototype.
9862
+ * @remarks
9863
+ * Applies to subclasses: AmmoItem
9864
+ *
9159
9865
  * @param ammo_source_type - "default", "player", "turret", or "vehicle"
9160
9866
  */
9161
9867
  get_ammo_type(this: void,
@@ -9179,7 +9885,7 @@ interface LuaItemPrototype {
9179
9885
  * Applies to subclasses: SelectionTool
9180
9886
  *
9181
9887
  */
9182
- readonly alt_entity_filter_mode: string
9888
+ readonly alt_entity_filter_mode?: string
9183
9889
 
9184
9890
  /**
9185
9891
  * The alt entity filters used by this selection tool indexed by entity name.
@@ -9187,7 +9893,7 @@ interface LuaItemPrototype {
9187
9893
  * Applies to subclasses: SelectionTool
9188
9894
  *
9189
9895
  */
9190
- readonly alt_entity_filters: {[key: string]: LuaEntityPrototype}
9896
+ readonly alt_entity_filters?: {[key: string]: LuaEntityPrototype}
9191
9897
 
9192
9898
  /**
9193
9899
  * The alt entity type filters used by this selection tool indexed by entity type.
@@ -9196,7 +9902,7 @@ interface LuaItemPrototype {
9196
9902
  * Applies to subclasses: SelectionTool
9197
9903
  *
9198
9904
  */
9199
- readonly alt_entity_type_filters: {[key: string]: boolean}
9905
+ readonly alt_entity_type_filters?: {[key: string]: boolean}
9200
9906
 
9201
9907
  /**
9202
9908
  * The color used when doing alt selection with this selection tool prototype.
@@ -9204,14 +9910,14 @@ interface LuaItemPrototype {
9204
9910
  * Applies to subclasses: SelectionTool
9205
9911
  *
9206
9912
  */
9207
- readonly alt_selection_border_color: Color
9913
+ readonly alt_selection_border_color?: Color
9208
9914
 
9209
9915
  /**
9210
9916
  * @remarks
9211
9917
  * Applies to subclasses: SelectionTool
9212
9918
  *
9213
9919
  */
9214
- readonly alt_selection_cursor_box_type: string
9920
+ readonly alt_selection_cursor_box_type?: string
9215
9921
 
9216
9922
  /**
9217
9923
  * Flags that affect which entities will be selected during alternate selection.
@@ -9219,7 +9925,7 @@ interface LuaItemPrototype {
9219
9925
  * Applies to subclasses: SelectionTool
9220
9926
  *
9221
9927
  */
9222
- readonly alt_selection_mode_flags: SelectionModeFlags
9928
+ readonly alt_selection_mode_flags?: SelectionModeFlags
9223
9929
 
9224
9930
  /**
9225
9931
  * The alt tile filter mode used by this selection tool.
@@ -9227,7 +9933,7 @@ interface LuaItemPrototype {
9227
9933
  * Applies to subclasses: SelectionTool
9228
9934
  *
9229
9935
  */
9230
- readonly alt_tile_filter_mode: string
9936
+ readonly alt_tile_filter_mode?: string
9231
9937
 
9232
9938
  /**
9233
9939
  * The alt tile filters used by this selection tool indexed by tile name.
@@ -9235,7 +9941,7 @@ interface LuaItemPrototype {
9235
9941
  * Applies to subclasses: SelectionTool
9236
9942
  *
9237
9943
  */
9238
- readonly alt_tile_filters: {[key: string]: LuaTilePrototype}
9944
+ readonly alt_tile_filters?: {[key: string]: LuaTilePrototype}
9239
9945
 
9240
9946
  /**
9241
9947
  * If tiles area always included when doing selection with this selection tool prototype.
@@ -9243,15 +9949,18 @@ interface LuaItemPrototype {
9243
9949
  * Applies to subclasses: SelectionTool
9244
9950
  *
9245
9951
  */
9246
- readonly always_include_tiles: boolean
9952
+ readonly always_include_tiles?: boolean
9247
9953
 
9248
9954
  /**
9249
- * The gun attack parameters or `nil` if not a gun item prototype.
9955
+ * The gun attack parameters.
9956
+ * @remarks
9957
+ * Applies to subclasses: Gun
9958
+ *
9250
9959
  */
9251
9960
  readonly attack_parameters?: AttackParameters
9252
9961
 
9253
9962
  /**
9254
- * The result of burning this item as fuel or `nil`.
9963
+ * The result of burning this item as fuel, if any.
9255
9964
  */
9256
9965
  readonly burnt_result?: LuaItemPrototype
9257
9966
 
@@ -9261,7 +9970,10 @@ interface LuaItemPrototype {
9261
9970
  readonly can_be_mod_opened: boolean
9262
9971
 
9263
9972
  /**
9264
- * The capsule action for this capsule item prototype or `nil` if this isn't a capsule item prototype.
9973
+ * The capsule action for this capsule item prototype.
9974
+ * @remarks
9975
+ * Applies to subclasses: Capsule
9976
+ *
9265
9977
  */
9266
9978
  readonly capsule_action?: CapsuleAction
9267
9979
 
@@ -9271,10 +9983,10 @@ interface LuaItemPrototype {
9271
9983
  * Applies to subclasses: ModuleItem
9272
9984
  *
9273
9985
  */
9274
- readonly category: string
9986
+ readonly category?: string
9275
9987
 
9276
9988
  /**
9277
- * The curved rail prototype used for this rail planner prototype, or `nil` if this isn't a rail planner prototype.
9989
+ * The curved rail prototype used for this rail planner prototype.
9278
9990
  * @remarks
9279
9991
  * Applies to subclasses: RailPlanner
9280
9992
  *
@@ -9282,12 +9994,12 @@ interface LuaItemPrototype {
9282
9994
  readonly curved_rail?: LuaEntityPrototype
9283
9995
 
9284
9996
  /**
9285
- * The default label color used for this item with label. `nil` if not defined or if this isn't an item with label.
9997
+ * The default label color used for this item with label, if any.
9286
9998
  * @remarks
9287
9999
  * Applies to subclasses: ItemWithLabel
9288
10000
  *
9289
10001
  */
9290
- readonly default_label_color: Color
10002
+ readonly default_label_color?: Color
9291
10003
 
9292
10004
  /**
9293
10005
  * The default request value.
@@ -9300,10 +10012,10 @@ interface LuaItemPrototype {
9300
10012
  * Applies to subclasses: ItemWithLabel
9301
10013
  *
9302
10014
  */
9303
- readonly draw_label_for_cursor_render: boolean
10015
+ readonly draw_label_for_cursor_render?: boolean
9304
10016
 
9305
10017
  /**
9306
- * The durability of this tool item or `nil` if not a tool item.
10018
+ * The durability of this tool item.
9307
10019
  * @remarks
9308
10020
  * Applies to subclasses: ToolItem
9309
10021
  *
@@ -9316,7 +10028,7 @@ interface LuaItemPrototype {
9316
10028
  * Applies to subclasses: ToolItem
9317
10029
  *
9318
10030
  */
9319
- readonly durability_description_key: string
10031
+ readonly durability_description_key?: string
9320
10032
 
9321
10033
  /**
9322
10034
  * The entity filter mode used by this selection tool.
@@ -9324,10 +10036,10 @@ interface LuaItemPrototype {
9324
10036
  * Applies to subclasses: SelectionTool
9325
10037
  *
9326
10038
  */
9327
- readonly entity_filter_mode: string
10039
+ readonly entity_filter_mode?: string
9328
10040
 
9329
10041
  /**
9330
- * The number of entity filters this deconstruction item has or `nil` if this isn't a deconstruction item prototype.
10042
+ * The number of entity filters this deconstruction item has.
9331
10043
  * @remarks
9332
10044
  * Applies to subclasses: DeconstructionItem
9333
10045
  *
@@ -9340,7 +10052,7 @@ interface LuaItemPrototype {
9340
10052
  * Applies to subclasses: SelectionTool
9341
10053
  *
9342
10054
  */
9343
- readonly entity_filters: {[key: string]: LuaEntityPrototype}
10055
+ readonly entity_filters?: {[key: string]: LuaEntityPrototype}
9344
10056
 
9345
10057
  /**
9346
10058
  * The entity type filters used by this selection tool indexed by entity type.
@@ -9349,10 +10061,13 @@ interface LuaItemPrototype {
9349
10061
  * Applies to subclasses: SelectionTool
9350
10062
  *
9351
10063
  */
9352
- readonly entity_type_filters: {[key: string]: boolean}
10064
+ readonly entity_type_filters?: {[key: string]: boolean}
9353
10065
 
9354
10066
  /**
9355
- * The prototype of this armor equipment grid or `nil` if none or this is not an armor item.
10067
+ * The prototype of this armor equipment grid, if any.
10068
+ * @remarks
10069
+ * Applies to subclasses: Armor
10070
+ *
9356
10071
  */
9357
10072
  readonly equipment_grid?: LuaEquipmentGridPrototype
9358
10073
 
@@ -9362,7 +10077,7 @@ interface LuaItemPrototype {
9362
10077
  * Applies to subclasses: ItemWithInventory
9363
10078
  *
9364
10079
  */
9365
- readonly extend_inventory_by_default: boolean
10080
+ readonly extend_inventory_by_default?: boolean
9366
10081
 
9367
10082
  /**
9368
10083
  * The filter mode used by this item with inventory.
@@ -9370,7 +10085,7 @@ interface LuaItemPrototype {
9370
10085
  * Applies to subclasses: ItemWithInventory
9371
10086
  *
9372
10087
  */
9373
- readonly filter_mode: string
10088
+ readonly filter_mode?: string
9374
10089
 
9375
10090
  /**
9376
10091
  * The flags for this item prototype.
@@ -9383,7 +10098,7 @@ interface LuaItemPrototype {
9383
10098
  readonly fuel_acceleration_multiplier: number
9384
10099
 
9385
10100
  /**
9386
- * The fuel category or `nil`.
10101
+ * The fuel category of this item prototype, if any.
9387
10102
  */
9388
10103
  readonly fuel_category?: string
9389
10104
 
@@ -9408,12 +10123,12 @@ interface LuaItemPrototype {
9408
10123
  readonly group: LuaGroup
9409
10124
 
9410
10125
  /**
9411
- * If this tool item has infinite durability. `nil` if not a tool type item.
10126
+ * If this tool item has infinite durability.
9412
10127
  * @remarks
9413
10128
  * Applies to subclasses: ToolItem
9414
10129
  *
9415
10130
  */
9416
- readonly infinite: boolean
10131
+ readonly infinite?: boolean
9417
10132
 
9418
10133
  /**
9419
10134
  * The insertion priority mode used by this item with inventory.
@@ -9421,44 +10136,44 @@ interface LuaItemPrototype {
9421
10136
  * Applies to subclasses: ItemWithInventory
9422
10137
  *
9423
10138
  */
9424
- readonly insertion_priority_mode: string
10139
+ readonly insertion_priority_mode?: string
9425
10140
 
9426
10141
  /**
9427
- * The main inventory size for item-with-inventory-prototype. `nil` if not an item-with-inventory-prototype.
10142
+ * The main inventory size for item-with-inventory-prototype.
9428
10143
  * @remarks
9429
10144
  * Applies to subclasses: ItemWithInventoryPrototype
9430
10145
  *
9431
10146
  */
9432
- readonly inventory_size: number
10147
+ readonly inventory_size?: number
9433
10148
 
9434
10149
  /**
9435
- * The inventory size bonus for this armor prototype. `nil` if this isn't an armor prototype.
10150
+ * The inventory size bonus for this armor prototype.
9436
10151
  * @remarks
9437
10152
  * Applies to subclasses: ArmorPrototype
9438
10153
  *
9439
10154
  */
9440
- readonly inventory_size_bonus: number
10155
+ readonly inventory_size_bonus?: number
9441
10156
 
9442
10157
  /**
9443
10158
  * @remarks
9444
10159
  * Applies to subclasses: ItemWithInventory
9445
10160
  *
9446
10161
  */
9447
- readonly item_filters: {[key: string]: LuaItemPrototype}
10162
+ readonly item_filters?: {[key: string]: LuaItemPrototype}
9448
10163
 
9449
10164
  /**
9450
10165
  * @remarks
9451
10166
  * Applies to subclasses: ItemWithInventory
9452
10167
  *
9453
10168
  */
9454
- readonly item_group_filters: {[key: string]: LuaGroup}
10169
+ readonly item_group_filters?: {[key: string]: LuaGroup}
9455
10170
 
9456
10171
  /**
9457
10172
  * @remarks
9458
10173
  * Applies to subclasses: ItemWithInventory
9459
10174
  *
9460
10175
  */
9461
- readonly item_subgroup_filters: {[key: string]: LuaGroup}
10176
+ readonly item_subgroup_filters?: {[key: string]: LuaGroup}
9462
10177
 
9463
10178
  /**
9464
10179
  * The limitation message key used when the player attempts to use this modules in some place it's not allowed.
@@ -9466,7 +10181,7 @@ interface LuaItemPrototype {
9466
10181
  * Applies to subclasses: ModuleItem
9467
10182
  *
9468
10183
  */
9469
- readonly limitation_message_key: string
10184
+ readonly limitation_message_key?: string
9470
10185
 
9471
10186
  /**
9472
10187
  * An array of recipe names this module is allowed to work with. Empty when all recipes are allowed.
@@ -9474,7 +10189,7 @@ interface LuaItemPrototype {
9474
10189
  * Applies to subclasses: ModuleItem
9475
10190
  *
9476
10191
  */
9477
- readonly limitations: string[]
10192
+ readonly limitations?: string[]
9478
10193
 
9479
10194
  readonly localised_description: LocalisedString
9480
10195
 
@@ -9484,22 +10199,25 @@ interface LuaItemPrototype {
9484
10199
  * Applies to subclasses: ItemWithInventory
9485
10200
  *
9486
10201
  */
9487
- readonly localised_filter_message: LocalisedString
10202
+ readonly localised_filter_message?: LocalisedString
9488
10203
 
9489
10204
  readonly localised_name: LocalisedString
9490
10205
 
9491
10206
  /**
9492
- * Size of full magazine; `nil` if this is not an ammo item.
10207
+ * Size of full magazine.
10208
+ * @remarks
10209
+ * Applies to subclasses: AmmoItem
10210
+ *
9493
10211
  */
9494
- readonly magazine_size: number
10212
+ readonly magazine_size?: number
9495
10213
 
9496
10214
  /**
9497
- * How many filters an upgrade item has. `nil` if not a upgrade item.
10215
+ * How many filters an upgrade item has.
9498
10216
  * @remarks
9499
10217
  * Applies to subclasses: UpgradeItem
9500
10218
  *
9501
10219
  */
9502
- readonly mapper_count: number
10220
+ readonly mapper_count?: number
9503
10221
 
9504
10222
  /**
9505
10223
  * Effects of this module.
@@ -9507,7 +10225,7 @@ interface LuaItemPrototype {
9507
10225
  * Applies to subclasses: ModuleItem
9508
10226
  *
9509
10227
  */
9510
- readonly module_effects: ModuleEffects
10228
+ readonly module_effects?: ModuleEffects
9511
10229
 
9512
10230
  /**
9513
10231
  * Name of this prototype.
@@ -9525,27 +10243,30 @@ interface LuaItemPrototype {
9525
10243
  readonly order: string
9526
10244
 
9527
10245
  /**
9528
- * Prototype of the equipment that will be created by placing this item in an equipment grid or `nil` if there is no equipment defined.
10246
+ * Prototype of the equipment that will be created by placing this item in an equipment grid, if any.
9529
10247
  */
9530
10248
  readonly place_as_equipment_result?: LuaEquipmentPrototype
9531
10249
 
9532
10250
  /**
9533
- * The place-as-tile result if one is defined, else `nil`.
10251
+ * The place-as-tile result if one is defined, if any.
9534
10252
  */
9535
- readonly place_as_tile_result: PlaceAsTileResult
10253
+ readonly place_as_tile_result?: PlaceAsTileResult
9536
10254
 
9537
10255
  /**
9538
- * Prototype of the entity that will be created by placing this item, or `nil` if there is no such entity.
10256
+ * Prototype of the entity that will be created by placing this item, if any.
9539
10257
  */
9540
10258
  readonly place_result?: LuaEntityPrototype
9541
10259
 
9542
10260
  /**
9543
- * Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine or `nil` if this is not an ammo item.
10261
+ * Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine.
10262
+ * @remarks
10263
+ * Applies to subclasses: AmmoItem
10264
+ *
9544
10265
  */
9545
10266
  readonly reload_time?: number
9546
10267
 
9547
10268
  /**
9548
- * The repair result of this repair tool prototype or `nil` if this isn't a repair tool prototype.
10269
+ * The repair result of this repair tool prototype.
9549
10270
  * @remarks
9550
10271
  * Applies to subclasses: RepairTool
9551
10272
  *
@@ -9553,9 +10274,12 @@ interface LuaItemPrototype {
9553
10274
  readonly repair_result?: TriggerItem[]
9554
10275
 
9555
10276
  /**
9556
- * Resistances of this armour item, indexed by damage type name. `nil` if not an armor or the armor has no resistances.
10277
+ * Resistances of this armor item, if any, indexed by damage type name.
10278
+ * @remarks
10279
+ * Applies to subclasses: Armor
10280
+ *
9557
10281
  */
9558
- readonly resistances: {[key: string]: Resistance}
10282
+ readonly resistances?: {[key: string]: Resistance}
9559
10283
 
9560
10284
  /**
9561
10285
  * The reverse entity filter mode used by this selection tool.
@@ -9563,7 +10287,7 @@ interface LuaItemPrototype {
9563
10287
  * Applies to subclasses: SelectionTool
9564
10288
  *
9565
10289
  */
9566
- readonly reverse_alt_entity_filter_mode: string
10290
+ readonly reverse_alt_entity_filter_mode?: string
9567
10291
 
9568
10292
  /**
9569
10293
  * The reverse entity filters used by this selection tool indexed by entity name.
@@ -9571,7 +10295,7 @@ interface LuaItemPrototype {
9571
10295
  * Applies to subclasses: SelectionTool
9572
10296
  *
9573
10297
  */
9574
- readonly reverse_entity_filters: {[key: string]: LuaEntityPrototype}
10298
+ readonly reverse_entity_filters?: {[key: string]: LuaEntityPrototype}
9575
10299
 
9576
10300
  /**
9577
10301
  * The reverse entity type filters used by this selection tool indexed by entity type.
@@ -9580,7 +10304,7 @@ interface LuaItemPrototype {
9580
10304
  * Applies to subclasses: SelectionTool
9581
10305
  *
9582
10306
  */
9583
- readonly reverse_entity_type_filters: {[key: string]: boolean}
10307
+ readonly reverse_entity_type_filters?: {[key: string]: boolean}
9584
10308
 
9585
10309
  /**
9586
10310
  * The color used when doing reverse selection with this selection tool prototype.
@@ -9588,14 +10312,14 @@ interface LuaItemPrototype {
9588
10312
  * Applies to subclasses: SelectionTool
9589
10313
  *
9590
10314
  */
9591
- readonly reverse_selection_border_color: Color
10315
+ readonly reverse_selection_border_color?: Color
9592
10316
 
9593
10317
  /**
9594
10318
  * @remarks
9595
10319
  * Applies to subclasses: SelectionTool
9596
10320
  *
9597
10321
  */
9598
- readonly reverse_selection_cursor_box_type: string
10322
+ readonly reverse_selection_cursor_box_type?: string
9599
10323
 
9600
10324
  /**
9601
10325
  * Flags that affect which entities will be selected during reverse selection.
@@ -9603,7 +10327,7 @@ interface LuaItemPrototype {
9603
10327
  * Applies to subclasses: SelectionTool
9604
10328
  *
9605
10329
  */
9606
- readonly reverse_selection_mode_flags: SelectionModeFlags
10330
+ readonly reverse_selection_mode_flags?: SelectionModeFlags
9607
10331
 
9608
10332
  /**
9609
10333
  * The reverse tile filter mode used by this selection tool.
@@ -9611,7 +10335,7 @@ interface LuaItemPrototype {
9611
10335
  * Applies to subclasses: SelectionTool
9612
10336
  *
9613
10337
  */
9614
- readonly reverse_tile_filter_mode: string
10338
+ readonly reverse_tile_filter_mode?: string
9615
10339
 
9616
10340
  /**
9617
10341
  * The reverse tile filters used by this selection tool indexed by tile name.
@@ -9619,10 +10343,10 @@ interface LuaItemPrototype {
9619
10343
  * Applies to subclasses: SelectionTool
9620
10344
  *
9621
10345
  */
9622
- readonly reverse_tile_filters: {[key: string]: LuaTilePrototype}
10346
+ readonly reverse_tile_filters?: {[key: string]: LuaTilePrototype}
9623
10347
 
9624
10348
  /**
9625
- * The results from launching this item in a rocket.
10349
+ * The results of launching this item in a rocket.
9626
10350
  */
9627
10351
  readonly rocket_launch_products: Product[]
9628
10352
 
@@ -9632,14 +10356,14 @@ interface LuaItemPrototype {
9632
10356
  * Applies to subclasses: SelectionTool
9633
10357
  *
9634
10358
  */
9635
- readonly selection_border_color: Color
10359
+ readonly selection_border_color?: Color
9636
10360
 
9637
10361
  /**
9638
10362
  * @remarks
9639
10363
  * Applies to subclasses: SelectionTool
9640
10364
  *
9641
10365
  */
9642
- readonly selection_cursor_box_type: string
10366
+ readonly selection_cursor_box_type?: string
9643
10367
 
9644
10368
  /**
9645
10369
  * Flags that affect which entities will be selected.
@@ -9647,12 +10371,15 @@ interface LuaItemPrototype {
9647
10371
  * Applies to subclasses: SelectionTool
9648
10372
  *
9649
10373
  */
9650
- readonly selection_mode_flags: SelectionModeFlags
10374
+ readonly selection_mode_flags?: SelectionModeFlags
9651
10375
 
9652
10376
  /**
9653
- * The repairing speed if this is a repairing tool; otherwise `nil`.
10377
+ * The repairing speed if this is a repairing tool.
10378
+ * @remarks
10379
+ * Applies to subclasses: RepairTool
10380
+ *
9654
10381
  */
9655
- readonly speed: number
10382
+ readonly speed?: number
9656
10383
 
9657
10384
  /**
9658
10385
  * Maximum stack size of the item specified by this prototype.
@@ -9665,7 +10392,7 @@ interface LuaItemPrototype {
9665
10392
  readonly stackable: boolean
9666
10393
 
9667
10394
  /**
9668
- * The straight rail prototype used for this rail planner prototype, or `nil` if this isn't a rail planner prototype.
10395
+ * The straight rail prototype used for this rail planner prototype.
9669
10396
  * @remarks
9670
10397
  * Applies to subclasses: RailPlanner
9671
10398
  *
@@ -9683,7 +10410,7 @@ interface LuaItemPrototype {
9683
10410
  * Applies to subclasses: ModuleItem
9684
10411
  *
9685
10412
  */
9686
- readonly tier: number
10413
+ readonly tier?: number
9687
10414
 
9688
10415
  /**
9689
10416
  * The tile filter mode used by this selection tool.
@@ -9691,10 +10418,10 @@ interface LuaItemPrototype {
9691
10418
  * Applies to subclasses: SelectionTool
9692
10419
  *
9693
10420
  */
9694
- readonly tile_filter_mode: string
10421
+ readonly tile_filter_mode?: string
9695
10422
 
9696
10423
  /**
9697
- * The number of tile filters this deconstruction item has or `nil` if this isn't a deconstruction item prototype.
10424
+ * The number of tile filters this deconstruction item has.
9698
10425
  * @remarks
9699
10426
  * Applies to subclasses: DeconstructionItem
9700
10427
  *
@@ -9707,7 +10434,7 @@ interface LuaItemPrototype {
9707
10434
  * Applies to subclasses: SelectionTool
9708
10435
  *
9709
10436
  */
9710
- readonly tile_filters: {[key: string]: LuaTilePrototype}
10437
+ readonly tile_filters?: {[key: string]: LuaTilePrototype}
9711
10438
 
9712
10439
  /**
9713
10440
  * Type of this prototype. E.g. `"gun"` or `"mining-tool"`.
@@ -9720,7 +10447,7 @@ interface LuaItemPrototype {
9720
10447
  readonly valid: boolean
9721
10448
 
9722
10449
  /**
9723
- * The number of items needed to connect 2 entities with this as wire.
10450
+ * The number of items needed to connect two entities with this as wire.
9724
10451
  */
9725
10452
  readonly wire_count: number
9726
10453
 
@@ -10074,11 +10801,11 @@ interface LuaItemStack {
10074
10801
  * @remarks
10075
10802
  * Applies to subclasses: DeconstructionItem
10076
10803
  *
10077
- * @param filter - Setting to nil erases the filter.
10804
+ * @param filter - Writing `nil` removes the filter.
10078
10805
  */
10079
10806
  set_entity_filter(this: void,
10080
10807
  index: number,
10081
- filter: string | LuaEntityPrototype | LuaEntity): void
10808
+ filter: string | LuaEntityPrototype | LuaEntity | null): void
10082
10809
 
10083
10810
  /**
10084
10811
  * Sets the module filter at the given index for this upgrade item.
@@ -10135,15 +10862,15 @@ interface LuaItemStack {
10135
10862
  stack: ItemStackIdentification): void
10136
10863
 
10137
10864
  /**
10138
- * The active blueprint index for this blueprint book. May be `nil`.
10865
+ * The active blueprint index for this blueprint book. `nil` if this blueprint book is empty.
10139
10866
  * @remarks
10140
10867
  * Applies to subclasses: BlueprintBookItem
10141
10868
  *
10142
10869
  */
10143
- active_index: number
10870
+ active_index?: number
10144
10871
 
10145
10872
  /**
10146
- * If the label for this item can be manually changed. When false the label can only be changed through the API.
10873
+ * Whether the label for this item can be manually changed. When false the label can only be changed through the API.
10147
10874
  * @remarks
10148
10875
  * Applies to subclasses: ItemWithLabel
10149
10876
  *
@@ -10167,33 +10894,36 @@ interface LuaItemStack {
10167
10894
  blueprint_absolute_snapping: boolean
10168
10895
 
10169
10896
  /**
10170
- * Icons of a blueprint item, blueprint book, deconstruction item or upgrade planner. An item that doesn't have icons returns nil on read and throws error on write.
10897
+ * Icons of this blueprint item, blueprint book, deconstruction item or upgrade planner. An item that doesn't have icons returns `nil` on read and throws error on write.
10171
10898
  * @remarks
10172
10899
  * Applies to subclasses: BlueprintItem
10173
10900
  *
10174
10901
  */
10175
- blueprint_icons: BlueprintSignalIcon[]
10902
+ blueprint_icons?: BlueprintSignalIcon[]
10176
10903
 
10177
10904
  /**
10178
- * The offset from the absolute grid or nil if absolute snapping is not enabled.
10905
+ * The offset from the absolute grid. `nil` if absolute snapping is not enabled.
10179
10906
  * @remarks
10180
10907
  * Applies to subclasses: BlueprintItem
10181
10908
  *
10182
10909
  */
10183
- blueprint_position_relative_to_grid: TilePosition
10910
+ blueprint_position_relative_to_grid?: TilePosition
10184
10911
 
10185
10912
  /**
10186
- * The snapping grid size in this blueprint item or nil if snapping is not enabled.
10913
+ * The snapping grid size in this blueprint item. `nil` if snapping is not enabled.
10187
10914
  * @remarks
10188
10915
  * Applies to subclasses: BlueprintItem
10189
10916
  *
10190
10917
  */
10191
- blueprint_snap_to_grid: TilePosition
10918
+ blueprint_snap_to_grid?: TilePosition
10192
10919
 
10193
10920
  /**
10194
- * If this item is a spidertron remote that has a spidertron bound to it, it returns the connected spider-vehicle entity, `nil` otherwise.
10921
+ * If this item is a spidertron remote that has a spidertron bound to it, it returns the connected spider-vehicle entity.
10922
+ * @remarks
10923
+ * Applies to subclasses: SpidertronRemote
10924
+ *
10195
10925
  */
10196
- connected_entity: LuaEntity
10926
+ connected_entity?: LuaEntity
10197
10927
 
10198
10928
  /**
10199
10929
  * Raw materials required to build this blueprint. Result is a dictionary mapping each item prototype name to the required count.
@@ -10224,10 +10954,10 @@ interface LuaItemStack {
10224
10954
  /**
10225
10955
  * Durability of the contained item. Automatically capped at the item's maximum durability.
10226
10956
  * @remarks
10227
- * When used on a non-tool item, the value of this attribute is `nil`.
10957
+ * Applies to subclasses: Tool
10228
10958
  *
10229
10959
  */
10230
- durability: number
10960
+ durability?: number
10231
10961
 
10232
10962
  /**
10233
10963
  * The number of entity filters this deconstruction item supports.
@@ -10259,7 +10989,7 @@ interface LuaItemStack {
10259
10989
  extends_inventory: boolean
10260
10990
 
10261
10991
  /**
10262
- * The equipment grid of this item or `nil` if this item doesn't have a grid.
10992
+ * The equipment grid of this item, if any.
10263
10993
  */
10264
10994
  readonly grid?: LuaEquipmentGrid
10265
10995
 
@@ -10339,7 +11069,7 @@ interface LuaItemStack {
10339
11069
  readonly is_upgrade_item: boolean
10340
11070
 
10341
11071
  /**
10342
- * The unique identifier for this item if it has one, `nil` otherwise. Note that this ID stays the same no matter where the item is moved to.
11072
+ * The unique identifier for this item , if any. Note that this ID stays the same no matter where the item is moved to.
10343
11073
  *
10344
11074
  * Only these types of items have unique IDs:
10345
11075
  * - `"armor"`
@@ -10354,23 +11084,23 @@ interface LuaItemStack {
10354
11084
  * - `"item-with-inventory"`
10355
11085
  * - `"item-with-tags"`
10356
11086
  */
10357
- readonly item_number: number
11087
+ readonly item_number?: number
10358
11088
 
10359
11089
  /**
10360
- * The current label for this item. Nil when none.
11090
+ * The current label for this item, if any.
10361
11091
  * @remarks
10362
11092
  * Applies to subclasses: ItemWithLabel
10363
11093
  *
10364
11094
  */
10365
- label: string
11095
+ label?: string
10366
11096
 
10367
11097
  /**
10368
- * The current label color for this item. Nil when none.
11098
+ * The current label color for this item, if any.
10369
11099
  * @remarks
10370
11100
  * Applies to subclasses: ItemWithLabel
10371
11101
  *
10372
11102
  */
10373
- label_color: Color
11103
+ label_color?: Color
10374
11104
 
10375
11105
  /**
10376
11106
  * Prototype name of the item held in this stack.
@@ -10466,7 +11196,7 @@ interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior {
10466
11196
  help(this: void): void
10467
11197
 
10468
11198
  /**
10469
- * The color the lamp is showing or `nil` if not using any color.
11199
+ * The color the lamp is showing, if any.
10470
11200
  */
10471
11201
  readonly color?: Color
10472
11202
 
@@ -10563,7 +11293,7 @@ interface LuaLogisticCell {
10563
11293
  readonly construction_radius: number
10564
11294
 
10565
11295
  /**
10566
- * The network that owns this cell or `nil`.
11296
+ * The network that owns this cell, if any.
10567
11297
  */
10568
11298
  readonly logistic_network?: LuaLogisticNetwork
10569
11299
 
@@ -10659,6 +11389,17 @@ interface LuaLogisticContainerControlBehavior extends LuaControlBehavior {
10659
11389
  * A single logistic network of a given force on a given surface.
10660
11390
  */
10661
11391
  interface LuaLogisticNetwork {
11392
+ /**
11393
+ * Can the network satisfy a request for a given item and count.
11394
+ * @param count - Count to check. Defaults to 1.
11395
+ * @param include_buffers - Should buffers be considered? Defaults to false.
11396
+ * @param item - Item name to check.
11397
+ */
11398
+ can_satisfy_request(this: void,
11399
+ item: string,
11400
+ count?: number,
11401
+ include_buffers?: boolean): void
11402
+
10662
11403
  /**
10663
11404
  * Find logistic cell closest to a given position.
10664
11405
  */
@@ -10679,6 +11420,20 @@ interface LuaLogisticNetwork {
10679
11420
  item?: string,
10680
11421
  member?: string): void
10681
11422
 
11423
+ /**
11424
+ * Get the amount of items of the given type indexed by the storage member.
11425
+ * @param item - Item name to check.
11426
+ */
11427
+ get_supply_counts(this: void,
11428
+ item: string): void
11429
+
11430
+ /**
11431
+ * Gets the logistic points with of the given type indexed by the storage member.
11432
+ * @param item - Item name to check.
11433
+ */
11434
+ get_supply_points(this: void,
11435
+ item: string): void
11436
+
10682
11437
  /**
10683
11438
  * All methods and properties that this object supports.
10684
11439
  */
@@ -10860,7 +11615,7 @@ interface LuaLogisticPoint {
10860
11615
  readonly exact: boolean
10861
11616
 
10862
11617
  /**
10863
- * The logistic filters for this logistic point or `nil` if this doesn't use logistic filters.
11618
+ * The logistic filters for this logistic point, if this uses any.
10864
11619
  * @remarks
10865
11620
  * The returned array will always have an entry for each filter and will be indexed in sequence when not nil.
10866
11621
  *
@@ -10965,17 +11720,17 @@ interface LuaModSettingPrototype {
10965
11720
  help(this: void): void
10966
11721
 
10967
11722
  /**
10968
- * If this string setting allows blank values or `nil` if not a string setting.
11723
+ * Whether this string setting allows blank values. `nil` if not a string setting.
10969
11724
  */
10970
11725
  readonly allow_blank?: boolean
10971
11726
 
10972
11727
  /**
10973
- * The allowed values for this setting or `nil` if this setting doesn't use the a fixed set of values.
11728
+ * The allowed values for this setting. `nil` if this setting doesn't use the a fixed set of values.
10974
11729
  */
10975
11730
  readonly allowed_values?: string[] | number[]
10976
11731
 
10977
11732
  /**
10978
- * If this string setting auto-trims values or `nil` if not a string setting.
11733
+ * Whether this string setting auto-trims values. `nil` if not a string setting
10979
11734
  */
10980
11735
  readonly auto_trim?: boolean
10981
11736
 
@@ -10985,7 +11740,7 @@ interface LuaModSettingPrototype {
10985
11740
  readonly default_value: boolean | number | string
10986
11741
 
10987
11742
  /**
10988
- * If this setting is hidden from the GUI.
11743
+ * Whether this setting is hidden from the GUI.
10989
11744
  */
10990
11745
  readonly hidden: boolean
10991
11746
 
@@ -10994,12 +11749,12 @@ interface LuaModSettingPrototype {
10994
11749
  readonly localised_name: LocalisedString
10995
11750
 
10996
11751
  /**
10997
- * The maximum value for this setting or `nil` if this setting type doesn't support a maximum.
11752
+ * The maximum value for this setting. `nil` if this setting type doesn't support a maximum.
10998
11753
  */
10999
11754
  readonly maximum_value?: number
11000
11755
 
11001
11756
  /**
11002
- * The minimum value for this setting or `nil` if this setting type doesn't support a minimum.
11757
+ * The minimum value for this setting. `nil` if this setting type doesn't support a minimum.
11003
11758
  */
11004
11759
  readonly minimum_value?: number
11005
11760
 
@@ -11705,7 +12460,7 @@ interface LuaPlayer extends LuaControl {
11705
12460
  remove_alert(this: void,
11706
12461
  table: {
11707
12462
  entity?: LuaEntity,
11708
- prototype?: LuaEntityPrototype,
12463
+ prototype?: LuaEntityPrototype | string,
11709
12464
  position?: MapPosition,
11710
12465
  type?: defines.alert_type,
11711
12466
  surface?: SurfaceIdentification,
@@ -11876,10 +12631,7 @@ interface LuaPlayer extends LuaControl {
11876
12631
  readonly blueprint_to_setup: LuaItemStack
11877
12632
 
11878
12633
  /**
11879
- * The character attached to this player, or `nil` if no character.
11880
- * @remarks
11881
- * Will also return `nil` when the player is disconnected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
11882
- *
12634
+ * The character attached to this player, if any. Returns `nil` when the player is disconnected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
11883
12635
  */
11884
12636
  character?: LuaEntity
11885
12637
 
@@ -11901,12 +12653,9 @@ interface LuaPlayer extends LuaControl {
11901
12653
  readonly controller_type: defines.controllers
11902
12654
 
11903
12655
  /**
11904
- * When in a cutscene; the character this player would be using once the cutscene is over.
11905
- * @remarks
11906
- * Will also return `nil` when the player is disconnected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
11907
- *
12656
+ * When in a cutscene; the character this player would be using once the cutscene is over, if any. Returns `nil` when the player is disconnected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
11908
12657
  */
11909
- readonly cutscene_character: LuaEntity
12658
+ readonly cutscene_character?: LuaEntity
11910
12659
 
11911
12660
  /**
11912
12661
  * The display resolution for this player.
@@ -11925,11 +12674,9 @@ interface LuaPlayer extends LuaControl {
11925
12674
  readonly display_scale: number
11926
12675
 
11927
12676
  /**
11928
- * The source entity used during entity settings copy-paste if any.
11929
- *
11930
- * `nil` if there isn't currently a source entity.
12677
+ * The source entity used during entity settings copy-paste, if any.
11931
12678
  */
11932
- readonly entity_copy_source: LuaEntity
12679
+ readonly entity_copy_source?: LuaEntity
11933
12680
 
11934
12681
  /**
11935
12682
  * The player's game view settings.
@@ -11939,9 +12686,9 @@ interface LuaPlayer extends LuaControl {
11939
12686
  readonly gui: LuaGui
11940
12687
 
11941
12688
  /**
11942
- * The original location of the item in the cursor, marked with a hand. When writing, the specified inventory slot must be empty and the cursor stack must not be empty.
12689
+ * The original location of the item in the cursor, marked with a hand. `nil` if the cursor stack is empty. When writing, the specified inventory slot must be empty and the cursor stack must not be empty.
11943
12690
  */
11944
- hand_location: ItemStackLocation
12691
+ hand_location?: ItemStackLocation
11945
12692
 
11946
12693
  /**
11947
12694
  * This player's unique index in {@link LuaGameScript::players | LuaGameScript::players}. It is given to them when they are {@link created | on_player_created} and remains assigned to them until they are {@link removed | on_player_removed}.
@@ -11969,7 +12716,7 @@ interface LuaPlayer extends LuaControl {
11969
12716
  minimap_enabled: boolean
11970
12717
 
11971
12718
  /**
11972
- * Gets the current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings::get_player_settings | LuaSettings::get_player_settings}.
12719
+ * The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings::get_player_settings | LuaSettings::get_player_settings}.
11973
12720
  * @remarks
11974
12721
  * This table will become invalid if its associated player does.
11975
12722
  *
@@ -11997,7 +12744,7 @@ interface LuaPlayer extends LuaControl {
11997
12744
  readonly opened_self: boolean
11998
12745
 
11999
12746
  /**
12000
- * The permission group this player is part of or `nil` if not part of any group.
12747
+ * The permission group this player is part of, if any.
12001
12748
  */
12002
12749
  permission_group?: LuaPermissionGroup
12003
12750
 
@@ -12022,7 +12769,7 @@ interface LuaPlayer extends LuaControl {
12022
12769
  spectator: boolean
12023
12770
 
12024
12771
  /**
12025
- * The stashed controller type or `nil` if no controller is stashed.
12772
+ * The stashed controller type, if any.
12026
12773
  * @remarks
12027
12774
  * This is mainly useful when a player is in the map editor.
12028
12775
  *
@@ -12035,9 +12782,10 @@ interface LuaPlayer extends LuaControl {
12035
12782
  tag: string
12036
12783
 
12037
12784
  /**
12038
- * The number of ticks until this player will respawn or `nil` if not waiting to respawn.
12039
- * @remarks
12785
+ * The number of ticks until this player will respawn. `nil` if this player is not waiting to respawn.
12786
+ *
12040
12787
  * Set to `nil` to immediately respawn the player.
12788
+ * @remarks
12041
12789
  * Set to any positive value to trigger the respawn state for this player.
12042
12790
  *
12043
12791
  */
@@ -12556,9 +13304,9 @@ interface LuaRecipePrototype {
12556
13304
  readonly localised_name: LocalisedString
12557
13305
 
12558
13306
  /**
12559
- * The main product of this recipe, `nil` if no main product is defined.
13307
+ * The main product of this recipe, if any.
12560
13308
  */
12561
- readonly main_product: Product
13309
+ readonly main_product?: Product
12562
13310
 
12563
13311
  /**
12564
13312
  * Name of the recipe. This can be different than the name of the result items as there could be more recipes to make the same item.
@@ -13996,9 +14744,15 @@ interface LuaShortcutPrototype {
13996
14744
 
13997
14745
  readonly action: string
13998
14746
 
13999
- readonly associated_control_input: string
14747
+ /**
14748
+ * The control input that is associated with this shortcut, if any.
14749
+ */
14750
+ readonly associated_control_input?: string
14000
14751
 
14001
- readonly item_to_spawn: LuaItemPrototype
14752
+ /**
14753
+ * The item to create when this shortcut is used, if any.
14754
+ */
14755
+ readonly item_to_spawn?: LuaItemPrototype
14002
14756
 
14003
14757
  readonly localised_description: LocalisedString
14004
14758
 
@@ -14019,7 +14773,10 @@ interface LuaShortcutPrototype {
14019
14773
  */
14020
14774
  readonly order: string
14021
14775
 
14022
- readonly technology_to_unlock: LuaTechnologyPrototype
14776
+ /**
14777
+ * The technology to unlock when this shortcut is used, if any.
14778
+ */
14779
+ readonly technology_to_unlock?: LuaTechnologyPrototype
14023
14780
 
14024
14781
  readonly toggleable: boolean
14025
14782
 
@@ -14234,9 +14991,9 @@ interface LuaStyle {
14234
14991
  height: number
14235
14992
 
14236
14993
  /**
14237
- * Horizontal align of the inner content of the widget, possible values are "left", "center" or "right"
14994
+ * Horizontal align of the inner content of the widget, if any. Possible values are "left", "center" or "right".
14238
14995
  */
14239
- horizontal_align: string
14996
+ horizontal_align?: string
14240
14997
 
14241
14998
  /**
14242
14999
  * Horizontal space between individual cells.
@@ -14247,14 +15004,14 @@ interface LuaStyle {
14247
15004
  horizontal_spacing: number
14248
15005
 
14249
15006
  /**
14250
- * If the GUI element can be squashed (by maximal width of some parent element) horizontally. This is mainly meant to be used for scroll-pane The default value is false.
15007
+ * Whether the GUI element can be squashed (by maximal width of some parent element) horizontally. `nil` if this element does not support squashing. This is mainly meant to be used for scroll-pane The default value is false.
14251
15008
  */
14252
- horizontally_squashable: boolean
15009
+ horizontally_squashable?: boolean
14253
15010
 
14254
15011
  /**
14255
- * If the GUI element stretches its size horizontally to other elements.
15012
+ * Whether the GUI element stretches its size horizontally to other elements. `nil` if this element does not support stretching.
14256
15013
  */
14257
- horizontally_stretchable: boolean
15014
+ horizontally_stretchable?: boolean
14258
15015
 
14259
15016
  /**
14260
15017
  * @remarks
@@ -14431,9 +15188,9 @@ interface LuaStyle {
14431
15188
  readonly valid: boolean
14432
15189
 
14433
15190
  /**
14434
- * Vertical align of the inner content of the widget, possible values are "top", "center" or "bottom"
15191
+ * Vertical align of the inner content of the widget, if any. Possible values are "top", "center" or "bottom".
14435
15192
  */
14436
- vertical_align: string
15193
+ vertical_align?: string
14437
15194
 
14438
15195
  /**
14439
15196
  * Vertical space between individual cells.
@@ -14444,14 +15201,14 @@ interface LuaStyle {
14444
15201
  vertical_spacing: number
14445
15202
 
14446
15203
  /**
14447
- * If the GUI element can be squashed (by maximal height of some parent element) vertically. This is mainly meant to be used for scroll-pane The default (parent) value for scroll pane is true, false otherwise.
15204
+ * Whether the GUI element can be squashed (by maximal height of some parent element) vertically. `nil` if this element does not support squashing. This is mainly meant to be used for scroll-pane The default (parent) value for scroll pane is true, false otherwise.
14448
15205
  */
14449
- vertically_squashable: boolean
15206
+ vertically_squashable?: boolean
14450
15207
 
14451
15208
  /**
14452
- * If the GUI element stretches its size vertically to other elements.
15209
+ * Whether the GUI element stretches its size vertically to other elements. `nil` if this element does not support stretching.
14453
15210
  */
14454
- vertically_stretchable: boolean
15211
+ vertically_stretchable?: boolean
14455
15212
 
14456
15213
  /**
14457
15214
  * Sets both minimal and maximal width to the given value.
@@ -15355,7 +16112,7 @@ interface LuaSurface {
15355
16112
  * @param table.entity_to_ignore - Makes the pathfinder ignore collisions with this entity if it is given.
15356
16113
  * @param table.force - The force for which to generate the path, determining which gates can be opened for example.
15357
16114
  * @param table.goal - The position to find a path to.
15358
- * @param table.path_resolution_modifier - Defines how coarse the pathfinder's grid is. Smaller values mean a coarser grid (negative numbers allowed). Defaults to `0`.
16115
+ * @param table.path_resolution_modifier - Defines how coarse the pathfinder's grid is. Smaller values mean a coarser grid (negative numbers allowed). Allowed values are from -8 to 8. Defaults to `0`.
15359
16116
  * @param table.pathfind_flags - Flags that affect pathfinder behavior.
15360
16117
  * @param table.radius - How close the pathfinder needs to get to its `goal` (in tiles). Defaults to `1`.
15361
16118
  * @param table.start - The position from which to start pathfinding.
@@ -15677,9 +16434,9 @@ interface LuaTechnology {
15677
16434
  readonly research_unit_count: number
15678
16435
 
15679
16436
  /**
15680
- * The count formula used for this infinite research or nil if this isn't an infinite research.
16437
+ * The count formula used for this infinite research. `nil` if this research isn't infinite.
15681
16438
  */
15682
- readonly research_unit_count_formula: string
16439
+ readonly research_unit_count_formula?: string
15683
16440
 
15684
16441
  /**
15685
16442
  * Amount of energy required to finish a unit of research.
@@ -15791,9 +16548,9 @@ interface LuaTechnologyPrototype {
15791
16548
  readonly research_unit_count: number
15792
16549
 
15793
16550
  /**
15794
- * The count formula used for this infinite research or nil if this isn't an infinite research.
16551
+ * The count formula used for this infinite research. `nil` if this research isn't infinite.
15795
16552
  */
15796
- readonly research_unit_count_formula: string
16553
+ readonly research_unit_count_formula?: string
15797
16554
 
15798
16555
  /**
15799
16556
  * Amount of energy required to finish a unit of research.
@@ -15883,7 +16640,7 @@ interface LuaTile {
15883
16640
  force?: ForceIdentification): void
15884
16641
 
15885
16642
  /**
15886
- * The name of the {@link LuaTilePrototype | LuaTilePrototype} hidden under this tile or `nil` if there is no hidden tile. During normal gameplay, only {@link non-mineable | LuaTilePrototype::mineable_properties} tiles can become hidden. This can however be circumvented with {@link LuaSurface::set_hidden_tile | LuaSurface::set_hidden_tile}.
16643
+ * The name of the {@link LuaTilePrototype | LuaTilePrototype} hidden under this tile, if any. During normal gameplay, only {@link non-mineable | LuaTilePrototype::mineable_properties} tiles can become hidden. This can however be circumvented with {@link LuaSurface::set_hidden_tile | LuaSurface::set_hidden_tile}.
15887
16644
  */
15888
16645
  readonly hidden_tile?: string
15889
16646
 
@@ -15930,9 +16687,9 @@ interface LuaTilePrototype {
15930
16687
  readonly automatic_neighbors: boolean
15931
16688
 
15932
16689
  /**
15933
- * Autoplace specification for this prototype. `nil` if none.
16690
+ * Autoplace specification for this prototype, if any.
15934
16691
  */
15935
- readonly autoplace_specification: AutoplaceSpecification
16692
+ readonly autoplace_specification?: AutoplaceSpecification
15936
16693
 
15937
16694
  /**
15938
16695
  * False if this tile is not allowed in blueprints regardless of the ability to build it.
@@ -15974,7 +16731,28 @@ interface LuaTilePrototype {
15974
16731
 
15975
16732
  readonly map_color: Color
15976
16733
 
15977
- readonly mineable_properties: { minable: boolean, mining_particle?: string, mining_time: number, products: Product[] }
16734
+ readonly mineable_properties: {
16735
+
16736
+ /**
16737
+ * Is this tile mineable at all?
16738
+ */
16739
+ minable: boolean,
16740
+
16741
+ /**
16742
+ * Prototype name of the particle produced when mining this tile. Will only be present if this tile produces any particle during mining.
16743
+ */
16744
+ mining_particle?: string,
16745
+
16746
+ /**
16747
+ * Energy required to mine a tile.
16748
+ */
16749
+ mining_time: number,
16750
+
16751
+ /**
16752
+ * Products obtained by mining this tile.
16753
+ */
16754
+ products: Product[]
16755
+ }
15978
16756
 
15979
16757
  /**
15980
16758
  * Name of this prototype.
@@ -15987,7 +16765,7 @@ interface LuaTilePrototype {
15987
16765
  readonly needs_correction: boolean
15988
16766
 
15989
16767
  /**
15990
- * The next direction of this tile or `nil` - used when a tile has multiple directions (such as hazard concrete)
16768
+ * The next direction of this tile, if any. Used when a tile has multiple directions (such as hazard concrete)
15991
16769
  */
15992
16770
  readonly next_direction?: LuaTilePrototype
15993
16771
 
@@ -16099,12 +16877,12 @@ interface LuaTrain {
16099
16877
  stack: ItemStackIdentification): void
16100
16878
 
16101
16879
  /**
16102
- * The rail at the back end of the train, possibly `nil`.
16880
+ * The rail at the back end of the train, if any.
16103
16881
  */
16104
- readonly back_rail: LuaEntity
16882
+ readonly back_rail?: LuaEntity
16105
16883
 
16106
16884
  /**
16107
- * The back stock of this train, or `nil`. The back of the train is at the opposite end of the {@link front | LuaTrain::front_stock}.
16885
+ * The back stock of this train, if any. The back of the train is at the opposite end of the {@link front | LuaTrain::front_stock}.
16108
16886
  */
16109
16887
  readonly back_stock?: LuaEntity
16110
16888
 
@@ -16124,12 +16902,12 @@ interface LuaTrain {
16124
16902
  readonly fluid_wagons: LuaEntity[]
16125
16903
 
16126
16904
  /**
16127
- * The rail at the front end of the train, possibly `nil`.
16905
+ * The rail at the front end of the train, if any.
16128
16906
  */
16129
- readonly front_rail: LuaEntity
16907
+ readonly front_rail?: LuaEntity
16130
16908
 
16131
16909
  /**
16132
- * The front stock of this train, or `nil`. The front of the train is in the direction that a majority of locomotives are pointing in. If it's a tie, the North and West directions take precedence.
16910
+ * The front stock of this train, if any. The front of the train is in the direction that a majority of locomotives are pointing in. If it's a tie, the North and West directions take precedence.
16133
16911
  */
16134
16912
  readonly front_stock?: LuaEntity
16135
16913
 
@@ -16189,17 +16967,17 @@ interface LuaTrain {
16189
16967
  readonly passengers: LuaPlayer[]
16190
16968
 
16191
16969
  /**
16192
- * The path this train is using or `nil` if none.
16970
+ * The path this train is using, if any.
16193
16971
  */
16194
16972
  readonly path?: LuaRailPath
16195
16973
 
16196
16974
  /**
16197
- * The destination rail this train is currently pathing to or `nil`.
16975
+ * The destination rail this train is currently pathing to, if any.
16198
16976
  */
16199
16977
  readonly path_end_rail?: LuaEntity
16200
16978
 
16201
16979
  /**
16202
- * The destination train stop this train is currently pathing to or `nil`.
16980
+ * The destination train stop this train is currently pathing to, if any.
16203
16981
  */
16204
16982
  readonly path_end_stop?: LuaEntity
16205
16983
 
@@ -16213,7 +16991,7 @@ interface LuaTrain {
16213
16991
  readonly riding_state: RidingState
16214
16992
 
16215
16993
  /**
16216
- * The trains current schedule or `nil` if empty. Set to `nil` to clear.
16994
+ * This train's current schedule, if any. Set to `nil` to clear.
16217
16995
  * @remarks
16218
16996
  * The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
16219
16997
  *
@@ -16221,7 +16999,7 @@ interface LuaTrain {
16221
16999
  schedule?: TrainSchedule
16222
17000
 
16223
17001
  /**
16224
- * The signal this train is arriving or waiting at or `nil` if none.
17002
+ * The signal this train is arriving or waiting at, if any.
16225
17003
  */
16226
17004
  readonly signal?: LuaEntity
16227
17005
 
@@ -16239,7 +17017,7 @@ interface LuaTrain {
16239
17017
  readonly state: defines.train_state
16240
17018
 
16241
17019
  /**
16242
- * The train stop this train is stopped at or `nil`.
17020
+ * The train stop this train is stopped at, if any.
16243
17021
  */
16244
17022
  readonly station?: LuaEntity
16245
17023
 
@@ -16575,12 +17353,12 @@ interface LuaUnitGroup {
16575
17353
  start_moving(this: void): void
16576
17354
 
16577
17355
  /**
16578
- * The command given to this group or `nil` is the group has no command.
17356
+ * The command given to this group, if any.
16579
17357
  */
16580
17358
  readonly command?: Command
16581
17359
 
16582
17360
  /**
16583
- * The distraction command given to this group or `nil` is the group currently isn't distracted.
17361
+ * The distraction command given to this group, if any.
16584
17362
  */
16585
17363
  readonly distraction_command?: Command
16586
17364
 
@@ -16941,7 +17719,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends LuaGuiElementAddParams
16941
17719
  /**
16942
17720
  * Filters describing what to show in the selection window. The applicable filter depends on the `elem_type`.
16943
17721
  */
16944
- 'elem_filters'?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
17722
+ 'elem_filters'?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter
16945
17723
 
16946
17724
  /**
16947
17725
  * The type of the button - one of the following values.