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")
function core.register_cheat(cheatname, category, func)
core.cheats[category] = core.cheats[category] or {}
core.cheats[category][cheatname] = func
-end
+end
end
local nodedef = core.get_node_def(name)
table.combine(itemdef, nodedef)
-
+
for k, v in pairs(redefinition) do
rawset(itemdef, k, v)
end
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
end
end
+
function table.combine(t, other)
other = other or {}
for k, v in pairs(other) do
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
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});
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
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
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
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
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
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();
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);