Skip to content

Instantly share code, notes, and snippets.

View gist:c5fcb546a07964056572
minetest.register_craftitem("needbees:frame_blitz", {
inventory_image = "frame_blitz.png",
on_use = function(itemstack, user, pointed_thing)
local md = tonumber(itemstack:get_metadata()) or 0
md = md + 1
itemstack:set_metadata(md .. "")
print(itemstack:get_metadata()) -- Always prints '1'?
View gist:c2d1c3258d2b9dfac2a1
bool walking = movement_XZ && player->touching_ground;
bool swimming = (movement_XZ || movement_Y) && player->in_liquid);
const bool climbing = movement_Y && player->is_climbing;
if ((walking || swimming || climbing) &&
m_cache_view_bobbing &&
(!g_settings->getBool("free_move") || !m_gamedef->checkLocalPrivilege("fly")))
View gist:5386e4e1b38dbd6bff87
diff --git a/src/camera.cpp b/src/camera.cpp
index e5954a5..d680845 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -379,31 +379,36 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
my_cp.Y += 2;
// Calculate new position
- bool abort = false;
- for (int i = BS; i <= BS*2.75; i++)
View gist:7778f52aed3a18d349b3
In file included from /home/adam/Programs/buildat/src/impl/compress.cpp:7:0:
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:86:5: error: ‘z_const’ does not name a type
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:94:5: error: ‘z_const’ does not name a type
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:1025:29: error: ‘z_const’ has not been declared
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:1025:29: error: two or more data types in declaration of ‘parameter’
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:1349:32: error: expected initializer before ‘Z_ARG’
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:1673:5: error: ‘z_off64_t’ does not name a type
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:1748:15: error: ‘z_crc_t’ does not name a type
/home/adam/Programs/buildat/3rdparty/zlib/zlib.h:1758:44: error: expected initializer before ‘Z_ARG’
/home/adam/Programs/buildat/src/impl/compress.cpp: In function ‘void interface::compress_zlib(const ss_&, std::ostream&, int)’:
View gist:34358b9e90c4cf7e13dc
diff --git a/src/emerge.cpp b/src/emerge.cpp
index 443d703..95a0932 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -156,6 +156,11 @@ class EmergeThread : public JThread
mglist.clear();
delete biomedef;
+
+ if (params.sparams) {
View gist:11067037
00:26:44: ERROR[AsyncWorkerThread_0]: URL: servers.minetest.net/list
00:26:44: ERROR[AsyncWorkerThread_0]: Failed to parse json data * Line 1, Column 52182
00:26:44: ERROR[AsyncWorkerThread_0]: Missing ',' or '}' in object declaration
00:26:44: ERROR[AsyncWorkerThread_0]: data: "{"total_max":{"clients":256,"servers":38},"total":{"clients":107,"servers":31},"list":[{"clients_top":"47","damage":"true","gameid":"minetest","ip":"87.110.8.195","time":1397859876,"game_time":"2705760","clients_max":"50","key":"87.110.8.195:30000","password":"","pop_c":68467,"clients_list":["Guest5057","Guest1260","Guest7406","Guest5263","Guest8620","Guest3724","escuela","Corin","Guest1447","Guest6518","Guest8704","Caue","QossAy","donniecline","Guest5616","aaryn","prince","barsik"],"mods":["screwdriver","fire","external_legacy","dye","default","wool","farming","vessels","stairs","legacy","give_initial_stuff","flowers","doors","creative","bucket","bones"],"url":"","uptime":"96244","address":"87.110.8.195","dedicated":"true","first":
View gist:10991874
minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields["skins_set"] then
local event = minetest.exploce_textlist_event(fields["skins_set"])
if event.type == "CHG" then
local index = event.index
-- Apply skin here
end
end
end)
View gist:9773601
diff --git a/builtin/falling.lua b/builtin/falling.lua
index c8f3bc5..dc9e48e 100644
--- a/builtin/falling.lua
+++ b/builtin/falling.lua
@@ -181,8 +181,12 @@ function nodeupdate_single(p, delay)
if minetest.get_node_group(n.name, "attached_node") ~= 0 then
if not check_attached_node(p, n) then
- drop_attached_node(p)
- nodeupdate(p)
View gist:9097207
minetest.register_on_mapgen_init(function(params)
minetest.set_mapgen_params({
mgname = "v7",
seed = params.seed,
water_level = 1,
flags = {
trees = false,
caves = true,
flat = false,
dungeons = false,
View gist:8809700
(gdb) thread apply all bt
Thread 26 (Thread 0x7fffabfff700 (LWP 4418)):
#0 sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1 0x0000000000608bf7 in Event::wait (this=this@entry=0x11d1ba8) at /home/adam/Minetest/minetest/src/jthread/pthread/jevent.cpp:45
#2 0x00000000006f8f29 in EmergeThread::Thread (this=0x11d1ae0) at /home/adam/Minetest/minetest/src/emerge.cpp:468
#3 0x0000000000608f58 in JThread::TheThread (param=0x11d1ae0) at /home/adam/Minetest/minetest/src/jthread/pthread/jthread.cpp:203
#4 0x00007ffff69d5f8e in start_thread (arg=0x7fffabfff700) at pthread_create.c:311
#5 0x00007ffff55dda0d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113