fix many codestyle issues
parent
3bedc81068
commit
5f82e76862
|
@ -2,7 +2,7 @@ mcl_weather.nether_dust = {}
|
||||||
mcl_weather.nether_dust.particles_count = 99
|
mcl_weather.nether_dust.particles_count = 99
|
||||||
|
|
||||||
-- calculates coordinates and draw particles for Nether dust
|
-- calculates coordinates and draw particles for Nether dust
|
||||||
mcl_weather.nether_dust.add_dust_particles = function(player)
|
function mcl_weather.nether_dust.add_dust_particles(player)
|
||||||
for i=mcl_weather.nether_dust.particles_count, 1,-1 do
|
for i=mcl_weather.nether_dust.particles_count, 1,-1 do
|
||||||
local rpx, rpy, rpz = mcl_weather.get_random_pos_by_player_look_dir(player)
|
local rpx, rpy, rpz = mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||||
minetest.add_particle({
|
minetest.add_particle({
|
||||||
|
|
|
@ -235,7 +235,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local initsky = function(player)
|
local function initsky(player)
|
||||||
if (mcl_weather.skycolor.active) then
|
if (mcl_weather.skycolor.active) then
|
||||||
mcl_weather.skycolor.force_update = true
|
mcl_weather.skycolor.force_update = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ mcl_weather.snow.particles_count = 15
|
||||||
mcl_weather.snow.init_done = false
|
mcl_weather.snow.init_done = false
|
||||||
|
|
||||||
-- calculates coordinates and draw particles for snow weather
|
-- calculates coordinates and draw particles for snow weather
|
||||||
mcl_weather.snow.add_snow_particles = function(player)
|
function mcl_weather.snow.add_snow_particles(player)
|
||||||
mcl_weather.rain.last_rp_count = 0
|
mcl_weather.rain.last_rp_count = 0
|
||||||
for i=mcl_weather.snow.particles_count, 1,-1 do
|
for i=mcl_weather.snow.particles_count, 1,-1 do
|
||||||
local random_pos_x, _, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player)
|
local random_pos_x, _, random_pos_z = mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||||
|
@ -30,7 +30,7 @@ mcl_weather.snow.add_snow_particles = function(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
mcl_weather.snow.set_sky_box = function()
|
function mcl_weather.snow.set_sky_box()
|
||||||
mcl_weather.skycolor.add_layer(
|
mcl_weather.skycolor.add_layer(
|
||||||
"weather-pack-snow-sky",
|
"weather-pack-snow-sky",
|
||||||
{{r=0, g=0, b=0},
|
{{r=0, g=0, b=0},
|
||||||
|
|
|
@ -39,7 +39,7 @@ mcl_weather.reg_weathers["none"] = {
|
||||||
|
|
||||||
local storage = minetest.get_mod_storage()
|
local storage = minetest.get_mod_storage()
|
||||||
-- Save weather into mod storage, so it can be loaded after restarting the server
|
-- Save weather into mod storage, so it can be loaded after restarting the server
|
||||||
local save_weather = function()
|
local function save_weather()
|
||||||
if not mcl_weather.end_time then return end
|
if not mcl_weather.end_time then return end
|
||||||
storage:set_string("mcl_weather_state", mcl_weather.state)
|
storage:set_string("mcl_weather_state", mcl_weather.state)
|
||||||
storage:set_int("mcl_weather_end_time", mcl_weather.end_time)
|
storage:set_int("mcl_weather_end_time", mcl_weather.end_time)
|
||||||
|
@ -47,7 +47,7 @@ local save_weather = function()
|
||||||
end
|
end
|
||||||
minetest.register_on_shutdown(save_weather)
|
minetest.register_on_shutdown(save_weather)
|
||||||
|
|
||||||
mcl_weather.get_rand_end_time = function(min_duration, max_duration)
|
function mcl_weather.get_rand_end_time(min_duration, max_duration)
|
||||||
local r
|
local r
|
||||||
if min_duration ~= nil and max_duration ~= nil then
|
if min_duration ~= nil and max_duration ~= nil then
|
||||||
r = math.random(min_duration, max_duration)
|
r = math.random(min_duration, max_duration)
|
||||||
|
@ -57,7 +57,7 @@ mcl_weather.get_rand_end_time = function(min_duration, max_duration)
|
||||||
return minetest.get_gametime() + r
|
return minetest.get_gametime() + r
|
||||||
end
|
end
|
||||||
|
|
||||||
mcl_weather.get_current_light_factor = function()
|
function mcl_weather.get_current_light_factor()
|
||||||
if mcl_weather.state == "none" then
|
if mcl_weather.state == "none" then
|
||||||
return nil
|
return nil
|
||||||
else
|
else
|
||||||
|
@ -68,7 +68,7 @@ end
|
||||||
-- Returns true if pos is outdoor.
|
-- Returns true if pos is outdoor.
|
||||||
-- Outdoor is defined as any node in the Overworld under open sky.
|
-- Outdoor is defined as any node in the Overworld under open sky.
|
||||||
-- FIXME: Nodes below glass also count as “outdoor”, this should not be the case.
|
-- FIXME: Nodes below glass also count as “outdoor”, this should not be the case.
|
||||||
mcl_weather.is_outdoor = function(pos)
|
function mcl_weather.is_outdoor(pos)
|
||||||
local cpos = {x=pos.x, y=pos.y+1, z=pos.z}
|
local cpos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
local dim = mcl_worlds.pos_to_dimension(cpos)
|
local dim = mcl_worlds.pos_to_dimension(cpos)
|
||||||
if minetest.get_node_light(cpos, 0.5) == 15 and dim == "overworld" then
|
if minetest.get_node_light(cpos, 0.5) == 15 and dim == "overworld" then
|
||||||
|
@ -79,7 +79,7 @@ end
|
||||||
|
|
||||||
-- checks if player is undewater. This is needed in order to
|
-- checks if player is undewater. This is needed in order to
|
||||||
-- turn off weather particles generation.
|
-- turn off weather particles generation.
|
||||||
mcl_weather.is_underwater = function(player)
|
function mcl_weather.is_underwater(player)
|
||||||
local ppos = player:get_pos()
|
local ppos = player:get_pos()
|
||||||
local offset = player:get_eye_offset()
|
local offset = player:get_eye_offset()
|
||||||
local player_eye_pos = {x = ppos.x + offset.x,
|
local player_eye_pos = {x = ppos.x + offset.x,
|
||||||
|
@ -94,7 +94,7 @@ end
|
||||||
|
|
||||||
-- trying to locate position for particles by player look direction for performance reason.
|
-- trying to locate position for particles by player look direction for performance reason.
|
||||||
-- it is costly to generate many particles around player so goal is focus mainly on front view.
|
-- it is costly to generate many particles around player so goal is focus mainly on front view.
|
||||||
mcl_weather.get_random_pos_by_player_look_dir = function(player)
|
function mcl_weather.get_random_pos_by_player_look_dir(player)
|
||||||
local look_dir = player:get_look_dir()
|
local look_dir = player:get_look_dir()
|
||||||
local player_pos = player:get_pos()
|
local player_pos = player:get_pos()
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ mcl_weather.get_random_pos_by_player_look_dir = function(player)
|
||||||
end
|
end
|
||||||
|
|
||||||
local t, wci = 0, mcl_weather.check_interval
|
local t, wci = 0, mcl_weather.check_interval
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
t = t + dtime
|
t = t + dtime
|
||||||
if t < wci then return end
|
if t < wci then return end
|
||||||
|
@ -146,7 +147,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Sets random weather (which could be 'none' (no weather)).
|
-- Sets random weather (which could be 'none' (no weather)).
|
||||||
mcl_weather.set_random_weather = function(weather_name, weather_meta)
|
function mcl_weather.set_random_weather(weather_name, weather_meta)
|
||||||
if weather_meta == nil then return end
|
if weather_meta == nil then return end
|
||||||
local transitions = weather_meta.transitions
|
local transitions = weather_meta.transitions
|
||||||
local random_roll = math.random(0,100)
|
local random_roll = math.random(0,100)
|
||||||
|
@ -166,7 +167,7 @@ end
|
||||||
-- * explicit_end_time is OPTIONAL. If specified, explicitly set the
|
-- * explicit_end_time is OPTIONAL. If specified, explicitly set the
|
||||||
-- gametime (minetest.get_gametime) in which the weather ends.
|
-- gametime (minetest.get_gametime) in which the weather ends.
|
||||||
-- * changer is OPTIONAL, for logging purposes.
|
-- * changer is OPTIONAL, for logging purposes.
|
||||||
mcl_weather.change_weather = function(new_weather, explicit_end_time, changer_name)
|
function mcl_weather.change_weather(new_weather, explicit_end_time, changer_name)
|
||||||
local changer_name = changer_name or debug.getinfo(2).name.."()"
|
local changer_name = changer_name or debug.getinfo(2).name.."()"
|
||||||
|
|
||||||
if (mcl_weather.reg_weathers ~= nil and mcl_weather.reg_weathers[new_weather] ~= nil) then
|
if (mcl_weather.reg_weathers ~= nil and mcl_weather.reg_weathers[new_weather] ~= nil) then
|
||||||
|
@ -199,7 +200,7 @@ mcl_weather.change_weather = function(new_weather, explicit_end_time, changer_na
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
mcl_weather.get_weather = function()
|
function mcl_weather.get_weather()
|
||||||
return mcl_weather.state
|
return mcl_weather.state
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -273,7 +274,7 @@ if weather_allow_abm ~= nil and weather_allow_abm == false then
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local load_weather = function()
|
local function load_weather()
|
||||||
local weather = storage:get_string("mcl_weather_state")
|
local weather = storage:get_string("mcl_weather_state")
|
||||||
if weather and weather ~= "" then
|
if weather and weather ~= "" then
|
||||||
mcl_weather.state = weather
|
mcl_weather.state = weather
|
||||||
|
|
|
@ -448,13 +448,13 @@ end
|
||||||
doc.entry_builders = {}
|
doc.entry_builders = {}
|
||||||
|
|
||||||
-- Scrollable freeform text
|
-- Scrollable freeform text
|
||||||
doc.entry_builders.text = function(data)
|
function doc.entry_builders.text(data)
|
||||||
local formstring = doc.widgets.text(data, doc.FORMSPEC.ENTRY_START_X, doc.FORMSPEC.ENTRY_START_Y, doc.FORMSPEC.ENTRY_WIDTH - 0.4, doc.FORMSPEC.ENTRY_HEIGHT)
|
local formstring = doc.widgets.text(data, doc.FORMSPEC.ENTRY_START_X, doc.FORMSPEC.ENTRY_START_Y, doc.FORMSPEC.ENTRY_WIDTH - 0.4, doc.FORMSPEC.ENTRY_HEIGHT)
|
||||||
return formstring
|
return formstring
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Scrollable freeform text with an optional standard gallery (3 rows, 3:2 aspect ratio)
|
-- Scrollable freeform text with an optional standard gallery (3 rows, 3:2 aspect ratio)
|
||||||
doc.entry_builders.text_and_gallery = function(data, playername)
|
function doc.entry_builders.text_and_gallery(data, playername)
|
||||||
-- How much height the image gallery “steals” from the text widget
|
-- How much height the image gallery “steals” from the text widget
|
||||||
local stolen_height = 0
|
local stolen_height = 0
|
||||||
local formstring = ""
|
local formstring = ""
|
||||||
|
@ -476,7 +476,7 @@ end
|
||||||
doc.widgets = {}
|
doc.widgets = {}
|
||||||
|
|
||||||
-- Scrollable freeform text
|
-- Scrollable freeform text
|
||||||
doc.widgets.text = function(data, x, y, width, height)
|
function doc.widgets.text(data, x, y, width, height)
|
||||||
if x == nil then
|
if x == nil then
|
||||||
x = doc.FORMSPEC.ENTRY_START_X
|
x = doc.FORMSPEC.ENTRY_START_X
|
||||||
end
|
end
|
||||||
|
@ -502,7 +502,7 @@ end
|
||||||
|
|
||||||
-- Image gallery
|
-- Image gallery
|
||||||
-- Currently, only one gallery per entry is supported. TODO: Add support for multiple galleries in an entry (low priority)
|
-- Currently, only one gallery per entry is supported. TODO: Add support for multiple galleries in an entry (low priority)
|
||||||
doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top)
|
function doc.widgets.gallery(imagedata, playername, x, y, aspect_ratio, width, rows, align_left, align_top)
|
||||||
if playername == nil then return nil end -- emergency exit
|
if playername == nil then return nil end -- emergency exit
|
||||||
|
|
||||||
local formstring = ""
|
local formstring = ""
|
||||||
|
@ -591,7 +591,7 @@ doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width,
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Direct formspec
|
-- Direct formspec
|
||||||
doc.entry_builders.formspec = function(data)
|
function doc.entry_builders.formspec(data)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -802,7 +802,7 @@ function doc.get_sorted_entry_names(cid)
|
||||||
local cat = doc.data.categories[cid]
|
local cat = doc.data.categories[cid]
|
||||||
local used_eids = {}
|
local used_eids = {}
|
||||||
-- Helper function to extract the entry ID out of the output table
|
-- Helper function to extract the entry ID out of the output table
|
||||||
local extract = function(entry_table)
|
local function extract(entry_table)
|
||||||
local eids = {}
|
local eids = {}
|
||||||
for k,v in pairs(entry_table) do
|
for k,v in pairs(entry_table) do
|
||||||
local eid = v.eid
|
local eid = v.eid
|
||||||
|
@ -1175,7 +1175,7 @@ minetest.register_on_joinplayer(function(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
---[[ Add buttons for inventory mods ]]
|
---[[ Add buttons for inventory mods ]]
|
||||||
local button_action = function(player)
|
local function button_action(player)
|
||||||
doc.show_doc(player:get_player_name())
|
doc.show_doc(player:get_player_name())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local S = minetest.get_translator("doc_identifier")
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
local doc_identifier = {}
|
local doc_identifier = {}
|
||||||
|
|
||||||
|
@ -6,15 +6,16 @@ doc_identifier.registered_objects = {}
|
||||||
|
|
||||||
-- API
|
-- API
|
||||||
doc.sub.identifier = {}
|
doc.sub.identifier = {}
|
||||||
doc.sub.identifier.register_object = function(object_name, category_id, entry_id)
|
|
||||||
|
function doc.sub.identifier.register_object(object_name, category_id, entry_id)
|
||||||
doc_identifier.registered_objects[object_name] = { category = category_id, entry = entry_id }
|
doc_identifier.registered_objects[object_name] = { category = category_id, entry = entry_id }
|
||||||
end
|
end
|
||||||
|
|
||||||
-- END OF API
|
-- END OF API
|
||||||
|
|
||||||
doc_identifier.identify = function(itemstack, user, pointed_thing)
|
function doc_identifier.identify(itemstack, user, pointed_thing)
|
||||||
local username = user:get_player_name()
|
local username = user:get_player_name()
|
||||||
local show_message = function(username, itype, param)
|
local function show_message(username, itype, param)
|
||||||
local vsize = 2
|
local vsize = 2
|
||||||
local message
|
local message
|
||||||
if itype == "error_item" then
|
if itype == "error_item" then
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
local S = minetest.get_translator("doc_items")
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
local N = function(s) return s end
|
local N = function(s) return s end
|
||||||
|
|
||||||
|
local math = math
|
||||||
|
local string = string
|
||||||
|
|
||||||
|
local tostring = tostring
|
||||||
|
local pairs = pairs
|
||||||
|
|
||||||
doc.sub.items = {}
|
doc.sub.items = {}
|
||||||
|
|
||||||
-- Template texts
|
-- Template texts
|
||||||
|
@ -34,13 +40,17 @@ local suppressed = {
|
||||||
local forbidden_core_factoids = {}
|
local forbidden_core_factoids = {}
|
||||||
|
|
||||||
-- Helper functions
|
-- Helper functions
|
||||||
local yesno = function(bool)
|
local function yesno(bool)
|
||||||
if bool==true then return S("Yes")
|
if bool == true then
|
||||||
elseif bool==false then return S("No")
|
return S("Yes")
|
||||||
else return "N/A" end
|
elseif bool == false then
|
||||||
|
return S("No")
|
||||||
|
else
|
||||||
|
return "N/A"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local groups_to_string = function(grouptable, filter)
|
local function groups_to_string(grouptable, filter)
|
||||||
local gstring = ""
|
local gstring = ""
|
||||||
local groups_count = 0
|
local groups_count = 0
|
||||||
for id, value in pairs(grouptable) do
|
for id, value in pairs(grouptable) do
|
||||||
|
@ -66,7 +76,7 @@ local groups_to_string = function(grouptable, filter)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Removes all text after the first newline (including the newline)
|
-- Removes all text after the first newline (including the newline)
|
||||||
local scrub_newlines = function(text)
|
local function scrub_newlines(text)
|
||||||
local spl = string.split(text, "\n")
|
local spl = string.split(text, "\n")
|
||||||
if spl and #spl > 0 then
|
if spl and #spl > 0 then
|
||||||
return spl[1]
|
return spl[1]
|
||||||
|
@ -76,7 +86,7 @@ local scrub_newlines = function(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Append a newline to text, unless it already ends with a newline. ]]
|
--[[ Append a newline to text, unless it already ends with a newline. ]]
|
||||||
local newline = function(text)
|
local function newline(text)
|
||||||
if string.sub(text, #text, #text) == "\n" or text == "" then
|
if string.sub(text, #text, #text) == "\n" or text == "" then
|
||||||
return text
|
return text
|
||||||
else
|
else
|
||||||
|
@ -85,7 +95,7 @@ local newline = function(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Make sure the text ends with two newlines by appending any missing newlines at the end, if neccessary. ]]
|
--[[ Make sure the text ends with two newlines by appending any missing newlines at the end, if neccessary. ]]
|
||||||
local newline2 = function(text)
|
local function newline2(text)
|
||||||
if string.sub(text, #text-1, #text) == "\n\n" or text == "" then
|
if string.sub(text, #text-1, #text) == "\n\n" or text == "" then
|
||||||
return text
|
return text
|
||||||
elseif string.sub(text, #text, #text) == "\n" then
|
elseif string.sub(text, #text, #text) == "\n" then
|
||||||
|
@ -97,7 +107,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
-- Extract suitable item description for formspec
|
-- Extract suitable item description for formspec
|
||||||
local description_for_formspec = function(itemstring)
|
local function description_for_formspec(itemstring)
|
||||||
if minetest.registered_items[itemstring] == nil then
|
if minetest.registered_items[itemstring] == nil then
|
||||||
-- Huh? The item doesn't exist for some reason. Better give a dummy string
|
-- Huh? The item doesn't exist for some reason. Better give a dummy string
|
||||||
minetest.log("warning", "[doc] Unknown item detected: "..tostring(itemstring))
|
minetest.log("warning", "[doc] Unknown item detected: "..tostring(itemstring))
|
||||||
|
@ -111,7 +121,7 @@ local description_for_formspec = function(itemstring)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local get_entry_name = function(itemstring)
|
local function get_entry_name(itemstring)
|
||||||
local def = minetest.registered_items[itemstring]
|
local def = minetest.registered_items[itemstring]
|
||||||
if def._doc_items_entry_name ~= nil then
|
if def._doc_items_entry_name ~= nil then
|
||||||
return def._doc_items_entry_name
|
return def._doc_items_entry_name
|
||||||
|
@ -122,7 +132,7 @@ local get_entry_name = function(itemstring)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
doc.sub.items.get_group_name = function(groupname)
|
function doc.sub.items.get_group_name(groupname)
|
||||||
if groupdefs[groupname] ~= nil and doc.sub.items.settings.friendly_group_names == true then
|
if groupdefs[groupname] ~= nil and doc.sub.items.settings.friendly_group_names == true then
|
||||||
return groupdefs[groupname]
|
return groupdefs[groupname]
|
||||||
else
|
else
|
||||||
|
@ -130,7 +140,7 @@ doc.sub.items.get_group_name = function(groupname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local burntime_to_text = function(burntime)
|
local function burntime_to_text(burntime)
|
||||||
if burntime == nil then
|
if burntime == nil then
|
||||||
return S("unknown")
|
return S("unknown")
|
||||||
elseif burntime == 1 then
|
elseif burntime == 1 then
|
||||||
|
@ -146,7 +156,7 @@ end
|
||||||
* Full punch interval
|
* Full punch interval
|
||||||
* Damage groups
|
* Damage groups
|
||||||
]]
|
]]
|
||||||
local factoid_toolcaps = function(tool_capabilities, check_uses)
|
local function factoid_toolcaps(tool_capabilities, check_uses)
|
||||||
if forbidden_core_factoids.tool_capabilities then
|
if forbidden_core_factoids.tool_capabilities then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
@ -282,7 +292,7 @@ end
|
||||||
- Digging times/groups
|
- Digging times/groups
|
||||||
- level group
|
- level group
|
||||||
]]
|
]]
|
||||||
local factoid_mining_node = function(data)
|
local function factoid_mining_node(data)
|
||||||
if forbidden_core_factoids.node_mining then
|
if forbidden_core_factoids.node_mining then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
@ -344,7 +354,7 @@ local factoid_mining_node = function(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Pointing range of itmes
|
-- Pointing range of itmes
|
||||||
local range_factoid = function(itemstring, def)
|
local function range_factoid(itemstring, def)
|
||||||
local handrange = minetest.registered_items[""].range
|
local handrange = minetest.registered_items[""].range
|
||||||
local itemrange = def.range
|
local itemrange = def.range
|
||||||
if itemstring == "" then
|
if itemstring == "" then
|
||||||
|
@ -364,7 +374,7 @@ local range_factoid = function(itemstring, def)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Smelting fuel factoid
|
-- Smelting fuel factoid
|
||||||
local factoid_fuel = function(itemstring, ctype)
|
local function factoid_fuel(itemstring, ctype)
|
||||||
if forbidden_core_factoids.fuel then
|
if forbidden_core_factoids.fuel then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
@ -392,7 +402,7 @@ local factoid_fuel = function(itemstring, ctype)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Shows the itemstring of an item
|
-- Shows the itemstring of an item
|
||||||
local factoid_itemstring = function(itemstring, playername)
|
local function factoid_itemstring(itemstring, playername)
|
||||||
if forbidden_core_factoids.itemstring then
|
if forbidden_core_factoids.itemstring then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
@ -405,7 +415,7 @@ local factoid_itemstring = function(itemstring, playername)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local entry_image = function(data)
|
local function entry_image(data)
|
||||||
local formstring = ""
|
local formstring = ""
|
||||||
-- No image for air
|
-- No image for air
|
||||||
if data.itemstring ~= "air" then
|
if data.itemstring ~= "air" then
|
||||||
|
@ -434,7 +444,7 @@ factoid_generators.craftitems = {}
|
||||||
* factoid_type: If set, oly returns factoid with a matching factoid_type.
|
* factoid_type: If set, oly returns factoid with a matching factoid_type.
|
||||||
If nil, all factoids for this category will be generated
|
If nil, all factoids for this category will be generated
|
||||||
* data: Entry data to parse ]]
|
* data: Entry data to parse ]]
|
||||||
local factoid_custom = function(category_id, factoid_type, data)
|
local function factoid_custom(category_id, factoid_type, data)
|
||||||
local ftable = factoid_generators[category_id]
|
local ftable = factoid_generators[category_id]
|
||||||
local datastring = ""
|
local datastring = ""
|
||||||
-- Custom factoids are inserted here
|
-- Custom factoids are inserted here
|
||||||
|
@ -450,7 +460,7 @@ local factoid_custom = function(category_id, factoid_type, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Shows core information shared by all items, to be inserted at the top
|
-- Shows core information shared by all items, to be inserted at the top
|
||||||
local factoids_header = function(data, ctype)
|
local function factoids_header(data, ctype)
|
||||||
local datastring = ""
|
local datastring = ""
|
||||||
if not forbidden_core_factoids.basics then
|
if not forbidden_core_factoids.basics then
|
||||||
|
|
||||||
|
@ -510,7 +520,7 @@ local factoids_header = function(data, ctype)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Shows less important information shared by all items, to be inserted at the bottom
|
-- Shows less important information shared by all items, to be inserted at the bottom
|
||||||
local factoids_footer = function(data, playername, ctype)
|
local function factoids_footer(data, playername, ctype)
|
||||||
local datastring = ""
|
local datastring = ""
|
||||||
datastring = datastring .. factoid_custom(ctype, "groups", data)
|
datastring = datastring .. factoid_custom(ctype, "groups", data)
|
||||||
datastring = newline2(datastring)
|
datastring = newline2(datastring)
|
||||||
|
@ -812,7 +822,7 @@ doc.add_category("nodes", {
|
||||||
-- Non-default drops
|
-- Non-default drops
|
||||||
if not forbidden_core_factoids.drops and data.def.drop ~= nil and data.def.drop ~= data.itemstring and data.itemstring ~= "air" then
|
if not forbidden_core_factoids.drops and data.def.drop ~= nil and data.def.drop ~= data.itemstring and data.itemstring ~= "air" then
|
||||||
-- TODO: Calculate drop probabilities of max > 1 like for max == 1
|
-- TODO: Calculate drop probabilities of max > 1 like for max == 1
|
||||||
local get_desc = function(stack)
|
local function get_desc(stack)
|
||||||
return description_for_formspec(stack:get_name())
|
return description_for_formspec(stack:get_name())
|
||||||
end
|
end
|
||||||
if data.def.drop == "" then
|
if data.def.drop == "" then
|
||||||
|
@ -904,7 +914,7 @@ doc.add_category("nodes", {
|
||||||
-- Do some cleanup of the probability table
|
-- Do some cleanup of the probability table
|
||||||
if max == 1 or max == nil then
|
if max == 1 or max == nil then
|
||||||
-- Sort by rarity
|
-- Sort by rarity
|
||||||
local comp = function(p1, p2)
|
local function comp(p1, p2)
|
||||||
return p1.rarity < p2.rarity
|
return p1.rarity < p2.rarity
|
||||||
end
|
end
|
||||||
table.sort(probtables, comp)
|
table.sort(probtables, comp)
|
||||||
|
@ -1232,7 +1242,7 @@ local function gather_descs()
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local add_entries = function(deftable, category_id)
|
local function add_entries(deftable, category_id)
|
||||||
for id, def in pairs(deftable) do
|
for id, def in pairs(deftable) do
|
||||||
local name, ld, uh, im
|
local name, ld, uh, im
|
||||||
local forced = false
|
local forced = false
|
||||||
|
|
|
@ -726,7 +726,7 @@ local function make_formspec(name)
|
||||||
return concat(fs)
|
return concat(fs)
|
||||||
end
|
end
|
||||||
|
|
||||||
local show_fs = function(player, name)
|
local function show_fs(player, name)
|
||||||
if sfinv_only then
|
if sfinv_only then
|
||||||
sfinv.set_player_inventory_formspec(player)
|
sfinv.set_player_inventory_formspec(player)
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,11 +7,11 @@ tt.NAME_COLOR = mcl_colors.YELLOW
|
||||||
-- API
|
-- API
|
||||||
tt.registered_snippets = {}
|
tt.registered_snippets = {}
|
||||||
|
|
||||||
tt.register_snippet = function(func)
|
function tt.register_snippet(func)
|
||||||
table.insert(tt.registered_snippets, func)
|
table.insert(tt.registered_snippets, func)
|
||||||
end
|
end
|
||||||
|
|
||||||
tt.register_priority_snippet = function(func)
|
function tt.register_priority_snippet(func)
|
||||||
table.insert(tt.registered_snippets, 1, func)
|
table.insert(tt.registered_snippets, 1, func)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ end
|
||||||
|
|
||||||
minetest.register_on_mods_loaded(append_snippets)
|
minetest.register_on_mods_loaded(append_snippets)
|
||||||
|
|
||||||
tt.reload_itemstack_description = function(itemstack)
|
function tt.reload_itemstack_description(itemstack)
|
||||||
local itemstring = itemstack:get_name()
|
local itemstring = itemstack:get_name()
|
||||||
local def = itemstack:get_definition()
|
local def = itemstack:get_definition()
|
||||||
local meta = itemstack:get_meta()
|
local meta = itemstack:get_meta()
|
||||||
|
|
|
@ -179,7 +179,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, direction,
|
||||||
format_string_config.format_max_value = "%d"
|
format_string_config.format_max_value = "%d"
|
||||||
end
|
end
|
||||||
|
|
||||||
hudtable.add_all = function(player, hudtable, start_value, start_max, start_hidden)
|
function hudtable.add_all(player, hudtable, start_value, start_max, start_hidden)
|
||||||
if start_value == nil then start_value = hudtable.default_start_value end
|
if start_value == nil then start_value = hudtable.default_start_value end
|
||||||
if start_max == nil then start_max = hudtable.default_start_max end
|
if start_max == nil then start_max = hudtable.default_start_max end
|
||||||
if start_hidden == nil then start_hidden = hudtable.default_start_hidden end
|
if start_hidden == nil then start_hidden = hudtable.default_start_hidden end
|
||||||
|
|
|
@ -40,7 +40,7 @@ minetest.register_on_mods_loaded(function()
|
||||||
registered_nodes = minetest.registered_nodes
|
registered_nodes = minetest.registered_nodes
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local load_data = function(player)
|
local function load_data(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
pool[name] = {}
|
pool[name] = {}
|
||||||
local temp_pool = pool[name]
|
local temp_pool = pool[name]
|
||||||
|
@ -52,7 +52,7 @@ local load_data = function(player)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- saves data to be utilized on next login
|
-- saves data to be utilized on next login
|
||||||
local save_data = function(player)
|
local function save_data(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local temp_pool = pool[name]
|
local temp_pool = pool[name]
|
||||||
local meta = player:get_meta()
|
local meta = player:get_meta()
|
||||||
|
@ -70,7 +70,7 @@ minetest.register_on_leaveplayer(function(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- create instance of new hud
|
-- create instance of new hud
|
||||||
hud_manager.add_hud = function(player,hud_name,def)
|
function hud_manager.add_hud(player,hud_name,def)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if minetest.is_creative_enabled(name) then
|
if minetest.is_creative_enabled(name) then
|
||||||
return
|
return
|
||||||
|
@ -100,7 +100,7 @@ hud_manager.add_hud = function(player,hud_name,def)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- delete instance of hud
|
-- delete instance of hud
|
||||||
hud_manager.remove_hud = function(player,hud_name)
|
function hud_manager.remove_hud(player,hud_name)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if player_huds[name] and player_huds[name][hud_name] then
|
if player_huds[name] and player_huds[name][hud_name] then
|
||||||
player:hud_remove(player_huds[name][hud_name])
|
player:hud_remove(player_huds[name][hud_name])
|
||||||
|
@ -109,7 +109,7 @@ hud_manager.remove_hud = function(player,hud_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- change element of hud
|
-- change element of hud
|
||||||
hud_manager.change_hud = function(data)
|
function hud_manager.change_hud(data)
|
||||||
local name = data.player:get_player_name()
|
local name = data.player:get_player_name()
|
||||||
if player_huds[name] and player_huds[name][data.hud_name] then
|
if player_huds[name] and player_huds[name][data.hud_name] then
|
||||||
data.player:hud_change(player_huds[name][data.hud_name], data.element, data.data)
|
data.player:hud_change(player_huds[name][data.hud_name], data.element, data.data)
|
||||||
|
@ -117,7 +117,7 @@ hud_manager.change_hud = function(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- gets if hud exists
|
-- gets if hud exists
|
||||||
hud_manager.hud_exists = function(player,hud_name)
|
function hud_manager.hud_exists(player,hud_name)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if player_huds[name] and player_huds[name][hud_name] then
|
if player_huds[name] and player_huds[name][hud_name] then
|
||||||
return true
|
return true
|
||||||
|
@ -133,7 +133,7 @@ minetest.register_on_leaveplayer(function(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- is used for shutdowns to save all data
|
-- is used for shutdowns to save all data
|
||||||
local save_all = function()
|
local function save_all()
|
||||||
for name,_ in pairs(pool) do
|
for name,_ in pairs(pool) do
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player then
|
if player then
|
||||||
|
|
|
@ -33,13 +33,13 @@ groups to be set. ]]
|
||||||
do
|
do
|
||||||
for name,def in pairs(minetest.registered_items) do
|
for name,def in pairs(minetest.registered_items) do
|
||||||
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
|
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
|
||||||
local is_redstone = function(def)
|
local function is_redstone(def)
|
||||||
return def.mesecons or def.groups.mesecon or def.groups.mesecon_conductor_craftable or def.groups.mesecon_effecor_off
|
return def.mesecons or def.groups.mesecon or def.groups.mesecon_conductor_craftable or def.groups.mesecon_effecor_off
|
||||||
end
|
end
|
||||||
local is_tool = function(def)
|
local function is_tool(def)
|
||||||
return def.groups.tool or (def.tool_capabilities ~= nil and def.tool_capabilities.damage_groups == nil)
|
return def.groups.tool or (def.tool_capabilities ~= nil and def.tool_capabilities.damage_groups == nil)
|
||||||
end
|
end
|
||||||
local is_weapon_or_armor = function(def)
|
local function is_weapon_or_armor(def)
|
||||||
return def.groups.weapon or def.groups.weapon_ranged or def.groups.ammo or def.groups.combat_item or ((def.groups.armor_head or def.groups.armor_torso or def.groups.armor_legs or def.groups.armor_feet or def.groups.horse_armor) and def.groups.non_combat_armor ~= 1)
|
return def.groups.weapon or def.groups.weapon_ranged or def.groups.ammo or def.groups.combat_item or ((def.groups.armor_head or def.groups.armor_torso or def.groups.armor_legs or def.groups.armor_feet or def.groups.horse_armor) and def.groups.non_combat_armor ~= 1)
|
||||||
end
|
end
|
||||||
-- Is set to true if it was added in any category besides misc
|
-- Is set to true if it was added in any category besides misc
|
||||||
|
@ -208,7 +208,7 @@ local filtername = {}
|
||||||
local noffset_x_start = -0.24
|
local noffset_x_start = -0.24
|
||||||
local noffset_x = noffset_x_start
|
local noffset_x = noffset_x_start
|
||||||
local noffset_y = -0.25
|
local noffset_y = -0.25
|
||||||
local next_noffset = function(id, right)
|
local function next_noffset(id, right)
|
||||||
if right then
|
if right then
|
||||||
noffset[id] = { 8.94, noffset_y }
|
noffset[id] = { 8.94, noffset_y }
|
||||||
else
|
else
|
||||||
|
@ -291,7 +291,7 @@ filtername["inv"] = S("Survival Inventory")
|
||||||
end]]
|
end]]
|
||||||
|
|
||||||
|
|
||||||
mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_size, show, page, filter)
|
function mcl_inventory.set_creative_formspec(player, start_i, pagenum, inv_size, show, page, filter)
|
||||||
--reset_menu_item_bg()
|
--reset_menu_item_bg()
|
||||||
pagenum = math.floor(pagenum) or 1
|
pagenum = math.floor(pagenum) or 1
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not minetest.is_creative_enabled("") then
|
if not minetest.is_creative_enabled("") then
|
||||||
mcl_inventory.update_inventory_formspec = function(player)
|
function mcl_inventory.update_inventory_formspec(player)
|
||||||
set_inventory(player)
|
set_inventory(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -158,7 +158,7 @@ minetest.register_on_joinplayer(function(player)
|
||||||
player:hud_set_hotbar_selected_image("mcl_inventory_hotbar_selected.png")
|
player:hud_set_hotbar_selected_image("mcl_inventory_hotbar_selected.png")
|
||||||
|
|
||||||
local old_update_player = mcl_armor.update_player
|
local old_update_player = mcl_armor.update_player
|
||||||
mcl_armor.update_player = function(player, info)
|
function mcl_armor.update_player(player, info)
|
||||||
old_update_player(player, info)
|
old_update_player(player, info)
|
||||||
set_inventory(player, true)
|
set_inventory(player, true)
|
||||||
end
|
end
|
||||||
|
|
|
@ -93,11 +93,11 @@ local layer_ratio = 255
|
||||||
local standing_banner_entity_offset = { x=0, y=-0.499, z=0 }
|
local standing_banner_entity_offset = { x=0, y=-0.499, z=0 }
|
||||||
local hanging_banner_entity_offset = { x=0, y=-1.7, z=0 }
|
local hanging_banner_entity_offset = { x=0, y=-1.7, z=0 }
|
||||||
|
|
||||||
local rotation_level_to_yaw = function(rotation_level)
|
local function rotation_level_to_yaw(rotation_level)
|
||||||
return (rotation_level * (math.pi/8)) + math.pi
|
return (rotation_level * (math.pi/8)) + math.pi
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_dig_banner = function(pos, node, digger)
|
local function on_dig_banner(pos, node, digger)
|
||||||
-- Check protection
|
-- Check protection
|
||||||
local name = digger:get_player_name()
|
local name = digger:get_player_name()
|
||||||
if minetest.is_protected(pos, name) then
|
if minetest.is_protected(pos, name) then
|
||||||
|
@ -116,7 +116,7 @@ local on_dig_banner = function(pos, node, digger)
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_destruct_banner = function(pos, hanging)
|
local function on_destruct_banner(pos, hanging)
|
||||||
local offset, nodename
|
local offset, nodename
|
||||||
if hanging then
|
if hanging then
|
||||||
offset = hanging_banner_entity_offset
|
offset = hanging_banner_entity_offset
|
||||||
|
@ -136,15 +136,15 @@ local on_destruct_banner = function(pos, hanging)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_destruct_standing_banner = function(pos)
|
local function on_destruct_standing_banner(pos)
|
||||||
return on_destruct_banner(pos, false)
|
return on_destruct_banner(pos, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_destruct_hanging_banner = function(pos)
|
local function on_destruct_hanging_banner(pos)
|
||||||
return on_destruct_banner(pos, true)
|
return on_destruct_banner(pos, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
local make_banner_texture = function(base_color, layers)
|
local function make_banner_texture(base_color, layers)
|
||||||
local colorize
|
local colorize
|
||||||
if mcl_banners.colors[base_color] then
|
if mcl_banners.colors[base_color] then
|
||||||
colorize = mcl_banners.colors[base_color][4]
|
colorize = mcl_banners.colors[base_color][4]
|
||||||
|
@ -174,7 +174,7 @@ local make_banner_texture = function(base_color, layers)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local spawn_banner_entity = function(pos, hanging, itemstack)
|
local function spawn_banner_entity(pos, hanging, itemstack)
|
||||||
local banner
|
local banner
|
||||||
if hanging then
|
if hanging then
|
||||||
banner = minetest.add_entity(pos, "mcl_banners:hanging_banner")
|
banner = minetest.add_entity(pos, "mcl_banners:hanging_banner")
|
||||||
|
@ -198,7 +198,7 @@ local spawn_banner_entity = function(pos, hanging, itemstack)
|
||||||
return banner
|
return banner
|
||||||
end
|
end
|
||||||
|
|
||||||
local respawn_banner_entity = function(pos, node, force)
|
local function respawn_banner_entity(pos, node, force)
|
||||||
local hanging = node.name == "mcl_banners:hanging_banner"
|
local hanging = node.name == "mcl_banners:hanging_banner"
|
||||||
local offset
|
local offset
|
||||||
if hanging then
|
if hanging then
|
||||||
|
|
|
@ -259,7 +259,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create a banner description containing all the layer names
|
-- Create a banner description containing all the layer names
|
||||||
mcl_banners.make_advanced_banner_description = function(description, layers)
|
function mcl_banners.make_advanced_banner_description(description, layers)
|
||||||
if layers == nil or #layers == 0 then
|
if layers == nil or #layers == 0 then
|
||||||
-- No layers, revert to default
|
-- No layers, revert to default
|
||||||
return ""
|
return ""
|
||||||
|
@ -296,7 +296,7 @@ Parameters same as for minetest.register_craft_predict.
|
||||||
craft_predict is set true when called from minetest.craft_preview, in this case, this function
|
craft_predict is set true when called from minetest.craft_preview, in this case, this function
|
||||||
MUST NOT change the crafting grid.
|
MUST NOT change the crafting grid.
|
||||||
]]
|
]]
|
||||||
local banner_pattern_craft = function(itemstack, player, old_craft_grid, craft_inv, craft_predict)
|
local function banner_pattern_craft(itemstack, player, old_craft_grid, craft_inv, craft_predict)
|
||||||
if minetest.get_item_group(itemstack:get_name(), "banner") ~= 1 then
|
if minetest.get_item_group(itemstack:get_name(), "banner") ~= 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,7 @@ end
|
||||||
-- Get the included text out of the book item
|
-- Get the included text out of the book item
|
||||||
-- itemstack: Book item
|
-- itemstack: Book item
|
||||||
-- meta: Meta of book (optional)
|
-- meta: Meta of book (optional)
|
||||||
local get_text = function(itemstack)
|
local function get_text(itemstack)
|
||||||
-- Grab the text
|
-- Grab the text
|
||||||
local meta = itemstack:get_meta()
|
local meta = itemstack:get_meta()
|
||||||
local text = meta:get_string("text")
|
local text = meta:get_string("text")
|
||||||
|
@ -56,7 +56,7 @@ local get_text = function(itemstack)
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
local make_description = function(title, author, generation)
|
local function make_description(title, author, generation)
|
||||||
local desc
|
local desc
|
||||||
if generation == 0 then
|
if generation == 0 then
|
||||||
desc = S("“@1”", title)
|
desc = S("“@1”", title)
|
||||||
|
@ -71,11 +71,11 @@ local make_description = function(title, author, generation)
|
||||||
return desc
|
return desc
|
||||||
end
|
end
|
||||||
|
|
||||||
local cap_text_length = function(text, max_length)
|
local function cap_text_length(text, max_length)
|
||||||
return string.sub(text, 1, max_length)
|
return string.sub(text, 1, max_length)
|
||||||
end
|
end
|
||||||
|
|
||||||
local write = function(itemstack, user, pointed_thing)
|
local function write(itemstack, user, pointed_thing)
|
||||||
-- Call on_rightclick if the pointed node defines it
|
-- Call on_rightclick if the pointed node defines it
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
local node = minetest.get_node(pointed_thing.under)
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
|
@ -96,7 +96,7 @@ local write = function(itemstack, user, pointed_thing)
|
||||||
minetest.show_formspec(user:get_player_name(), "mcl_books:writable_book", formspec)
|
minetest.show_formspec(user:get_player_name(), "mcl_books:writable_book", formspec)
|
||||||
end
|
end
|
||||||
|
|
||||||
local read = function(itemstack, user, pointed_thing)
|
local function read(itemstack, user, pointed_thing)
|
||||||
-- Call on_rightclick if the pointed node defines it
|
-- Call on_rightclick if the pointed node defines it
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
local node = minetest.get_node(pointed_thing.under)
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local S = minetest.get_translator("mcl_bows")
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
local math = math
|
local math = math
|
||||||
local vector = vector
|
local vector = vector
|
||||||
|
@ -79,7 +79,7 @@ local ARROW_ENTITY={
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Destroy arrow entity self at pos and drops it as an item
|
-- Destroy arrow entity self at pos and drops it as an item
|
||||||
local spawn_item = function(self, pos)
|
local function spawn_item(self, pos)
|
||||||
if not minetest.is_creative_enabled("") then
|
if not minetest.is_creative_enabled("") then
|
||||||
local item = minetest.add_item(pos, "mcl_bows:arrow")
|
local item = minetest.add_item(pos, "mcl_bows:arrow")
|
||||||
item:set_velocity({x=0, y=0, z=0})
|
item:set_velocity({x=0, y=0, z=0})
|
||||||
|
@ -89,7 +89,7 @@ local spawn_item = function(self, pos)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
local damage_particles = function(pos, is_critical)
|
local function damage_particles(pos, is_critical)
|
||||||
if is_critical then
|
if is_critical then
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
amount = 15,
|
amount = 15,
|
||||||
|
@ -111,7 +111,7 @@ local damage_particles = function(pos, is_critical)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ARROW_ENTITY.on_step = function(self, dtime)
|
function ARROW_ENTITY.on_step(self, dtime)
|
||||||
mcl_burning.tick(self.object, dtime, self)
|
mcl_burning.tick(self.object, dtime, self)
|
||||||
|
|
||||||
self._time_in_air = self._time_in_air + .001
|
self._time_in_air = self._time_in_air + .001
|
||||||
|
@ -423,13 +423,13 @@ end
|
||||||
|
|
||||||
-- Force recheck of stuck arrows when punched.
|
-- Force recheck of stuck arrows when punched.
|
||||||
-- Otherwise, punching has no effect.
|
-- Otherwise, punching has no effect.
|
||||||
ARROW_ENTITY.on_punch = function(self)
|
function ARROW_ENTITY.on_punch(self)
|
||||||
if self._stuck then
|
if self._stuck then
|
||||||
self._stuckrechecktimer = STUCK_RECHECK_TIME
|
self._stuckrechecktimer = STUCK_RECHECK_TIME
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ARROW_ENTITY.get_staticdata = function(self)
|
function ARROW_ENTITY.get_staticdata(self)
|
||||||
local out = {
|
local out = {
|
||||||
lastpos = self._lastpos,
|
lastpos = self._lastpos,
|
||||||
startpos = self._startpos,
|
startpos = self._startpos,
|
||||||
|
@ -451,7 +451,7 @@ ARROW_ENTITY.get_staticdata = function(self)
|
||||||
return minetest.serialize(out)
|
return minetest.serialize(out)
|
||||||
end
|
end
|
||||||
|
|
||||||
ARROW_ENTITY.on_activate = function(self, staticdata, dtime_s)
|
function ARROW_ENTITY.on_activate(self, staticdata, dtime_s)
|
||||||
self._time_in_air = 1.0
|
self._time_in_air = 1.0
|
||||||
self._in_player = false
|
self._in_player = false
|
||||||
local data = minetest.deserialize(staticdata)
|
local data = minetest.deserialize(staticdata)
|
||||||
|
|
|
@ -33,7 +33,7 @@ local bow_load = {}
|
||||||
-- Another player table, this one stores the wield index of the bow being charged
|
-- Another player table, this one stores the wield index of the bow being charged
|
||||||
local bow_index = {}
|
local bow_index = {}
|
||||||
|
|
||||||
mcl_bows.shoot_arrow = function(arrow_item, pos, dir, yaw, shooter, power, damage, is_critical, bow_stack, collectable)
|
function mcl_bows.shoot_arrow(arrow_item, pos, dir, yaw, shooter, power, damage, is_critical, bow_stack, collectable)
|
||||||
local obj = minetest.add_entity({x=pos.x,y=pos.y,z=pos.z}, arrow_item.."_entity")
|
local obj = minetest.add_entity({x=pos.x,y=pos.y,z=pos.z}, arrow_item.."_entity")
|
||||||
if power == nil then
|
if power == nil then
|
||||||
power = BOW_MAX_SPEED --19
|
power = BOW_MAX_SPEED --19
|
||||||
|
@ -75,7 +75,7 @@ mcl_bows.shoot_arrow = function(arrow_item, pos, dir, yaw, shooter, power, damag
|
||||||
return obj
|
return obj
|
||||||
end
|
end
|
||||||
|
|
||||||
local get_arrow = function(player)
|
local function get_arrow(player)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local arrow_stack, arrow_stack_id
|
local arrow_stack, arrow_stack_id
|
||||||
for i=1, inv:get_size("main") do
|
for i=1, inv:get_size("main") do
|
||||||
|
@ -89,7 +89,7 @@ local get_arrow = function(player)
|
||||||
return arrow_stack, arrow_stack_id
|
return arrow_stack, arrow_stack_id
|
||||||
end
|
end
|
||||||
|
|
||||||
local player_shoot_arrow = function(itemstack, player, power, damage, is_critical)
|
local function player_shoot_arrow(itemstack, player, power, damage, is_critical)
|
||||||
local arrow_stack, arrow_stack_id = get_arrow(player)
|
local arrow_stack, arrow_stack_id = get_arrow(player)
|
||||||
local arrow_itemstring
|
local arrow_itemstring
|
||||||
local has_infinity_enchantment = mcl_enchanting.has_enchantment(player:get_wielded_item(), "infinity")
|
local has_infinity_enchantment = mcl_enchanting.has_enchantment(player:get_wielded_item(), "infinity")
|
||||||
|
@ -162,7 +162,7 @@ S("The speed and damage of the arrow increases the longer you charge. The regula
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Iterates through player inventory and resets all the bows in "charging" state back to their original stage
|
-- Iterates through player inventory and resets all the bows in "charging" state back to their original stage
|
||||||
local reset_bows = function(player)
|
local function reset_bows(player)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local list = inv:get_list("main")
|
local list = inv:get_list("main")
|
||||||
for place, stack in pairs(list) do
|
for place, stack in pairs(list) do
|
||||||
|
@ -182,7 +182,7 @@ local reset_bows = function(player)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Resets the bow charging state and player speed. To be used when the player is no longer charging the bow
|
-- Resets the bow charging state and player speed. To be used when the player is no longer charging the bow
|
||||||
local reset_bow_state = function(player, also_reset_bows)
|
local function reset_bow_state(player, also_reset_bows)
|
||||||
bow_load[player:get_player_name()] = nil
|
bow_load[player:get_player_name()] = nil
|
||||||
bow_index[player:get_player_name()] = nil
|
bow_index[player:get_player_name()] = nil
|
||||||
if minetest.get_modpath("playerphysics") then
|
if minetest.get_modpath("playerphysics") then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local S = minetest.get_translator("mcl_brewing")
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
local function active_brewing_formspec(fuel_percent, brew_percent)
|
local function active_brewing_formspec(fuel_percent, brew_percent)
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ local tiles = {
|
||||||
"mcl_brewing_side.png^[transformFX", --front
|
"mcl_brewing_side.png^[transformFX", --front
|
||||||
}
|
}
|
||||||
|
|
||||||
local allow_put = function(pos, listname, index, stack, player)
|
local function allow_put(pos, listname, index, stack, player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if minetest.is_protected(pos, name) then
|
if minetest.is_protected(pos, name) then
|
||||||
minetest.record_protection_violation(pos, name)
|
minetest.record_protection_violation(pos, name)
|
||||||
|
@ -335,7 +335,7 @@ local allow_put = function(pos, listname, index, stack, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local on_put = function(pos, listname, index, stack, player)
|
local function on_put(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local str = ""
|
local str = ""
|
||||||
|
@ -352,18 +352,18 @@ local on_put = function(pos, listname, index, stack, player)
|
||||||
--some code here to enforce only potions getting placed on stands
|
--some code here to enforce only potions getting placed on stands
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[local after_dig = function(pos, oldnode, oldmetadata, digger)
|
--[[local function after_dig(pos, oldnode, oldmetadata, digger)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:from_table(oldmetadata)
|
meta:from_table(oldmetadata)
|
||||||
drop_brewing_stand_items(pos, meta)
|
drop_brewing_stand_items(pos, meta)
|
||||||
end]]
|
end]]
|
||||||
|
|
||||||
local on_destruct = function(pos)
|
local function on_destruct(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
drop_brewing_stand_items(pos, meta)
|
drop_brewing_stand_items(pos, meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
local allow_take = function(pos, listname, index, stack, player)
|
local function allow_take(pos, listname, index, stack, player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if minetest.is_protected(pos, name) then
|
if minetest.is_protected(pos, name) then
|
||||||
minetest.record_protection_violation(pos, name)
|
minetest.record_protection_violation(pos, name)
|
||||||
|
@ -493,7 +493,6 @@ minetest.register_node("mcl_brewing:stand_100", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -503,7 +502,6 @@ minetest.register_node("mcl_brewing:stand_100", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -511,10 +509,10 @@ minetest.register_node("mcl_brewing:stand_100", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mcl_brewing:stand_010", {
|
minetest.register_node("mcl_brewing:stand_010", {
|
||||||
description = S("Brewing Stand"),
|
description = S("Brewing Stand"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
|
@ -567,7 +565,6 @@ minetest.register_node("mcl_brewing:stand_010", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -577,7 +574,6 @@ minetest.register_node("mcl_brewing:stand_010", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -585,10 +581,10 @@ minetest.register_node("mcl_brewing:stand_010", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mcl_brewing:stand_001", {
|
minetest.register_node("mcl_brewing:stand_001", {
|
||||||
description = S("Brewing Stand"),
|
description = S("Brewing Stand"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
|
@ -605,7 +601,6 @@ minetest.register_node("mcl_brewing:stand_001", {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
||||||
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
||||||
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
||||||
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
||||||
|
@ -637,7 +632,6 @@ minetest.register_node("mcl_brewing:stand_001", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -647,7 +641,6 @@ minetest.register_node("mcl_brewing:stand_001", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -655,10 +648,10 @@ minetest.register_node("mcl_brewing:stand_001", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mcl_brewing:stand_110", {
|
minetest.register_node("mcl_brewing:stand_110", {
|
||||||
description = S("Brewing Stand"),
|
description = S("Brewing Stand"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
|
@ -675,7 +668,6 @@ minetest.register_node("mcl_brewing:stand_110", {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
||||||
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
||||||
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
||||||
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
||||||
|
@ -717,7 +709,6 @@ minetest.register_node("mcl_brewing:stand_110", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -727,7 +718,6 @@ minetest.register_node("mcl_brewing:stand_110", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -735,10 +725,10 @@ minetest.register_node("mcl_brewing:stand_110", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mcl_brewing:stand_101", {
|
minetest.register_node("mcl_brewing:stand_101", {
|
||||||
description = S("Brewing Stand"),
|
description = S("Brewing Stand"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
|
@ -755,7 +745,6 @@ minetest.register_node("mcl_brewing:stand_101", {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
||||||
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
||||||
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
||||||
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
||||||
|
@ -793,7 +782,6 @@ minetest.register_node("mcl_brewing:stand_101", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -803,7 +791,6 @@ minetest.register_node("mcl_brewing:stand_101", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -811,10 +798,10 @@ minetest.register_node("mcl_brewing:stand_101", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mcl_brewing:stand_011", {
|
minetest.register_node("mcl_brewing:stand_011", {
|
||||||
description = S("Brewing Stand"),
|
description = S("Brewing Stand"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
|
@ -831,7 +818,6 @@ minetest.register_node("mcl_brewing:stand_011", {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
||||||
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
||||||
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
||||||
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
||||||
|
@ -869,7 +855,6 @@ minetest.register_node("mcl_brewing:stand_011", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -879,7 +864,6 @@ minetest.register_node("mcl_brewing:stand_011", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -887,10 +871,10 @@ minetest.register_node("mcl_brewing:stand_011", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mcl_brewing:stand_111", {
|
minetest.register_node("mcl_brewing:stand_111", {
|
||||||
description = S("Brewing Stand"),
|
description = S("Brewing Stand"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
|
@ -907,7 +891,6 @@ minetest.register_node("mcl_brewing:stand_111", {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
||||||
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
{-1/16, -5/16, -1/16, 1/16, 8/16, 1/16}, -- heat plume
|
||||||
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
{ 2/16, -8/16, -8/16, 8/16, -6/16, -2/16}, -- base
|
||||||
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
{-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base
|
||||||
|
@ -952,7 +935,6 @@ minetest.register_node("mcl_brewing:stand_111", {
|
||||||
allow_metadata_inventory_put = allow_put,
|
allow_metadata_inventory_put = allow_put,
|
||||||
on_metadata_inventory_put = on_put,
|
on_metadata_inventory_put = on_put,
|
||||||
on_metadata_inventory_take = on_put,
|
on_metadata_inventory_take = on_put,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -962,7 +944,6 @@ minetest.register_node("mcl_brewing:stand_111", {
|
||||||
local form = brewing_formspec
|
local form = brewing_formspec
|
||||||
meta:set_string("formspec", form)
|
meta:set_string("formspec", form)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local sender_name = sender:get_player_name()
|
local sender_name = sender:get_player_name()
|
||||||
if minetest.is_protected(pos, sender_name) then
|
if minetest.is_protected(pos, sender_name) then
|
||||||
|
@ -970,7 +951,6 @@ minetest.register_node("mcl_brewing:stand_111", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = brewing_stand_timer,
|
on_timer = brewing_stand_timer,
|
||||||
on_rotate = on_rotate,
|
on_rotate = on_rotate,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue