1
0
Fork 0
objects
AFCMS 2021-03-16 17:43:32 +01:00
parent 8f30e223e2
commit 6645c4cb30
9 changed files with 19 additions and 13 deletions

View File

@ -223,7 +223,7 @@ function boat.on_step(self, dtime, moveresult)
self._regen_timer = regen_timer
if moveresult and moveresult.collides then
for _, collision in ipairs(moveresult.collisions) do
for _, collision in pairs(moveresult.collisions) do
local pos = collision.node_pos
if collision.type == "node" and minetest.get_item_group(minetest.get_node(pos).name, "dig_by_boat") > 0 then
minetest.dig_node(pos)
@ -305,7 +305,7 @@ function boat.on_step(self, dtime, moveresult)
self._animation = 0
end
for _, obj in ipairs(minetest.get_objects_inside_radius(self.object:get_pos(), 1.3)) do
for _, obj in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 1.3)) do
local entity = obj:get_luaentity()
if entity and entity._cmi_is_mob then
attach_object(self, obj)

View File

@ -267,7 +267,7 @@ function mcl_burning.fire_entity_step(self, dtime)
if not parent or not mcl_burning.is_burning(parent) then
do_remove = true
else
for _, other in ipairs(minetest.get_objects_inside_radius(obj:get_pos(), 0)) do
for _, other in pairs(minetest.get_objects_inside_radius(obj:get_pos(), 0)) do
local luaentity = obj:get_luaentity()
if luaentity and luaentity.name == "mcl_burning:fire" and not luaentity.doing_step and not luaentity.removed then
do_remove = true

View File

@ -785,7 +785,7 @@ minetest.register_entity(":__builtin:item", {
if self.physical_state then
local own_stack = ItemStack(self.object:get_luaentity().itemstring)
-- Merge with close entities of the same item
for _, object in ipairs(minetest.get_objects_inside_radius(p, 0.8)) do
for _, object in pairs(minetest.get_objects_inside_radius(p, 0.8)) do
local obj = object:get_luaentity()
if obj and obj.name == "__builtin:item"
and obj.physical_state == false then

View File

@ -1,6 +1,8 @@
local PARTICLES_COUNT_RAIN = 30
local PARTICLES_COUNT_THUNDER = 45
local get_connected_players = minetest.get_connected_players
mcl_weather.rain = {
-- max rain particles created at time
particles_count = PARTICLES_COUNT_RAIN,
@ -36,7 +38,7 @@ mcl_weather.rain.set_sky_box = function()
{r=85, g=86, b=98},
{r=0, g=0, b=0}})
mcl_weather.skycolor.active = true
for _, player in ipairs(minetest.get_connected_players()) do
for _, player in pairs(get_connected_players()) do
player:set_clouds({color="#5D5D5FE8"})
end
end
@ -154,7 +156,7 @@ mcl_weather.rain.clear = function()
mcl_weather.rain.init_done = false
mcl_weather.rain.set_particles_mode("rain")
mcl_weather.skycolor.remove_layer("weather-pack-rain-sky")
for _, player in ipairs(minetest.get_connected_players()) do
for _, player in pairs(get_connected_players()) do
mcl_weather.rain.remove_sound(player)
mcl_weather.rain.remove_player(player)
end
@ -176,7 +178,7 @@ mcl_weather.rain.make_weather = function()
mcl_weather.rain.init_done = true
end
for _, player in ipairs(minetest.get_connected_players()) do
for _, player in pairs(get_connected_players()) do
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos())) then
mcl_weather.rain.remove_sound(player)
return false

View File

@ -43,7 +43,7 @@ mcl_weather.skycolor = {
-- Remove layer from colors table
remove_layer = function(layer_name)
for k, name in ipairs(mcl_weather.skycolor.layer_names) do
for k, name in pairs(mcl_weather.skycolor.layer_names) do
if name == layer_name then
table.remove(mcl_weather.skycolor.layer_names, k)
mcl_weather.skycolor.force_update = true

View File

@ -1,3 +1,5 @@
local get_connected_players = minetest.get_connected_players
mcl_weather.snow = {}
mcl_weather.snow.particles_count = 15
@ -37,7 +39,7 @@ mcl_weather.snow.set_sky_box = function()
{r=85, g=86, b=86},
{r=0, g=0, b=0}})
mcl_weather.skycolor.active = true
for _, player in ipairs(minetest.get_connected_players()) do
for _, player in pairs(get_connected_players()) do
player:set_clouds({color="#ADADADE8"})
end
mcl_weather.skycolor.active = true
@ -71,7 +73,7 @@ minetest.register_globalstep(function(dtime)
mcl_weather.snow.init_done = true
end
for _, player in ipairs(minetest.get_connected_players()) do
for _, player in pairs(get_connected_players()) do
if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos())) then
return false
end

View File

@ -1,3 +1,5 @@
local get_connected_players = minetest.get_connected_players
-- turn off lightning mod 'auto mode'
lightning.auto = false
@ -25,7 +27,7 @@ minetest.register_globalstep(function(dtime)
{r=40, g=40, b=40},
{r=0, g=0, b=0}})
mcl_weather.skycolor.active = true
for _, player in ipairs(minetest.get_connected_players()) do
for _, player in pairs(get_connected_players()) do
player:set_clouds({color="#3D3D3FE8"})
end
mcl_weather.thunder.init_done = true

View File

@ -118,7 +118,7 @@ local function get_entity_pos(pos, dir, double)
end
local function find_entity(pos)
for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 0)) do
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 0)) do
local luaentity = obj:get_luaentity()
if luaentity and luaentity.name == "mcl_chests:chest" then
return luaentity

View File

@ -52,7 +52,7 @@ minetest.register_globalstep(function(dtime)
compass_image = math.floor((angle_relative/11.25) + 0.5) % compass_frames
end
for j,stack in ipairs(player:get_inventory():get_list("main")) do
for j,stack in pairs(player:get_inventory():get_list("main")) do
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and
minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then
local itemname = "mcl_compass:"..compass_image