Initial commit

master
Elias Fleckenstein 2021-11-15 19:19:31 +01:00
commit 24e0bb55e3
No known key found for this signature in database
GPG Key ID: 06927A5199D6C9B2
3 changed files with 61 additions and 0 deletions

2
README Normal file
View File

@ -0,0 +1,2 @@
# simpletp
A dragonfire CSM that includes some simple exploits to teleport to the nether, end or go back to the spawn location.

56
init.lua Normal file
View File

@ -0,0 +1,56 @@
local function tp_func(y, goal)
return function()
local player = minetest.localplayer
local pos = player:get_pos()
if pos.y < y then
return false, "Can't teleport to " .. goal .. " from this location."
end
pos.y = y
player:set_pos(pos)
return true
end
end
local function disconnect_wrapper(func)
return function()
local success, msg = func()
if success then
minetest.after(0, minetest.disconnect)
end
return success, msg
end
end
local function menu_wrapper(func)
return function()
local _, msg = func()
if msg then
minetest.display_chat_message(msg)
end
end
end
local end_func = tp_func(-27000, "End")
local nether_func = tp_func(-29000, "Nether")
local spawn_func = disconnect_wrapper(tp_func(-32000, "Spawn"))
minetest.register_chatcommand("end", {
description = "Teleport to the end (works in the overworld only). This may drop you above the void, so make sure you have Fly or Jetpack enabled.",
func = end_func,
})
minetest.register_chatcommand("nether", {
description = "Teleport to the nether (works in the overworld or the end). This may move you into solid blocks, so make sure you have a pickaxe ready or Noclip enabled.",
func = nether_func,
})
minetest.register_chatcommand("spawn", {
description = "Teleport to your spawn location. This will disconnect you, you have to reconnect afterwards.",
func = spawn_func,
})
minetest.register_cheat("End", "Exploit", menu_wrapper(end_func))
minetest.register_cheat("Nether", "Exploit", menu_wrapper(nether_func))
minetest.register_cheat("Spawn", "Exploit", menu_wrapper(spawn_func))

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = simpletp
author = Fleckenstein
description = A dragonfire CSM that includes some simple exploits to teleport to the nether, end or go back to the spawn location.