1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-12-19 16:25:47 +01:00

OK, ROLLBACK!

- All the modifications done before 7845fd5f1f are reverted
- Merged commits from http://github.com/minetest/minetest_game from 10 days ago to today. (concerning default mod)

TODO: Merge the other mods which have been reverted.
      Add all the commits of Ombridride after the 7845fd5f1f one.

Signed-off-by: LeMagnesium <mg.minetest@gmail.com>
This commit is contained in:
LeMagnesium
2014-12-10 16:49:14 +01:00
parent beb7e8e900
commit 2155ecc638
50 changed files with 443 additions and 506 deletions

View File

@@ -1,14 +1,15 @@
--
-- Formspecs
--
--
-- Formspecs
--
local function active_formspec(fuel_percent, item_percent)
local formspec =
local formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
--gui_slots..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
@@ -98,9 +99,9 @@ minetest.register_node("default:furnace", {
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
@@ -133,7 +134,7 @@ minetest.register_node("default:furnace_active", {
can_dig = can_dig,
aallow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
@@ -163,15 +164,15 @@ minetest.register_abm({
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
--
-- Inizialize inventory
--
local inv = meta:get_inventory()
for listname, size in pairs({
src = 1,
fuel = 1,
dst = 4,
src = 1,
fuel = 1,
dst = 4,
}) do
if inv:get_size(listname) ~= size then
inv:set_size(listname, size)
@@ -188,16 +189,16 @@ minetest.register_abm({
-- Check if we have cookable content
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
local cookable = true
if cooked.time == 0 then
cookable = false
end
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + 1
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + 1
@@ -215,7 +216,7 @@ minetest.register_abm({
if cookable then
-- We need to get new fuel
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
@@ -224,10 +225,10 @@ minetest.register_abm({
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
fuel_totaltime = fuel.time
fuel_time = 0
end
else
-- We don't need to get new fuel since there is no cookable item
@@ -236,7 +237,7 @@ minetest.register_abm({
src_time = 0
end
end
--
-- Update formspec, infotext and node
--
@@ -244,7 +245,7 @@ minetest.register_abm({
local item_state = ""
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
item_percent = math.floor(src_time / cooked.time * 100)
item_state = item_percent .. "%"
else
if srclist[1]:is_empty() then
@@ -253,7 +254,7 @@ minetest.register_abm({
item_state = "Not cookable"
end
end
local fuel_state = "Empty"
local active = "inactive "
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
@@ -268,9 +269,9 @@ minetest.register_abm({
end
swap_node(pos, "default:furnace")
end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
--
-- Set meta values
--