forked from MineClone5/MineClone5
Make it RUN under Minetest 5.1.1!!! :)
This commit is contained in:
parent
ce7a4fec3d
commit
0096100228
|
@ -107,7 +107,9 @@ minetest.register_globalstep(function(dtime)
|
||||||
|
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
|
|
||||||
if tick == true and pool[name] > 0 then
|
local pool_name = pool[name]
|
||||||
|
|
||||||
|
if tick == true and pool_name and pool_name > 0 then
|
||||||
minetest.sound_play("item_drop_pickup", {
|
minetest.sound_play("item_drop_pickup", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
gain = 0.7,
|
gain = 0.7,
|
||||||
|
|
|
@ -55,10 +55,16 @@ minetest.register_globalstep(function(dtime)
|
||||||
for p=1, #players do
|
for p=1, #players do
|
||||||
if players[p].set_moon then
|
if players[p].set_moon then
|
||||||
players[p]:set_moon(moon_arg)
|
players[p]:set_moon(moon_arg)
|
||||||
|
else
|
||||||
|
-- TODO: use old sky api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
if player.set_moon then
|
||||||
player:set_moon({texture = get_moon_texture(), scale=3.75})
|
player:set_moon({texture = get_moon_texture(), scale=3.75})
|
||||||
|
else
|
||||||
|
-- TODO: use old sky api
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -90,6 +90,11 @@ end
|
||||||
|
|
||||||
local function set_texture(player, index, texture)
|
local function set_texture(player, index, texture)
|
||||||
local textures = player_textures[player:get_player_name()]
|
local textures = player_textures[player:get_player_name()]
|
||||||
|
if not textures then
|
||||||
|
-- TODO: Check if minetest.register_on_joinplayer() shouldn't really work in minetest 5.1.1?
|
||||||
|
player_textures[player:get_player_name()] = {"blank.png", "blank.png", "blank.png"}
|
||||||
|
textures = player_textures[player:get_player_name()]
|
||||||
|
end
|
||||||
textures[index] = texture
|
textures[index] = texture
|
||||||
player:set_properties({textures = textures})
|
player:set_properties({textures = textures})
|
||||||
end
|
end
|
||||||
|
|
|
@ -277,6 +277,11 @@ minetest.register_globalstep(function(dtime)
|
||||||
local fly_node = minetest.get_node({x = fly_pos.x, y = fly_pos.y - 0.5, z = fly_pos.z}).name
|
local fly_node = minetest.get_node({x = fly_pos.x, y = fly_pos.y - 0.5, z = fly_pos.z}).name
|
||||||
local elytra = mcl_playerplus.elytra[player]
|
local elytra = mcl_playerplus.elytra[player]
|
||||||
|
|
||||||
|
if not elytra then
|
||||||
|
mcl_playerplus.elytra[player] = {}
|
||||||
|
elytra = mcl_playerplus.elytra[player]
|
||||||
|
end
|
||||||
|
|
||||||
elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra"
|
elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra"
|
||||||
and not player:get_attach()
|
and not player:get_attach()
|
||||||
and (elytra.active or control.jump and player_velocity.y < -6)
|
and (elytra.active or control.jump and player_velocity.y < -6)
|
||||||
|
@ -399,7 +404,8 @@ minetest.register_globalstep(function(dtime)
|
||||||
-- Update jump status immediately since we need this info in real time.
|
-- Update jump status immediately since we need this info in real time.
|
||||||
-- WARNING: This section is HACKY as hell since it is all just based on heuristics.
|
-- WARNING: This section is HACKY as hell since it is all just based on heuristics.
|
||||||
|
|
||||||
if mcl_playerplus_internal[name].jump_cooldown > 0 then
|
local mcl_playerplus_internal_name = mcl_playerplus_internal[name]
|
||||||
|
if mcl_playerplus_internal_name and mcl_playerplus_internal_name.jump_cooldown > 0 then
|
||||||
mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime
|
mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -614,6 +620,9 @@ minetest.register_globalstep(function(dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Update internal values
|
-- Update internal values
|
||||||
|
if not mcl_playerplus_internal[name] then
|
||||||
|
mcl_playerplus_internal[name] = {}
|
||||||
|
end
|
||||||
mcl_playerplus_internal[name].lastPos = pos
|
mcl_playerplus_internal[name].lastPos = pos
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue