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
|
||||
function build_0gb_us.chunk_select(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())
|
||||
if not build_0gb_us.pos[name] then
|
||||
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")
|
||||
if file then
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local min, max = build_0gb_us.normalize(pos0, pos1)
|
||||
for line in file:lines() do
|
||||
local data = line:split(" ")
|
||||
|
@ -147,6 +147,9 @@ build_0gb_us = {
|
||||
local file = io.open(filename, "r")
|
||||
if file then
|
||||
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 update = {}
|
||||
for line in file:lines() do
|
||||
|
@ -1,25 +1,9 @@
|
||||
if minetest.setting_getbool("sudo.0gb.us") then
|
||||
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 privileges = minetest.setting_get("privileges.chatcommands.0gb.us")
|
||||
if privileges then
|
||||
local grantable = {}
|
||||
if privileges then
|
||||
for key, value in pairs(privileges:split(",")) do
|
||||
grantable[value] = true
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("grant", {
|
||||
params = "<name> <privilege>|all",
|
||||
description = "Give privilege to player",
|
||||
@ -105,8 +89,9 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("teleport", {
|
||||
minetest.register_chatcommand("teleport", {
|
||||
params = "<to_name>",
|
||||
description = "teleport to given player",
|
||||
privs = {teleport=true},
|
||||
@ -115,15 +100,28 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
||||
if location then
|
||||
coords = location:getpos()
|
||||
player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
player:setpos(coords)
|
||||
minetest.chat_send_player(name, "Teleported to "..param..".")
|
||||
else
|
||||
minetest.chat_send_player(name, 'Player "'..param..'" not found.')
|
||||
end
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("clearobjects", {
|
||||
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", {
|
||||
params = "",
|
||||
description = "clear all objects in loaded areas",
|
||||
privs = {server=true},
|
||||
@ -136,8 +134,7 @@ if minetest.setting_getbool("sudo.0gb.us") then
|
||||
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},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local pos = player:getpos()
|
||||
|
||||
if not landclaim_0gb_us.can_interact(name, pos) then
|
||||
|
@ -29,6 +29,9 @@ minetest.register_chatcommand("claim", {
|
||||
privs = {interact=true},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local pos = player:getpos()
|
||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||
local owner = landclaim_0gb_us.get_owner(pos)
|
||||
@ -55,6 +58,9 @@ minetest.register_chatcommand("unclaim", {
|
||||
privs = {interact=true},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local pos = player:getpos()
|
||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||
local owner = landclaim_0gb_us.get_owner(pos)
|
||||
@ -84,6 +90,9 @@ minetest.register_chatcommand("sharearea", {
|
||||
privs = {interact=true},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local pos = player:getpos()
|
||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||
local owner = landclaim_0gb_us.get_owner(pos)
|
||||
@ -114,6 +123,9 @@ minetest.register_chatcommand("unsharearea", {
|
||||
privs = {interact=true},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local pos = player:getpos()
|
||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||
local owner = landclaim_0gb_us.get_owner(pos)
|
||||
@ -146,6 +158,9 @@ minetest.register_chatcommand("mayedit", {
|
||||
local pos = minetest.string_to_pos(param)
|
||||
if not pos then
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
pos = player:getpos()
|
||||
pos.y = pos.y + .5 --compensated for Minetest's incorrect y coordinate for player objects
|
||||
end
|
||||
|
@ -3,6 +3,9 @@ minetest.register_chatcommand("claimdebug", {
|
||||
description = "debug command",
|
||||
privs = {interact=true},
|
||||
func = function(name, param)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
local pos = player:getpos()
|
||||
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)
|
||||
if teleport[name][warp] then
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
player:setpos(teleport[name][warp])
|
||||
minetest.chat_send_player(name, "Teleporting to "..warp)
|
||||
else
|
||||
@ -113,6 +116,9 @@ local function setnewwarp(name, warp)
|
||||
points_0gb_us.add_points(name, price.ore, -price.number)
|
||||
points_0gb_us.save(name)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
teleport[name][warp] = player:getpos()
|
||||
save(name)
|
||||
minetest.chat_send_player(name, 'Warp point "'..warp..'" added at current location.')
|
||||
@ -122,6 +128,9 @@ end
|
||||
local function setwarp(name, warp)
|
||||
if teleport[name][warp] then
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
teleport[name][warp] = player:getpos()
|
||||
save(name)
|
||||
minetest.chat_send_player(name, 'Warp point "'..warp..'" moved to current location.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user