From 282af37555232ce569f3705b61a3219de527c0e0 Mon Sep 17 00:00:00 2001 From: epCode Date: Fri, 5 Feb 2021 19:44:41 -0800 Subject: [PATCH] Add some sneaking commentary --- mods/PLAYER/mcl_playerplus/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 9fa4d8f9..bf5dfdc4 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -33,12 +33,16 @@ minetest.register_globalstep(function(dtime) end if controls.sneak and player:get_attach() == nil then + -- controls head pitch when sneaking player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+36,0,0)) - if player:get_properties().collisionbox ~= {-0.35,0,-0.35,0.35,1.40,0.35} then + -- sets collisionbox, eye height, and nametag color accordingly + if player:get_properties().collisionbox ~= {-0.35,0,-0.35,0.35,1.35,0.35} then player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.35,0.35}, eye_height = 1.35, nametag_color = { r = 255, b = 225, a = 0, g = 225 }}) end else + -- controls head pitch when not sneaking player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,0,0)) + -- sets collisionbox, eye height, and nametag color accordingly if player:get_properties().collisionbox ~= {-0.35,0,-0.35,0.35,1.8,0.35} then player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.65, nametag_color = { r = 255, b = 225, a = 225, g = 225 }}) end