From f9a86947e58316d2e336740bc2765f0df0a78f03 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 23 May 2021 00:09:07 +0200 Subject: [PATCH] [mcl_core] fix warnings --- mods/ITEMS/mcl_core/nodes_base.lua | 5 ++--- mods/ITEMS/mcl_core/nodes_climb.lua | 1 - mods/ITEMS/mcl_core/nodes_glass.lua | 4 ++-- mods/ITEMS/mcl_core/nodes_liquid.lua | 7 +++++-- mods/ITEMS/mcl_core/nodes_misc.lua | 5 ++--- mods/ITEMS/mcl_core/nodes_trees.lua | 5 ++--- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 4477f0377..39015e53b 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -990,9 +990,8 @@ for i=1,8 do local itemcount = itemstack:get_count() local fakestack = ItemStack(itemstring.." "..itemcount) fakestack:set_name("mcl_core:snow_"..math.min(8, (i+g))) - local success - itemstack, success = minetest.item_place(fakestack, placer, pointed_thing) - minetest.sound_play(mcl_sounds.node_sound_snow_defaults().place, {pos = below}, true) + itemstack = minetest.item_place(fakestack, placer, pointed_thing) + minetest.sound_play(mcl_sounds.node_sound_snow_defaults().place, {pos = pointed_thing.under}, true) itemstack:set_name(itemstring) return itemstack end diff --git a/mods/ITEMS/mcl_core/nodes_climb.lua b/mods/ITEMS/mcl_core/nodes_climb.lua index d9ecd76d3..3b2d3ab60 100644 --- a/mods/ITEMS/mcl_core/nodes_climb.lua +++ b/mods/ITEMS/mcl_core/nodes_climb.lua @@ -120,7 +120,6 @@ minetest.register_node("mcl_core:vine", { local node = minetest.get_node(under) local def = minetest.registered_nodes[node.name] if not def then return itemstack end - local groups = def.groups -- Check special rightclick action of pointed node if def and def.on_rightclick then diff --git a/mods/ITEMS/mcl_core/nodes_glass.lua b/mods/ITEMS/mcl_core/nodes_glass.lua index 85bf614f4..8c12d8b93 100644 --- a/mods/ITEMS/mcl_core/nodes_glass.lua +++ b/mods/ITEMS/mcl_core/nodes_glass.lua @@ -20,7 +20,7 @@ minetest.register_node("mcl_core:glass", { }) ------------------------ --- Create Color Glass -- +-- Create Color Glass -- ------------------------ local canonical_color = "yellow" function mcl_core.add_stained_glass(desc, recipeitem, colorgroup, color) @@ -54,7 +54,7 @@ function mcl_core.add_stained_glass(desc, recipeitem, colorgroup, color) _mcl_hardness = 0.3, _mcl_silk_touch_drop = true, }) - + minetest.register_craft({ output = 'mcl_core:glass_'..color..' 8', recipe = { diff --git a/mods/ITEMS/mcl_core/nodes_liquid.lua b/mods/ITEMS/mcl_core/nodes_liquid.lua index c49b685eb..99d33cf59 100644 --- a/mods/ITEMS/mcl_core/nodes_liquid.lua +++ b/mods/ITEMS/mcl_core/nodes_liquid.lua @@ -3,7 +3,10 @@ local S = minetest.get_translator("mcl_core") local N = function(s) return s end -local WATER_ALPHA = 179 +local vector = vector +local math = math + +--local WATER_ALPHA = 179 local WATER_VISC = 1 local LAVA_VISC = 7 local LIGHT_LAVA = minetest.LIGHT_MAX @@ -215,7 +218,7 @@ local emit_lava_particle = function(pos) return end local ppos = vector.add(pos, { x = math.random(-7, 7)/16, y = 0.45, z = math.random(-7, 7)/16}) - local spos = vector.add(ppos, { x = 0, y = -0.2, z = 0 }) + --local spos = vector.add(ppos, { x = 0, y = -0.2, z = 0 }) local vel = { x = math.random(-3, 3)/10, y = math.random(4, 7), z = math.random(-3, 3)/10 } local acc = { x = 0, y = -9.81, z = 0 } -- Lava droplet diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index 8b36f0696..a8188350a 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -31,7 +31,7 @@ minetest.register_node("mcl_core:slimeblock", { node_box = { type = "fixed", fixed = { - {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, } }, @@ -39,7 +39,6 @@ minetest.register_node("mcl_core:slimeblock", { type = "regular", }, tiles = {"mcl_core_slime.png"}, - paramtype = "light", use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true, stack_max = 64, -- According to Minecraft Wiki, bouncing off a slime block from a height off 255 blocks should result in a bounce height of 50 blocks @@ -213,7 +212,7 @@ minetest.register_node("mcl_core:barrier", { -- Same as barrier, but non-pointable. This node is only to be used internally to separate realms. -- It must NOT be used for anything else. -- This node only exists because Minetest does not have support for “dimensions” yet and needs to --- be removed when support for this is implemented. +-- be removed when support for this is implemented. minetest.register_node("mcl_core:realm_barrier", { description = S("Realm Barrier"), _doc_items_create_entry = false, diff --git a/mods/ITEMS/mcl_core/nodes_trees.lua b/mods/ITEMS/mcl_core/nodes_trees.lua index 801810dbd..cc64cd9cf 100644 --- a/mods/ITEMS/mcl_core/nodes_trees.lua +++ b/mods/ITEMS/mcl_core/nodes_trees.lua @@ -81,7 +81,7 @@ local register_stripped_trunk = function(subname, description_stripped_trunk, de _mcl_blast_resistance = 2, _mcl_hardness = 2, }) - + minetest.register_craft({ output = "mcl_core:"..subname.."_bark 3", recipe = { @@ -107,13 +107,12 @@ local register_wooden_planks = function(subname, description, tiles) end local register_leaves = function(subname, description, longdesc, tiles, sapling, drop_apples, sapling_chances, leafdecay_distance) - local drop if leafdecay_distance == nil then leafdecay_distance = 4 end local apple_chances = {200, 180, 160, 120, 40} local stick_chances = {50, 45, 30, 35, 10} - + local function get_drops(fortune_level) local drop = { max_items = 1,