From: oilboi <47129783+oilboi@users.noreply.github.com> Date: Wed, 15 Apr 2020 02:00:17 +0000 (-0400) Subject: Downgrade to stable version X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=e5c6e58aaadba17cb14efc83e973c39f41c5407d;p=crafter_client.git Downgrade to stable version --- diff --git a/player_input.lua b/player_input.lua index 43bebc4..fa9d218 100644 --- a/player_input.lua +++ b/player_input.lua @@ -11,6 +11,38 @@ local old_sneak = false local bunny_hop = false local old_bunny_hop = false +--0 is nothing +--1 is up +--2 is down +--4 is left +--8 is right +--16 is jump +--32 is auxilary +--64 is sneak +--128 is left click +--256 is right click + +--make the data from get_key_pressed usable +--Thanks Thou shalt use my mods! +function minetest.get_control_bits(player) + local input = player:get_key_pressed() + local input_table = {} + --iterate through the table using the highest value first + local keys = {"rightclick","leftclick","sneak","aux","jump","right","left","down","up"} + for index,data in pairs(keys) do + local modifier = math.pow(2, 9-index) + if input >= modifier then + input_table[data] = true + input = input - modifier + else + input_table[data] = false + end + end + return(input_table) +end + + + --attempt to tell the server to allow us to run local send_server_movement_state = function(state) player_movement_state:send_all(state) @@ -31,17 +63,22 @@ minetest.register_globalstep(function(dtime) return end - local input = minetest.localplayer:get_control() + --save this for the 5.3.0 version + --local input = minetest.localplayer:get_control() + local input = minetest.get_control_bits(minetest.localplayer) local vel = minetest.localplayer:get_velocity() local oldvel = minetest.localplayer:get_last_velocity() --cancel running if the player bumps into something + --save this for 5.3.0 + --[[ if running == true and ((vel.x == 0 and oldvel.x ~= 0) or (vel.z == 0 and oldvel.z ~= 0)) then running = false bunny_hop = false run_discharge_timer = 0 state = 0 end + ]]-- --reset the run flag if running == true and (input.up == false or input.sneak == true or input.down == true) then diff --git a/weather_handling.lua b/weather_handling.lua index d93ee57..17a95bc 100644 --- a/weather_handling.lua +++ b/weather_handling.lua @@ -33,7 +33,9 @@ local spawn_snow = function(player) for z,y in pairs(x_index) do if minetest.get_node_or_nil(vector.new(x,y+1,z)) ~= nil then local pos = vector.new(x,y+1,z) - local lightlevel = minetest.get_node_light(pos, 0.5) + --save this for 5.3.0 + --local lightlevel = minetest.get_node_light(pos, 0.5) + local lightlevel = 15 if lightlevel >= 14 then minetest.add_particlespawner({ amount = 1, @@ -88,7 +90,9 @@ local spawn_rain = function(player) for z,y in pairs(x_index) do if minetest.get_node_or_nil(vector.new(x,y+1,z)) ~= nil then local pos = vector.new(x,y+1,z) - local lightlevel = minetest.get_node_light(pos, 0.5) + --save this for 5.3.0 + --local lightlevel = minetest.get_node_light(pos, 0.5) + local lightlevel = 15 if lightlevel >= 14 then minetest.add_particlespawner({ amount = 1,