factorio-types 1.2.33 → 1.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/classes.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 2.0.47
5
+ // Factorio version 2.0.49
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -4714,7 +4714,7 @@ interface LuaCommandable {
4714
4714
  */
4715
4715
  readonly is_entity: boolean;
4716
4716
  /**
4717
- * Whether this unit group is controlled by a script or by the game engine. This can be changed using {@link LuaCommandable::set_autonomous | runtime:LuaCommandable::set_autonomous}.
4717
+ * Whether this unit group is controlled by a script or by the game engine. This can be changed using {@link LuaCommandable::set_autonomous | runtime:LuaCommandable::set_autonomous}. Units created by {@link LuaSurface::create_unit_group | runtime:LuaSurface::create_unit_group} are considered script-driven.
4718
4718
  */
4719
4719
  readonly is_script_driven: boolean;
4720
4720
  /**
@@ -4899,6 +4899,10 @@ interface LuaControl {
4899
4899
  * @returns The inventory or `nil` if none with the given index was found.
4900
4900
  */
4901
4901
  get_inventory(this: void, inventory: defines.inventory): LuaInventory | null;
4902
+ /**
4903
+ * Get name of inventory. Names match keys of {@link defines.inventory | runtime:defines.inventory}.
4904
+ */
4905
+ get_inventory_name(this: void, inventory: defines.inventory): string | null;
4902
4906
  /**
4903
4907
  * Get the number of all or some items in this entity.
4904
4908
  * @param item The item to count. If not specified, count all items.
@@ -5957,6 +5961,15 @@ interface LuaEntity extends LuaControl {
5957
5961
  * @param fluid Prototype name of the fluid to count. If not specified, count all fluids.
5958
5962
  */
5959
5963
  get_fluid_count(this: void, fluid?: string): double;
5964
+ /**
5965
+ * Checks what is expected fluid to be produced from the offshore pump's source tile. It accounts for visible tile, hidden tile and double hidden tile. It ignores currently set fluid box filter.
5966
+ * @returns Name of fluid that should be produced by this offshore pump based on existing tiles.
5967
+ */
5968
+ get_fluid_source_fluid(this: void): string | null;
5969
+ /**
5970
+ * Gives TilePosition of a tile which this offshore pump uses to check what fluid should be produced.
5971
+ */
5972
+ get_fluid_source_tile(this: void): TilePosition;
5960
5973
  /**
5961
5974
  * The fuel inventory for this entity or `nil` if this entity doesn't have a fuel inventory.
5962
5975
  */
@@ -6239,9 +6252,10 @@ interface LuaEntity extends LuaControl {
6239
6252
  */
6240
6253
  is_registered_for_upgrade(this: void): boolean;
6241
6254
  /**
6255
+ * @param character If provided, must be of `character` type.
6242
6256
  * @returns `true` if the rocket was successfully launched. Return value of `false` means the silo is not ready for launch.
6243
6257
  */
6244
- launch_rocket(this: void, destination?: CargoDestination): boolean;
6258
+ launch_rocket(this: void, destination?: CargoDestination, character?: LuaEntity): boolean;
6245
6259
  /**
6246
6260
  * Mines this entity.
6247
6261
  *
@@ -6503,11 +6517,18 @@ interface LuaEntity extends LuaControl {
6503
6517
  *
6504
6518
  * The player will be automatically disassociated when a controller is set on the character. Also, all characters associated to a player will be logged off when the player logs off in multiplayer.
6505
6519
  *
6506
- * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
6520
+ * A character associated with a player is not directly controlled by any player.
6521
+ */
6522
+ readonly associated_player?: LuaPlayer;
6523
+ /**
6524
+ * The player this character is associated with, if any. Set to `nil` to clear.
6525
+ *
6526
+ * The player will be automatically disassociated when a controller is set on the character. Also, all characters associated to a player will be logged off when the player logs off in multiplayer.
6507
6527
  *
6508
6528
  * A character associated with a player is not directly controlled by any player.
6529
+ * @customName associated_player
6509
6530
  */
6510
- associated_player?: LuaPlayer | PlayerIdentification;
6531
+ associated_player_write?: PlayerIdentification;
6511
6532
  /**
6512
6533
  * The cargo pod attached to this rocket silo rocket if any.
6513
6534
  */
@@ -6571,6 +6592,10 @@ interface LuaEntity extends LuaControl {
6571
6592
  * The burner energy source for this entity, if any.
6572
6593
  */
6573
6594
  readonly burner?: LuaBurner;
6595
+ /**
6596
+ * The space platform hub or cargo landing pad this cargo bay is connected to if any.
6597
+ */
6598
+ readonly cargo_bay_connection_owner?: LuaEntity;
6574
6599
  /**
6575
6600
  * The cargo hatches owned by this entity if any.
6576
6601
  */
@@ -6957,10 +6982,13 @@ interface LuaEntity extends LuaControl {
6957
6982
  kills: uint;
6958
6983
  /**
6959
6984
  * The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. `nil` if the last user is not part of the save anymore.
6960
- *
6961
- * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
6962
6985
  */
6963
- last_user?: LuaPlayer | PlayerIdentification;
6986
+ readonly last_user?: LuaPlayer;
6987
+ /**
6988
+ * 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.
6989
+ * @customName last_user
6990
+ */
6991
+ last_user_write?: PlayerIdentification;
6964
6992
  /**
6965
6993
  * The link ID this linked container is using.
6966
6994
  */
@@ -7076,6 +7104,10 @@ interface LuaEntity extends LuaControl {
7076
7104
  * The smooth orientation of this entity.
7077
7105
  */
7078
7106
  orientation: RealOrientation;
7107
+ /**
7108
+ * Plants registered by this agricultural tower.
7109
+ */
7110
+ readonly owned_plants: LuaEntity[];
7079
7111
  parameters: ProgrammableSpeakerParameters;
7080
7112
  /**
7081
7113
  * Where the inserter will pick up items from.
@@ -7179,10 +7211,13 @@ interface LuaEntity extends LuaControl {
7179
7211
  remove_unfiltered_items: boolean;
7180
7212
  /**
7181
7213
  * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, or `highlight-box` is visible to. `nil` when this entity is rendered for all players.
7182
- *
7183
- * Reading this property will return a {@link LuaPlayer | runtime:LuaPlayer}, while {@link PlayerIdentification | runtime:PlayerIdentification} can be used when writing.
7184
7214
  */
7185
- render_player?: LuaPlayer | PlayerIdentification;
7215
+ readonly render_player?: LuaPlayer;
7216
+ /**
7217
+ * The player that this `simple-entity-with-owner`, `simple-entity-with-force`, or `highlight-box` is visible to. `nil` when this entity is rendered for all players.
7218
+ * @customName render_player
7219
+ */
7220
+ render_player_write?: PlayerIdentification;
7186
7221
  /**
7187
7222
  * The forces that this `simple-entity-with-owner` or `simple-entity-with-force` is visible to. `nil` or an empty array when this entity is rendered for all forces.
7188
7223
  *
@@ -7438,10 +7473,22 @@ interface LuaEntity extends LuaControl {
7438
7473
  * This has no effect if the prototype does not support filters.
7439
7474
  */
7440
7475
  use_filters: boolean;
7476
+ /**
7477
+ * When true, the rocket silo will request items for space platforms in orbit.
7478
+ *
7479
+ * Setting the value will have no effect when the silo doesn't support logistics.
7480
+ */
7481
+ use_transitional_requests: boolean;
7441
7482
  /**
7442
7483
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
7443
7484
  */
7444
7485
  readonly valid: boolean;
7486
+ /**
7487
+ * The threshold override of this valve, or `nil` if an override is not defined.
7488
+ *
7489
+ * If no override is defined, the threshold is taken from {@link LuaEntityPrototype::valve_threshold | runtime:LuaEntityPrototype::valve_threshold}.
7490
+ */
7491
+ valve_threshold_override?: float;
7445
7492
  /**
7446
7493
  * Read when this spidertron auto-targets enemies
7447
7494
  */
@@ -7519,6 +7566,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7519
7566
  * The supply area of this electric pole or beacon prototype.
7520
7567
  */
7521
7568
  get_supply_area_distance(this: void, quality?: QualityID): double;
7569
+ /**
7570
+ * The maximum flow rate through this valve.
7571
+ */
7572
+ get_valve_flow_rate(this: void, quality?: QualityID): double;
7522
7573
  /**
7523
7574
  * Test whether this entity prototype has a certain flag set.
7524
7575
  * @param flag The flag to test.
@@ -7529,6 +7580,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7529
7580
  * A table of pollutions amounts that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution, indexed by the name of each absorbed pollution type.
7530
7581
  */
7531
7582
  readonly absorptions_to_join_attack?: Record<string, float>;
7583
+ readonly accepted_seeds?: string[];
7532
7584
  /**
7533
7585
  * The active energy usage of this rocket silo or combinator prototype.
7534
7586
  */
@@ -7541,6 +7593,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7541
7593
  * Whether this unit prototype is affected by tile walking speed modifiers.
7542
7594
  */
7543
7595
  readonly affected_by_tiles?: boolean;
7596
+ readonly agricultural_tower_radius?: double;
7544
7597
  /**
7545
7598
  * The air resistance of this rolling stock prototype.
7546
7599
  */
@@ -7731,6 +7784,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7731
7784
  * The value in the dictionary is meaningless and exists just to allow for easy lookup.
7732
7785
  */
7733
7786
  readonly crafting_categories?: Record<string, true>;
7787
+ /**
7788
+ * The crane energy usage of this agricultural tower prototype.
7789
+ */
7790
+ readonly crane_energy_usage?: double;
7734
7791
  /**
7735
7792
  * If this prototype will attempt to create a ghost of itself on death.
7736
7793
  *
@@ -7884,6 +7941,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7884
7941
  * The fluid energy source prototype this entity uses, if any.
7885
7942
  */
7886
7943
  readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype;
7944
+ readonly fluid_source_offset?: Vector;
7887
7945
  /**
7888
7946
  * The fluid usage of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_fluid_usage_per_tick | runtime:LuaEntityPrototype::get_fluid_usage_per_tick} and should not be used.
7889
7947
  */
@@ -7912,6 +7970,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7912
7970
  * The equipment grid prototype for this entity, if any.
7913
7971
  */
7914
7972
  readonly grid_prototype?: LuaEquipmentGridPrototype;
7973
+ readonly growth_area_radius?: double;
7915
7974
  readonly growth_grid_tile_size?: uint;
7916
7975
  readonly growth_ticks?: uint;
7917
7976
  /**
@@ -8055,6 +8114,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8055
8114
  * The lamp energy usage of this rocket silo prototype.
8056
8115
  */
8057
8116
  readonly lamp_energy_usage?: double;
8117
+ readonly launch_to_space_platforms?: boolean;
8058
8118
  /**
8059
8119
  * The rocket launch delay for this rocket silo prototype.
8060
8120
  */
@@ -8342,6 +8402,9 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8342
8402
  * The cursor size used when shooting at this entity.
8343
8403
  */
8344
8404
  readonly shooting_cursor_size: float;
8405
+ readonly solar_panel_performance_at_day: double;
8406
+ readonly solar_panel_performance_at_night: double;
8407
+ readonly solar_panel_solar_coefficient_property: LuaSurfacePropertyPrototype;
8345
8408
  /**
8346
8409
  * The spawning cooldown for this enemy spawner prototype.
8347
8410
  */
@@ -8456,6 +8519,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8456
8519
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
8457
8520
  */
8458
8521
  readonly valid: boolean;
8522
+ /**
8523
+ * The mode of operation of this valve.
8524
+ */
8525
+ readonly valve_mode?: ValveMode;
8526
+ /**
8527
+ * The default threshold of this valve.
8528
+ */
8529
+ readonly valve_threshold?: float;
8459
8530
  readonly vector_to_place_result?: Vector;
8460
8531
  /**
8461
8532
  * Vertical selection shift used by rolling stocks. It affects selection box vertical position but is also used to shift rolling stock graphics along the rails to fine tune train's look.
@@ -8513,7 +8584,7 @@ interface LuaEquipment {
8513
8584
  */
8514
8585
  readonly max_energy: double;
8515
8586
  /**
8516
- * Maximum shield value.
8587
+ * Maximum shield value. `0` if this equipment doesn't have a shield.
8517
8588
  */
8518
8589
  readonly max_shield: double;
8519
8590
  /**
@@ -8549,9 +8620,9 @@ interface LuaEquipment {
8549
8620
  height: uint;
8550
8621
  };
8551
8622
  /**
8552
- * Current shield value of the equipment.
8623
+ * Current shield value of the equipment. Can't be set higher than {@link LuaEquipment::max_shield | runtime:LuaEquipment::max_shield}.
8553
8624
  *
8554
- * Can't be set higher than {@link LuaEquipment::max_shield | runtime:LuaEquipment::max_shield}.
8625
+ * Trying to write this value on non-shield equipment will throw an error.
8555
8626
  */
8556
8627
  shield: double;
8557
8628
  /**
@@ -8997,7 +9068,7 @@ interface LuaFluidBox {
8997
9068
  */
8998
9069
  flush(this: void, index: uint, fluid?: FluidID): Record<string, float>;
8999
9070
  /**
9000
- * The capacity of the given fluidbox index.
9071
+ * The capacity of the given fluidbox segment.
9001
9072
  */
9002
9073
  get_capacity(this: void, index: uint): double;
9003
9074
  /**
@@ -9012,6 +9083,8 @@ interface LuaFluidBox {
9012
9083
  get_filter(this: void, index: uint): FluidBoxFilter | null;
9013
9084
  /**
9014
9085
  * Gets counts of all fluids in the fluid segment. May return `nil` for fluid wagon, fluid turret's internal buffer, or a fluidbox which does not belong to a fluid segment.
9086
+ *
9087
+ * Note that this method only ever returns one fluid, since fluids can't be mixed anymore.
9015
9088
  * @returns The counts, indexed by fluid name.
9016
9089
  */
9017
9090
  get_fluid_segment_contents(this: void, index: uint): Record<string, uint> | null;
@@ -10356,10 +10429,10 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
10356
10429
  * @example ```
10357
10430
  -- Tell an entity to be active (for example a lamp to be lit) when it receives a
10358
10431
  -- circuit signal of more than 4 chain signals.
10359
- a_behavior.circuit_condition = {condition={
10432
+ a_behavior.circuit_condition = {
10360
10433
  comparator=">",
10361
10434
  first_signal={type="item", name="rail-chain-signal"},
10362
- constant=4}
10435
+ constant=4
10363
10436
  }
10364
10437
  ```
10365
10438
  */
@@ -10381,10 +10454,10 @@ interface LuaGenericOnOffControlBehavior extends LuaControlBehavior {
10381
10454
  * @example ```
10382
10455
  -- Tell an entity to be active (for example a lamp to be lit) when the logistics
10383
10456
  -- network it's connected to has more than four chain signals.
10384
- a_behavior.logistic_condition = {condition={
10457
+ a_behavior.logistic_condition = {
10385
10458
  comparator=">",
10386
10459
  first_signal={type="item", name="rail-chain-signal"},
10387
- constant=4}
10460
+ constant=4
10388
10461
  }
10389
10462
  ```
10390
10463
  */
@@ -10889,6 +10962,15 @@ interface LuaGuiElement {
10889
10962
  * The position this camera or minimap is focused on, if any.
10890
10963
  */
10891
10964
  position: MapPosition;
10965
+ /**
10966
+ * The quality to be shown in the bottom left corner of this sprite-button, or `nil` to show nothing.
10967
+ */
10968
+ readonly quality?: LuaQualityPrototype;
10969
+ /**
10970
+ * The quality to be shown in the bottom left corner of this sprite-button, or `nil` to show nothing.
10971
+ * @customName quality
10972
+ */
10973
+ quality_write?: QualityID;
10892
10974
  /**
10893
10975
  * Whether this element will raise {@link on_gui_hover | runtime:on_gui_hover} and {@link on_gui_leave | runtime:on_gui_leave}.
10894
10976
  */
@@ -11438,6 +11520,10 @@ interface LuaGuiElementAddParamsSpriteButton extends BaseLuaGuiElementAddParams
11438
11520
  * The number shown on the button.
11439
11521
  */
11440
11522
  'number'?: double;
11523
+ /**
11524
+ * The name of the quality shown on the button.
11525
+ */
11526
+ 'quality'?: string;
11441
11527
  /**
11442
11528
  * Formats small numbers as percentages. Defaults to `false`.
11443
11529
  */
@@ -11903,6 +11989,10 @@ interface LuaInventory {
11903
11989
  * The mod that owns this inventory, if any.
11904
11990
  */
11905
11991
  readonly mod_owner?: string;
11992
+ /**
11993
+ * Name of this inventory, if any. Names match keys of {@link defines.inventory | runtime:defines.inventory}.
11994
+ */
11995
+ readonly name?: string;
11906
11996
  /**
11907
11997
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
11908
11998
  */
@@ -12160,7 +12250,7 @@ interface LuaItemCommon {
12160
12250
  *
12161
12251
  * In contrast to {@link LuaItemCommon::get_mapper | runtime:LuaItemCommon::get_mapper}, indices past the upgrade item's current size are valid and expand the list of mappings accordingly, if within reasonable bounds.
12162
12252
  * @param index The index of the mapper to set.
12163
- * @param mapper The mapper to set or `nil`
12253
+ * @param mapper The mapper to set. Set `nil` to clear the mapper.
12164
12254
  */
12165
12255
  set_mapper(this: void, index: uint, type: 'from' | 'to', mapper: UpgradeMapperSource | UpgradeMapperDestination | nil): void;
12166
12256
  /**
@@ -14942,10 +15032,19 @@ interface LuaReactorControlBehavior extends LuaControlBehavior {
14942
15032
  * A crafting recipe. Recipes belong to forces (see {@link LuaForce | runtime:LuaForce}) because some recipes are unlocked by research, and researches are per-force.
14943
15033
  */
14944
15034
  interface LuaRecipe {
15035
+ /**
15036
+ * Checks if recipe has given category
15037
+ * @returns `true` if recipe has this category.
15038
+ */
15039
+ has_category(this: void, category: RecipeCategoryID): boolean;
14945
15040
  /**
14946
15041
  * Reload the recipe from the prototype.
14947
15042
  */
14948
15043
  reload(this: void): void;
15044
+ /**
15045
+ * Additional categories of this recipe.
15046
+ */
15047
+ readonly additional_categories: string[];
14949
15048
  /**
14950
15049
  * Category of the recipe.
14951
15050
  */
@@ -15041,6 +15140,15 @@ interface LuaRecipeCategoryPrototype extends LuaPrototypeBase {
15041
15140
  * A crafting recipe prototype.
15042
15141
  */
15043
15142
  interface LuaRecipePrototype extends LuaPrototypeBase {
15143
+ /**
15144
+ * Checks if recipe has given category
15145
+ * @returns `true` if recipe has this category.
15146
+ */
15147
+ has_category(this: void, category: RecipeCategoryID): boolean;
15148
+ /**
15149
+ * Additional categories of the recipe.
15150
+ */
15151
+ readonly additional_categories: string[];
15044
15152
  /**
15045
15153
  * If this recipe is enabled for the purpose of intermediate hand-crafting.
15046
15154
  */
@@ -15305,9 +15413,8 @@ interface LuaRecord {
15305
15413
  *
15306
15414
  * In contrast to {@link LuaRecord::set_mapper | runtime:LuaRecord::set_mapper}, indices past the upgrade item's current size are considered to be out of bounds.
15307
15415
  * @param index The index of the mapper to read.
15308
- * @param type `"from"` or `"to"`.
15309
15416
  */
15310
- get_mapper(this: void, index: uint, type: string): UpgradeMapperSource | UpgradeMapperDestination;
15417
+ get_mapper(this: void, index: uint, type: 'from' | 'to'): UpgradeMapperSource | UpgradeMapperDestination;
15311
15418
  /**
15312
15419
  * Gets the tile filter at the given index for this deconstruction planner.
15313
15420
  */
@@ -15349,10 +15456,9 @@ interface LuaRecord {
15349
15456
  *
15350
15457
  * In contrast to {@link LuaRecord::get_mapper | runtime:LuaRecord::get_mapper}, indices past the upgrade item's current size are valid and expand the list of mappings accordingly, if within reasonable bounds.
15351
15458
  * @param index The index of the mapper to set.
15352
- * @param type `"from"` or `"to"`.
15353
- * @param mapper The mapper to set or `nil`
15459
+ * @param mapper The mapper to set. Set `nil` to clear the mapper.
15354
15460
  */
15355
- set_mapper(this: void, index: uint, type: string, mapper: UpgradeMapperSource | UpgradeMapperDestination): void;
15461
+ set_mapper(this: void, index: uint, type: 'from' | 'to', mapper: UpgradeMapperSource | UpgradeMapperDestination | nil): void;
15356
15462
  /**
15357
15463
  * Sets the tile filter at the given index for this deconstruction planner.
15358
15464
  * @param filter Setting to nil erases the filter.
@@ -16372,6 +16478,7 @@ interface LuaSimulation {
16372
16478
  */
16373
16479
  deactivate_rail_planner(this: void): void;
16374
16480
  /**
16481
+ * @param table.slot_index This index is 0-based, unlike other inventory indices.
16375
16482
  * @param table.inventory Defaults to `"character"`.
16376
16483
  * @returns Position of the GUI slot on the screen, if successfully found.
16377
16484
  */
@@ -16513,6 +16620,10 @@ interface LuaSpacePlatform {
16513
16620
  * Cancels deletion of this space platform if it was scheduled for deletion.
16514
16621
  */
16515
16622
  cancel_deletion(this: void): void;
16623
+ /**
16624
+ * Removes all ejected items from this space platform.
16625
+ */
16626
+ clear_ejected_items(this: void): void;
16516
16627
  /**
16517
16628
  * Creates the given asteroid chunks on this platform.
16518
16629
  */
@@ -16541,6 +16652,13 @@ interface LuaSpacePlatform {
16541
16652
  limit?: uint;
16542
16653
  invert?: boolean;
16543
16654
  }): void;
16655
+ /**
16656
+ * Ejects an item into space on this space platform.
16657
+ *
16658
+ * If a LuaItemStack is provided, the actual item is ejected and removed from the source.
16659
+ * @param movement When inserters drop items into space, the {@link InserterPrototype::insert_position | prototype:InserterPrototype::insert_position} rotated to the inserter direction is used.
16660
+ */
16661
+ eject_item(this: void, item: ItemStackIdentification, position: MapPosition, movement: Vector): void;
16544
16662
  /**
16545
16663
  * Find asteroid chunks of a given name in a given area.
16546
16664
  *
@@ -16576,6 +16694,10 @@ interface LuaSpacePlatform {
16576
16694
  * It is represented as a number in range `[0, 1]`, with 0 being {@link LuaSpaceConnectionPrototype::from | runtime:LuaSpaceConnectionPrototype::from} and 1 being {@link LuaSpaceConnectionPrototype::to | runtime:LuaSpaceConnectionPrototype::to}.
16577
16695
  */
16578
16696
  distance?: double;
16697
+ /**
16698
+ * All items that have been thrown overboard.
16699
+ */
16700
+ readonly ejected_items: EjectedItem[];
16579
16701
  /**
16580
16702
  * The force of this space platform.
16581
16703
  */
@@ -17111,6 +17233,28 @@ interface LuaSurface {
17111
17233
  check_collision?: boolean;
17112
17234
  decoratives: Decorative[];
17113
17235
  }): void;
17236
+ /**
17237
+ * This method only works when used in simulations.
17238
+ *
17239
+ * Places entities via the given blueprint string. These entities are force-built.
17240
+ * @param table.string The blueprint string to import.
17241
+ * @param table.position The position to place the blueprint at.
17242
+ * @param table.force The force to place the blueprint for. Defaults to the player force.
17243
+ * @param table.direction The direction to place the blueprint in. Defaults to north.
17244
+ * @param table.flip_horizontal Whether to flip the blueprint horizontally. Defaults to `false`.
17245
+ * @param table.flip_vertical Whether to flip the blueprint vertically. Defaults to `false`.
17246
+ * @param table.by_player The player that placed the blueprint. Defaults to `nil`.
17247
+ * @returns If the blueprint string was invalid, `1` is returned. Otherwise, `nil` is returned.
17248
+ */
17249
+ create_entities_from_blueprint_string(this: void, table: {
17250
+ string: string;
17251
+ position: MapPosition;
17252
+ force?: ForceID;
17253
+ direction?: defines.direction;
17254
+ flip_horizontal?: boolean;
17255
+ flip_vertical?: boolean;
17256
+ by_player?: PlayerIdentification;
17257
+ }): int | null;
17114
17258
  /**
17115
17259
  * Create an entity on this surface.
17116
17260
  * @example ```
@@ -17651,6 +17795,14 @@ interface LuaSurface {
17651
17795
  force?: ForceID;
17652
17796
  unit_search_distance?: uint;
17653
17797
  }): uint;
17798
+ /**
17799
+ * Set the pollution for a given position.
17800
+ *
17801
+ * Pollution changes by this are not included in pollution statistics and do not affect evolution factors (as opposed to {@link LuaSurface::pollute | runtime:LuaSurface::pollute}).
17802
+ * @param position The position to set the chunk's pollution
17803
+ * @param amount New amount of pollution to be set on the chunk. Must be >= 0.
17804
+ */
17805
+ set_pollution(this: void, position: MapPosition, amount: double): void;
17654
17806
  /**
17655
17807
  * Sets the value of surface property on this surface.
17656
17808
  * @param property Property to change.
@@ -17680,6 +17832,7 @@ interface LuaSurface {
17680
17832
  * @param table.allow_belts Whether items can be spilled onto belts. Defaults to `true`.
17681
17833
  * @param table.max_radius Max radius from the specified `position` to spill items.
17682
17834
  * @param table.use_start_position_on_failure Allow spilling items at `position` if no non-colliding position is found. Note: Setting to false might cause some items not to be spilled. Defaults to `true`.
17835
+ * @param table.drop_full_stack If item on ground should be made out of an entire provided stack. Defaults to `false`.
17683
17836
  * @returns The created item-on-ground entities.
17684
17837
  */
17685
17838
  spill_item_stack(this: void, table: {
@@ -17690,6 +17843,7 @@ interface LuaSurface {
17690
17843
  allow_belts?: boolean;
17691
17844
  max_radius?: double;
17692
17845
  use_start_position_on_failure?: boolean;
17846
+ drop_full_stack?: boolean;
17693
17847
  }): LuaEntity[];
17694
17848
  /**
17695
17849
  * Place an upgrade request.
@@ -17734,6 +17888,29 @@ interface LuaSurface {
17734
17888
  * Current time of day, as a number in range `[0, 1)`.
17735
17889
  */
17736
17890
  daytime: double;
17891
+ /**
17892
+ * Parameters of daytime. Equivalent as reading {@link dusk | runtime:LuaSurface::dusk}, {@link evening | runtime:LuaSurface::evening}, {@link morning | runtime:LuaSurface::morning} and {@link dawn | runtime:LuaSurface::dawn} at the same time.
17893
+ *
17894
+ * In order for a write to take place, a new table needs to be written in one go: changing individual members of the returned table has no effect as those are value copies.
17895
+ */
17896
+ daytime_parameters: {
17897
+ /**
17898
+ * Must be < evening.
17899
+ */
17900
+ dusk: double;
17901
+ /**
17902
+ * Must be > dusk and < morning.
17903
+ */
17904
+ evening: double;
17905
+ /**
17906
+ * Must be > evening and < dawn.
17907
+ */
17908
+ morning: double;
17909
+ /**
17910
+ * Must be > morning.
17911
+ */
17912
+ dawn: double;
17913
+ };
17737
17914
  /**
17738
17915
  * If this surface can be deleted.
17739
17916
  */
@@ -17755,9 +17932,13 @@ interface LuaSurface {
17755
17932
  */
17756
17933
  generate_with_lab_tiles: boolean;
17757
17934
  /**
17758
- * Surface-wide effects applied to entities with effect receivers. May be `nil` if surface is not using surface-wide effect source.
17935
+ * Surface-wide effects applied to entities with effect receivers. `nil` if this surface is not using surface-wide effect source.
17759
17936
  */
17760
17937
  global_effect?: ModuleEffects;
17938
+ /**
17939
+ * The global electric network statistics for this surface.
17940
+ */
17941
+ readonly global_electric_network_statistics?: LuaFlowStatistics;
17761
17942
  /**
17762
17943
  * Whether this surface currently has a global electric network.
17763
17944
  */
@@ -17817,6 +17998,10 @@ interface LuaSurface {
17817
17998
  * The type of pollutant enabled on the surface, or `nil` if no pollutant is enabled.
17818
17999
  */
17819
18000
  readonly pollutant_type?: LuaAirbornePollutantPrototype;
18001
+ /**
18002
+ * The pollution statistics for this surface.
18003
+ */
18004
+ readonly pollution_statistics: LuaFlowStatistics;
17820
18005
  /**
17821
18006
  * If clouds are shown on this surface. If false, clouds are never shown. If true the player must also have clouds enabled in graphics settings for them to be shown.
17822
18007
  */