mirror of
https://github.com/Lokrates/Biofuel.git
synced 2024-07-07 07:45:14 +02:00
Merge pull request #8 from mazes-80/do_not_override_groups
refactor biofuel group registration but do not override item groups
This commit is contained in:
commit
7fdd2d1eb9
133
biofuel.lua
133
biofuel.lua
@ -67,115 +67,40 @@ minetest.register_craft({
|
|||||||
--Mod compatibility:
|
--Mod compatibility:
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
local register_biofuel = function(name, burntime)
|
||||||
|
if not minetest.registered_items[name] then
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
local groups = table.copy(minetest.registered_items[name].groups)
|
||||||
|
groups.biofuel = 1
|
||||||
|
minetest.override_item(name, { groups = groups })
|
||||||
|
if burntime and burntime >= 0 then
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = name,
|
||||||
|
burntime = burntime,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--Wine
|
--Wine
|
||||||
|
register_biofuel("wine:bottle_rum", 40)
|
||||||
if minetest.registered_nodes ["wine:bottle_rum"] then
|
register_biofuel("wine:bottle_tequila", 40)
|
||||||
minetest.override_item("wine:bottle_rum", {
|
register_biofuel("wine:bottle_bourbon", 40)
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
register_biofuel("wine:bottle_sake", 40)
|
||||||
})
|
register_biofuel("wine:bottle_vodka", 40)
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "wine:bottle_rum",
|
|
||||||
burntime = 40,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_nodes ["wine:bottle_tequila"] then
|
|
||||||
minetest.override_item("wine:bottle_tequila", {
|
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "wine:bottle_tequila",
|
|
||||||
burntime = 40,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_nodes ["wine:bottle_bourbon"] then
|
|
||||||
minetest.override_item("wine:bottle_bourbon", {
|
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "wine:bottle_burbon",
|
|
||||||
burntime = 40,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_nodes ["wine:bottle_sake"] then
|
|
||||||
minetest.override_item("wine:bottle_sake", {
|
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "wine:bottle_sake",
|
|
||||||
burntime = 40,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_nodes ["wine:bottle_vodka"] then
|
|
||||||
minetest.override_item("wine:bottle_vodka", {
|
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "wine:bottle_vodka",
|
|
||||||
burntime = 40,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--Basic Materials
|
--Basic Materials
|
||||||
|
register_biofuel("basic_materials:oil_extract")
|
||||||
if minetest.registered_items ["basic_materials:oil_extract"] then
|
|
||||||
minetest.override_item("basic_materials:oil_extract", {
|
|
||||||
groups = {biofuel = 1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--Cucina_Vegana
|
--Cucina_Vegana
|
||||||
|
register_biofuel("cucina_vegana:sunflower_seeds_oil")
|
||||||
if minetest.registered_items ["cucina_vegana:sunflower_seeds_oil"] then
|
register_biofuel("cucina_vegana:flax_seed_oil")
|
||||||
minetest.override_item("cucina_vegana:sunflower_seeds_oil", {
|
register_biofuel("cucina_vegana:lettuce_oil")
|
||||||
groups = {biofuel = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food = 1, food_oil = 1, food_vegan = 1, eatable = 1},
|
register_biofuel("cucina_vegana:peanut_oil")
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_items ["cucina_vegana:flax_seed_oil"] then
|
|
||||||
minetest.override_item("cucina_vegana:flax_seed_oil", {
|
|
||||||
groups = {biofuel = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food = 1, food_oil = 1, food_vegan = 1, eatable = 1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_items ["cucina_vegana:lettuce_oil"] then
|
|
||||||
minetest.override_item("cucina_vegana:lettuce_oil", {
|
|
||||||
groups = {biofuel = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food = 1, food_oil = 1, food_vegan = 1, eatable = 1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_items ["cucina_vegana:peanut_oil"] then
|
|
||||||
minetest.override_item("cucina_vegana:peanut_oil", {
|
|
||||||
groups = {biofuel = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food = 1, food_oil = 1, food_vegan = 1, eatable = 1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--Farming_Redo
|
--Farming_Redo
|
||||||
|
register_biofuel("farming:bottle_ethanol")
|
||||||
if minetest.registered_items ["farming:bottle_ethanol"] then
|
register_biofuel("farming:hemp_oil")
|
||||||
minetest.override_item("farming:bottle_ethanol", {
|
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_items ["farming:hemp_oil"] then
|
|
||||||
minetest.override_item("farming:hemp_oil", {
|
|
||||||
groups = {biofuel = 1, dig_immediate = 3, attached_node = 1, vessel = 1},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
2
init.lua
2
init.lua
@ -1,2 +1,2 @@
|
|||||||
dofile(minetest.get_modpath('biofuel')..'/biofuel.lua')
|
dofile(minetest.get_modpath('biofuel')..'/biofuel.lua')
|
||||||
dofile(minetest.get_modpath('biofuel')..'/refinery.lua')
|
dofile(minetest.get_modpath('biofuel')..'/refinery.lua')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# textdomain: biofuel
|
# textdomain: biofuel
|
||||||
loading...=cargando...
|
loading...=cargando...
|
||||||
progress: @1%=progreso: @ 1%
|
progress: @1%=progreso: @1%
|
||||||
To start fuel production add biomass =Para iniciar la producción de combustible añadir biomasa.
|
To start fuel production add biomass =Para iniciar la producción de combustible añadir biomasa.
|
||||||
moves stuff to refinery at= mueve cosas a la refineria en
|
moves stuff to refinery at= mueve cosas a la refineria en
|
||||||
takes stuff from refinery at= toma cosas de la refineria en
|
takes stuff from refinery at= toma cosas de la refineria en
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
# textdomain: biofuel
|
# textdomain: biofuel
|
||||||
loading...=chargement...
|
loading...=chargement...
|
||||||
progress: @1%=progrès: @ 1%
|
progress: @1%=progression: @1%
|
||||||
To start fuel production add biomass =Pour démarrer la production de carburant, ajoutez de la biomasse
|
To start fuel production add biomass =Pour démarrer la production de carburant, ajoutez de la biomasse
|
||||||
moves stuff to refinery at= déplace des choses à la raffinerie à
|
moves stuff to refinery at= déplace des choses vers la raffinerie à
|
||||||
takes stuff from refinery at= prend des choses de la raffinerie à
|
takes stuff from refinery at= prend des choses de la raffinerie à
|
||||||
Biofuel Refinery=Raffinerie de biocarburant
|
Biofuel Refinery=Raffinerie de biocarburant
|
||||||
Biofuel Refinery Active=Raffinerie de biocarburant active
|
Biofuel Refinery Active=Raffinerie de biocarburant active
|
||||||
loaded.= chargé.
|
loaded.= chargé.
|
||||||
Bottle of Biofuel=Bouteille de biocarburant
|
Bottle of Biofuel=Bouteille de biocarburant
|
||||||
Canister of Biofuel=Bidon de biocarburant
|
Canister of Biofuel=Bidon de biocarburant
|
||||||
Vial of Biofuel=Fiole de biocarburant
|
Vial of Biofuel=Fiole de biocarburant
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# textdomain: biofuel
|
# textdomain: biofuel
|
||||||
loading...=caricamento...
|
loading...=caricamento...
|
||||||
progress: @1%=progresso: @ 1%
|
progress: @1%=progresso: @1%
|
||||||
To start fuel production add biomass =Per avviare la produzione di carburante aggiungere biomassa
|
To start fuel production add biomass =Per avviare la produzione di carburante aggiungere biomassa
|
||||||
moves stuff to refinery at= muove cose alla raffineria a
|
moves stuff to refinery at= muove cose alla raffineria a
|
||||||
takes stuff from refinery at= prende roba dalla raffineria a
|
takes stuff from refinery at= prende roba dalla raffineria a
|
||||||
|
@ -25,7 +25,7 @@ end
|
|||||||
minetest.log('action', 'MOD: Biofuel ' .. S("loading..."))
|
minetest.log('action', 'MOD: Biofuel ' .. S("loading..."))
|
||||||
biofuel_version = '0.6'
|
biofuel_version = '0.6'
|
||||||
|
|
||||||
food_fuel = minetest.setting_getbool("food_fuel") -- Enables the conversion of food into fuel (settingtypes.txt)
|
food_fuel = minetest.settings:get_bool("food_fuel") -- Enables the conversion of food into fuel (settingtypes.txt)
|
||||||
if food_fuel == nil then food_fuel = false end -- default false
|
if food_fuel == nil then food_fuel = false end -- default false
|
||||||
|
|
||||||
|
|
||||||
@ -119,9 +119,9 @@ local function is_convertible(input)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
plants_input = tonumber(minetest.setting_get("biomass_input")) or 4 -- The number of biomass required for fuel production (settingtypes.txt)
|
plants_input = tonumber(minetest.settings:get("biomass_input")) or 4 -- The number of biomass required for fuel production (settingtypes.txt)
|
||||||
|
|
||||||
bottle_output = minetest.setting_getbool("refinery_output") -- Change of refinery output between vial or bottle (settingtypes.txt)
|
bottle_output = minetest.settings:get_bool("refinery_output") -- Change of refinery output between vial or bottle (settingtypes.txt)
|
||||||
if bottle_output == nil then bottle_output = false end -- default false
|
if bottle_output == nil then bottle_output = false end -- default false
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ local function update_timer(pos)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local count = count_input(pos)
|
local count = count_input(pos)
|
||||||
local refinery_time = minetest.setting_get("fuel_production_time") or 10 -- Timebase (settingtypes.txt)
|
local refinery_time = minetest.settings:get("fuel_production_time") or 10 -- Timebase (settingtypes.txt)
|
||||||
if not timer:is_started() and count >= plants_input then -- Input
|
if not timer:is_started() and count >= plants_input then -- Input
|
||||||
timer:start((refinery_time)/5) -- Timebase
|
timer:start((refinery_time)/5) -- Timebase
|
||||||
meta:set_int('progress', 0)
|
meta:set_int('progress', 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user