Make GitHub Actions Happy try 1

This commit is contained in:
Elias Fleckenstein 2020-12-12 13:58:46 +01:00
parent 8b58465aa1
commit f783f59392
10 changed files with 50 additions and 38 deletions

View File

@ -180,5 +180,5 @@ core.register_chatcommand("setpitch", {
end
})
core.register_list_command("xray", "Configure X-Ray", "xray_nodes")
core.register_list_command("search", "Configure NodeESP", "node_esp_nodes")
core.register_list_command("xray", "Configure X-Ray", "xray_nodes")
core.register_list_command("search", "Configure NodeESP", "node_esp_nodes")

View File

@ -55,4 +55,4 @@ core.cheats = {
function core.register_cheat(cheatname, category, func)
core.cheats[category] = core.cheats[category] or {}
core.cheats[category][cheatname] = func
end
end

View File

@ -36,4 +36,3 @@ core.register_chatcommand("respawn", {
end
end
})

View File

@ -60,7 +60,7 @@ function core.override_item(name, redefinition)
end
local nodedef = core.get_node_def(name)
table.combine(itemdef, nodedef)
for k, v in pairs(redefinition) do
rawset(itemdef, k, v)
end

View File

@ -13,13 +13,13 @@ function core.parse_pos(param)
return true, vector.round(p)
end
return false, "Invalid position (" .. param .. ")"
end
end
function core.parse_relative_pos(param)
local success, pos = core.parse_pos(param:gsub("~", "0"))
if success then pos = vector.round(vector.add(core.localplayer:get_pos(), pos)) end
return success, pos
end
end
function core.find_item(item, mini, maxi)
for index, stack in ipairs(core.get_inventory("current_player").main) do

View File

@ -516,6 +516,7 @@ function table.shuffle(t, from, to, random)
end
end
function table.combine(t, other)
other = other or {}
for k, v in pairs(other) do
@ -603,7 +604,7 @@ local function rgb_to_hex(rgb)
while(value > 0)do
local index = math.fmod(value, 16) + 1
value = math.floor(value / 16)
hex = string.sub('0123456789ABCDEF', index, index) .. hex
hex = string.sub('0123456789ABCDEF', index, index) .. hex
end
if(string.len(hex) == 0)then
@ -624,12 +625,12 @@ local function color_from_hue(hue)
local c = 255
local x = (1 - math.abs(h%2 - 1)) * 255
local i = math.floor(h);
local i = math.floor(h);
if (i == 0) then
return rgb_to_hex({c, x, 0})
elseif (i == 1) then
elseif (i == 1) then
return rgb_to_hex({x, c, 0})
elseif (i == 2) then
elseif (i == 2) then
return rgb_to_hex({0, c, x})
elseif (i == 3) then
return rgb_to_hex({0, x, c});
@ -649,9 +650,9 @@ function core.rainbow(input)
if char:match("%s") then
output = output .. char
else
output = output .. core.get_color_escape_sequence(color_from_hue(hue)) .. char
output = output .. core.get_color_escape_sequence(color_from_hue(hue)) .. char
end
hue = hue + step
hue = hue + step
end
return output
end

View File

@ -50,12 +50,12 @@ local function get_formspec(tabview, name, tabdata)
packages = filterlist.create(get_data, pkgmgr.compare_package,
is_equal, nil, {})
local filename = core.get_clientmodpath() .. DIR_DELIM .. "mods.conf"
local conffile = Settings(filename)
local mods = conffile:to_table()
for i = 1, #packages_raw do
local mod = packages_raw[i]
if mod.is_clientside and not mod.is_modpack then
@ -71,7 +71,7 @@ local function get_formspec(tabview, name, tabdata)
mods["load_mod_" .. mod.name] = nil
end
end
-- Remove mods that are not present anymore
for key in pairs(mods) do
if key:sub(1, 9) == "load_mod_" then
@ -211,24 +211,26 @@ local function handle_buttons(tabview, fields, tabname, tabdata)
local event = core.explode_table_event(fields["pkglist"])
tabdata.selected_pkg = event.row
local mod = packages:get_list()[tabdata.selected_pkg]
if event.type == "DCL" and mod.is_clientside then
pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}})
packages = nil
end
return true
end
if fields.btn_mod_mgr_mp_enable ~= nil or
fields.btn_mod_mgr_mp_disable ~= nil then
pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}}, fields.btn_mod_mgr_mp_enable ~= nil)
pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}},
fields.btn_mod_mgr_mp_enable ~= nil)
packages = nil
return true
end
if fields.btn_mod_mgr_enable_mod ~= nil or
fields.btn_mod_mgr_disable_mod ~= nil then
pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}}, fields.btn_mod_mgr_enable_mod ~= nil)
pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}},
fields.btn_mod_mgr_enable_mod ~= nil)
packages = nil
return true
end

View File

@ -3373,6 +3373,26 @@ void Game::readSettings()
m_does_lost_focus_pause_game = g_settings->getBool("pause_on_lost_focus");
}
bool Game::isKeyDown(GameKeyType k)
{
return input->isKeyDown(k);
}
bool Game::wasKeyDown(GameKeyType k)
{
return input->wasKeyDown(k);
}
bool Game::wasKeyPressed(GameKeyType k)
{
return input->wasKeyPressed(k);
}
bool Game::wasKeyReleased(GameKeyType k)
{
return input->wasKeyReleased(k);
}
/****************************************************************************/
/****************************************************************************
Shutdown / cleanup

View File

@ -792,22 +792,10 @@ public:
static void updateAllMapBlocksCallback(const std::string &setting_name, void *data);
void readSettings();
inline bool isKeyDown(GameKeyType k)
{
return input->isKeyDown(k);
}
inline bool wasKeyDown(GameKeyType k)
{
return input->wasKeyDown(k);
}
inline bool wasKeyPressed(GameKeyType k)
{
return input->wasKeyPressed(k);
}
inline bool wasKeyReleased(GameKeyType k)
{
return input->wasKeyReleased(k);
}
bool isKeyDown(GameKeyType k);
bool wasKeyDown(GameKeyType k);
bool wasKeyPressed(GameKeyType k);
bool wasKeyReleased(GameKeyType k);
#ifdef __ANDROID__
void handleAndroidChatInput();

View File

@ -58,7 +58,9 @@ public:
bool on_punchnode(v3s16 p, MapNode node);
bool on_placenode(const PointedThing &pointed, const ItemDefinition &item);
bool on_item_use(const ItemStack &item, const PointedThing &pointed);
bool on_recieve_physics_override(float override_speed, float override_jump, float override_gravity, bool sneak, bool sneak_glitch, bool new_move);
bool on_recieve_physics_override(float override_speed, float override_jump,
float override_gravity, bool sneak, bool sneak_glitch,
bool new_move);
bool on_play_sound(SimpleSoundSpec spec);
bool on_spawn_particle(struct ParticleParameters param);