take{position?=…, equipment?=…, by_player?=…} | → SimpleItemStack? | Remove an equipment from the grid. |
Remove an equipment from the grid. | ||
take_all(by_player?) changed | → array[ItemCountWithQuality] | Remove all equipment from the grid. |
Remove all equipment from the grid. | ||
clear(by_player?) | Clear all equipment from the grid, removing it without actually returning it. | |
Clear all equipment from the grid, removing it without actually returning it. | ||
put{name=…, quality?=…, position?=…, by_player?=…, ghost?=…} changed | → LuaEquipment? | Insert an equipment into the grid. |
Insert an equipment into the grid. | ||
can_move{equipment=…, position=…} | → boolean | Check whether moving an equipment would succeed. |
Check whether moving an equipment would succeed. | ||
move{equipment=…, position=…} | → boolean | Move an equipment within this grid. |
Move an equipment within this grid. | ||
get(position) | → LuaEquipment? | Find equipment in the Equipment Grid based off a position. |
Find equipment in the Equipment Grid based off a position. | ||
get_contents() | → dictionary[string → uint] | Get counts of all equipment in this grid. |
Get counts of all equipment in this grid. | ||
get_generator_energy(quality?) new | → double | Total energy per tick generated by the equipment inside this grid. |
Total energy per tick generated by the equipment inside this grid. | ||
find(equipment, search_ghosts?) changed | → LuaEquipment? | Find equipment by name. |
Find equipment by name. | ||
count(equipment?) | → uint | Get the number of all or some equipment in this grid. |
Get the number of all or some equipment in this grid. | ||
revive(equipment) new | → LuaEquipment | Revives the given equipment ghost if possible. |
Revives the given equipment ghost if possible. | ||
order_removal(equipment) new | → boolean | Marks the given equipment for removal. [...] |
Marks the given equipment for removal. [...] | ||
cancel_removal(equipment) new | → boolean | Cancels removal for the given equipment. |
Cancels removal for the given equipment. | ||
prototype | :: R LuaEquipmentGridPrototype | |
width | :: R uint | Width of the equipment grid. |
Width of the equipment grid. | ||
height | :: R uint | Height of the equipment grid. |
Height of the equipment grid. | ||
equipment | :: R array[LuaEquipment] | All the equipment in this grid. |
All the equipment in this grid. | ||
max_solar_energy | :: R double | Maximum energy per tick that can be created by any solar panels in the equipment grid. [...] |
Maximum energy per tick that can be created by any solar panels in the equipment grid. [...] | ||
available_in_batteries | :: R double | The total energy stored in all batteries in the equipment grid. |
The total energy stored in all batteries in the equipment grid. | ||
battery_capacity | :: R double | Total energy storage capacity of all batteries in the equipment grid. |
Total energy storage capacity of all batteries in the equipment grid. | ||
shield | :: R float | The amount of shields this equipment grid has. |
The amount of shields this equipment grid has. | ||
max_shield | :: R float | The maximum amount of shields this equipment grid has. |
The maximum amount of shields this equipment grid has. | ||
inventory_bonus new | :: R uint | The total amount of inventory bonus this equipment grid gives. |
The total amount of inventory bonus this equipment grid gives. | ||
movement_bonus new | :: R double | The total amount of movement bonus this equipment grid gives. [...] |
The total amount of movement bonus this equipment grid gives. [...] | ||
inhibit_movement_bonus | :: RW boolean | Whether this grid's equipment movement bonus is active. |
Whether this grid's equipment movement bonus is active. | ||
unique_id | :: R uint | Unique identifier of this equipment grid. |
Unique identifier of this equipment grid. | ||
entity_owner new | :: R LuaEntity? | The entity that this equipment grid is owned by (in some inventory or item stack.) If the owning entity is a character owned by some player and the player is disconnected this will return |
The entity that this equipment grid is owned by (in some inventory or item stack.) If the owning entity is a character owned by some player and the player is disconnected this will return | ||
player_owner new | :: R LuaPlayer? | The player that this equipment grid is owned by (in some inventory or item stack.) |
The player that this equipment grid is owned by (in some inventory or item stack.) | ||
valid | :: R boolean | Is this object valid? [...] |
Is this object valid? [...] | ||
object_name | :: R string | The class name of this object. [...] |
The class name of this object. [...] |
position | :: EquipmentPosition? | Take the equipment that contains this position in the grid. |
Take the equipment that contains this position in the grid. | ||
equipment | :: LuaEquipment? | Take this exact equipment. |
Take this exact equipment. | ||
by_player | :: PlayerIdentification? | If provided the action is done 'as' this player and on_player_removed_equipment is triggered. |
If provided the action is done 'as' this player and on_player_removed_equipment is triggered. |
→ SimpleItemStack? | The removed equipment, or |
by_player | :: PlayerIdentification? | If provided, the action is done 'as' this player and on_player_removed_equipment is triggered. |
If provided, the action is done 'as' this player and on_player_removed_equipment is triggered. |
→ array[ItemCountWithQuality] | List of the equipment that has been removed. |
by_player | :: PlayerIdentification? | If provided, the action is done 'as' this player and on_player_removed_equipment is triggered. |
If provided, the action is done 'as' this player and on_player_removed_equipment is triggered. |
name | :: EquipmentID | Equipment prototype name |
Equipment prototype name | ||
quality | :: QualityID? | The quality, |
The quality, | ||
position | :: EquipmentPosition? | Grid position to put the equipment in. |
Grid position to put the equipment in. | ||
by_player | :: PlayerIdentification? | If provided the action is done 'as' this player and on_player_placed_equipment is triggered. |
If provided the action is done 'as' this player and on_player_placed_equipment is triggered. | ||
ghost | :: boolean? | If true, place the equipment as a ghost. |
If true, place the equipment as a ghost. |
→ LuaEquipment? | The newly-added equipment, or |
equipment | :: LuaEquipment | The equipment to move |
The equipment to move | ||
position | :: EquipmentPosition | Where to put it |
Where to put it |
equipment | :: LuaEquipment | The equipment to move |
The equipment to move | ||
position | :: EquipmentPosition | Where to put it |
Where to put it |
→ boolean |
|
position | :: EquipmentPosition | The position |
The position |
→ LuaEquipment? | The found equipment, or |
equipment | :: EquipmentWithQualityID | Prototype of the equipment to find. |
Prototype of the equipment to find. | ||
search_ghosts | :: boolean? | If ghosts inner equipment should be searched. Defaults to |
If ghosts inner equipment should be searched. Defaults to |
→ LuaEquipment? | The first found equipment, or |
equipment | :: string? | Prototype name of the equipment to count. If not specified, count all equipment. |
Prototype name of the equipment to count. If not specified, count all equipment. |
equipment | :: LuaEquipment |
→ boolean | If the equipment was successfully marked for removal (or in the case of a ghost; removed.) |
equipment | :: LuaEquipment |
→ boolean | If the equipment removal was successfully cancelled. |