Fix a bunch of deprecation warnings

This commit is contained in:
a-bad-dev 2026-01-22 20:21:43 -04:00
commit 9ebc01bf29
7 changed files with 34 additions and 31 deletions

View file

@ -1,3 +1,3 @@
min_minetest_version = 5.9.0 min_minetest_version = 5.9.0
name = Simple Shooter Game title = Simple Shooter Game
allowed_mapgens = singlenode allowed_mapgens = singlenode

View file

@ -148,7 +148,7 @@ function start_match(map) -- Start the match
for _, player in pairs(core.get_connected_players()) do for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name() local player_name = player:get_player_name()
inv = player:get_inventory() local inv = player:get_inventory()
inv:set_list("main", {}) inv:set_list("main", {})

View file

@ -50,7 +50,7 @@ end)
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
player_scope_huds[player:get_player_name()] = player:hud_add({ player_scope_huds[player:get_player_name()] = player:hud_add({
hud_elem_type = "image", type = "image",
alignment = { x=0.0, y=0.0 }, alignment = { x=0.0, y=0.0 },
position = {x = 0.5, y = 0.5}, position = {x = 0.5, y = 0.5},
scale = { x=2, y=2 }, scale = { x=2, y=2 },

View file

@ -130,7 +130,7 @@ local function update(player, settings)
if settings.type == TYPE_BUILTIN then if settings.type == TYPE_BUILTIN then
player:set_nametag_attributes({ player:set_nametag_attributes({
color = settings.color or {a=255, r=255, g=255, b=255}, color = {a=settings.color.a or 255, r=settings.color.r or 255, g=settings.color.g or 255, b=settings.color.b or 255},
bgcolor = {a=0, r=0, g=0, b=0}, bgcolor = {a=0, r=0, g=0, b=0},
}) })
elseif settings.type == TYPE_ENTITY then elseif settings.type == TYPE_ENTITY then
@ -162,6 +162,7 @@ function playertag.get_all()
end end
minetest.register_entity("playertag:tag", { minetest.register_entity("playertag:tag", {
initial_properties = {
visual = "sprite", visual = "sprite",
visual_size = {x=2.16, y=0.18, z=2.16}, --{x=1.44, y=0.12, z=1.44}, visual_size = {x=2.16, y=0.18, z=2.16}, --{x=1.44, y=0.12, z=1.44},
textures = {"blank.png"}, textures = {"blank.png"},
@ -186,6 +187,7 @@ minetest.register_entity("playertag:tag", {
end end
end end
end end
}
}) })
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)

View file

@ -1 +0,0 @@
hudbars?

View file

@ -37,7 +37,7 @@ minetest.register_on_joinplayer(function(player)
hb.init_hudbar(player, "sprint") hb.init_hudbar(player, "sprint")
else else
players[playerName].hud = player:hud_add({ players[playerName].hud = player:hud_add({
hud_elem_type = "statbar", type = "statbar",
position = {x=0.5,y=1}, position = {x=0.5,y=1},
size = {x=24, y=24}, size = {x=24, y=24},
text = "sprint_stamina_icon.png", text = "sprint_stamina_icon.png",
@ -70,14 +70,14 @@ minetest.register_globalstep(function(dtime)
--If the player is sprinting, create particles behind him/her --If the player is sprinting, create particles behind him/her
if playerInfo["sprinting"] == true and gameTime % 0.1 == 0 then if playerInfo["sprinting"] == true and gameTime % 0.1 == 0 then
local numParticles = math.random(1, 2) local numParticles = math.random(1, 2)
local playerPos = player:getpos() local playerPos = player:get_pos()
local playerNode = minetest.get_node({x=playerPos["x"], y=playerPos["y"]-1, z=playerPos["z"]}) local playerNode = minetest.get_node({x=playerPos["x"], y=playerPos["y"]-1, z=playerPos["z"]})
if playerNode["name"] ~= "air" then if playerNode["name"] ~= "air" then
for i=1, numParticles, 1 do for i=1, numParticles, 1 do
minetest.add_particle({ minetest.add_particle({
pos = {x=playerPos["x"]+math.random(-1,1)*math.random()/2,y=playerPos["y"]+0.1,z=playerPos["z"]+math.random(-1,1)*math.random()/2}, pos = {x=playerPos["x"]+math.random(-1,1)*math.random()/2,y=playerPos["y"]+0.1,z=playerPos["z"]+math.random(-1,1)*math.random()/2},
vel = {x=0, y=5, z=0}, velocity = {x=0, y=5, z=0},
acc = {x=0, y=-13, z=0}, acceleration = {x=0, y=-13, z=0},
expirationtime = math.random(), expirationtime = math.random(),
size = math.random()+0.5, size = math.random()+0.5,
collisiondetection = true, collisiondetection = true,

View file

@ -0,0 +1,2 @@
name = sprint
description = Slightly improved version of GunshipPenguin's sprint mod