v0.17 with several bugfixes
This commit is contained in:
parent
355c30a509
commit
d131bbc93b
@ -75,6 +75,12 @@ Available worlds will be converted to 'lsqlite3', but there is no way back, so:
|
|||||||
|
|
||||||
### History
|
### History
|
||||||
|
|
||||||
|
**2020-07-16 V0.17**
|
||||||
|
- TA4 Reactor recipe bugfix
|
||||||
|
- TA3 furnace power bugfix (response to the pull request #12 from Thomas-S)
|
||||||
|
- Manual bugfix (Thomas-S)
|
||||||
|
- Charcoal pile doesn't start smoking after beeing unloaded (issue #9 from Skamiz)
|
||||||
|
|
||||||
**2020-07-06 V0.16**
|
**2020-07-06 V0.16**
|
||||||
- Oil cracking/hydrogenation recipes added
|
- Oil cracking/hydrogenation recipes added
|
||||||
- Ethereal growlight bugfix
|
- Ethereal growlight bugfix
|
||||||
|
@ -16,7 +16,6 @@ local S = techage.S
|
|||||||
local M = minetest.get_meta
|
local M = minetest.get_meta
|
||||||
|
|
||||||
local Recipes = {} -- {rtype = {ouput = {....},...}}
|
local Recipes = {} -- {rtype = {ouput = {....},...}}
|
||||||
local RecipeList = {} -- {rtype = {<output name>,...}}
|
|
||||||
|
|
||||||
local range = techage.in_range
|
local range = techage.in_range
|
||||||
|
|
||||||
@ -47,8 +46,7 @@ end
|
|||||||
|
|
||||||
function techage.recipes.get(nvm, rtype)
|
function techage.recipes.get(nvm, rtype)
|
||||||
local recipes = Recipes[rtype] or {}
|
local recipes = Recipes[rtype] or {}
|
||||||
local recipe_list = RecipeList[rtype] or {}
|
return recipes[nvm.recipe_idx or 1]
|
||||||
return recipes[recipe_list[nvm.recipe_idx or 1]]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add 4 input/output/waste recipe
|
-- Add 4 input/output/waste recipe
|
||||||
@ -64,9 +62,6 @@ function techage.recipes.add(rtype, recipe)
|
|||||||
if not Recipes[rtype] then
|
if not Recipes[rtype] then
|
||||||
Recipes[rtype] = {}
|
Recipes[rtype] = {}
|
||||||
end
|
end
|
||||||
if not RecipeList[rtype] then
|
|
||||||
RecipeList[rtype] = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
local name, num
|
local name, num
|
||||||
local item = {input = {}}
|
local item = {input = {}}
|
||||||
@ -84,8 +79,7 @@ function techage.recipes.add(rtype, recipe)
|
|||||||
name, num = unpack(string.split(recipe.output, " "))
|
name, num = unpack(string.split(recipe.output, " "))
|
||||||
item.output = {name = name or "", num = tonumber(num) or 0}
|
item.output = {name = name or "", num = tonumber(num) or 0}
|
||||||
item.catalyst = recipe.catalyst
|
item.catalyst = recipe.catalyst
|
||||||
Recipes[rtype][name] = item
|
Recipes[rtype][#Recipes[rtype]+1] = item
|
||||||
RecipeList[rtype][#(RecipeList[rtype])+1] = name
|
|
||||||
|
|
||||||
if minetest.global_exists("unified_inventory") then
|
if minetest.global_exists("unified_inventory") then
|
||||||
unified_inventory.register_craft({
|
unified_inventory.register_craft({
|
||||||
@ -98,10 +92,9 @@ end
|
|||||||
|
|
||||||
function techage.recipes.formspec(x, y, rtype, nvm)
|
function techage.recipes.formspec(x, y, rtype, nvm)
|
||||||
local recipes = Recipes[rtype] or {}
|
local recipes = Recipes[rtype] or {}
|
||||||
local recipe_list = RecipeList[rtype] or {}
|
nvm.recipe_idx = range(nvm.recipe_idx or 1, 1, #recipes)
|
||||||
nvm.recipe_idx = range(nvm.recipe_idx or 1, 1, #recipe_list)
|
|
||||||
local idx = nvm.recipe_idx
|
local idx = nvm.recipe_idx
|
||||||
local recipe = recipes[recipe_list[idx]] or RECIPE
|
local recipe = recipes[idx] or RECIPE
|
||||||
local output = recipe.output.name.." "..recipe.output.num
|
local output = recipe.output.name.." "..recipe.output.num
|
||||||
local waste = recipe.waste.name.." "..recipe.waste.num
|
local waste = recipe.waste.name.." "..recipe.waste.num
|
||||||
local catalyst = recipe.catalyst and techage.item_image_small(2.05, 0, recipe.catalyst, S("Catalyst")) or ""
|
local catalyst = recipe.catalyst and techage.item_image_small(2.05, 0, recipe.catalyst, S("Catalyst")) or ""
|
||||||
@ -114,7 +107,7 @@ function techage.recipes.formspec(x, y, rtype, nvm)
|
|||||||
techage.item_image(2.95, 1, waste)..
|
techage.item_image(2.95, 1, waste)..
|
||||||
"button[0,2;1,1;priv;<<]"..
|
"button[0,2;1,1;priv;<<]"..
|
||||||
"button[1,2;1,1;next;>>]"..
|
"button[1,2;1,1;next;>>]"..
|
||||||
"label[1.9,2.2;"..S("Recipe")..": "..idx.."/"..#recipe_list.."]"..
|
"label[1.9,2.2;"..S("Recipe")..": "..idx.."/"..#recipes.."]"..
|
||||||
"container_end[]"
|
"container_end[]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -189,6 +189,8 @@ techage.register_node({"techage:ta3_booster", "techage:ta3_booster_on"}, {
|
|||||||
if topic == "power" then
|
if topic == "power" then
|
||||||
return techage.get_node_lvm(pos).name == "techage:ta3_booster_on" or
|
return techage.get_node_lvm(pos).name == "techage:ta3_booster_on" or
|
||||||
power.power_available(pos, Cable)
|
power.power_available(pos, Cable)
|
||||||
|
elseif topic == "running" then
|
||||||
|
return techage.get_node_lvm(pos).name == "techage:ta3_booster_on"
|
||||||
elseif topic == "start" and not nvm.running then
|
elseif topic == "start" and not nvm.running then
|
||||||
if power.power_available(pos, Cable) then
|
if power.power_available(pos, Cable) then
|
||||||
nvm.running = true
|
nvm.running = true
|
||||||
|
@ -228,7 +228,7 @@ techage.register_node({"techage:furnace_firebox", "techage:furnace_firebox_on"},
|
|||||||
if topic == "fuel" then
|
if topic == "fuel" then
|
||||||
return has_fuel(pos, nvm) and booster_cmnd(pos, "power")
|
return has_fuel(pos, nvm) and booster_cmnd(pos, "power")
|
||||||
elseif topic == "running" then
|
elseif topic == "running" then
|
||||||
return nvm.running and booster_cmnd(pos, "power")
|
return nvm.running and booster_cmnd(pos, "running")
|
||||||
elseif topic == "start" then
|
elseif topic == "start" then
|
||||||
start_firebox(pos, nvm)
|
start_firebox(pos, nvm)
|
||||||
booster_cmnd(pos, "start")
|
booster_cmnd(pos, "start")
|
||||||
|
@ -85,9 +85,17 @@ local function firebox_cmnd(pos, cmnd)
|
|||||||
"techage:furnace_heater", "techage:furnace_heater_on"})
|
"techage:furnace_heater", "techage:furnace_heater_on"})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function firebox_has_fuel(nvm, pos)
|
||||||
|
if nvm.techage_state == techage.RUNNING then
|
||||||
|
return firebox_cmnd(pos, "running")
|
||||||
|
else
|
||||||
|
return firebox_cmnd(pos, "fuel")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function cooking(pos, crd, nvm, elapsed)
|
local function cooking(pos, crd, nvm, elapsed)
|
||||||
if nvm.techage_state == techage.RUNNING or check_if_worth_to_wakeup(pos, nvm) then
|
if nvm.techage_state == techage.RUNNING or check_if_worth_to_wakeup(pos, nvm) then
|
||||||
if firebox_cmnd(pos, "fuel") then
|
if firebox_has_fuel(nvm, pos) then
|
||||||
local state, err = smelting(pos, nvm, elapsed)
|
local state, err = smelting(pos, nvm, elapsed)
|
||||||
if state == techage.RUNNING then
|
if state == techage.RUNNING then
|
||||||
crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS)
|
crd.State:keep_running(pos, nvm, COUNTDOWN_TICKS)
|
||||||
|
2
init.lua
2
init.lua
@ -13,7 +13,7 @@
|
|||||||
techage = {}
|
techage = {}
|
||||||
|
|
||||||
-- Version for compatibility checks, see readme.md/history
|
-- Version for compatibility checks, see readme.md/history
|
||||||
techage.version = 0.16
|
techage.version = 0.17
|
||||||
|
|
||||||
if minetest.global_exists("tubelib") then
|
if minetest.global_exists("tubelib") then
|
||||||
minetest.log("error", "[techage] Techage can't be used together with the mod tubelib!")
|
minetest.log("error", "[techage] Techage can't be used together with the mod tubelib!")
|
||||||
|
@ -139,7 +139,7 @@ end
|
|||||||
-- Consumer related functions
|
-- Consumer related functions
|
||||||
--
|
--
|
||||||
|
|
||||||
-- check if there is a living network
|
-- function checks for a power grid, not for enough power
|
||||||
function techage.power.power_available(pos, Cable)
|
function techage.power.power_available(pos, Cable)
|
||||||
local nvm = techage.get_nvm(pos)
|
local nvm = techage.get_nvm(pos)
|
||||||
local tlib_type = Cable.tube_type
|
local tlib_type = Cable.tube_type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user