diff --git a/mods/CORE/tga_encoder/donut.lua b/mods/CORE/tga_encoder/donut.lua index 8567f8aed..428233218 100644 --- a/mods/CORE/tga_encoder/donut.lua +++ b/mods/CORE/tga_encoder/donut.lua @@ -89,9 +89,9 @@ function render_frame(A, B) zbuffer[yp][xp] = ooz local luminance = math.max( math.ceil( L * 180 ), 0 ) -- luminance is now in the range 0 to 255 - r = math.ceil( (luminance + xp) / 2 ) - g = math.ceil( (luminance + yp) / 2 ) - b = math.ceil( (luminance + xp + yp) / 3 ) + local r = math.ceil( (luminance + xp) / 2 ) + local g = math.ceil( (luminance + yp) / 2 ) + local b = math.ceil( (luminance + xp + yp) / 3 ) output[yp][xp] = { r, g, b } end end diff --git a/mods/HELP/doc/doc_items/init.lua b/mods/HELP/doc/doc_items/init.lua index 69d91f779..7cbcc66b2 100644 --- a/mods/HELP/doc/doc_items/init.lua +++ b/mods/HELP/doc/doc_items/init.lua @@ -1152,7 +1152,7 @@ doc.add_category("mobs", { datastring = datastring .. S("Type: @1", data.type) datastring = newline2(datastring) end - + if data.spawn_class then datastring = datastring .. S("spawn class: @1", data.spawn_class) datastring = newline2(datastring) @@ -1167,25 +1167,18 @@ doc.add_category("mobs", { datastring = datastring .. S("Can Fly") datastring = newline2(datastring) end - - if data.drops then - count = 0 + + if data.drops and #data.drops > 0 then + datastring = datastring .. S("drops: ") + datastring = newline(datastring) + for _,item in ipairs(data.drops) do - count = count + 1 - end - - if count > 0 then - datastring = datastring .. S("drops: ") + local itemDescription = ItemStack(item.name):get_short_description() + datastring = datastring .. itemDescription datastring = newline(datastring) - - for _,item in ipairs(data.drops) do - local itemDescription = ItemStack(item.name):get_short_description() - datastring = datastring .. itemDescription - datastring = newline(datastring) - end - - datastring = newline2(datastring) end + + datastring = newline2(datastring) end if data.follow then @@ -1203,12 +1196,11 @@ doc.add_category("mobs", { datastring = newline(datastring) end end - + datastring = newline2(datastring) end local formstring = doc.widgets.text(datastring, nil, nil, doc.FORMSPEC.ENTRY_WIDTH - 1.2) - return formstring else return "label[0,1;NO DATA AVALIABLE!]" diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua index 5fcaa383a..0ed75a9ea 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua @@ -191,7 +191,7 @@ local dropperdef = { local speed = 3 item_entity:set_velocity(vector.multiply(drop_vel, speed)) stack:take_item() - item_dropped = trie + item_dropped = true end -- Remove dropped items from inventory diff --git a/mods/ITEMS/REDSTONE/mesecons_commandblock/api.lua b/mods/ITEMS/REDSTONE/mesecons_commandblock/api.lua index 7edcc9083..6163c972c 100644 --- a/mods/ITEMS/REDSTONE/mesecons_commandblock/api.lua +++ b/mods/ITEMS/REDSTONE/mesecons_commandblock/api.lua @@ -11,7 +11,7 @@ mod.initialize = function(meta) meta:set_string("commander", "") end -mod.place = function(meta, placer) +mod.place = function(meta, placer) if not placer then return end meta:set_string("commander", placer:get_player_name()) @@ -118,7 +118,7 @@ end local formspec_metas = {} -mod.handle_rightclick = function(meta, player) +mod.handle_rightclick = function(meta, player, pos) local can_edit = true -- Only allow write access in Creative Mode if not minetest.is_creative_enabled(player:get_player_name()) then @@ -205,7 +205,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) -- Retrieve the metadata object this formspec data belongs to local index, _, fs_id = string.find(formname, "commandblock_(-?%d+)") fs_id = tonumber(fs_id) - if not index or not fs_id or not formspec_metas[fs_id] then + if not index or not fs_id or not formspec_metas[fs_id] then print("index="..tostring(index)..", fs_id="..tostring(fs_id).."formspec_metas[fs_id]="..tostring(formspec_metas[fs_id])) minetest.chat_send_player(player:get_player_name(), S("Editing the command block has failed! The command block is gone.")) return diff --git a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua index 3c3aa741a..d04801c76 100644 --- a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua @@ -53,8 +53,7 @@ local function on_rightclick(pos, node, player, itemstack, pointed_thing) end local meta = minetest.get_meta(pos) - api.handle_rightclick(meta, player) - + api.handle_rightclick(meta, player, pos) end local function on_place(itemstack, placer, pointed_thing) diff --git a/mods/ITEMS/mcl_beacons/init.lua b/mods/ITEMS/mcl_beacons/init.lua index e17de8a0e..f45fa3bfe 100644 --- a/mods/ITEMS/mcl_beacons/init.lua +++ b/mods/ITEMS/mcl_beacons/init.lua @@ -366,7 +366,7 @@ minetest.register_node("mcl_beacons:beacon", { remove_beacon_beam(pos) for y = pos.y +1, pos.y + 201 do local node = minetest.get_node({x=pos.x,y=y,z=pos.z}) - if node.name == ignore then + if node.name == "ignore" then minetest.get_voxel_manip():read_from_map({x=pos.x,y=y,z=pos.z}, {x=pos.x,y=y,z=pos.z}) node = minetest.get_node({x=pos.x,y=y,z=pos.z}) end diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index 3953a060a..4d8c87151 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -46,7 +46,7 @@ core.register_craftitem("mcl_bows:rocket", { end, _on_collide_with_entity = function(self, _, obj) if self._in_player == false then - pos = self.object:get_pos() + local pos = self.object:get_pos() obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=self._damage}, diff --git a/mods/ITEMS/mcl_chests/ender.lua b/mods/ITEMS/mcl_chests/ender.lua index d76d627bb..33e24591f 100644 --- a/mods/ITEMS/mcl_chests/ender.lua +++ b/mods/ITEMS/mcl_chests/ender.lua @@ -30,7 +30,7 @@ minetest.register_node("mcl_chests:ender_chest", { end, }) -local formspec_ender_chest = table.concat({ +mcl_chests.formspec_ender_chest = table.concat({ "formspec_version[4]", "size[11.75,10.425]", @@ -84,7 +84,7 @@ minetest.register_node("mcl_chests:ender_chest_small", { return false end minetest.show_formspec(clicker:get_player_name(), "mcl_chests:ender_chest_" .. clicker:get_player_name(), - formspec_ender_chest) + mcl_chests.formspec_ender_chest) mcl_chests.player_chest_open(clicker, pos, "mcl_chests:ender_chest_small", mcl_chests.tiles.ender_chest_texture, node.param2, false, "mcl_chests_enderchest", "mcl_chests_chest") diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 988353601..05657c329 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -85,7 +85,7 @@ minetest.register_lbm({ mcl_chests.chest_update_after_close(pos) elseif node_name == "mcl_chests:ender_chest" then local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec_ender_chest) + meta:set_string("formspec", mcl_chests.formspec_ender_chest) end end }) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 31e848b80..95064d1d8 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -162,10 +162,10 @@ minetest.register_node("mcl_crimson:twisting_vines", { end grow_vines(pos, 1, "mcl_crimson:twisting_vines") local idef = itemstack:get_definition() - local itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing) + local itemstack, success = minetest.item_place_node(itemstack, clicker, pointed_thing) if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true) + minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}, true) end end @@ -257,10 +257,10 @@ minetest.register_node("mcl_crimson:weeping_vines", { end grow_vines(pos, 1, "mcl_crimson:weeping_vines", -1) local idef = itemstack:get_definition() - local itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing) + local itemstack, success = minetest.item_place_node(itemstack, clicker, pointed_thing) if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true) + minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}, true) end end diff --git a/mods/ITEMS/mcl_grindstone/init.lua b/mods/ITEMS/mcl_grindstone/init.lua index f1b539326..bcf0311ad 100644 --- a/mods/ITEMS/mcl_grindstone/init.lua +++ b/mods/ITEMS/mcl_grindstone/init.lua @@ -150,7 +150,7 @@ local function update_grindstone_slots(meta) local new_item = create_new_item(name, meta, wear) new_output = transfer_curse(input1, new_item) elseif input1:get_name() == "mcl_enchanting:book_enchanted" then - new_item = create_new_item("mcl_books:book", meta, nil) + local new_item = create_new_item("mcl_books:book", meta, nil) new_output = transfer_curse(input1, new_item) else new_output = "" @@ -164,7 +164,7 @@ local function update_grindstone_slots(meta) local new_item = create_new_item(name, meta, wear) new_output = transfer_curse(input2, new_item) elseif input2:get_name() == "mcl_enchanting:book_enchanted" then - new_item = create_new_item("mcl_books:book", meta, nil) + local new_item = create_new_item("mcl_books:book", meta, nil) new_output = transfer_curse(input2, new_item) else new_output = "" diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index b3aa232ba..5d71bfc68 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -1355,7 +1355,7 @@ minetest.register_globalstep(function(dtime) EF[name][object] = nil if effect.after_end then effect.after_end(object) end if object:is_player() then - meta = object:get_meta() + local meta = object:get_meta() meta:set_string("mcl_potions:_EF_"..name, "") potions_set_hud(object) else @@ -1500,7 +1500,7 @@ function mcl_potions._load_player_effects(player) meta:set_string("_is_weak", "") end if legacy_water_breathing then - EF.water_breathing[player] = legacy_water_breating + EF.water_breathing[player] = legacy_water_breathing meta:set_string("_is_water_breating", "") end if legacy_leaping then diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 471522d93..4d261603e 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -103,7 +103,7 @@ core.register_globalstep(function(dtime) end if vals.def.custom_effect - and vals.def.custom_effect(obj, (vals.potency+1) * mcl_potions.LINGERING_FACTOR, plus) then + and vals.def.custom_effect(obj, (vals.potency+1) * mcl_potions.LINGERING_FACTOR, vals.plus) then applied = true end diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 03cd2a0a3..a175ba8af 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -371,7 +371,7 @@ minetest.register_globalstep(function(dtime) mcl_hunger.eat_internal[player_name]._custom_wrapper(player_name) - player:get_inventory():set_stack("main", player:get_wield_index(), itemstack) + --player:get_inventory():set_stack("main", player:get_wield_index(), itemstack) end clear_eat_internal_and_timers(player, player_name)