Use get instead of get_string

This commit is contained in:
AFCMS 2024-12-03 15:04:03 +01:00
parent bd1e50b007
commit 8e908870f9
No known key found for this signature in database
GPG key ID: 8720389A25B652E3

View file

@ -45,13 +45,13 @@ function mcl_gamemode.get_gamemode(player)
return "creative"
end
local gm = player:get_meta():get_string("gamemode")
if gm == "" then
player:get_meta():set_string("gamemode", "survival")
return "survival"
else
local gm = player:get_meta():get("gamemode")
if gm then
---@diagnostic disable-next-line: return-type-mismatch
return gm
else
player:get_meta():set_string("gamemode", "survival")
return "survival"
end
end