v1.16.5 Cobblestone generation can be disabled, Teleporter bugfix

This commit is contained in:
Joachim Stolberg 2018-10-14 13:26:23 +02:00
parent 9a1ad7349f
commit 5d36b1f65c
7 changed files with 57 additions and 9 deletions

@ -68,6 +68,13 @@ TechPack supports the following mods:
- Hopper (Gravel Sieve)
- Mesecon (Mesecon Converter)
### Configuration
- Enable cobblestone generation (true/false)
If set to false, the lava/water cobblestone generator produces Basalt instead,
which can't be used by TechPack.
### License
Copyright (C) 2017-2018 Joachim Stolberg
Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt

@ -2,8 +2,18 @@
## V1.16.4 (2018-09-26)
## V1.16.5 (2018-10-14)
### Additions
- Cobblestone generation can be disabled via configuration
### Fixes
- Teleporter recursion bugfix
- tube bugfix
## V1.16.4 (2018-09-26)
### Additions
- Stopwatch function to SmartLine Controller added
@ -13,8 +23,8 @@
- Owner bugfix for the SmartLine Controller
## V1.16.3 (2018-09-26)
## V1.16.3 (2018-09-26)
### Changes
- Added further textures to the Gate Block
@ -23,7 +33,6 @@
## V1.16.2 (2018-09-22)
### Changes
- Futher improvement of the "sneak" button usage
@ -31,7 +40,6 @@
## V1.16.1 (2018-09-21)
### Additions
- Straight ahead tubes can be placed my means of the "sneak" button

@ -193,7 +193,7 @@ function tubelib.remove_node(pos)
Number2Pos[number] = {
pos = pos,
name = nil,
time = minetest.get_day_count() -- used for aging
time = minetest.get_day_count() -- used for reservation timeout
}
end
end

@ -77,7 +77,7 @@ function tubelib.get_neighbor_pos(pos, side)
if ndir then
npos, ndir = remote_node(npos, ndir)
end
return npos, ndir-1
return npos, (ndir or 1) -1
end
return npos, facedir
end

@ -10,6 +10,31 @@
]]--
local cobble_generator_enabled =
tonumber(minetest.setting_get("tubelib_addons1_cobble_generator_enabled")) or true
if not cobble_generator_enabled then
-- Replace default:stone with tubelib_addons1:basalt which is useless.
default.cool_lava = function(pos, node)
if node.name == "default:lava_source" then
minetest.set_node(pos, {name = "default:obsidian"})
else -- Lava flowing
minetest.set_node(pos, {name = "tubelib_addons1:basalt"})
end
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
minetest.register_node("tubelib_addons1:basalt", {
description = "Basalt",
tiles = {"default_obsidian.png^[brighten"},
groups = {cracky = 3, stone = 1},
drop = 'default:cobble',
sounds = default.node_sound_stone_defaults(),
})
end
dofile(minetest.get_modpath("tubelib_addons1") .. "/nodes.lua")
dofile(minetest.get_modpath("tubelib_addons1") .. "/quarry.lua")
dofile(minetest.get_modpath("tubelib_addons1") .. "/grinder.lua")

@ -0,0 +1,3 @@
# Cobble generator enabled (true/false)
tubelib_addons1_cobble_generator_enabled (Enable cobblestone generation) bool true

@ -21,7 +21,7 @@ local sForm = "size[7.5,3]"..
"button_exit[2,2;3,1;exit;Save]"
local function pairing(pos, channel)
if PairingList[channel] and pos ~= PairingList[channel] then
if PairingList[channel] and not vector.equals(pos, PairingList[channel]) then
-- store peer position on both nodes
local meta1 = minetest.get_meta(pos)
local peer = minetest.pos_to_string(PairingList[channel])
@ -115,14 +115,19 @@ minetest.register_craft({
},
})
-- recursion detection
local LastPeerPos = nil
tubelib.register_node("tubelib_addons3:teleporter", {}, {
on_push_item = function(pos, side, item)
-- push on peer side
local meta = minetest.get_meta(pos)
local peer = meta:get_string("peer")
if peer ~= "" then
return tubelib.push_items(minetest.string_to_pos(peer), "R", item, nil)
if peer ~= "" and peer ~= LastPeerPos then
LastPeerPos = peer
local res = tubelib.push_items(minetest.string_to_pos(peer), "R", item, nil)
LastPeerPos = nil
return res
end
return false
end,