Replace usages of get_node_group by get_item_group

This commit is contained in:
Elias Fleckenstein 2021-02-23 10:25:17 +01:00
parent 9caf6f2904
commit 2d4b8a8232
4 changed files with 4 additions and 4 deletions

View file

@ -210,7 +210,7 @@ function boat.on_step(self, dtime, moveresult)
if moveresult and moveresult.collides then
for _, collision in ipairs(moveresult.collisions) do
local pos = collision.node_pos
if collision.type == "node" and minetest.get_node_group(minetest.get_node(pos).name, "dig_by_boat") > 0 then
if collision.type == "node" and minetest.get_item_group(minetest.get_node(pos).name, "dig_by_boat") > 0 then
minetest.dig_node(pos)
end
end

View file

@ -617,7 +617,7 @@ minetest.register_entity("mcl_experience:bottle",{
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
local n = node.name
if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and minetest.get_node_group(n, "liquid") == 0 then
if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and minetest.get_item_group(n, "liquid") == 0 then
minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1})
mcl_experience.throw_experience(pos, math.random(3, 11))
self.object:remove()

View file

@ -142,7 +142,7 @@ minetest.register_entity(id.."_flying",{
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
local n = node.name
local g = minetest.get_node_group(n, "liquid")
local g = minetest.get_item_group(n, "liquid")
local d = 4
if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then
minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1})

View file

@ -64,7 +64,7 @@ function mcl_potions.register_splash(name, descr, color, def)
local pos = self.object:get_pos()
local node = minetest.get_node(pos)
local n = node.name
local g = minetest.get_node_group(n, "liquid")
local g = minetest.get_item_group(n, "liquid")
local d = 0.1
local redux_map = {7/8,0.5,0.25}
if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then