Add changes from waspsaliva initial commit
This commit contains changes best credited to flyc0r
<flyc0r@localhost.localdomain>, although the changes were separated
out from waspsaliva's original initial commit rev. 0e9e1f352, which
added the files from DFC work tree, and squashed in numerous additions
by flyc0r and collaborators. That commit log:
commit 0e9e1f3528c3d2fa1f1e9a79d4a00576be8552f5
Author: flyc0r <flyc0r@localhost.localdomain>
Date: Sun Oct 4 03:37:08 2020 +0200
init
This rebase had the effect of griefing the git history xD, so
for example `git blame` of DFC and even upstream Minetest sources
appear to be originally authored by `flyc0r` in that commit.
To fix this, I will recommit only the changes onto the appropriate
commit in DFC, and recreate the following git history (incl. merges).
After this, the git history will be at least visually the same as the
original Waspsaliva, even if commit sha1sums have changed.
AFAICT, the closest commit from DFC was af085acbd. That commit was
found simply by running `git diff wsc-master <some_DFC_rev>`, and
locating the commit with the smallest number of differences.
This commit was then created as follows:
# Check out the DFC base commit
git checkout af085acbd
# Check out the *files* from WSC's initial commit
git checkout 0e9e1f352 -- .
# Make sure everything is added and commit the changes
git add -A
git commit
2020-10-04 03:37:08 +02:00
|
|
|
function sleep(s)
|
|
|
|
local ntime = os.clock() + s/10
|
|
|
|
repeat until os.clock() > ntime
|
|
|
|
end
|
|
|
|
|
2020-08-15 15:45:28 +02:00
|
|
|
minetest.register_chatcommand("findnodes", {
|
|
|
|
description = "Scan for one or multible nodes in a radius around you",
|
|
|
|
param = "<radius> <node1>[,<node2>...]",
|
|
|
|
func = function(param)
|
|
|
|
local radius = tonumber(param:split(" ")[1])
|
|
|
|
local nodes = param:split(" ")[2]:split(",")
|
|
|
|
local pos = minetest.localplayer:get_pos()
|
|
|
|
local fpos = minetest.find_node_near(pos, radius, nodes, true)
|
|
|
|
if fpos then
|
|
|
|
return true, "Found " .. table.concat(nodes, " or ") .. " at " .. minetest.pos_to_string(fpos)
|
|
|
|
end
|
|
|
|
return false, "None of " .. table.concat(nodes, " or ") .. " found in a radius of " .. tostring(radius)
|
|
|
|
end,
|
Add changes from waspsaliva initial commit
This commit contains changes best credited to flyc0r
<flyc0r@localhost.localdomain>, although the changes were separated
out from waspsaliva's original initial commit rev. 0e9e1f352, which
added the files from DFC work tree, and squashed in numerous additions
by flyc0r and collaborators. That commit log:
commit 0e9e1f3528c3d2fa1f1e9a79d4a00576be8552f5
Author: flyc0r <flyc0r@localhost.localdomain>
Date: Sun Oct 4 03:37:08 2020 +0200
init
This rebase had the effect of griefing the git history xD, so
for example `git blame` of DFC and even upstream Minetest sources
appear to be originally authored by `flyc0r` in that commit.
To fix this, I will recommit only the changes onto the appropriate
commit in DFC, and recreate the following git history (incl. merges).
After this, the git history will be at least visually the same as the
original Waspsaliva, even if commit sha1sums have changed.
AFAICT, the closest commit from DFC was af085acbd. That commit was
found simply by running `git diff wsc-master <some_DFC_rev>`, and
locating the commit with the smallest number of differences.
This commit was then created as follows:
# Check out the DFC base commit
git checkout af085acbd
# Check out the *files* from WSC's initial commit
git checkout 0e9e1f352 -- .
# Make sure everything is added and commit the changes
git add -A
git commit
2020-10-04 03:37:08 +02:00
|
|
|
})
|
2020-08-15 15:45:28 +02:00
|
|
|
|
|
|
|
minetest.register_chatcommand("place", {
|
|
|
|
params = "<X>,<Y>,<Z>",
|
|
|
|
description = "Place wielded item",
|
|
|
|
func = function(param)
|
|
|
|
local success, pos = minetest.parse_relative_pos(param)
|
|
|
|
if success then
|
|
|
|
minetest.place_node(pos)
|
|
|
|
return true, "Node placed at " .. minetest.pos_to_string(pos)
|
|
|
|
end
|
|
|
|
return false, pos
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_chatcommand("dig", {
|
|
|
|
params = "<X>,<Y>,<Z>",
|
|
|
|
description = "Dig node",
|
|
|
|
func = function(param)
|
|
|
|
local success, pos = minetest.parse_relative_pos(param)
|
|
|
|
if success then
|
|
|
|
minetest.dig_node(pos)
|
|
|
|
return true, "Node at " .. minetest.pos_to_string(pos) .. " dug"
|
|
|
|
end
|
|
|
|
return false, pos
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2020-08-22 13:51:50 +02:00
|
|
|
minetest.register_on_dignode(function(pos)
|
|
|
|
if minetest.settings:get_bool("replace") then
|
|
|
|
minetest.after(0, minetest.place_node, pos)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2020-08-16 20:34:32 +02:00
|
|
|
local etime = 0
|
|
|
|
|
|
|
|
minetest.register_globalstep(function(dtime)
|
Add changes from waspsaliva initial commit
This commit contains changes best credited to flyc0r
<flyc0r@localhost.localdomain>, although the changes were separated
out from waspsaliva's original initial commit rev. 0e9e1f352, which
added the files from DFC work tree, and squashed in numerous additions
by flyc0r and collaborators. That commit log:
commit 0e9e1f3528c3d2fa1f1e9a79d4a00576be8552f5
Author: flyc0r <flyc0r@localhost.localdomain>
Date: Sun Oct 4 03:37:08 2020 +0200
init
This rebase had the effect of griefing the git history xD, so
for example `git blame` of DFC and even upstream Minetest sources
appear to be originally authored by `flyc0r` in that commit.
To fix this, I will recommit only the changes onto the appropriate
commit in DFC, and recreate the following git history (incl. merges).
After this, the git history will be at least visually the same as the
original Waspsaliva, even if commit sha1sums have changed.
AFAICT, the closest commit from DFC was af085acbd. That commit was
found simply by running `git diff wsc-master <some_DFC_rev>`, and
locating the commit with the smallest number of differences.
This commit was then created as follows:
# Check out the DFC base commit
git checkout af085acbd
# Check out the *files* from WSC's initial commit
git checkout 0e9e1f352 -- .
# Make sure everything is added and commit the changes
git add -A
git commit
2020-10-04 03:37:08 +02:00
|
|
|
if not ( minetest.settings:get_bool("autotnt") or minetest.settings:get_bool("scaffold") or minetest.settings:get_bool("mscaffold") or minetest.settings:get_bool("highway_z") or minetest.settings:get_bool("block_water") ) then return end
|
|
|
|
--if true then return end
|
2020-08-16 20:34:32 +02:00
|
|
|
etime = etime + dtime
|
|
|
|
if etime < 1 then return end
|
|
|
|
local player = minetest.localplayer
|
2020-08-15 15:45:28 +02:00
|
|
|
if not player then return end
|
2020-08-16 16:39:29 +02:00
|
|
|
local pos = player:get_pos()
|
2020-08-16 20:34:32 +02:00
|
|
|
local item = player:get_wielded_item()
|
|
|
|
local def = minetest.get_item_def(item:get_name())
|
2020-08-20 18:29:36 +02:00
|
|
|
local nodes_per_tick = tonumber(minetest.settings:get("nodes_per_tick")) or 8
|
2020-08-16 20:34:32 +02:00
|
|
|
if item:get_count() > 0 and def.node_placement_prediction ~= "" then
|
2020-08-16 16:39:29 +02:00
|
|
|
if minetest.settings:get_bool("scaffold") then
|
|
|
|
minetest.place_node(vector.add(pos, {x = 0, y = -0.6, z = 0}))
|
Add changes from waspsaliva initial commit
This commit contains changes best credited to flyc0r
<flyc0r@localhost.localdomain>, although the changes were separated
out from waspsaliva's original initial commit rev. 0e9e1f352, which
added the files from DFC work tree, and squashed in numerous additions
by flyc0r and collaborators. That commit log:
commit 0e9e1f3528c3d2fa1f1e9a79d4a00576be8552f5
Author: flyc0r <flyc0r@localhost.localdomain>
Date: Sun Oct 4 03:37:08 2020 +0200
init
This rebase had the effect of griefing the git history xD, so
for example `git blame` of DFC and even upstream Minetest sources
appear to be originally authored by `flyc0r` in that commit.
To fix this, I will recommit only the changes onto the appropriate
commit in DFC, and recreate the following git history (incl. merges).
After this, the git history will be at least visually the same as the
original Waspsaliva, even if commit sha1sums have changed.
AFAICT, the closest commit from DFC was af085acbd. That commit was
found simply by running `git diff wsc-master <some_DFC_rev>`, and
locating the commit with the smallest number of differences.
This commit was then created as follows:
# Check out the DFC base commit
git checkout af085acbd
# Check out the *files* from WSC's initial commit
git checkout 0e9e1f352 -- .
# Make sure everything is added and commit the changes
git add -A
git commit
2020-10-04 03:37:08 +02:00
|
|
|
elseif minetest.settings:get_bool("mscaffold") then
|
|
|
|
--local z = pos.z
|
|
|
|
local positions = {
|
|
|
|
{x = 0, y = -0.6, z = 0},
|
|
|
|
{x = 1, y = -0.6, z = 0},
|
|
|
|
{x = -1, y = -0.6, z = 0},
|
|
|
|
|
|
|
|
{x = -1, y = -0.6, z = -1},
|
|
|
|
{x = 0, y = -0.6, z = -1},
|
|
|
|
{x = 1, y = -0.6, z = -1},
|
|
|
|
|
|
|
|
{x = -1, y = -0.6, z = 1},
|
|
|
|
{x = 0, y = -0.6, z = 1},
|
|
|
|
{x = 1, y = -0.6, z = 1}
|
|
|
|
|
|
|
|
}
|
|
|
|
for i, p in pairs(positions) do
|
|
|
|
if i > nodes_per_tick then return end
|
|
|
|
minetest.place_node(vector.add(pos,p))
|
|
|
|
end
|
|
|
|
|
2020-08-16 16:39:29 +02:00
|
|
|
elseif minetest.settings:get_bool("highway_z") then
|
|
|
|
local z = pos.z
|
|
|
|
local positions = {
|
|
|
|
{x = 0, y = 0, z = z},
|
|
|
|
{x = 1, y = 0, z = z},
|
|
|
|
{x = 2, y = 1, z = z},
|
|
|
|
{x = -2, y = 1, z = z},
|
|
|
|
{x = -2, y = 0, z = z},
|
|
|
|
{x = -1, y = 0, z = z},
|
|
|
|
{x = 2, y = 0, z = z}
|
|
|
|
}
|
|
|
|
for i, p in pairs(positions) do
|
2020-08-20 18:29:36 +02:00
|
|
|
if i > nodes_per_tick then break end
|
2020-08-16 16:39:29 +02:00
|
|
|
minetest.place_node(p)
|
|
|
|
end
|
2020-08-22 13:51:50 +02:00
|
|
|
elseif minetest.settings:get_bool("block_water") then
|
2020-08-16 18:09:27 +02:00
|
|
|
local positions = minetest.find_nodes_near(pos, 5, {"mcl_core:water_source", "mcl_core:water_floating"}, true)
|
2020-08-20 18:29:36 +02:00
|
|
|
for i, p in pairs(positions) do
|
|
|
|
if i > nodes_per_tick then break end
|
2020-08-16 16:39:29 +02:00
|
|
|
minetest.place_node(p)
|
|
|
|
end
|
2020-08-18 19:15:19 +02:00
|
|
|
elseif minetest.settings:get_bool("autotnt") then
|
|
|
|
local positions = minetest.find_nodes_near_under_air_except(pos, 5, item:get_name(), true)
|
2020-08-16 16:39:29 +02:00
|
|
|
for i, p in pairs(positions) do
|
2020-08-20 18:29:36 +02:00
|
|
|
if i > nodes_per_tick then break end
|
2020-08-16 18:09:27 +02:00
|
|
|
minetest.place_node(vector.add(p, {x = 0, y = 1, z = 0}))
|
2020-08-15 15:45:28 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
Add changes from waspsaliva initial commit
This commit contains changes best credited to flyc0r
<flyc0r@localhost.localdomain>, although the changes were separated
out from waspsaliva's original initial commit rev. 0e9e1f352, which
added the files from DFC work tree, and squashed in numerous additions
by flyc0r and collaborators. That commit log:
commit 0e9e1f3528c3d2fa1f1e9a79d4a00576be8552f5
Author: flyc0r <flyc0r@localhost.localdomain>
Date: Sun Oct 4 03:37:08 2020 +0200
init
This rebase had the effect of griefing the git history xD, so
for example `git blame` of DFC and even upstream Minetest sources
appear to be originally authored by `flyc0r` in that commit.
To fix this, I will recommit only the changes onto the appropriate
commit in DFC, and recreate the following git history (incl. merges).
After this, the git history will be at least visually the same as the
original Waspsaliva, even if commit sha1sums have changed.
AFAICT, the closest commit from DFC was af085acbd. That commit was
found simply by running `git diff wsc-master <some_DFC_rev>`, and
locating the commit with the smallest number of differences.
This commit was then created as follows:
# Check out the DFC base commit
git checkout af085acbd
# Check out the *files* from WSC's initial commit
git checkout 0e9e1f352 -- .
# Make sure everything is added and commit the changes
git add -A
git commit
2020-10-04 03:37:08 +02:00
|
|
|
end)
|
2020-08-15 15:45:28 +02:00
|
|
|
|
Add changes from waspsaliva initial commit
This commit contains changes best credited to flyc0r
<flyc0r@localhost.localdomain>, although the changes were separated
out from waspsaliva's original initial commit rev. 0e9e1f352, which
added the files from DFC work tree, and squashed in numerous additions
by flyc0r and collaborators. That commit log:
commit 0e9e1f3528c3d2fa1f1e9a79d4a00576be8552f5
Author: flyc0r <flyc0r@localhost.localdomain>
Date: Sun Oct 4 03:37:08 2020 +0200
init
This rebase had the effect of griefing the git history xD, so
for example `git blame` of DFC and even upstream Minetest sources
appear to be originally authored by `flyc0r` in that commit.
To fix this, I will recommit only the changes onto the appropriate
commit in DFC, and recreate the following git history (incl. merges).
After this, the git history will be at least visually the same as the
original Waspsaliva, even if commit sha1sums have changed.
AFAICT, the closest commit from DFC was af085acbd. That commit was
found simply by running `git diff wsc-master <some_DFC_rev>`, and
locating the commit with the smallest number of differences.
This commit was then created as follows:
# Check out the DFC base commit
git checkout af085acbd
# Check out the *files* from WSC's initial commit
git checkout 0e9e1f352 -- .
# Make sure everything is added and commit the changes
git add -A
git commit
2020-10-04 03:37:08 +02:00
|
|
|
minetest.register_cheat("mScaffold", "World", "mscaffold")
|
2020-08-15 15:45:28 +02:00
|
|
|
minetest.register_cheat("Scaffold", "World", "scaffold")
|
|
|
|
minetest.register_cheat("HighwayZ", "World", "highway_z")
|
2020-08-22 13:51:50 +02:00
|
|
|
minetest.register_cheat("BlockWater", "World", "block_water")
|
2020-08-18 19:15:19 +02:00
|
|
|
minetest.register_cheat("AutoTNT", "World", "autotnt")
|
2020-08-22 13:51:50 +02:00
|
|
|
minetest.register_cheat("Replace", "World", "replace")
|