Performed maintenance for ShadowNinja
* Added .gitignore * Added compatibility with the IRC plugin In the process, one minetest.conf setting was renamed, and another removed altogether. Other than that, 0gb.us_game should behave exactly as before.
This commit is contained in:
parent
44266e22c9
commit
40fc9e3f4f
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*~
|
||||||
|
Thumbs.db
|
||||||
|
|
@ -1,6 +1,9 @@
|
|||||||
if minetest.get_modpath("landclaim_0gb_us") then
|
if minetest.get_modpath("landclaim_0gb_us") then
|
||||||
function build_0gb_us.chunk_select(name)
|
function build_0gb_us.chunk_select(name)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pos = landclaim_0gb_us.get_chunk_center(player:getpos())
|
local pos = landclaim_0gb_us.get_chunk_center(player:getpos())
|
||||||
if not build_0gb_us.pos[name] then
|
if not build_0gb_us.pos[name] then
|
||||||
build_0gb_us.pos[name] = {}
|
build_0gb_us.pos[name] = {}
|
||||||
|
@ -25,6 +25,9 @@ function build_0gb_us.import_as_cobble(name, pos0, pos1, filename)
|
|||||||
local file = io.open(filename, "r")
|
local file = io.open(filename, "r")
|
||||||
if file then
|
if file then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local min, max = build_0gb_us.normalize(pos0, pos1)
|
local min, max = build_0gb_us.normalize(pos0, pos1)
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
local data = line:split(" ")
|
local data = line:split(" ")
|
||||||
|
@ -147,6 +147,9 @@ build_0gb_us = {
|
|||||||
local file = io.open(filename, "r")
|
local file = io.open(filename, "r")
|
||||||
if file then
|
if file then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local min, max = build_0gb_us.normalize(pos0, pos1)
|
local min, max = build_0gb_us.normalize(pos0, pos1)
|
||||||
local update = {}
|
local update = {}
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
|
@ -1,25 +1,9 @@
|
|||||||
if minetest.setting_getbool("sudo.0gb.us") then
|
local privileges = minetest.setting_get("privileges.chatcommands.0gb.us")
|
||||||
minetest.chatcommands.sudo_grant = minetest.chatcommands.grant
|
|
||||||
minetest.chatcommands.sudo_grant.privs.sudo = true
|
|
||||||
|
|
||||||
minetest.chatcommands.sudo_revoke = minetest.chatcommands.revoke
|
|
||||||
minetest.chatcommands.sudo_revoke.privs.sudo = true
|
|
||||||
|
|
||||||
minetest.chatcommands.sudo_teleport = minetest.chatcommands.teleport
|
|
||||||
minetest.chatcommands.sudo_teleport.privs.sudo = true
|
|
||||||
|
|
||||||
minetest.chatcommands.sudo_clearobjects = minetest.chatcommands.clearobjects
|
|
||||||
minetest.chatcommands.sudo_clearobjects.privs.sudo = true
|
|
||||||
|
|
||||||
minetest.register_privilege("sudo", "Can override the safeguards placed on commands")
|
|
||||||
local privileges = minetest.setting_get("privileges.sudo.0gb.us")
|
|
||||||
local grantable = {}
|
|
||||||
if privileges then
|
if privileges then
|
||||||
|
local grantable = {}
|
||||||
for key, value in pairs(privileges:split(",")) do
|
for key, value in pairs(privileges:split(",")) do
|
||||||
grantable[value] = true
|
grantable[value] = true
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_chatcommand("grant", {
|
minetest.register_chatcommand("grant", {
|
||||||
params = "<name> <privilege>|all",
|
params = "<name> <privilege>|all",
|
||||||
description = "Give privilege to player",
|
description = "Give privilege to player",
|
||||||
@ -105,6 +89,7 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_chatcommand("teleport", {
|
minetest.register_chatcommand("teleport", {
|
||||||
params = "<to_name>",
|
params = "<to_name>",
|
||||||
@ -115,6 +100,9 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
|||||||
if location then
|
if location then
|
||||||
coords = location:getpos()
|
coords = location:getpos()
|
||||||
player = minetest.env:get_player_by_name(name)
|
player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
player:setpos(coords)
|
player:setpos(coords)
|
||||||
minetest.chat_send_player(name, "Teleported to "..param..".")
|
minetest.chat_send_player(name, "Teleported to "..param..".")
|
||||||
else
|
else
|
||||||
@ -123,6 +111,16 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.chatcommands["give"] = nil
|
||||||
|
minetest.chatcommands["giveme"] = nil
|
||||||
|
minetest.chatcommands["spawnentity"] = nil
|
||||||
|
|
||||||
|
if not minetest.get_modpath("logpulverize_0gb_us") then
|
||||||
|
minetest.chatcommands["pulverize"] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.chatcommands["rollback"] = nil
|
||||||
|
|
||||||
minetest.register_chatcommand("clearobjects", {
|
minetest.register_chatcommand("clearobjects", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "clear all objects in loaded areas",
|
description = "clear all objects in loaded areas",
|
||||||
@ -137,7 +135,6 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
|
||||||
minetest.debug("[sudo_0gb_us]: Plugin loaded from\n"..minetest.get_modpath("sudo_0gb_us"))
|
minetest.debug("[chatcommands_0gb_us]: Plugin loaded from\n"..minetest.get_modpath("chatcommands_0gb_us"))
|
||||||
|
|
@ -6,6 +6,9 @@ minetest.register_chatcommand("drain", {
|
|||||||
privs = {drain=true},
|
privs = {drain=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
|
|
||||||
if not landclaim_0gb_us.can_interact(name, pos) then
|
if not landclaim_0gb_us.can_interact(name, pos) then
|
||||||
|
@ -29,6 +29,9 @@ minetest.register_chatcommand("claim", {
|
|||||||
privs = {interact=true},
|
privs = {interact=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||||
local owner = landclaim_0gb_us.get_owner(pos)
|
local owner = landclaim_0gb_us.get_owner(pos)
|
||||||
@ -55,6 +58,9 @@ minetest.register_chatcommand("unclaim", {
|
|||||||
privs = {interact=true},
|
privs = {interact=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||||
local owner = landclaim_0gb_us.get_owner(pos)
|
local owner = landclaim_0gb_us.get_owner(pos)
|
||||||
@ -84,6 +90,9 @@ minetest.register_chatcommand("sharearea", {
|
|||||||
privs = {interact=true},
|
privs = {interact=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||||
local owner = landclaim_0gb_us.get_owner(pos)
|
local owner = landclaim_0gb_us.get_owner(pos)
|
||||||
@ -114,6 +123,9 @@ minetest.register_chatcommand("unsharearea", {
|
|||||||
privs = {interact=true},
|
privs = {interact=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||||
local owner = landclaim_0gb_us.get_owner(pos)
|
local owner = landclaim_0gb_us.get_owner(pos)
|
||||||
@ -146,6 +158,9 @@ minetest.register_chatcommand("mayedit", {
|
|||||||
local pos = minetest.string_to_pos(param)
|
local pos = minetest.string_to_pos(param)
|
||||||
if not pos then
|
if not pos then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
pos = player:getpos()
|
pos = player:getpos()
|
||||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||||
end
|
end
|
||||||
|
@ -3,6 +3,9 @@ minetest.register_chatcommand("claimdebug", {
|
|||||||
description = "debug command",
|
description = "debug command",
|
||||||
privs = {interact=true},
|
privs = {interact=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||||
|
@ -81,6 +81,9 @@ end)
|
|||||||
local function warp(name, warp)
|
local function warp(name, warp)
|
||||||
if teleport[name][warp] then
|
if teleport[name][warp] then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
player:setpos(teleport[name][warp])
|
player:setpos(teleport[name][warp])
|
||||||
minetest.chat_send_player(name, "Teleporting to "..warp)
|
minetest.chat_send_player(name, "Teleporting to "..warp)
|
||||||
else
|
else
|
||||||
@ -113,6 +116,9 @@ local function setnewwarp(name, warp)
|
|||||||
points_0gb_us.add_points(name, price.ore, -price.number)
|
points_0gb_us.add_points(name, price.ore, -price.number)
|
||||||
points_0gb_us.save(name)
|
points_0gb_us.save(name)
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
teleport[name][warp] = player:getpos()
|
teleport[name][warp] = player:getpos()
|
||||||
save(name)
|
save(name)
|
||||||
minetest.chat_send_player(name, 'Warp point "'..warp..'" added at current location.')
|
minetest.chat_send_player(name, 'Warp point "'..warp..'" added at current location.')
|
||||||
@ -122,6 +128,9 @@ end
|
|||||||
local function setwarp(name, warp)
|
local function setwarp(name, warp)
|
||||||
if teleport[name][warp] then
|
if teleport[name][warp] then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return
|
||||||
|
end
|
||||||
teleport[name][warp] = player:getpos()
|
teleport[name][warp] = player:getpos()
|
||||||
save(name)
|
save(name)
|
||||||
minetest.chat_send_player(name, 'Warp point "'..warp..'" moved to current location.')
|
minetest.chat_send_player(name, 'Warp point "'..warp..'" moved to current location.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user