local riteg_box = {fixed = {{(-4 / 16), ((-1 / 2) + (3 / 16)), (-4 / 16), (4 / 16), (1 / 2), (4 / 16)}, {(-1 / 2), (-1 / 2), (-1 / 2), (1 / 2), ((-1 / 2) + (3 / 16)), (1 / 2)}}, type = "fixed"}
local fuel = {["loria:plutonium_dioxide"] = 3, ["loria:plutonium_tetrafluoride"] = 0.40000000000000002, ["loria:plutonium_trifluoride"] = 0.29999999999999999, ["loria:uranium"] = 0.5, ["loria:uranium_tetrachloride"] = 0.10000000000000001}
local riteg_formspec = ("size[8,6.5]" .. "label[3.5,0;RITEG]" .. "list[context;place;3.5,0.5;1,1;]" .. "list[current_player;main;0,2;8,1;]" .. "list[current_player;main;0,3.5;8,3;8]")
local function update_riteg(pos)
  local meta = minetest.get_meta(pos)
  local inv = meta:get_inventory()
  local stack = inv:get_stack("place", 1)
  local emf = (fuel[stack:get_name()] or 0)
  return meta:set_float("emf", emf)
end
local function _0_(pos, listname, index, stack, player)
  local inv = minetest.get_meta(pos):get_inventory()
  if (inv:get_stack(listname, index):get_count() == 1) then
    return 0
  else
    return 1
  end
end
local function _1_(pos)
  local meta = minetest.get_meta(pos)
  local inv = meta:get_inventory()
  inv:set_size("place", 1)
  meta:set_float("resis", 0.40000000000000002)
  return meta:set_string("formspec", riteg_formspec)
end
minetest.register_node("electricity:riteg", {allow_metadata_inventory_put = _0_, description = "RITEG", drawtype = "nodebox", groups = {crumbly = 3, source = 1}, node_box = riteg_box, on_construct = _1_, on_destruct = andthen(reset_current, drop_everything), on_metadata_inventory_move = update_riteg, on_metadata_inventory_put = update_riteg, on_metadata_inventory_take = update_riteg, paramtype = "light", paramtype2 = "facedir", selection_box = riteg_box, tiles = {"electricity_riteg_top.png", "electricity_riteg_bottom.png", "electricity_riteg_side.png", "electricity_riteg_side.png", "electricity_riteg_connect_side.png", "electricity_riteg_connect_side.png"}})
model["electricity:riteg"] = vsource
return nil
