Skip to content

Instantly share code, notes, and snippets.

🕹
Taking a break from Minetest until mid-December

ANAND ClobberXD

🕹
Taking a break from Minetest until mid-December
Block or report user

Report or block ClobberXD

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ClobberXD
ClobberXD / Entity.h
Created Aug 7, 2019
Quick, dirty alternative to RTTI
View Entity.h
enum EntityType { EntityType_Entity = 0, EntityType_Player, EntityType_Enemy };
class Entity
{
public:
Entity() : type(EntityType_Entity) {}
// This would generally be private, with a public getter
EntityType type;
};
@ClobberXD
ClobberXD / irc.md
Last active Jul 9, 2018 — forked from xero/irc.md
irc cheat sheet
View irc.md

IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
View schem_map.lua
local pos1 = ...
local pos2 = ...
local lvm = VoxelManip(lvm_p1, lvm_p2) -- or minetest.get_voxel_manip(pos1, pos2)
lvm:write_to_map(true)
@ClobberXD
ClobberXD / init.lua
Created May 17, 2018
minetest.send_join_message()
View init.lua
minetest.send_join_message = function(player_name)
return minetest.get_server_status() .. "\n Testing new status message!"
end
View minetest.after()
minetest.after(duration, function()
player:hud_remove(hud_bg)
player:hud_remove(hud_header)
player:hud_remove(hud_msg)
end)
View gist:6de70a7de43ff935df05da118939d140
core.register_chatcommand("hasprivs", {
params = "<priv>",
description = "Returns a list of all online players with the priv passed as param. e.g. /hasprivs fly",
privs = {server = true},
func = function(caller, param)
param = param:trim()
if param == "" then
return false, "Invalid parameters (see /help hasprivs)"
end
local param_privs = core.string_to_privs(param)
View gist:dac91fedd038a1ac6a5fa5468be08447
minetest.register_chatcommand("/p", {
params = "set/set1/set2/get",
description = "Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region",
privs = {worldedit=true},
func = function(name, param)
if param == "set" then --set both WorldEdit positions
worldedit.set_pos[name] = "pos1"
worldedit.player_notify(name, "select positions by punching two nodes")
elseif param == "set1" then --set WorldEdit position 1
worldedit.set_pos[name] = "pos1only"
@ClobberXD
ClobberXD / debug.txt
Last active Apr 11, 2018
debug.txt (latest run only) for debugging aluminium
View debug.txt
2018-04-11 07:18:41: INFO[Main]: Selected world: Aluminum [C:\Minetest\bin\..\worlds\Aluminum]
2018-04-11 07:18:41: INFO[Main]: SourceImageCache::getOrLoad(): Loading path "C:\Minetest\bin\..\textures\base\pack\progress_bar.png"
2018-04-11 07:18:41: INFO[Main]: SourceImageCache::getOrLoad(): Loading path "C:\Minetest\bin\..\textures\base\pack\progress_bar_bg.png"
2018-04-11 07:18:41: INFO[Main]: Attempting to use OpenAL audio
2018-04-11 07:18:41: INFO[Main]: Audio: Initializing...
2018-04-11 07:18:41: INFO[Main]: Audio: Initialized: OpenAL 1.1 ALSOFT 1.15.1, using OpenAL Soft
2018-04-11 07:18:41: INFO[Main]: Server created for gameid "minetest" in simple singleplayer mode
2018-04-11 07:18:41: INFO[Main]: - world: C:\Minetest\bin\..\worlds\Aluminum
2018-04-11 07:18:41: INFO[Main]: - game: C:\Minetest\bin\..\games\minetest_game
2018-04-11 07:18:41: INFO[Main]: Initializing world at C:\Minetest\bin\..\worlds\Aluminum
You can’t perform that action at this time.