Skip to content

Instantly share code, notes, and snippets.

View sapier's full-sized avatar

sapier

View GitHub Profile
@sapier
sapier / gist:5959230
Last active December 19, 2015 12:59
Drawing of background/overlay/header/footer
texturepack --> file from texturepack
game --> file from game
default --> file from engine
Overlay/Background
---------------------------------------------------------------------------------
background false
if singleplayertab
@sapier
sapier / gist:5961251
Last active December 19, 2015 13:19
Formspec Menu TODO
Fixed but not merged:
1) server description not saved localy https://github.com/minetest/minetest/pull/824
2) "Configure" window doesnt work with -DRUN_IN_PLACE=0 https://github.com/minetest/minetest/pull/824
3) All the mods of modpacks are listed in the configure window. This really messes up the list when using modpacks like mesecons wich have a lot of mods.
4) Add Playernumber to favorites list
5) fix menu stuck if no internet connection by adding configurable curl timeout
6) the menu header is not drawn in other tabs than Singleplayer
Fixed but not pushed:
@sapier
sapier / gist:6030971
Last active December 19, 2015 22:58
Formspec Treeview proposal
treeview[<X>,<Y>;<W>,<H>;<name>;<transparent>;<selected>;<treedepth 1>:<iconimage 1>:<text 1>:<expanded 1>,<treedepth 2>:<iconimage 2>:<text 2>:<expanded 2> ... <treedepth n>:<iconimage n>:<text n>:<expanded n>]
^ x and y position the treeview relative to the top left of the menu
^ w and h are the size of the treeview
^ name fieldname sent to server on click value is element causing the event
: (or some other char) needs to be introduced as new separator and has to be escaped at least within treeview
For <treedepth>:<iconimage>:<text> following rules apply:
1) treedepth has to start with 1 for first element
diff --git a/src/server.cpp b/src/server.cpp
index c29ec3d..1798b3c 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -98,6 +98,8 @@ void * ServerThread::Thread()
BEGIN_DEBUG_EXCEPTION_HANDLER
+ f32 dedicated_server_step = g_settings->getFloat("dedicated_server_step");
+
diff --git a/src/server.cpp b/src/server.cpp
index c29ec3d..ff8c017 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -98,6 +98,8 @@ void * ServerThread::Thread()
BEGIN_DEBUG_EXCEPTION_HANDLER
+ f32 dedicated_server_step = g_settings->getFloat("dedicated_server_step");
+
if fields[installbtn] then
local modlistentry =
modstore.current_list.page * modstore.modsperpage + i
if modstore.modlist_unsorted.data[modlistentry] ~= nil and
modstore.modlist_unsorted.data[modlistentry].details ~= nil then
local moddetails = modstore.modlist_unsorted.data[modlistentry].details
local fullurl = engine.setting_get("modstore_download_url") ..
********************************************************************************
* *
* Advanced spawning mod (adv_spawning) 0.0.0 *
* *
* URL: http://github.com/sapier/adv_spawning *
* Author: sapier *
* *
********************************************************************************
function adv_spawning.quota_enter()
--ONLY enable this one if you're quite sure there aren't bugs in
--assert(adv_spawning.quota_starttime == nil)
if adv_spawning.quota_left <= 0 then
print("Quota: no time left: " .. adv_spawning.quota_left)
return false
end
adv_spawning.quota_starttime = adv_spawning.gettime()
return true
--------------------------------------------------------------------------------
-- @function [parent=#adv_spawning] check_light_around_voxel
-- @param pos position to validate
-- @param light_around light around definitions
-- @return true/false
--------------------------------------------------------------------------------
function adv_spawning.check_light_around_voxel(pos,light_around)
if light_around == nil then
return true
end
@sapier
sapier / gist:7863517
Last active March 9, 2022 00:44
Minetest get light from VoxelManip data
local light_lookup = {
{4250+125, 150},
{4500+125, 150},
{4750+125, 250},
{5000+125, 350},
{5250+125, 500},
{5500+125, 675},
{5750+125, 875},
{6000+125, 1000},
{6250+125, 1000}