Merge pull request #3 from sangeet79/master

Sangeet's merge request
This commit is contained in:
0siribix 2023-02-21 10:05:28 -06:00 committed by GitHub
commit 3a61a8aff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 25 additions and 43 deletions

View File

@ -1,6 +0,0 @@
default
moreblocks?
tubelib?
hopper?
pipeworks?

View File

@ -1 +0,0 @@
This mod includes a hammer to produce gravel from Cobblestone and a sieve to sift gravel to find ores.

View File

@ -48,21 +48,23 @@ local S = gravelsieve.S
dofile(minetest.get_modpath("gravelsieve") .. "/hammer.lua")
local settings_get
--[[local settings_get
if minetest.setting_get then
settings_get = minetest.setting_get
else
settings_get = function(...) return minetest.settings:get(...) end
end
gravelsieve.ore_rarity = tonumber(settings_get("gravelsieve_ore_rarity")) or 1.16
gravelsieve.ore_max_elevation = tonumber(settings_get("gravelsieve_ore_max_elevation")) or 0
gravelsieve.ore_min_elevation = tonumber(settings_get("gravelsieve_ore_min_elevation")) or -30912
]]--
gravelsieve.ore_rarity = tonumber(minetest.settings:get("gravelsieve_ore_rarity")) or 1.16
gravelsieve.ore_max_elevation = tonumber(minetest.settings:get("gravelsieve_ore_max_elevation")) or 0
gravelsieve.ore_min_elevation = tonumber(minetest.settings:get("gravelsieve_ore_min_elevation")) or -30912
local y_spread = math.max(1 + gravelsieve.ore_max_elevation - gravelsieve.ore_min_elevation, 1)
-- Increase the probability over the natural occurrence
local PROBABILITY_FACTOR = tonumber(settings_get("gravelsieve_probability_factor")) or 3
local PROBABILITY_FACTOR = tonumber(minetest.settings:get("gravelsieve_probability_factor")) or 3
local STEP_DELAY = tonumber(settings_get("gravelsieve_step_delay")) or 1.0
local STEP_DELAY = tonumber(minetest.settings:get("gravelsieve_step_delay")) or 1.0
-- tubelib aging feature
local AGING_LEVEL1 = nil

View File

View File

@ -123,7 +123,7 @@ local function place_entities(pos)
y = pos.y + height,
z = pos.z - values.dz * depth + values.rz * right})
objrefs[entity_name]:setyaw(values.yaw)
objrefs[entity_name]:set_yaw(values.yaw)
end
end
return objrefs

View File

@ -1 +1,2 @@
name=lcdlib
description=This LCD Lib is based on Display Lib and Font Lib from Pierre-Yves Rollo

View File

View File

@ -1,4 +0,0 @@
SaferLua [safer_lua], a subset of the language Lua for safe and secure Lua sandboxes

View File

@ -1 +1,2 @@
name=safer_lua
description=SaferLua [safer_lua], a subset of the language Lua for safe and secure Lua sandboxes

View File

@ -1,2 +1,2 @@
-- Battery capacity in usec CPU time
sl_controller.battery_capacity = tonumber(minetest.setting_get("battery_capacity")) or 5000000
sl_controller.battery_capacity = tonumber(minetest.settings:get("battery_capacity")) or 5000000

View File

@ -1,5 +0,0 @@
default
doors
tubelib
safer_lua

View File

@ -1,2 +0,0 @@
SaferLua Controller - a controller to be programmed in LUA

View File

@ -1 +1,3 @@
name=sl_controller
description=SaferLua Controller - a controller to be programmed in LUA
depends=default, doors, tubelib, safer_lua

View File

@ -1,7 +0,0 @@
default
doors
tubelib
lcdlib
sl_controller
mail?

View File

@ -1,2 +0,0 @@
SmartLine is a Tubelib extension with small and smart sensors, actors and controllers.

View File

@ -1 +1,4 @@
name=smartline
description=SmartLine is a Tubelib extension with small and smart sensors, actors and controllers.
depends=default, doors, tubelib, lcdlib, sl_controller
optional_depends=mail

View File

@ -75,32 +75,32 @@ local function get_node_lvm(pos)
end
local function add_pos(pos, player)
local lPos = minetest.deserialize(player:get_attribute("tubelib_forceload_blocks")) or {}
local lPos = minetest.deserialize(player:get_meta():get("tubelib_forceload_blocks")) or {}
if not in_list(lPos, pos) and #lPos < tubelib.max_num_forceload_blocks then
lPos[#lPos+1] = pos
player:set_attribute("tubelib_forceload_blocks", minetest.serialize(lPos))
player:get_meta():set_string("tubelib_forceload_blocks", minetest.serialize(lPos))
return true
end
return false
end
local function del_pos(pos, player)
local lPos = minetest.deserialize(player:get_attribute("tubelib_forceload_blocks")) or {}
local lPos = minetest.deserialize(player:get_meta():get("tubelib_forceload_blocks")) or {}
lPos = remove_list_elem(lPos, pos)
player:set_attribute("tubelib_forceload_blocks", minetest.serialize(lPos))
player:get_meta():set_string("tubelib_forceload_blocks", minetest.serialize(lPos))
end
local function get_pos_list(player)
return minetest.deserialize(player:get_attribute("tubelib_forceload_blocks")) or {}
return minetest.deserialize(player:get_meta():get("tubelib_forceload_blocks")) or {}
end
local function set_pos_list(player, lPos)
player:set_attribute("tubelib_forceload_blocks", minetest.serialize(lPos))
player:get_meta():set_string("tubelib_forceload_blocks", minetest.serialize(lPos))
end
local function get_data(pos, player)
local pos1, pos2 = calc_area(pos)
local num = #minetest.deserialize(player:get_attribute("tubelib_forceload_blocks")) or 0
local num = #minetest.deserialize(player:get_meta():get("tubelib_forceload_blocks")) or 0
local max = tubelib.max_num_forceload_blocks
return pos1, pos2, num, max
end

View File

@ -54,7 +54,7 @@ function tubelib.mark_region(name, pos1, pos2)
visual_size={x=sizez * 2, y=sizey * 2},
collisionbox = {-thickness, -sizey, -sizez, thickness, sizey, sizez},
})
marker:setyaw(math.pi / 2)
marker:set_yaw(math.pi / 2)
marker:get_luaentity().player_name = name
table.insert(markers, marker)
end