From d0247f6b431693de0cbff5e10c4f157481e260c7 Mon Sep 17 00:00:00 2001 From: Fernando Zapata Date: Thu, 17 May 2012 20:39:51 -0600 Subject: [PATCH] some formatting and licensing information --- commands/init.lua | 9 +++++ farorb/init.lua | 29 ++++++++++++---- gemstones/init.lua | 86 +++++++++++++++++++++++++--------------------- tnt/init.lua | 11 ++++-- zlpdoors/init.lua | 17 +++++---- 5 files changed, 95 insertions(+), 57 deletions(-) diff --git a/commands/init.lua b/commands/init.lua index b69d98c..c8fb608 100644 --- a/commands/init.lua +++ b/commands/init.lua @@ -1,6 +1,13 @@ -------------------------------------------------------------------------------- -- Custom Commands +-------------------------------------------------------------------------------- +-- Many custom commands, currently includes: +-- /killme Suicide +-- -- (c)2012 Fernando Zapata +-- Code licensed under GNU GPLv2 +-- http://www.gnu.org/licenses/gpl-2.0.html +-- -- 2012-05-12 01:03:30 -------------------------------------------------------------------------------- @@ -13,4 +20,6 @@ minetest.register_chatcommand( 'killme', { end }) +print( ' ++ loaded : Custom Commands, by ZLovesPancakes' ) + -------------------------------------------------------------------------------- diff --git a/farorb/init.lua b/farorb/init.lua index 89d0409..f66d68b 100644 --- a/farorb/init.lua +++ b/farorb/init.lua @@ -1,11 +1,22 @@ -------------------------------------------------------------------------------- --- Magic Teleporting Ball +-- Farwalk Orb +-------------------------------------------------------------------------------- +-- Throw the orb to teleport to it's landing position. +-- -- (c)2012 Fernando Zapata (ZLovesPancakes, Franz.ZPT) +-- Code licensed under GNU GPLv2 +-- http://www.gnu.org/licenses/gpl-2.0.html +-- Content licensed under CC BY-SA 3.0 +-- http://creativecommons.org/licenses/by-sa/3.0/ -------------------------------------------------------------------------------- +------------------------------------------------------ Global Variables -------- + local V = 18 local G = 9 +------------------------------------------------------------ Definition -------- + local throw_orb = function( itemstack, user, pointed ) if itemstack:take_item() ~= nil then @@ -76,21 +87,25 @@ farorb_ent.on_step = function( self, dtime ) end +-------------------------------------------------------------- Register -------- + minetest.register_entity( 'farorb:farorb_ent', farorb_ent ) minetest.register_craftitem( 'farorb:farorb', { - description = 'Farwalk Orb', - inventory_image = 'farorb_farorb.png', - on_use = throw_orb + description = 'Farwalk Orb', + inventory_image = 'farorb_farorb.png', + on_use = throw_orb }) minetest.register_craft({ - output = 'farorb:farorb', - recipe = { + output = 'farorb:farorb', + recipe = { { '', 'default:glass', '' }, { 'default:glass', 'default:mese', 'default:glass' }, { '', 'default:glass', '' } } }) ------------------------------------------------------------ End of File -------- +print( ' ++ loaded : Farwalk Orb, by ZLovesPancakes' ) + +-------------------------------------------------------------------------------- diff --git a/gemstones/init.lua b/gemstones/init.lua index f91aabb..b543c2f 100644 --- a/gemstones/init.lua +++ b/gemstones/init.lua @@ -1,18 +1,20 @@ -------------------------------------------------------------------------------- --- Gemstones! +-- Gemstones! -------------------------------------------------------------------------------- --- This mod adds gems such as rubies, sapphires, emeralds, etc. Tools and --- "solid" blocks can be crafted from the gems. +-- This mod adds gems such as rubies, sapphires, emeralds, etc. Tools and +-- 'solid' blocks can be crafted from the gems. -- --- (c) 2011 Fernando Zapata --- Code now licensed under GNU GPLv2 --- Content licensed under CC BY-SA 3.0 +-- (c)2012 Fernando Zapata (ZLovesPancakes, Franz.ZPT) +-- Code licensed under GNU GPLv2 +-- http://www.gnu.org/licenses/gpl-2.0.html +-- Content licensed under CC BY-SA 3.0 +-- http://creativecommons.org/licenses/by-sa/3.0/ -- --- 2011-12-04 13:26:40 +-- 2011-12-04 13:26:40 -------------------------------------------------------------------------------- -- Name of the mod -- -gemsmodn = "gemstones" +gemsmodn = 'gemstones' -- List containing the names and quantity of the ores -- minerallist = {} @@ -25,17 +27,17 @@ minerallist = {} register_gem = function( modname, gemtype, rarity, basetime, durability, toolrules ) -- Ores -- - mineralname = modname .. ":mineral_" .. gemtype - mineraltex = "default_stone.png^" .. modname .. "_mineral_" .. gemtype .. ".png" + mineralname = modname .. ':mineral_'..gemtype + mineraltex = 'default_stone.png^'..modname..'_mineral_'..gemtype..'.png' -- Gems/lumps -- - gemname = modname .. ":gem_" .. gemtype - gemtex = modname .. "_gem_" .. gemtype .. ".png" + gemname = modname..':gem_'..gemtype + gemtex = modname..'_gem_'..gemtype..'.png' craftname = gemname -- Solid block -- - blockname = modname .. ":block_" .. gemtype - blocktex = modname .. "_block_" .. gemtype .. ".png" + blockname = modname..':block_'..gemtype + blocktex = modname..'_block_'..gemtype..'.png' table.insert( minerallist, { mineralname, rarity } ) @@ -46,27 +48,28 @@ register_gem = function( modname, gemtype, rarity, basetime, durability, toolrul -- Mineral block -- minetest.register_node( mineralname, { - description = 'Stone with ' .. gemtype, + description = 'Stone with '..gemtype, tile_images = { mineraltex }, is_ground_content = true, material = minetest.digprop_stonelike(1.0), groups = { cracky=3 }, - drop = craftname .. ' 1', + drop = craftname..' 1', } ) -- Solid block -- minetest.register_node( blockname, { - description = gemtype .. ' block', - --drawtype = "glasslike", + description = gemtype..' block', + --drawtype = 'glasslike', tile_images = { blocktex }, --alpha = 200, is_ground_content = true, groups = { cracky=2 } } ) - -- Tools, inspired by "add_tool" by MarkTraceur - --register_multitool( modname, gemtype, craftname, basetime, durability, toolrules ) + -- Tools, inspired by 'add_tool' by MarkTraceur + --register_multitool( modname, gemtype, craftname, basetime, durability, + -- toolrules ) -- Crafting blocks -- minetest.register_craft( { @@ -88,8 +91,8 @@ end ---- Create gems on chunk generation ------------------------------------------- -- celeron55 said: --- "It is somewhat doable, but not very fancily. Off the top of my head --- without any testing:" +-- 'It is somewhat doable, but not very fancily. Off the top of my head +-- without any testing:' -- + My fixes local generate_gem = function( minp, maxp ) for c, oreinfo in ipairs( minerallist ) do @@ -102,20 +105,25 @@ local generate_gem = function( minp, maxp ) z = math.random( minp.z, maxp.z ), } for i = -1, 1 do - for j = -1, 1 do - for k = -1, 1 do - if math.random() > 0.2 then - --continue - else - local p = { x=pos.x+i, y=pos.y+j, z=pos.z+k } - local n = minetest.env:get_node( p ) - if n.name == "default:stone" then - minetest.env:add_node( p, { name = oreinfo[1] } ) - end - end + for j = -1, 1 do + for k = -1, 1 do + if math.random() > 0.2 then + --continue + else + local p = { + x = pos.x + i, + y = pos.y + j, + z = pos.z + k + } + local n = minetest.env:get_node( p ) + if n.name == 'default:stone' then + minetest.env:add_node( p, { + name = oreinfo[1] } ) end end end + end + end end end end @@ -126,24 +134,24 @@ minetest.register_on_generated( generate_gem ) ---- Amethyst ---- -- Less durable but slightly faster than steel. -register_gem( gemsmodn, "amethyst", 5, 0.9, 250, { sword_time = 1 } ) +register_gem( gemsmodn, 'amethyst', 5, 0.9, 250, { sword_time = 1 } ) ---- Cubic Zirconia ---- -- Almost wood slow, but almost mese-like durability -register_gem( gemsmodn, "czirconia", 5, 1.6, 1000, { sword_time = 1 } ) +register_gem( gemsmodn, 'czirconia', 5, 1.6, 1000, { sword_time = 1 } ) ---- Emerald ---- -- Just a bit less durable than steel -register_gem( gemsmodn, "emerald", 5, 1.0, 300, { sword_time = 1 } ) +register_gem( gemsmodn, 'emerald', 5, 1.0, 300, { sword_time = 1 } ) ---- Ruby ---- -- Faster, but much less durable than steel -register_gem( gemsmodn, "ruby", 5, 0.7, 180, { sword_time = 1 } ) +register_gem( gemsmodn, 'ruby', 5, 0.7, 180, { sword_time = 1 } ) ---- Sapphire ---- -- Slow, but more durable than steel -register_gem( gemsmodn, "sapphire", 5, 1.2, 500, { sword_time = 1 } ) +register_gem( gemsmodn, 'sapphire', 5, 1.2, 500, { sword_time = 1 } ) ---- Was loaded? --------------------------------------------------------------- -- Just to be sure, may remove if you like. -print( " ++ loaded : Gemstones, by ZLovesPancakes" ) +print( ' ++ loaded : Gemstones, by ZLovesPancakes' ) diff --git a/tnt/init.lua b/tnt/init.lua index 873f5b0..4c63a89 100644 --- a/tnt/init.lua +++ b/tnt/init.lua @@ -1,7 +1,14 @@ -------------------------------------------------------------------------------- -- TNT +-------------------------------------------------------------------------------- +-- A simple TNT mod which damages both terrain and entities. +-- Based on bcmpinc's pull request. +-- -- (c)2012 Fernando Zapata (ZLovesPancakes, Franz.ZPT) --- Based on bcmpinc's pull request +-- Code licensed under GNU GPLv2 +-- http://www.gnu.org/licenses/gpl-2.0.html +-- Content licensed under CC BY-SA 3.0 +-- http://creativecommons.org/licenses/by-sa/3.0/ -------------------------------------------------------------------------------- local RANGE = 3 @@ -115,6 +122,6 @@ minetest.register_on_punchnode( function( pos, node ) end) ----------------------------------------------------------------- Debug -------- -print( '++ loaded: TNT, fixed by ZLovesPancakes' ) +print( ' ++ loaded : TNT, fixed by ZLovesPancakes' ) -------------------------------------------------------------------------------- diff --git a/zlpdoors/init.lua b/zlpdoors/init.lua index 44abf2e..8517d79 100644 --- a/zlpdoors/init.lua +++ b/zlpdoors/init.lua @@ -5,8 +5,10 @@ -- Now included with vainilla Minetest. -- -- (c) 2011-2012 Fernando Zapata --- Code now licensed under GNU GPLv2 +-- Code licensed under GNU GPLv2 +-- http://www.gnu.org/licenses/gpl-2.0.html -- Content licensed under CC BY-SA 3.0 +-- http://creativecommons.org/licenses/by-sa/3.0/ -- -- 2012-01-08 11:03:57 -------------------------------------------------------------------------------- @@ -16,10 +18,7 @@ local WALLMZ = 5 local WALLPX = 2 local WALLPZ = 4 --------------------------------------------------------------------------------- - - - +-------------------------------------------------------- Register Nodes -------- minetest.register_node( 'zlpdoors:door', { description = 'Door', @@ -103,7 +102,7 @@ minetest.register_node( 'zlpdoors:door_b_o', { drop = 'zlpdoors:door', }) --------------------------------------------------------------------------------- +----------------------------------------------------------- Definitions -------- local round = function( n ) if n >= 0 then @@ -204,12 +203,12 @@ local on_door_digged = function( pos, node, digger ) end end --------------------------------------------------------------------------------- +---------------------------------------------------- Register Functions -------- minetest.register_on_placenode( on_door_placed ) minetest.register_on_punchnode( on_door_punched ) minetest.register_on_dignode( on_door_digged ) --------------------------------------------------------------------------------- +print( ' ++ loaded : Doors, by ZLovesPancakes' ) -print( ' ++ loaded : Doors by ZLovesPancakes' ) +--------------------------------------------------------------------------------