From 912348aed8459f92dc72e37b43e9886b7d262b12 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 28 May 2017 09:57:55 +0200 Subject: [PATCH] :boom: :cat2: --- README.txt | 14 ++++++++++++++ init.lua | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 README.txt create mode 100644 init.lua diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..a3f1b7b --- /dev/null +++ b/README.txt @@ -0,0 +1,14 @@ + Minetest mod: sneak_glitch +============================ +This mod re-enables the sneak glitch in your Minetest world. +If you want to use the old sneak code, add the following setting +to your minetest.conf file: + + sneak_glitch.use_old_code = true + +In case you used the ingame command `/set` to apply this change, +you will have to rejoin the world. + + +License: CC0 +Dependencies: (none) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..f1ef406 --- /dev/null +++ b/init.lua @@ -0,0 +1,15 @@ +-- Enable the sneak glitch (horray!) + +local use_old_code = minetest.settings:get_bool("sneak_glitch.use_old_code") +if use_old_code == nil then + -- Default to the new sneak code + use_old_code = false +end + +minetest.register_on_joinplayer(function(player) + player:set_physics_override({ + sneak_glitch = true, + sneak = true, + new_move = not use_old_code + }) +end)