sorcery  Artifact [41dac58ae7]

Artifact 41dac58ae79b5316c3d1d151bc838f95512ce54eee4428b074fc3ec1fba64cac:


minetest.register_chatcommand('enchants', {
	description = 'Log information about the currently held object\'s enchantment';
	privs = { server = true };
	func = function(caller,params)
		local tool = minetest.get_player_by_name(caller):get_wielded_item()
		minetest.chat_send_player(caller, dump(sorcery.enchant.get(tool)))
		local binary = tool:get_meta():get_string('sorcery_enchantment_recs')
		local dumpout = ''
		for i=1,string.len(binary) do
			dumpout = dumpout .. string.format('%x%s',string.byte(binary,i),(i%16==0 and '\n') or ' ') 
		end
		print(dumpout)
	end;
})

-- minetest.register_chatcommand('hover', {
-- 	description = 'Test hover effect';
-- 	privs = { fly = true };
-- 	func = function(caller,params)
-- 		local player = minetest.get_player_by_name(caller)
-- 		late.new_effect(player, {
-- 			duration = 5;
-- 			fall = 5;
-- 			impacts = {
-- 				gravity = -0.1;
-- 			};
-- 		})
-- 	end;
-- })