Compare commits
	
		
			111 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 90aaa1fb62 | ||
|  | 6c70e0295a | ||
|  | 230747c748 | ||
|  | 86cff038a4 | ||
|  | 0823f16acb | ||
|  | e1d17b1747 | ||
|  | 2817db19d4 | ||
|  | 716397819d | ||
|  | 67fa74ac01 | ||
|  | d5cc51a396 | ||
|  | cd604fa9c8 | ||
|  | 686c0d087c | ||
|  | c27afe7ee8 | ||
|  | 9e23e9ecbf | ||
|  | 97db50a2fe | ||
|  | a0ba7cf973 | ||
|  | c1b1f2aa49 | ||
|  | 0beabfc755 | ||
|  | 5fa8852115 | ||
|  | 0eb46a01ff | ||
|  | de8726a9f7 | ||
|  | 33ec25caed | ||
|  | deb39ddcd4 | ||
|  | 2d1e7463d3 | ||
|  | 7505fbce51 | ||
|  | 9232734a48 | ||
|  | 1bf62bbad4 | ||
|  | 95cbfc50d8 | ||
|  | 61e60724f6 | ||
|  | 8c977451a8 | ||
|  | 73d078fd27 | ||
|  | 0636d574af | ||
|  | c4f2bee9a6 | ||
|  | 4763fa635a | ||
|  | 3928eccf74 | ||
|  | 5311c6ec96 | ||
|  | 91937acf76 | ||
|  | e7b4b2ba57 | ||
|  | 89fb5aed7f | ||
|  | df54836ea0 | ||
|  | f2a67871d2 | ||
|  | c3eaa9cd64 | ||
|  | d39044a2a7 | ||
|  | 8a6b2df6b1 | ||
|  | bed848f68a | ||
|  | 24939c299b | ||
|  | 24d8d79ea1 | ||
|  | cb4bfa51a1 | ||
|  | 7a01de2f36 | ||
|  | c7a4a68d28 | ||
|  | 91da5d1308 | ||
|  | 39e4bf0346 | ||
|  | dce87664d2 | ||
|  | b97400d71d | ||
|  | abaf4c5121 | ||
|  | 609646b9b5 | ||
|  | 04d40a5ce4 | ||
|  | 24781813fa | ||
|  | 0057a87b99 | ||
|  | dfa0f096ce | ||
|  | e9ad8d06c8 | ||
|  | 0495f9e209 | ||
|  | 2ff55cf6cc | ||
|  | d0638d7284 | ||
|  | 6687b5504d | ||
|  | c455ba9b68 | ||
|  | 165da9348a | ||
|  | fb8144f703 | ||
|  | df2fdba2b4 | ||
|  | 3a7cbfc531 | ||
|  | 2768d4974b | ||
|  | d317d7b80b | ||
|  | 91ee23d61b | ||
|  | df3a694099 | ||
|  | d75b39683a | ||
|  | 68020d2e93 | ||
|  | f1a447d1fe | ||
|  | 30d582296b | ||
|  | 36c17b04fe | ||
|  | ff9e2a75ee | ||
|  | 5497db98de | ||
|  | 4a68126a2b | ||
|  | 5ce918059d | ||
|  | e0fe1a08c5 | ||
|  | 25a6cd866b | ||
|  | 0ed7ccfc1f | ||
|  | e5502c9415 | ||
|  | e5e62f9085 | ||
|  | a8a204ae39 | ||
|  | a399f648e7 | ||
|  | 87a1e37d34 | ||
|  | 6ad1d56b3d | ||
|  | d3d3e76447 | ||
|  | 794c68b32b | ||
|  | 0722c8064b | ||
|  | d98eab6a84 | ||
|  | 61a9bb2b47 | ||
|  | 32ee20ebe7 | ||
|  | 937ec64ee6 | ||
|  | 7db7ea543f | ||
|  | 319ac40fa5 | ||
|  | cd4e86773f | ||
|  | 8643caac3c | ||
|  | 81afea1c00 | ||
|  | a29819ebee | ||
|  | 6de625c67f | ||
|  | e550a0e26f | ||
|  | 8739c4e737 | ||
|  | 3ea6096a7a | ||
|  | f2916c0a31 | ||
|  | c7b624d67c | 
| @@ -6,7 +6,7 @@ To build the wholeness of the Minetest project, insert this repository as | ||||
| in the Minetest Engine. | ||||
|  | ||||
| The Minetest Engine can be found in: | ||||
|   https://github.com/celeron55/minetest/ | ||||
|   https://github.com/minetest/minetest/ | ||||
|  | ||||
| Compatibility | ||||
| -------------- | ||||
| @@ -17,7 +17,7 @@ Additionally, when the minetest engine is tagged to be a certain version (eg. | ||||
| 0.4.dev-20120326), minetest_game is tagged with the version too. | ||||
|  | ||||
| When stable releases are made, minetest_game is packaged and made available in | ||||
|   https://github.com/celeron55/minetest_game/downloads | ||||
|   http://minetest.net/download.php | ||||
| and in case the repository has grown too much, it may be reset. In that sense, | ||||
| this is not a "real" git repository. (Package maintainers please note!) | ||||
|  | ||||
|   | ||||
| @@ -40,14 +40,21 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image) | ||||
| 				if pointed_thing.type ~= "node" then | ||||
| 					return | ||||
| 				end | ||||
| 				-- Check if pointing to a liquid | ||||
| 				-- Check if pointing to a buildable node | ||||
| 				n = minetest.env:get_node(pointed_thing.under) | ||||
| 				if bucket.liquids[n.name] == nil then | ||||
| 					-- Not a liquid | ||||
| 					minetest.env:add_node(pointed_thing.above, {name=source}) | ||||
| 				elseif n.name ~= source then | ||||
| 					-- It's a liquid | ||||
| 				if minetest.registered_nodes[n.name].buildable_to then | ||||
| 					-- buildable; replace the node | ||||
| 					minetest.env:add_node(pointed_thing.under, {name=source}) | ||||
| 				else | ||||
| 					-- not buildable to; place the liquid above | ||||
| 					-- check if the node above can be replaced | ||||
| 					n = minetest.env:get_node(pointed_thing.above) | ||||
| 					if minetest.registered_nodes[n.name].buildable_to then | ||||
| 						minetest.env:add_node(pointed_thing.above,{name=source}) | ||||
| 					else | ||||
| 						-- do not remove the bucket with the liquid | ||||
| 						return | ||||
| 					end | ||||
| 				end | ||||
| 				return {name="bucket:bucket_empty"} | ||||
| 			end | ||||
| @@ -56,6 +63,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image) | ||||
| end | ||||
|  | ||||
| minetest.register_craftitem("bucket:bucket_empty", { | ||||
| 	description = "Empty Bucket", | ||||
| 	inventory_image = "bucket.png", | ||||
| 	stack_max = 1, | ||||
| 	liquids_pointable = true, | ||||
|   | ||||
							
								
								
									
										22
									
								
								mods/creative/README.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,22 @@ | ||||
| Minetest 0.4 mod: creative | ||||
| ========================== | ||||
|  | ||||
| Implements creative mode. | ||||
|  | ||||
| Switch on by using the "creative_mode" setting. | ||||
|  | ||||
| Registered items that | ||||
| - have a description, and | ||||
| - do not have the group not_in_creative_inventory | ||||
| are added to the creative inventory. | ||||
|  | ||||
| License of source code and media files: | ||||
| --------------------------------------- | ||||
| Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com> | ||||
|  | ||||
| This program is free software. It comes without any warranty, to | ||||
| the extent permitted by applicable law. You can redistribute it | ||||
| and/or modify it under the terms of the Do What The Fuck You Want | ||||
| To Public License, Version 2, as published by Sam Hocevar. See | ||||
| http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
|  | ||||
							
								
								
									
										1
									
								
								mods/creative/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1 @@ | ||||
| default | ||||
							
								
								
									
										162
									
								
								mods/creative/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,162 @@ | ||||
| -- minetest/creative/init.lua | ||||
|  | ||||
| local creative_inventory = {} | ||||
| creative_inventory.creative_inventory_size = 0 | ||||
|  | ||||
| -- Create detached creative inventory after loading all mods | ||||
| minetest.after(0, function() | ||||
| 	local inv = minetest.create_detached_inventory("creative", { | ||||
| 		allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) | ||||
| 			if minetest.setting_getbool("creative_mode") then | ||||
| 				return count | ||||
| 			else | ||||
| 				return 0 | ||||
| 			end | ||||
| 		end, | ||||
| 		allow_put = function(inv, listname, index, stack, player) | ||||
| 			return 0 | ||||
| 		end, | ||||
| 		allow_take = function(inv, listname, index, stack, player) | ||||
| 			if minetest.setting_getbool("creative_mode") then | ||||
| 				return -1 | ||||
| 			else | ||||
| 				return 0 | ||||
| 			end | ||||
| 		end, | ||||
| 		on_move = function(inv, from_list, from_index, to_list, to_index, count, player) | ||||
| 		end, | ||||
| 		on_put = function(inv, listname, index, stack, player) | ||||
| 		end, | ||||
| 		on_take = function(inv, listname, index, stack, player) | ||||
| 			print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack)) | ||||
| 			if stack then | ||||
| 				print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count())) | ||||
| 			end | ||||
| 		end, | ||||
| 	}) | ||||
| 	local creative_list = {} | ||||
| 	for name,def in pairs(minetest.registered_items) do | ||||
| 		if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) | ||||
| 				and def.description and def.description ~= "" then | ||||
| 			table.insert(creative_list, name) | ||||
| 		end | ||||
| 	end | ||||
| 	table.sort(creative_list) | ||||
| 	inv:set_size("main", #creative_list) | ||||
| 	for _,itemstring in ipairs(creative_list) do | ||||
| 		inv:add_item("main", ItemStack(itemstring)) | ||||
| 	end | ||||
| 	creative_inventory.creative_inventory_size = #creative_list | ||||
| 	print("creative inventory size: "..dump(creative_inventory.creative_inventory_size)) | ||||
| end) | ||||
|  | ||||
| -- Create the trash field | ||||
| local trash = minetest.create_detached_inventory("creative_trash", { | ||||
| 	-- Allow the stack to be placed and remove it in on_put() | ||||
| 	-- This allows the creative inventory to restore the stack | ||||
| 	allow_put = function(inv, listname, index, stack, player) | ||||
| 		if minetest.setting_getbool("creative_mode") then | ||||
| 			return stack:get_count() | ||||
| 		else | ||||
| 			return 0 | ||||
| 		end | ||||
| 	end, | ||||
| 	on_put = function(inv, listname, index, stack, player) | ||||
| 		inv:set_stack(listname, index, "") | ||||
| 	end, | ||||
| }) | ||||
| trash:set_size("main", 1) | ||||
|  | ||||
|  | ||||
| creative_inventory.set_creative_formspec = function(player, start_i, pagenum) | ||||
| 	pagenum = math.floor(pagenum) | ||||
| 	local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1) | ||||
| 	player:set_inventory_formspec("size[13,7.5]".. | ||||
| 			--"image[6,0.6;1,2;player.png]".. | ||||
| 			"list[current_player;main;5,3.5;8,4;]".. | ||||
| 			"list[current_player;craft;8,0;3,3;]".. | ||||
| 			"list[current_player;craftpreview;12,1;1,1;]".. | ||||
| 			"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. | ||||
| 			"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. | ||||
| 			"button[0.3,6.5;1.6,1;creative_prev;<<]".. | ||||
| 			"button[2.7,6.5;1.6,1;creative_next;>>]".. | ||||
| 			"label[5,1.5;Trash:]".. | ||||
| 			"list[detached:creative_trash;main;5,2;1,1;]") | ||||
| end | ||||
| minetest.register_on_joinplayer(function(player) | ||||
| 	-- If in creative mode, modify player's inventory forms | ||||
| 	if not minetest.setting_getbool("creative_mode") then | ||||
| 		return | ||||
| 	end | ||||
| 	creative_inventory.set_creative_formspec(player, 0, 1) | ||||
| end) | ||||
| minetest.register_on_player_receive_fields(function(player, formname, fields) | ||||
| 	if not minetest.setting_getbool("creative_mode") then | ||||
| 		return | ||||
| 	end | ||||
| 	-- Figure out current page from formspec | ||||
| 	local current_page = 0 | ||||
| 	local formspec = player:get_inventory_formspec() | ||||
| 	local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]") | ||||
| 	start_i = tonumber(start_i) or 0 | ||||
|  | ||||
| 	if fields.creative_prev then | ||||
| 		start_i = start_i - 4*6 | ||||
| 	end | ||||
| 	if fields.creative_next then | ||||
| 		start_i = start_i + 4*6 | ||||
| 	end | ||||
|  | ||||
| 	if start_i < 0 then | ||||
| 		start_i = start_i + 4*6 | ||||
| 	end | ||||
| 	if start_i >= creative_inventory.creative_inventory_size then | ||||
| 		start_i = start_i - 4*6 | ||||
| 	end | ||||
| 		 | ||||
| 	if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then | ||||
| 		start_i = 0 | ||||
| 	end | ||||
|  | ||||
| 	creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1) | ||||
| end) | ||||
|  | ||||
| if minetest.setting_getbool("creative_mode") then | ||||
| 	 | ||||
| 	minetest.register_item(":", { | ||||
| 		type = "none", | ||||
| 		wield_image = "wieldhand.png", | ||||
| 		wield_scale = {x=1,y=1,z=2.5}, | ||||
| 		tool_capabilities = { | ||||
| 			full_punch_interval = 0.5, | ||||
| 			max_drop_level = 3, | ||||
| 			groupcaps = { | ||||
| 				crumbly = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3}, | ||||
| 				cracky = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3}, | ||||
| 				snappy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3}, | ||||
| 				choppy = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3}, | ||||
| 				oddly_breakable_by_hand = {times={[1]=0.5, [2]=0.5, [3]=0.5}, uses=0, maxlevel=3}, | ||||
| 			} | ||||
| 		} | ||||
| 	}) | ||||
| 	 | ||||
| 	minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) | ||||
| 		return true | ||||
| 	end) | ||||
| 	 | ||||
| 	function minetest.handle_node_drops(pos, drops, digger) | ||||
| 		if not digger or not digger:is_player() then | ||||
| 			return | ||||
| 		end | ||||
| 		local inv = digger:get_inventory() | ||||
| 		if inv then | ||||
| 			for _,item in ipairs(drops) do | ||||
| 				item = ItemStack(item):get_name() | ||||
| 				if not inv:contains_item("main", item) then | ||||
| 					inv:add_item("main", item) | ||||
| 				end | ||||
| 			end | ||||
| 		end | ||||
| 	end | ||||
| 	 | ||||
| end | ||||
| @@ -47,7 +47,6 @@ Cisoun's WTFPL texture pack: | ||||
|   default_tool_mesepick.png | ||||
|   default_tool_steelpick.png | ||||
|   default_tool_steelshovel.png | ||||
|   default_tool_steelsword.png | ||||
|   default_tool_stonepick.png | ||||
|   default_tool_stoneshovel.png | ||||
|   default_tool_woodpick.png | ||||
| @@ -61,4 +60,36 @@ Originating from G4JC's Almost MC Texture Pack: | ||||
|   default_torch.png | ||||
|   default_torch_on_ceiling.png | ||||
|   default_torch_on_floor.png | ||||
|    | ||||
|  | ||||
| VanessaE's animated torches (WTFPL): | ||||
|   default_torch_animated.png | ||||
|   default_torch_on_ceiling_animated.png | ||||
|   default_torch_on_floor_animated.png | ||||
|   default_torch_on_floor.png | ||||
|  | ||||
| RealBadAngel's animated water (WTFPL): | ||||
|   default_water_source_animated.png | ||||
|   default_water_flowing_animated.png | ||||
|  | ||||
| VanessaE: | ||||
|   default_nc_back.png | ||||
|   default_nc_front.png | ||||
|   default_nc_rb.png | ||||
|   default_nc_side.png | ||||
|  | ||||
| Calinou's improved default textures (CC BY-SA): | ||||
|   default_brick.png | ||||
|   default_clay_brick.png | ||||
|   default_papyrus.png | ||||
|   default_tool_steelsword.png | ||||
|  | ||||
| MirceaKitsune (WTFPL): | ||||
|   character.x | ||||
|  | ||||
| Jordach (CC BY-SA 3.0): | ||||
|   character.png | ||||
|  | ||||
| Glass breaking sounds (CC BY 3.0): | ||||
|   1: http://www.freesound.org/people/cmusounddesign/sounds/71947/ | ||||
|   2: http://www.freesound.org/people/Tomlija/sounds/97669/ | ||||
|   3: http://www.freesound.org/people/lsprice/sounds/88808/ | ||||
|   | ||||
| @@ -47,7 +47,7 @@ minetest.register_abm({ | ||||
| 				local n = minetest.env:get_node(trunkp) | ||||
| 				local reg = minetest.registered_nodes[n.name] | ||||
| 				-- Assume ignore is a trunk, to make the thing work at the border of the active area | ||||
| 				if n.name == "ignore" or (reg.groups.tree and reg.groups.tree ~= 0) then | ||||
| 				if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then | ||||
| 					--print("cached trunk still exists") | ||||
| 					return | ||||
| 				end | ||||
| @@ -86,6 +86,7 @@ minetest.register_abm({ | ||||
| 			end | ||||
| 			-- Remove node | ||||
| 			minetest.env:remove_node(p0) | ||||
| 			nodeupdate(p0) | ||||
| 		end | ||||
| 	end | ||||
| }) | ||||
|   | ||||
| @@ -29,7 +29,7 @@ minetest.register_alias("mapgen_desert_stone", "default:desert_stone") | ||||
| -- Ore generation | ||||
| -- | ||||
|  | ||||
| local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) | ||||
| function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) | ||||
| 	if maxp.y < height_min or minp.y > height_max then | ||||
| 		return | ||||
| 	end | ||||
| @@ -69,14 +69,26 @@ end | ||||
| function default.make_papyrus(pos, size) | ||||
| 	for y=0,size-1 do | ||||
| 		local p = {x=pos.x, y=pos.y+y, z=pos.z} | ||||
| 		minetest.env:set_node(p, {name="default:papyrus"}) | ||||
| 		local nn = minetest.env:get_node(p).name | ||||
| 		if minetest.registered_nodes[nn] and | ||||
| 			minetest.registered_nodes[nn].buildable_to then | ||||
| 			minetest.env:set_node(p, {name="default:papyrus"}) | ||||
| 		else | ||||
| 			return | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
|  | ||||
| function default.make_cactus(pos, size) | ||||
| 	for y=0,size-1 do | ||||
| 		local p = {x=pos.x, y=pos.y+y, z=pos.z} | ||||
| 		minetest.env:set_node(p, {name="default:cactus"}) | ||||
| 		local nn = minetest.env:get_node(p).name | ||||
| 		if minetest.registered_nodes[nn] and | ||||
| 			minetest.registered_nodes[nn].buildable_to then | ||||
| 			minetest.env:set_node(p, {name="default:cactus"}) | ||||
| 		else | ||||
| 			return | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
|  | ||||
| @@ -130,15 +142,17 @@ end | ||||
|  | ||||
| minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 	-- Generate regular ores | ||||
| 	generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8,    3, 8, -31000,  64) | ||||
| 	generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3,    -15,   2) | ||||
| 	generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9,    3, 5,    -63, -16) | ||||
| 	generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7,    3, 5, -31000, -64) | ||||
| 	generate_ore("default:mese",            "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3,   -127, -64) | ||||
| 	generate_ore("default:mese",            "default:stone", minp, maxp, seed+5, 1/9/9/9,    3, 5, -31000,-128) | ||||
| 	default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+0, 1/8/8/8,    3, 8, -31000,  64) | ||||
| 	default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/12/12/12, 2, 3,    -15,   2) | ||||
| 	default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/9/9/9,    3, 5,    -63, -16) | ||||
| 	default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/7/7/7,    3, 5, -31000, -64) | ||||
| 	 | ||||
| 	generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000,  0) | ||||
| 	generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64) | ||||
| 	default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+4, 1/16/16/16, 2, 3,   -127,  -64) | ||||
| 	default.generate_ore("default:stone_with_mese", "default:stone", minp, maxp, seed+5, 1/9/9/9,    3, 5, -31000, -128) | ||||
| 	default.generate_ore("default:mese",            "default:stone", minp, maxp, seed+8, 1/16/16/16, 2, 3, -31000,-1024) | ||||
| 	 | ||||
| 	default.generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed+7, 1/24/24/24, 6,27, -31000,  0) | ||||
| 	default.generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+6, 1/24/24/24, 6,27, -31000, -64) | ||||
|  | ||||
| 	if maxp.y >= 2 and minp.y <= 0 then | ||||
| 		-- Generate clay | ||||
| @@ -234,7 +248,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 			end | ||||
| 		end | ||||
| 		end | ||||
| 		-- Generate dry shrubs | ||||
| 		-- Generate grass | ||||
| 		local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100) | ||||
| 		-- Assume X and Z lengths are equal | ||||
| 		local divlen = 16 | ||||
| @@ -245,11 +259,11 @@ minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 			local z0 = minp.z + math.floor((divz+0)*divlen) | ||||
| 			local x1 = minp.x + math.floor((divx+1)*divlen) | ||||
| 			local z1 = minp.z + math.floor((divz+1)*divlen) | ||||
| 			-- Determine cactus amount from perlin noise | ||||
| 			local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0) | ||||
| 			-- Find random positions for cactus based on this random | ||||
| 			-- Determine grass amount from perlin noise | ||||
| 			local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 0) | ||||
| 			-- Find random positions for grass based on this random | ||||
| 			local pr = PseudoRandom(seed+1) | ||||
| 			for i=0,cactus_amount do | ||||
| 			for i=0,grass_amount do | ||||
| 				local x = pr:next(x0, x1) | ||||
| 				local z = pr:next(z0, z1) | ||||
| 				-- Find ground level (0...15) | ||||
| @@ -260,10 +274,25 @@ minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 						break | ||||
| 					end | ||||
| 				end | ||||
| 				-- If desert sand, make cactus | ||||
| 				if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then | ||||
| 					minetest.env:set_node({x=x,y=ground_y+1,z=z}, {name="default:dry_shrub"}) | ||||
| 				 | ||||
| 				if ground_y then | ||||
| 					local p = {x=x,y=ground_y+1,z=z} | ||||
| 					local nn = minetest.env:get_node(p).name | ||||
| 					-- Check if the node can be replaced | ||||
| 					if minetest.registered_nodes[nn] and | ||||
| 						minetest.registered_nodes[nn].buildable_to then | ||||
| 						nn = minetest.env:get_node({x=x,y=ground_y,z=z}).name | ||||
| 						-- If desert sand, make dry shrub | ||||
| 						if nn == "default:desert_sand" then | ||||
| 							minetest.env:set_node(p,{name="default:dry_shrub"}) | ||||
| 							 | ||||
| 						-- If grass, make junglegrass | ||||
| 						elseif nn == "default:dirt_with_grass" then | ||||
| 							minetest.env:set_node(p,{name="default:junglegrass"}) | ||||
| 						end | ||||
| 					end | ||||
| 				end | ||||
| 				 | ||||
| 			end | ||||
| 		end | ||||
| 		end | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/default/models/character.blend
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										
											BIN
										
									
								
								mods/default/models/character.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.2 KiB | 
							
								
								
									
										6557
									
								
								mods/default/models/character.x
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										132
									
								
								mods/default/player.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,132 @@ | ||||
| -- Minetest 0.4 mod: player | ||||
| -- See README.txt for licensing and other information. | ||||
|  | ||||
| -- | ||||
| -- Start of configuration area: | ||||
| -- | ||||
|  | ||||
| -- Player animation speed | ||||
| animation_speed = 30 | ||||
|  | ||||
| -- Player animation blending | ||||
| -- Note: This is currently broken due to a bug in Irrlicht, leave at 0 | ||||
| animation_blend = 0 | ||||
|  | ||||
| -- Default player appearance | ||||
| default_model = "character.x" | ||||
| default_textures = {"character.png", } | ||||
|  | ||||
| -- Frame ranges for each player model | ||||
| function player_get_animations(model) | ||||
| 	if model == "character.x" then | ||||
| 		return { | ||||
| 		stand_START = 0, | ||||
| 		stand_END = 79, | ||||
| 		sit_START = 81, | ||||
| 		sit_END = 160, | ||||
| 		lay_START = 162, | ||||
| 		lay_END = 166, | ||||
| 		walk_START = 168, | ||||
| 		walk_END = 187, | ||||
| 		mine_START = 189, | ||||
| 		mine_END = 198, | ||||
| 		walk_mine_START = 200, | ||||
| 		walk_mine_END = 219 | ||||
| 		} | ||||
| 	end | ||||
| end | ||||
|  | ||||
| -- | ||||
| -- End of configuration area. | ||||
| -- | ||||
|  | ||||
| -- Player stats and animations | ||||
| local player_model = {} | ||||
| local player_anim = {} | ||||
| local player_sneak = {} | ||||
| local ANIM_STAND = 1 | ||||
| local ANIM_SIT = 2 | ||||
| local ANIM_LAY = 3 | ||||
| local ANIM_WALK  = 4 | ||||
| local ANIM_WALK_MINE = 5 | ||||
| local ANIM_MINE = 6 | ||||
|  | ||||
| -- Called when a player's appearance needs to be updated | ||||
| function player_update_visuals(pl) | ||||
| 	local name = pl:get_player_name() | ||||
|  | ||||
| 	player_model[name] = default_model | ||||
| 	player_anim[name] = 0 -- Animation will be set further below immediately | ||||
| 	player_sneak[name] = false | ||||
| 	prop = { | ||||
| 		mesh = default_model, | ||||
| 		textures = default_textures, | ||||
| 		visual = "mesh", | ||||
| 		visual_size = {x=1, y=1}, | ||||
| 	} | ||||
| 	pl:set_properties(prop) | ||||
| end | ||||
|  | ||||
| -- Update appearance when the player joins | ||||
| minetest.register_on_joinplayer(player_update_visuals) | ||||
|  | ||||
| -- Check each player and apply animations | ||||
| function player_step(dtime) | ||||
| 	for _, pl in pairs(minetest.get_connected_players()) do | ||||
| 		local name = pl:get_player_name() | ||||
| 		local anim = player_get_animations(player_model[name]) | ||||
| 		local controls = pl:get_player_control() | ||||
| 		local walking = false | ||||
| 		local animation_speed_mod = animation_speed | ||||
|  | ||||
| 		-- Determine if the player is walking | ||||
| 		if controls.up or controls.down or controls.left or controls.right then | ||||
| 			walking = true | ||||
| 		end | ||||
|  | ||||
| 		-- Determine if the player is sneaking, and reduce animation speed if so | ||||
| 		if controls.sneak and pl:get_hp() ~= 0 and (walking or controls.LMB) then | ||||
| 			animation_speed_mod = animation_speed_mod / 2 | ||||
| 			-- Refresh player animation below if sneak state changed | ||||
| 			if not player_sneak[name] then | ||||
| 				player_anim[name] = 0 | ||||
| 				player_sneak[name] = true | ||||
| 			end | ||||
| 		else | ||||
| 			-- Refresh player animation below if sneak state changed | ||||
| 			if player_sneak[name] then | ||||
| 				player_anim[name] = 0 | ||||
| 				player_sneak[name] = false | ||||
| 			end | ||||
| 		end | ||||
|  | ||||
| 		-- Apply animations based on what the player is doing | ||||
| 		if pl:get_hp() == 0 then | ||||
| 			if player_anim[name] ~= ANIM_LAY then | ||||
| 				pl:set_animation({x=anim.lay_START, y=anim.lay_END}, animation_speed_mod, animation_blend) | ||||
| 				player_anim[name] = ANIM_LAY | ||||
| 			end | ||||
| 		elseif walking and controls.LMB then | ||||
| 			if player_anim[name] ~= ANIM_WALK_MINE then | ||||
| 				pl:set_animation({x=anim.walk_mine_START, y=anim.walk_mine_END}, animation_speed_mod, animation_blend) | ||||
| 				player_anim[name] = ANIM_WALK_MINE | ||||
| 			end | ||||
| 		elseif walking then | ||||
| 			if player_anim[name] ~= ANIM_WALK then | ||||
| 				pl:set_animation({x=anim.walk_START, y=anim.walk_END}, animation_speed_mod, animation_blend) | ||||
| 				player_anim[name] = ANIM_WALK | ||||
| 			end | ||||
| 		elseif controls.LMB then | ||||
| 			if player_anim[name] ~= ANIM_MINE then | ||||
| 				pl:set_animation({x=anim.mine_START, y=anim.mine_END}, animation_speed_mod, animation_blend) | ||||
| 				player_anim[name] = ANIM_MINE | ||||
| 			end | ||||
| 		elseif player_anim[name] ~= ANIM_STAND then | ||||
| 			pl:set_animation({x=anim.stand_START, y=anim.stand_END}, animation_speed_mod, animation_blend) | ||||
| 			player_anim[name] = ANIM_STAND | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
| minetest.register_globalstep(player_step) | ||||
|  | ||||
| -- END | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/default/sounds/default_break_glass.1.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										
											BIN
										
									
								
								mods/default/sounds/default_break_glass.2.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										
											BIN
										
									
								
								mods/default/sounds/default_break_glass.3.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 283 B | 
| Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 626 B | 
| Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 271 B | 
| Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 339 B | 
| Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 255 B | 
| Before Width: | Height: | Size: 888 B After Width: | Height: | Size: 962 B | 
| Before Width: | Height: | Size: 925 B After Width: | Height: | Size: 567 B | 
| Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 237 B | 
| Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 554 B | 
| Before Width: | Height: | Size: 203 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_mese_block.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 482 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_mese_crystal.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 417 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_mese_crystal_fragment.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 212 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_mineral_mese.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 488 B | 
| Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 317 B | 
| Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 378 B | 
| Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 206 B | 
| Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 231 B | 
| Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 664 B | 
| Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 199 B | 
| Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 352 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_tool_steelsword.png
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						| Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 317 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_torch_animated.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.4 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_torch_on_ceiling_animated.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.3 KiB | 
| Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 282 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_torch_on_floor_animated.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.3 KiB | 
| Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 710 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_water_flowing_animated.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 5.8 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/default/textures/default_water_source_animated.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 5.0 KiB | 
| @@ -1,43 +1,23 @@ | ||||
| Minetest 0.4 mod: doors | ||||
| ======================== | ||||
| ======================= | ||||
|  | ||||
| License of source code: | ||||
| ----------------------- | ||||
| Original license text: | ||||
| --    (c) 2011 Fernando Zapata | ||||
| --    Code licensed under GNU GPLv3 | ||||
| --    Content licensed under CC BY-SA 3.0 | ||||
| --    2012-01-08    11:03:57 | ||||
| Copyright (C) 2012 PilzAdam | ||||
|  | ||||
| There has been unsuccesful attempts to contact the original author. Thus, | ||||
| based on the intentions of the author, it is assumed that this code is | ||||
| distributable and modifiable under LGPLv2+later, under which Minetest is | ||||
| distributed. | ||||
|  | ||||
| Modifications: | ||||
|   Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com> | ||||
|  | ||||
| This program is free software; you can redistribute it and/or modify | ||||
| it under the terms of the GNU Lesser General Public License as published by | ||||
| the Free Software Foundation; either version 2.1 of the License, or | ||||
| (at your option) any later version. | ||||
|  | ||||
| http://www.gnu.org/licenses/lgpl-2.1.html | ||||
| This program is free software. It comes without any warranty, to | ||||
| the extent permitted by applicable law. You can redistribute it | ||||
| and/or modify it under the terms of the Do What The Fuck You Want | ||||
| To Public License, Version 2, as published by Sam Hocevar. See | ||||
| http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
|  | ||||
| License of media (textures and sounds) | ||||
| -------------------------------------- | ||||
| Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)                                  | ||||
| http://creativecommons.org/licenses/by-sa/3.0/ | ||||
|  | ||||
| Authors of media files | ||||
| ----------------------- | ||||
| Everything not listed in here: | ||||
| Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com> | ||||
|  | ||||
| From the original zlpdoors mod by Fernando Zapata: | ||||
| Textures created by Fernando Zapata (CC BY-SA 3.0): | ||||
|   door_wood.png | ||||
|   door_wood_a.png | ||||
|   door_wood_a_r.png | ||||
|   door_wood_b.png | ||||
|   door_wood_b_r.png | ||||
|   door_wood.png | ||||
|    | ||||
|  | ||||
| All other textures (created by PilzAdam): WTFPL | ||||
|   | ||||
| @@ -1,205 +1,295 @@ | ||||
| -- Minetest 0.4 mod: doors | ||||
| -- See README.txt for licensing and other information. | ||||
| -------------------------------------------------------------------------------- | ||||
| doors = {} | ||||
|  | ||||
| local WALLMX = 3 | ||||
| local WALLMZ = 5 | ||||
| local WALLPX = 2 | ||||
| local WALLPZ = 4 | ||||
| -- Registers a door | ||||
| --  name: The name of the door | ||||
| --  def: a table with the folowing fields: | ||||
| --    description | ||||
| --    inventory_image | ||||
| --    groups | ||||
| --    tiles_bottom: the tiles of the bottom part of the door {front, side} | ||||
| --    tiles_top: the tiles of the bottom part of the door {front, side} | ||||
| --    If the following fields are not defined the default values are used | ||||
| --    node_box_bottom | ||||
| --    node_box_top | ||||
| --    selection_box_bottom | ||||
| --    selection_box_top | ||||
| --    only_placer_can_open: if true only the player who placed the door can | ||||
| --                          open it | ||||
| function doors:register_door(name, def) | ||||
| 	def.groups.not_in_creative_inventory = 1 | ||||
| 	 | ||||
| 	local box = {{-0.5, -0.5, -0.5,   0.5, 0.5, -0.5+1.5/16}} | ||||
| 	 | ||||
| 	if not def.node_box_bottom then | ||||
| 		def.node_box_bottom = box | ||||
| 	end | ||||
| 	if not def.node_box_top then | ||||
| 		def.node_box_top = box | ||||
| 	end | ||||
| 	if not def.selection_box_bottom then | ||||
| 		def.selection_box_bottom= box | ||||
| 	end | ||||
| 	if not def.selection_box_top then | ||||
| 		def.selection_box_top = box | ||||
| 	end | ||||
| 	 | ||||
| 	minetest.register_craftitem(name, { | ||||
| 		description = def.description, | ||||
| 		inventory_image = def.inventory_image, | ||||
| 		 | ||||
| 		on_place = function(itemstack, placer, pointed_thing) | ||||
| 			if not pointed_thing.type == "node" then | ||||
| 				return itemstack | ||||
| 			end | ||||
| 			 | ||||
| 			local ptu = pointed_thing.under | ||||
| 			local nu = minetest.env:get_node(ptu) | ||||
| 			if minetest.registered_nodes[nu.name].on_rightclick then | ||||
| 				return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack) | ||||
| 			end | ||||
| 			 | ||||
| 			local pt = pointed_thing.above | ||||
| 			local pt2 = {x=pt.x, y=pt.y, z=pt.z} | ||||
| 			pt2.y = pt2.y+1 | ||||
| 			if | ||||
| 				not minetest.registered_nodes[minetest.env:get_node(pt).name].buildable_to or | ||||
| 				not minetest.registered_nodes[minetest.env:get_node(pt2).name].buildable_to or | ||||
| 				not placer or | ||||
| 				not placer:is_player() | ||||
| 			then | ||||
| 				return itemstack | ||||
| 			end | ||||
| 			 | ||||
| 			local p2 = minetest.dir_to_facedir(placer:get_look_dir()) | ||||
| 			local pt3 = {x=pt.x, y=pt.y, z=pt.z} | ||||
| 			if p2 == 0 then | ||||
| 				pt3.x = pt3.x-1 | ||||
| 			elseif p2 == 1 then | ||||
| 				pt3.z = pt3.z+1 | ||||
| 			elseif p2 == 2 then | ||||
| 				pt3.x = pt3.x+1 | ||||
| 			elseif p2 == 3 then | ||||
| 				pt3.z = pt3.z-1 | ||||
| 			end | ||||
| 			if not string.find(minetest.env:get_node(pt3).name, name.."_b_") then | ||||
| 				minetest.env:set_node(pt, {name=name.."_b_1", param2=p2}) | ||||
| 				minetest.env:set_node(pt2, {name=name.."_t_1", param2=p2}) | ||||
| 			else | ||||
| 				minetest.env:set_node(pt, {name=name.."_b_2", param2=p2}) | ||||
| 				minetest.env:set_node(pt2, {name=name.."_t_2", param2=p2}) | ||||
| 			end | ||||
| 			 | ||||
| 			if def.only_placer_can_open then | ||||
| 				local pn = placer:get_player_name() | ||||
| 				local meta = minetest.env:get_meta(pt) | ||||
| 				meta:set_string("doors_owner", pn) | ||||
| 				meta:set_string("infotext", "Owned by "..pn) | ||||
| 				meta = minetest.env:get_meta(pt2) | ||||
| 				meta:set_string("doors_owner", pn) | ||||
| 				meta:set_string("infotext", "Owned by "..pn) | ||||
| 			end | ||||
| 			 | ||||
| 			if not minetest.setting_getbool("creative_mode") then | ||||
| 				itemstack:take_item() | ||||
| 			end | ||||
| 			return itemstack | ||||
| 		end, | ||||
| 	}) | ||||
| 	 | ||||
| 	local tt = def.tiles_top | ||||
| 	local tb = def.tiles_bottom | ||||
| 	 | ||||
| 	local function after_dig_node(pos, name) | ||||
| 		if minetest.env:get_node(pos).name == name then | ||||
| 			minetest.env:remove_node(pos) | ||||
| 		end | ||||
| 	end | ||||
| 	 | ||||
| 	local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) | ||||
| 		pos.y = pos.y+dir | ||||
| 		if not minetest.env:get_node(pos).name == check_name then | ||||
| 			return | ||||
| 		end | ||||
| 		local p2 = minetest.env:get_node(pos).param2 | ||||
| 		p2 = params[p2+1] | ||||
| 		 | ||||
| 		local meta = minetest.env:get_meta(pos):to_table() | ||||
| 		minetest.env:set_node(pos, {name=replace_dir, param2=p2}) | ||||
| 		minetest.env:get_meta(pos):from_table(meta) | ||||
| 		 | ||||
| 		pos.y = pos.y-dir | ||||
| 		meta = minetest.env:get_meta(pos):to_table() | ||||
| 		minetest.env:set_node(pos, {name=replace, param2=p2}) | ||||
| 		minetest.env:get_meta(pos):from_table(meta) | ||||
| 	end | ||||
| 	 | ||||
| 	local function check_player_priv(pos, player) | ||||
| 		if not def.only_placer_can_open then | ||||
| 			return true | ||||
| 		end | ||||
| 		local meta = minetest.env:get_meta(pos) | ||||
| 		local pn = player:get_player_name() | ||||
| 		return meta:get_string("doors_owner") == pn | ||||
| 	end | ||||
| 	 | ||||
| 	minetest.register_node(name.."_b_1", { | ||||
| 		tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"}, | ||||
| 		paramtype = "light", | ||||
| 		paramtype2 = "facedir", | ||||
| 		drop = name, | ||||
| 		drawtype = "nodebox", | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.node_box_bottom | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.selection_box_bottom | ||||
| 		}, | ||||
| 		groups = def.groups, | ||||
| 		 | ||||
| 		after_dig_node = function(pos, oldnode, oldmetadata, digger) | ||||
| 			pos.y = pos.y+1 | ||||
| 			after_dig_node(pos, name.."_t_1") | ||||
| 		end, | ||||
| 		 | ||||
| 		on_rightclick = function(pos, node, clicker) | ||||
| 			if check_player_priv(pos, clicker) then | ||||
| 				on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0}) | ||||
| 			end | ||||
| 		end, | ||||
| 		 | ||||
| 		can_dig = check_player_priv, | ||||
| 	}) | ||||
| 	 | ||||
| 	minetest.register_node(name.."_t_1", { | ||||
| 		tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"}, | ||||
| 		paramtype = "light", | ||||
| 		paramtype2 = "facedir", | ||||
| 		drop = name, | ||||
| 		drawtype = "nodebox", | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.node_box_top | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.selection_box_top | ||||
| 		}, | ||||
| 		groups = def.groups, | ||||
| 		 | ||||
| 		after_dig_node = function(pos, oldnode, oldmetadata, digger) | ||||
| 			pos.y = pos.y-1 | ||||
| 			after_dig_node(pos, name.."_b_1") | ||||
| 		end, | ||||
| 		 | ||||
| 		on_rightclick = function(pos, node, clicker) | ||||
| 			if check_player_priv(pos, clicker) then | ||||
| 				on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0}) | ||||
| 			end | ||||
| 		end, | ||||
| 		 | ||||
| 		can_dig = check_player_priv, | ||||
| 	}) | ||||
| 	 | ||||
| 	minetest.register_node(name.."_b_2", { | ||||
| 		tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]}, | ||||
| 		paramtype = "light", | ||||
| 		paramtype2 = "facedir", | ||||
| 		drop = name, | ||||
| 		drawtype = "nodebox", | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.node_box_bottom | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.selection_box_bottom | ||||
| 		}, | ||||
| 		groups = def.groups, | ||||
| 		 | ||||
| 		after_dig_node = function(pos, oldnode, oldmetadata, digger) | ||||
| 			pos.y = pos.y+1 | ||||
| 			after_dig_node(pos, name.."_t_2") | ||||
| 		end, | ||||
| 		 | ||||
| 		on_rightclick = function(pos, node, clicker) | ||||
| 			if check_player_priv(pos, clicker) then | ||||
| 				on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) | ||||
| 			end | ||||
| 		end, | ||||
| 		 | ||||
| 		can_dig = check_player_priv, | ||||
| 	}) | ||||
| 	 | ||||
| 	minetest.register_node(name.."_t_2", { | ||||
| 		tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]}, | ||||
| 		paramtype = "light", | ||||
| 		paramtype2 = "facedir", | ||||
| 		drop = name, | ||||
| 		drawtype = "nodebox", | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.node_box_top | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = def.selection_box_top | ||||
| 		}, | ||||
| 		groups = def.groups, | ||||
| 		 | ||||
| 		after_dig_node = function(pos, oldnode, oldmetadata, digger) | ||||
| 			pos.y = pos.y-1 | ||||
| 			after_dig_node(pos, name.."_b_2") | ||||
| 		end, | ||||
| 		 | ||||
| 		on_rightclick = function(pos, node, clicker) | ||||
| 			if check_player_priv(pos, clicker) then | ||||
| 				on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2}) | ||||
| 			end | ||||
| 		end, | ||||
| 		 | ||||
| 		can_dig = check_player_priv, | ||||
| 	}) | ||||
| 	 | ||||
| end | ||||
|  | ||||
| -------------------------------------------------------------------------------- | ||||
|  | ||||
| minetest.register_alias('door', 'doors:door_wood') | ||||
| minetest.register_alias('door_wood', 'doors:door_wood') | ||||
|  | ||||
| minetest.register_node( 'doors:door_wood', { | ||||
| 	description         = 'Wooden Door', | ||||
| 	drawtype            = 'signlike', | ||||
| 	tile_images         = { 'door_wood.png' }, | ||||
| 	inventory_image     = 'door_wood.png', | ||||
| 	wield_image         = 'door_wood.png', | ||||
| 	paramtype2          = 'wallmounted', | ||||
| 	selection_box       = { type = 'wallmounted' }, | ||||
| 	groups              = { choppy=2, dig_immediate=2 }, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output              = 'doors:door_wood', | ||||
| 	recipe = { | ||||
| 		{ 'default:wood', 'default:wood' }, | ||||
| 		{ 'default:wood', 'default:wood' }, | ||||
| 		{ 'default:wood', 'default:wood' }, | ||||
| 	}, | ||||
| doors:register_door("doors:door_wood", { | ||||
| 	description = "Wooden Door", | ||||
| 	inventory_image = "door_wood.png", | ||||
| 	groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, | ||||
| 	tiles_bottom = {"door_wood_b.png", "door_brown.png"}, | ||||
| 	tiles_top = {"door_wood_a.png", "door_brown.png"}, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = 'fuel', | ||||
| 	recipe = 'doors:door_wood', | ||||
| 	burntime = 30, | ||||
| 	output = "doors:door_wood", | ||||
| 	recipe = { | ||||
| 		{"group:wood", "group:wood"}, | ||||
| 		{"group:wood", "group:wood"}, | ||||
| 		{"group:wood", "group:wood"} | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| minetest.register_node( 'doors:door_wood_a_c', { | ||||
| 	Description         = 'Top Closed Door', | ||||
| 	drawtype            = 'signlike', | ||||
| 	tile_images         = { 'door_wood_a.png' }, | ||||
| 	inventory_image     = 'door_wood_a.png', | ||||
| 	paramtype           = 'light', | ||||
| 	paramtype2          = 'wallmounted', | ||||
| 	walkable            = true, | ||||
| 	selection_box       = { type = "wallmounted", }, | ||||
| 	groups              = { choppy=2, dig_immediate=2 }, | ||||
| 	legacy_wallmounted  = true, | ||||
| 	drop                = 'doors:door_wood', | ||||
| doors:register_door("doors:door_steel", { | ||||
| 	description = "Steel Door", | ||||
| 	inventory_image = "door_steel.png", | ||||
| 	groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1}, | ||||
| 	tiles_bottom = {"door_steel_b.png", "door_grey.png"}, | ||||
| 	tiles_top = {"door_steel_a.png", "door_grey.png"}, | ||||
| 	only_placer_can_open = true, | ||||
| }) | ||||
|  | ||||
| minetest.register_node( 'doors:door_wood_b_c', { | ||||
| 	Description         = 'Bottom Closed Door', | ||||
| 	drawtype            = 'signlike', | ||||
| 	tile_images         = { 'door_wood_b.png' }, | ||||
| 	inventory_image     = 'door_wood_b.png', | ||||
| 	paramtype           = 'light', | ||||
| 	paramtype2          = 'wallmounted', | ||||
| 	walkable            = true, | ||||
| 	selection_box       = { type = "wallmounted", }, | ||||
| 	groups              = { choppy=2, dig_immediate=2 }, | ||||
| 	legacy_wallmounted  = true, | ||||
| 	drop                = 'doors:door_wood', | ||||
| minetest.register_craft({ | ||||
| 	output = "doors:door_steel", | ||||
| 	recipe = { | ||||
| 		{"default:steel_ingot", "default:steel_ingot"}, | ||||
| 		{"default:steel_ingot", "default:steel_ingot"}, | ||||
| 		{"default:steel_ingot", "default:steel_ingot"} | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| minetest.register_node( 'doors:door_wood_a_o', { | ||||
| 	Description         = 'Top Open Door', | ||||
| 	drawtype            = 'signlike', | ||||
| 	tile_images         = { 'door_wood_a_r.png' }, | ||||
| 	inventory_image     = 'door_wood_a_r.png', | ||||
| 	paramtype           = 'light', | ||||
| 	paramtype2          = 'wallmounted', | ||||
| 	walkable            = false, | ||||
| 	selection_box       = { type = "wallmounted", }, | ||||
| 	groups              = { choppy=2, dig_immediate=2 }, | ||||
| 	legacy_wallmounted  = true, | ||||
| 	drop                = 'doors:door_wood', | ||||
| }) | ||||
|  | ||||
| minetest.register_node( 'doors:door_wood_b_o', { | ||||
| 	Description         = 'Bottom Open Door', | ||||
| 	drawtype            = 'signlike', | ||||
| 	tile_images         = { 'door_wood_b_r.png' }, | ||||
| 	inventory_image     = 'door_wood_b_r.png', | ||||
| 	paramtype           = 'light', | ||||
| 	paramtype2          = 'wallmounted', | ||||
| 	walkable            = false, | ||||
| 	selection_box       = { type = "wallmounted", }, | ||||
| 	groups              = { choppy=2, dig_immediate=2 }, | ||||
| 	legacy_wallmounted  = true, | ||||
| 	drop                = 'doors:door_wood', | ||||
| }) | ||||
|  | ||||
| -------------------------------------------------------------------------------- | ||||
|  | ||||
| local round = function( n ) | ||||
| 	if n >= 0 then | ||||
| 		return math.floor( n + 0.5 ) | ||||
| 	else | ||||
| 		return math.ceil( n - 0.5 ) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| local on_door_placed = function( pos, node, placer ) | ||||
| 	if node.name ~= 'doors:door_wood' then return end | ||||
|  | ||||
| 	upos = { x = pos.x, y = pos.y - 1, z = pos.z } | ||||
| 	apos = { x = pos.x, y = pos.y + 1, z = pos.z } | ||||
| 	und = minetest.env:get_node( upos ) | ||||
| 	abv = minetest.env:get_node( apos ) | ||||
|  | ||||
| 	dir = placer:get_look_dir() | ||||
|  | ||||
| 	if     round( dir.x ) == 1  then | ||||
| 		newparam = WALLMX | ||||
| 	elseif round( dir.x ) == -1 then | ||||
| 		newparam = WALLPX | ||||
| 	elseif round( dir.z ) == 1  then | ||||
| 		newparam = WALLMZ | ||||
| 	elseif round( dir.z ) == -1 then | ||||
| 		newparam = WALLPZ | ||||
| 	end | ||||
|  | ||||
| 	if und.name == 'air' then | ||||
| 		minetest.env:add_node( pos,  { name = 'doors:door_wood_a_c', param2 = newparam } ) | ||||
| 		minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } ) | ||||
| 	elseif abv.name == 'air' then | ||||
| 		minetest.env:add_node( pos,  { name = 'doors:door_wood_b_c', param2 = newparam } ) | ||||
| 		minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } ) | ||||
| 	else | ||||
| 		minetest.env:remove_node( pos ) | ||||
| 		placer:get_inventory():add_item( "main", 'doors:door_wood' ) | ||||
| 		minetest.chat_send_player( placer:get_player_name(), 'not enough space' ) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| local on_door_punched = function( pos, node, puncher ) | ||||
| 	if string.find( node.name, 'doors:door_wood' ) == nil then return end | ||||
|  | ||||
| 	upos = { x = pos.x, y = pos.y - 1, z = pos.z } | ||||
| 	apos = { x = pos.x, y = pos.y + 1, z = pos.z } | ||||
|  | ||||
| 	if string.find( node.name, '_c', -2 ) ~= nil then | ||||
| 		if     node.param2 == WALLPX then | ||||
| 			newparam = WALLMZ | ||||
| 		elseif node.param2 == WALLMZ then | ||||
| 			newparam = WALLMX | ||||
| 		elseif node.param2 == WALLMX then | ||||
| 			newparam = WALLPZ | ||||
| 		elseif node.param2 == WALLPZ then | ||||
| 			newparam = WALLPX | ||||
| 		end | ||||
| 	elseif string.find( node.name, '_o', -2 ) ~= nil then | ||||
| 		if     node.param2 == WALLMZ then | ||||
| 			newparam = WALLPX | ||||
| 		elseif node.param2 == WALLMX then | ||||
| 			newparam = WALLMZ | ||||
| 		elseif node.param2 == WALLPZ then | ||||
| 			newparam = WALLMX | ||||
| 		elseif node.param2 == WALLPX then | ||||
| 			newparam = WALLPZ | ||||
| 		end | ||||
| 	end | ||||
|  | ||||
| 	if ( node.name == 'doors:door_wood_a_c' ) then | ||||
| 		minetest.env:add_node( pos,  { name = 'doors:door_wood_a_o', param2 = newparam } ) | ||||
| 		minetest.env:add_node( upos, { name = 'doors:door_wood_b_o', param2 = newparam } ) | ||||
|  | ||||
| 	elseif ( node.name == 'doors:door_wood_b_c' ) then | ||||
| 		minetest.env:add_node( pos,  { name = 'doors:door_wood_b_o', param2 = newparam } ) | ||||
| 		minetest.env:add_node( apos, { name = 'doors:door_wood_a_o', param2 = newparam } ) | ||||
|  | ||||
| 	elseif ( node.name == 'doors:door_wood_a_o' ) then | ||||
| 		minetest.env:add_node( pos,  { name = 'doors:door_wood_a_c', param2 = newparam } ) | ||||
| 		minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } ) | ||||
|  | ||||
| 	elseif ( node.name == 'doors:door_wood_b_o' ) then | ||||
| 		minetest.env:add_node( pos,  { name = 'doors:door_wood_b_c', param2 = newparam } ) | ||||
| 		minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } ) | ||||
|  | ||||
| 	end | ||||
| end | ||||
|  | ||||
| local on_door_digged = function( pos, node, digger ) | ||||
| 	upos = { x = pos.x, y = pos.y - 1, z = pos.z } | ||||
| 	apos = { x = pos.x, y = pos.y + 1, z = pos.z } | ||||
|  | ||||
| 	if ( node.name == 'doors:door_wood_a_c' ) or ( node.name == 'doors:door_wood_a_o' ) then | ||||
| 		minetest.env:remove_node( upos ) | ||||
| 	elseif ( node.name == 'doors:door_wood_b_c' ) or ( node.name == 'doors:door_wood_b_o' ) then | ||||
| 		minetest.env:remove_node( apos ) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| -------------------------------------------------------------------------------- | ||||
|  | ||||
| minetest.register_on_placenode( on_door_placed ) | ||||
| minetest.register_on_punchnode( on_door_punched ) | ||||
| minetest.register_on_dignode( on_door_digged ) | ||||
|  | ||||
| -------------------------------------------------------------------------------- | ||||
|  | ||||
| minetest.register_alias("doors:door_wood_a_c", "doors:door_wood_t_1") | ||||
| minetest.register_alias("doors:door_wood_a_o", "doors:door_wood_t_1") | ||||
| minetest.register_alias("doors:door_wood_b_c", "doors:door_wood_b_1") | ||||
| minetest.register_alias("doors:door_wood_b_o", "doors:door_wood_b_1") | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/doors/textures/door_brown.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 109 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/doors/textures/door_grey.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 109 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/doors/textures/door_steel.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 230 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/doors/textures/door_steel_a.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 223 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/doors/textures/door_steel_b.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 206 B | 
| Before Width: | Height: | Size: 249 B | 
| Before Width: | Height: | Size: 216 B | 
							
								
								
									
										15
									
								
								mods/dye/README.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,15 @@ | ||||
| Minetest 0.4 mod: dye | ||||
| ====================== | ||||
|  | ||||
| See init.lua for documentation. | ||||
|  | ||||
| License of source code and media files: | ||||
| --------------------------------------- | ||||
| Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com> | ||||
|  | ||||
| This program is free software. It comes without any warranty, to | ||||
| the extent permitted by applicable law. You can redistribute it | ||||
| and/or modify it under the terms of the Do What The Fuck You Want | ||||
| To Public License, Version 2, as published by Sam Hocevar. See | ||||
| http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
|  | ||||
							
								
								
									
										0
									
								
								mods/dye/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										134
									
								
								mods/dye/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,134 @@ | ||||
| -- minetest/dye/init.lua | ||||
|  | ||||
| -- To make recipes that will work with any dye ever made by anybody, define | ||||
| -- them based on groups. | ||||
| -- You can select any group of groups, based on your need for amount of colors. | ||||
| -- basecolor: 9, excolor: 17, unicolor: 89 | ||||
| -- | ||||
| -- Example of one shapeless recipe using a color group: | ||||
| -- Note: As this uses basecolor_*, you'd need 9 of these. | ||||
| -- minetest.register_craft({ | ||||
| --     type = "shapeless", | ||||
| --     output = '<mod>:item_yellow', | ||||
| --     recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'}, | ||||
| -- }) | ||||
|  | ||||
| -- Other mods can use these for looping through available colors | ||||
| local dye = {} | ||||
| dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"} | ||||
| dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"} | ||||
|  | ||||
| -- Base color groups: | ||||
| -- - basecolor_white | ||||
| -- - basecolor_grey | ||||
| -- - basecolor_black | ||||
| -- - basecolor_red | ||||
| -- - basecolor_yellow | ||||
| -- - basecolor_green | ||||
| -- - basecolor_cyan | ||||
| -- - basecolor_blue | ||||
| -- - basecolor_magenta | ||||
|  | ||||
| -- Extended color groups (* = equal to a base color): | ||||
| -- * excolor_white | ||||
| -- - excolor_lightgrey | ||||
| -- * excolor_grey | ||||
| -- - excolor_darkgrey | ||||
| -- * excolor_black | ||||
| -- * excolor_red | ||||
| -- - excolor_orange | ||||
| -- * excolor_yellow | ||||
| -- - excolor_lime | ||||
| -- * excolor_green | ||||
| -- - excolor_aqua | ||||
| -- * excolor_cyan | ||||
| -- - excolor_sky_blue | ||||
| -- * excolor_blue | ||||
| -- - excolor_violet | ||||
| -- * excolor_magenta | ||||
| -- - excolor_red_violet | ||||
|  | ||||
| -- The whole unifieddyes palette as groups: | ||||
| -- - unicolor_<excolor> | ||||
| -- For the following, no white/grey/black is allowed: | ||||
| -- - unicolor_medium_<excolor> | ||||
| -- - unicolor_dark_<excolor> | ||||
| -- - unicolor_light_<excolor> | ||||
| -- - unicolor_<excolor>_s50 | ||||
| -- - unicolor_medium_<excolor>_s50 | ||||
| -- - unicolor_dark_<excolor>_s50 | ||||
|  | ||||
| -- Local stuff | ||||
| local dyelocal = {} | ||||
|  | ||||
| -- This collection of colors is partly a historic thing, partly something else. | ||||
| dyelocal.dyes = { | ||||
| 	{"white",      "White dye",     {dye=1, basecolor_white=1,   excolor_white=1,     unicolor_white=1}}, | ||||
| 	{"grey",       "Grey dye",      {dye=1, basecolor_grey=1,    excolor_grey=1,      unicolor_grey=1}}, | ||||
| 	{"dark_grey",  "Dark grey dye", {dye=1, basecolor_grey=1,    excolor_darkgrey=1,  unicolor_darkgrey=1}}, | ||||
| 	{"black",      "Black dye",     {dye=1, basecolor_black=1,   excolor_black=1,     unicolor_black=1}}, | ||||
| 	{"violet",     "Violet dye",    {dye=1, basecolor_magenta=1, excolor_violet=1,    unicolor_violet=1}}, | ||||
| 	{"blue",       "Blue dye",      {dye=1, basecolor_blue=1,    excolor_blue=1,      unicolor_blue=1}}, | ||||
| 	{"cyan",       "Cyan dye",      {dye=1, basecolor_cyan=1,    excolor_cyan=1,      unicolor_cyan=1}}, | ||||
| 	{"dark_green", "Dark green dye",{dye=1, basecolor_green=1,   excolor_green=1,     unicolor_dark_green=1}}, | ||||
| 	{"green",      "Green dye",     {dye=1, basecolor_green=1,   excolor_green=1,     unicolor_green=1}}, | ||||
| 	{"yellow",     "Yellow dye",    {dye=1, basecolor_yellow=1,  excolor_yellow=1,    unicolor_yellow=1}}, | ||||
| 	{"brown",      "Brown dye",     {dye=1, basecolor_yellow=1,  excolor_orange=1,    unicolor_dark_orange=1}}, | ||||
| 	{"orange",     "Orange dye",    {dye=1, basecolor_orange=1,  excolor_orange=1,    unicolor_orange=1}}, | ||||
| 	{"red",        "Red dye",       {dye=1, basecolor_red=1,     excolor_red=1,       unicolor_red=1}}, | ||||
| 	{"magenta",    "Magenta dye",   {dye=1, basecolor_magenta=1, excolor_red_violet=1,unicolor_red_violet=1}}, | ||||
| 	{"pink",       "Pink dye",      {dye=1, basecolor_red=1,     excolor_red=1,       unicolor_light_red=1}}, | ||||
| } | ||||
|  | ||||
| -- Define items | ||||
| for _, row in ipairs(dyelocal.dyes) do | ||||
| 	local name = row[1] | ||||
| 	local description = row[2] | ||||
| 	local groups = row[3] | ||||
| 	local item_name = "dye:"..name | ||||
| 	local item_image = "dye_"..name..".png" | ||||
| 	minetest.register_craftitem(item_name, { | ||||
| 		inventory_image = item_image, | ||||
| 		description = description, | ||||
| 		groups = groups | ||||
| 	}) | ||||
| end | ||||
|  | ||||
| -- Mix recipes | ||||
| -- Just mix everything to everything somehow sanely | ||||
|  | ||||
| dyelocal.mixbases = {"magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"} | ||||
|  | ||||
| dyelocal.mixes = { | ||||
| 	--       magenta,  red,    orange,   brown,    yellow,  green,  dark_green, cyan,    blue,   violet,   black,  dark_grey,  grey,   white | ||||
| 	white = {"pink",  "pink", "orange", "orange", "yellow", "green", "green",  "grey",  "cyan", "violet",  "grey",  "grey",   "white", "white"}, | ||||
| 	grey  = {"pink",  "pink", "orange", "orange", "yellow", "green", "green",  "grey",  "cyan",  "pink",  "dark_grey","grey", "grey"}, | ||||
| 	dark_grey={"brown","brown", "brown", "brown", "brown","dark_green","dark_green","blue","blue","violet","black", "black"}, | ||||
| 	black = {"black", "black", "black",  "black", "black",  "black", "black",  "black", "black", "black",  "black"}, | ||||
| 	violet= {"magenta","magenta","red",  "brown", "red",    "cyan",  "brown",  "blue",  "violet","violet"}, | ||||
| 	blue  = {"violet", "magenta","brown","brown","dark_green","cyan","cyan",   "cyan",  "blue"}, | ||||
| 	cyan  = {"blue","brown","dark_green","dark_grey","green","cyan","dark_green","cyan"}, | ||||
| 	dark_green={"brown","brown","brown", "brown", "green",  "green", "dark_green"}, | ||||
| 	green = {"brown", "yellow","yellow","dark_green","green","green"}, | ||||
| 	yellow= {"red",  "orange", "yellow","orange", "yellow"}, | ||||
| 	brown = {"brown", "brown","orange", "brown"}, | ||||
| 	orange= {"red",  "orange","orange"}, | ||||
| 	red   = {"magenta","red"}, | ||||
| 	magenta={"magenta"}, | ||||
| } | ||||
|  | ||||
| for one,results in pairs(dyelocal.mixes) do | ||||
| 	for i,result in ipairs(results) do | ||||
| 		local another = dyelocal.mixbases[i] | ||||
| 		minetest.register_craft({ | ||||
| 			type = "shapeless", | ||||
| 			output = 'dye:'..result..' 2', | ||||
| 			recipe = {'dye:'..one, 'dye:'..another}, | ||||
| 		}) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| -- Hide dyelocal | ||||
| dyelocal = nil | ||||
|  | ||||
| -- EOF | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_black.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 364 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_blue.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 352 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_brown.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 348 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_cyan.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 370 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_dark_green.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 367 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_dark_grey.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 371 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_green.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 376 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_grey.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 374 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_magenta.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 380 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_orange.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 374 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_pink.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 364 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_red.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 381 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_violet.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 376 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_white.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 375 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/dye/textures/dye_yellow.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 389 B | 
| @@ -28,3 +28,5 @@ fire_small.ogg sampled from: | ||||
| fire_large.ogg sampled from: | ||||
|   http://www.freesound.org/people/Dynamicell/sounds/17548/ | ||||
|  | ||||
| fire_basic_flame_animated.png: | ||||
|   Muadtralk | ||||
|   | ||||
| @@ -2,15 +2,29 @@ | ||||
|  | ||||
| minetest.register_node("fire:basic_flame", { | ||||
| 	description = "Fire", | ||||
| 	drawtype = "glasslike", | ||||
| 	tile_images = {"fire_basic_flame.png"}, | ||||
| 	drawtype = "plantlike", | ||||
| 	tiles = {{ | ||||
| 		name="fire_basic_flame_animated.png", | ||||
| 		animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}, | ||||
| 	}}, | ||||
| 	inventory_image = "fire_basic_flame.png", | ||||
| 	light_source = 14, | ||||
| 	groups = {igniter=2,dig_immediate=3}, | ||||
| 	drop = '', | ||||
| 	walkable = false, | ||||
| 	buildable_to = true, | ||||
| 	damage_per_second = 4, | ||||
| 	 | ||||
| 	after_place_node = function(pos, placer) | ||||
| 		fire.on_flame_add_at(pos) | ||||
| 	end, | ||||
| 	 | ||||
| 	after_dig_node = function(pos, oldnode, oldmetadata, digger) | ||||
| 		fire.on_flame_remove_at(pos) | ||||
| 	end, | ||||
| }) | ||||
|  | ||||
| local fire = {} | ||||
| fire = {} | ||||
| fire.D = 6 | ||||
| -- key: position hash of low corner of area | ||||
| -- value: {handle=sound handle, name=sound name} | ||||
| @@ -88,18 +102,6 @@ function fire.flame_should_extinguish(pos) | ||||
| 	return (#ps ~= 0) | ||||
| end | ||||
|  | ||||
| minetest.register_on_placenode(function(pos, newnode, placer) | ||||
| 	if newnode.name == "fire:basic_flame" then | ||||
| 		fire.on_flame_add_at(pos) | ||||
| 	end | ||||
| end) | ||||
|  | ||||
| minetest.register_on_dignode(function(pos, oldnode, digger) | ||||
| 	if oldnode.name == "fire:basic_flame" then | ||||
| 		fire.on_flame_remove_at(pos) | ||||
| 	end | ||||
| end) | ||||
|  | ||||
| -- Ignite neighboring nodes | ||||
| minetest.register_abm({ | ||||
| 	nodenames = {"group:flammable"}, | ||||
| @@ -177,6 +179,7 @@ minetest.register_abm({ | ||||
| 					return | ||||
| 				end | ||||
| 				minetest.env:remove_node(p) | ||||
| 				nodeupdate(p) | ||||
| 			end | ||||
| 		else | ||||
| 			-- remove flame | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/fire/textures/fire_basic_flame_animated.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 2.2 KiB | 
| @@ -102,6 +102,7 @@ minetest.register_craftitem(":cooked_rat", { | ||||
| minetest.register_craftitem(":firefly", { | ||||
| 	description = "Firefly", | ||||
| 	inventory_image = "firefly.png", | ||||
| 	groups = {not_in_creative_inventory=1}, | ||||
| 	on_drop = function(item, dropper, pos) | ||||
| 		minetest.env:add_firefly(pos) | ||||
| 		item:take_item() | ||||
|   | ||||
| @@ -4,8 +4,8 @@ | ||||
| stairs = {} | ||||
|  | ||||
| -- Node will be called stairs:stair_<subname> | ||||
| function stairs.register_stair(subname, recipeitem, groups, images, description) | ||||
| 	minetest.register_node("stairs:stair_" .. subname, { | ||||
| function stairs.register_stair(subname, recipeitem, groups, images, description, sounds) | ||||
| 	minetest.register_node(":stairs:stair_" .. subname, { | ||||
| 		description = description, | ||||
| 		drawtype = "nodebox", | ||||
| 		tiles = images, | ||||
| @@ -13,6 +13,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description) | ||||
| 		paramtype2 = "facedir", | ||||
| 		is_ground_content = true, | ||||
| 		groups = groups, | ||||
| 		sounds = sounds, | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = { | ||||
| @@ -20,6 +21,57 @@ function stairs.register_stair(subname, recipeitem, groups, images, description) | ||||
| 				{-0.5, 0, 0, 0.5, 0.5, 0.5}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = { | ||||
| 				{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, | ||||
| 				{-0.5, 0, 0, 0.5, 0.5, 0.5}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		on_place = function(itemstack, placer, pointed_thing) | ||||
| 			if pointed_thing.type ~= "node" then | ||||
| 				return itemstack | ||||
| 			end | ||||
| 			 | ||||
| 			local p0 = pointed_thing.under | ||||
| 			local p1 = pointed_thing.above | ||||
| 			if p0.y-1 == p1.y then | ||||
| 				local fakestack = ItemStack("stairs:stair_" .. subname.."upside_down") | ||||
| 				local ret = minetest.item_place(fakestack, placer, pointed_thing) | ||||
| 				if ret:is_empty() then | ||||
| 					itemstack:take_item() | ||||
| 					return itemstack | ||||
| 				end | ||||
| 			end | ||||
| 			 | ||||
| 			-- Otherwise place regularly | ||||
| 			return minetest.item_place(itemstack, placer, pointed_thing) | ||||
| 		end, | ||||
| 	}) | ||||
| 	 | ||||
| 	minetest.register_node(":stairs:stair_" .. subname.."upside_down", { | ||||
| 		drop = "stairs:stair_" .. subname, | ||||
| 		drawtype = "nodebox", | ||||
| 		tiles = images, | ||||
| 		paramtype = "light", | ||||
| 		paramtype2 = "facedir", | ||||
| 		is_ground_content = true, | ||||
| 		groups = groups, | ||||
| 		sounds = sounds, | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = { | ||||
| 				{-0.5, 0, -0.5, 0.5, 0.5, 0.5}, | ||||
| 				{-0.5, -0.5, 0, 0.5, 0, 0.5}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = { | ||||
| 				{-0.5, 0, -0.5, 0.5, 0.5, 0.5}, | ||||
| 				{-0.5, -0.5, 0, 0.5, 0, 0.5}, | ||||
| 			}, | ||||
| 		}, | ||||
| 	}) | ||||
|  | ||||
| 	minetest.register_craft({ | ||||
| @@ -43,14 +95,15 @@ function stairs.register_stair(subname, recipeitem, groups, images, description) | ||||
| end | ||||
|  | ||||
| -- Node will be called stairs:slab_<subname> | ||||
| function stairs.register_slab(subname, recipeitem, groups, images, description) | ||||
| 	minetest.register_node("stairs:slab_" .. subname, { | ||||
| function stairs.register_slab(subname, recipeitem, groups, images, description, sounds) | ||||
| 	minetest.register_node(":stairs:slab_" .. subname, { | ||||
| 		description = description, | ||||
| 		drawtype = "nodebox", | ||||
| 		tiles = images, | ||||
| 		paramtype = "light", | ||||
| 		is_ground_content = true, | ||||
| 		groups = groups, | ||||
| 		sounds = sounds, | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, | ||||
| @@ -71,13 +124,10 @@ function stairs.register_slab(subname, recipeitem, groups, images, description) | ||||
| 			local p0 = pointed_thing.under | ||||
| 			local p1 = pointed_thing.above | ||||
| 			local n0 = minetest.env:get_node(p0) | ||||
| 			local n1 = minetest.env:get_node(p1) | ||||
| 			if n0.name == "stairs:slab_" .. subname then | ||||
| 			if n0.name == "stairs:slab_" .. subname and | ||||
| 					p0.y+1 == p1.y then | ||||
| 				slabpos = p0 | ||||
| 				slabnode = n0 | ||||
| 			elseif n1.name == "stairs:slab_" .. subname then | ||||
| 				slabpos = p1 | ||||
| 				slabnode = n1 | ||||
| 			end | ||||
| 			if slabpos then | ||||
| 				-- Remove the slab at slabpos | ||||
| @@ -96,10 +146,69 @@ function stairs.register_slab(subname, recipeitem, groups, images, description) | ||||
| 				return itemstack | ||||
| 			end | ||||
| 			 | ||||
| 			-- Upside down slabs | ||||
| 			if p0.y-1 == p1.y then | ||||
| 				-- Turn into full block if pointing at a existing slab | ||||
| 				if n0.name == "stairs:slab_" .. subname.."upside_down" then | ||||
| 					-- Remove the slab at the position of the slab | ||||
| 					minetest.env:remove_node(p0) | ||||
| 					-- Make a fake stack of a single item and try to place it | ||||
| 					local fakestack = ItemStack(recipeitem) | ||||
| 					pointed_thing.above = p0 | ||||
| 					fakestack = minetest.item_place(fakestack, placer, pointed_thing) | ||||
| 					-- If the item was taken from the fake stack, decrement original | ||||
| 					if not fakestack or fakestack:is_empty() then | ||||
| 						itemstack:take_item(1) | ||||
| 					-- Else put old node back | ||||
| 					else | ||||
| 						minetest.env:set_node(p0, n0) | ||||
| 					end | ||||
| 					return itemstack | ||||
| 				end | ||||
| 				 | ||||
| 				-- Place upside down slab | ||||
| 				local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down") | ||||
| 				local ret = minetest.item_place(fakestack, placer, pointed_thing) | ||||
| 				if ret:is_empty() then | ||||
| 					itemstack:take_item() | ||||
| 					return itemstack | ||||
| 				end | ||||
| 			end | ||||
| 			 | ||||
| 			-- If pointing at the side of a upside down slab | ||||
| 			if n0.name == "stairs:slab_" .. subname.."upside_down" and | ||||
| 					p0.y+1 ~= p1.y then | ||||
| 				-- Place upside down slab | ||||
| 				local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down") | ||||
| 				local ret = minetest.item_place(fakestack, placer, pointed_thing) | ||||
| 				if ret:is_empty() then | ||||
| 					itemstack:take_item() | ||||
| 					return itemstack | ||||
| 				end | ||||
| 			end | ||||
| 			 | ||||
| 			-- Otherwise place regularly | ||||
| 			return minetest.item_place(itemstack, placer, pointed_thing) | ||||
| 		end, | ||||
| 	}) | ||||
| 	 | ||||
| 	minetest.register_node(":stairs:slab_" .. subname.."upside_down", { | ||||
| 		drop = "stairs:slab_"..subname, | ||||
| 		drawtype = "nodebox", | ||||
| 		tiles = images, | ||||
| 		paramtype = "light", | ||||
| 		is_ground_content = true, | ||||
| 		groups = groups, | ||||
| 		sounds = sounds, | ||||
| 		node_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5}, | ||||
| 		}, | ||||
| 		selection_box = { | ||||
| 			type = "fixed", | ||||
| 			fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5}, | ||||
| 		}, | ||||
| 	}) | ||||
|  | ||||
| 	minetest.register_craft({ | ||||
| 		output = 'stairs:slab_' .. subname .. ' 3', | ||||
| @@ -110,37 +219,42 @@ function stairs.register_slab(subname, recipeitem, groups, images, description) | ||||
| end | ||||
|  | ||||
| -- Nodes will be called stairs:{stair,slab}_<subname> | ||||
| function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab) | ||||
| 	stairs.register_stair(subname, recipeitem, groups, images, desc_stair) | ||||
| 	stairs.register_slab(subname, recipeitem, groups, images, desc_slab) | ||||
| function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds) | ||||
| 	stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds) | ||||
| 	stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds) | ||||
| end | ||||
|  | ||||
| stairs.register_stair_and_slab("wood", "default:wood", | ||||
| 		{snappy=2,choppy=2,oddly_breakable_by_hand=2}, | ||||
| 		{"default_wood.png"}, | ||||
| 		"Wooden stair", | ||||
| 		"Wooden slab") | ||||
| 		"Wooden slab", | ||||
| 		default.node_sound_wood_defaults()) | ||||
|  | ||||
| stairs.register_stair_and_slab("stone", "default:stone", | ||||
| 		{cracky=3}, | ||||
| 		{"default_stone.png"}, | ||||
| 		"Stone stair", | ||||
| 		"Stone slab") | ||||
| 		"Stone slab", | ||||
| 		default.node_sound_stone_defaults()) | ||||
|  | ||||
| stairs.register_stair_and_slab("cobble", "default:cobble", | ||||
| 		{cracky=3}, | ||||
| 		{"default_cobble.png"}, | ||||
| 		"Cobble stair", | ||||
| 		"Cobble slab") | ||||
| 		"Cobble slab", | ||||
| 		default.node_sound_stone_defaults()) | ||||
|  | ||||
| stairs.register_stair_and_slab("brick", "default:brick", | ||||
| 		{cracky=3}, | ||||
| 		{"default_brick.png"}, | ||||
| 		"Brick stair", | ||||
| 		"Brick slab") | ||||
| 		"Brick slab", | ||||
| 		default.node_sound_stone_defaults()) | ||||
|  | ||||
| stairs.register_stair_and_slab("sandstone", "default:sandstone", | ||||
| 		{crumbly=2,cracky=2}, | ||||
| 		{"default_sandstone.png"}, | ||||
| 		"Sandstone stair", | ||||
| 		"Sandstone slab") | ||||
| 		"Sandstone slab", | ||||
| 		default.node_sound_stone_defaults()) | ||||
|   | ||||
							
								
								
									
										45
									
								
								mods/vessels/README.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,45 @@ | ||||
| Minetest 0.4 mod: vessels | ||||
| ========================== | ||||
|  | ||||
| Crafts | ||||
| ------- | ||||
| Glass bottle (yields 10) | ||||
|  | ||||
|    G - G | ||||
|    G - G | ||||
|    - G - | ||||
|  | ||||
| Drinking Glass (yields 14) | ||||
|  | ||||
|    G - G | ||||
|    G - G | ||||
|    G G G | ||||
|  | ||||
| Heavy Steel Bottle (yields 5) | ||||
|  | ||||
|    S - S | ||||
|    S - S | ||||
|    - S - | ||||
|  | ||||
| License of source code: | ||||
| ----------------------- | ||||
| Copyright (C) 2012 Vanessa Ezekowitz | ||||
| Version 2012-09-02 | ||||
| Modifications by Perttu Ahola <celeron55@gmail.com> | ||||
|  | ||||
| This program is free software; you can redistribute it and/or modify | ||||
| it under the terms of the GNU Lesser General Public License as published by | ||||
| the Free Software Foundation; either version 2.1 of the License, or | ||||
| (at your option) any later version. | ||||
|  | ||||
| http://www.gnu.org/licenses/lgpl-2.1.html | ||||
|  | ||||
| License of media (textures and sounds) | ||||
| -------------------------------------- | ||||
| WTFPL | ||||
|  | ||||
| Authors of media files | ||||
| ----------------------- | ||||
| Unless specifically noted, | ||||
| Copyright (C) 2012 Vanessa Ezekowitz | ||||
|  | ||||
							
								
								
									
										1
									
								
								mods/vessels/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1 @@ | ||||
| default | ||||
							
								
								
									
										89
									
								
								mods/vessels/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,89 @@ | ||||
| -- Minetest 0.4 mod: vessels | ||||
| -- See README.txt for licensing and other information. | ||||
|  | ||||
| minetest.register_craftitem("vessels:glass_bottle", { | ||||
| 	description = "Glass Bottle (empty)", | ||||
| 	inventory_image = "vessels_glass_bottle_inv.png", | ||||
| 	wield_image = "vessels_glass_bottle.png", | ||||
| 	groups = {vessel=1}, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "vessels:glass_bottle 10", | ||||
| 	recipe = { | ||||
| 		{ "default:glass", "", "default:glass" }, | ||||
| 		{ "default:glass", "", "default:glass" }, | ||||
| 		{ "", "default:glass", "" } | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| minetest.register_craftitem("vessels:drinking_glass", { | ||||
| 	description = "Drinking Glass (empty)", | ||||
| 	inventory_image = "vessels_drinking_glass_inv.png", | ||||
| 	wield_image = "vessels_drinking_glass.png", | ||||
| 	groups = {vessel=1}, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "vessels:drinking_glass 14", | ||||
| 	recipe = { | ||||
| 		{ "default:glass", "", "default:glass" }, | ||||
| 		{ "default:glass", "", "default:glass" }, | ||||
| 		{ "default:glass", "default:glass", "default:glass" } | ||||
| 	} | ||||
| }) | ||||
|  | ||||
| minetest.register_craftitem("vessels:steel_bottle", { | ||||
| 	description = "Heavy Steel Bottle (empty)", | ||||
| 	inventory_image = "vessels_steel_bottle_inv.png", | ||||
| 	wield_image = "vessels_steel_bottle.png", | ||||
| 	groups = {vessel=1}, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	output = "vessels:steel_bottle 5", | ||||
| 	recipe = { | ||||
| 		{ "default:steel_ingot", "", "default:steel_ingot" }, | ||||
| 		{ "default:steel_ingot", "", "default:steel_ingot" }, | ||||
| 		{ "", "default:steel_ingot", "" } | ||||
| 	} | ||||
| }) | ||||
|  | ||||
|  | ||||
| -- Make sure we can recycle them | ||||
|  | ||||
| minetest.register_craftitem("vessels:glass_fragments", { | ||||
| 	description = "Pile of Glass Fragments", | ||||
| 	inventory_image = "vessels_glass_fragments.png", | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	type = "shapeless", | ||||
| 	output = "vessels:glass_fragments", | ||||
| 	recipe = { | ||||
| 		"vessels:glass_bottle", | ||||
| 		"vessels:glass_bottle", | ||||
| 	}, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	type = "shapeless", | ||||
| 	output = "vessels:glass_fragments", | ||||
| 	recipe = { | ||||
| 		"vessels:drinking_glass", | ||||
| 		"vessels:drinking_glass", | ||||
| 	}, | ||||
| }) | ||||
|  | ||||
| minetest.register_craft({ | ||||
| 	type = "cooking", | ||||
| 	output = "default:glass", | ||||
| 	recipe = "vessels:glass_fragments", | ||||
| }) | ||||
|  | ||||
| minetest.register_craft( { | ||||
| 	type = "cooking", | ||||
| 	output = "default:steel_ingot", | ||||
| 	recipe = "vessels:steel_bottle", | ||||
| }) | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/alternates/vessels_drinking_glass.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 253 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/alternates/vessels_glass_bottle.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 242 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/alternates/vessels_steel_bottle.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 345 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_drinking_glass.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 253 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_drinking_glass_inv.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 338 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_glass_bottle.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 242 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_glass_bottle_inv.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 405 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_glass_fragments.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 425 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_steel_bottle.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 345 B | 
							
								
								
									
										
											BIN
										
									
								
								mods/vessels/textures/vessels_steel_bottle_inv.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 342 B | 
							
								
								
									
										28
									
								
								mods/wool/README.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,28 @@ | ||||
| Minetest 0.4 mod: wool | ||||
| ====================== | ||||
|  | ||||
| Mostly backward-compatible with jordach's 16-color wool mod. | ||||
|  | ||||
| License of source code: | ||||
| ----------------------- | ||||
| Copyright (C) 2012 Perttu Ahola (celeron55) <celeron55@gmail.com> | ||||
|  | ||||
| This program is free software. It comes without any warranty, to | ||||
| the extent permitted by applicable law. You can redistribute it | ||||
| and/or modify it under the terms of the Do What The Fuck You Want | ||||
| To Public License, Version 2, as published by Sam Hocevar. See | ||||
| http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
|  | ||||
| License of media (textures and sounds) | ||||
| -------------------------------------- | ||||
| Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) | ||||
| http://creativecommons.org/licenses/by-sa/3.0/ | ||||
|  | ||||
| Authors of media files | ||||
| ----------------------- | ||||
| Cisoun: | ||||
| - wool_black.png wool_brown.png wool_dark_green.png wool_green.png | ||||
| - wool_magenta.png wool_pink.png wool_violet.png wool_yellow.png wool_blue.png | ||||
| - wool_cyan.png wool_dark_grey.png wool_grey.png wool_orange.png wool_red.png | ||||
| - wool_white.png | ||||
|  | ||||
							
								
								
									
										0
									
								
								mods/wool/depends.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										48
									
								
								mods/wool/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,48 @@ | ||||
| -- minetest/wool/init.lua | ||||
|  | ||||
| -- Backwards compatibility with jordach's 16-color wool mod | ||||
| minetest.register_alias("wool:dark_blue", "wool:blue") | ||||
| minetest.register_alias("wool:gold", "wool:yellow") | ||||
|  | ||||
| local wool = {} | ||||
| -- This uses a trick: you can first define the recipes using all of the base | ||||
| -- colors, and then some recipes using more specific colors for a few non-base | ||||
| -- colors available. When crafting, the last recipes will be checked first. | ||||
| wool.dyes = { | ||||
| 	{"white",      "White",      nil}, | ||||
| 	{"grey",       "Grey",       "basecolor_grey"}, | ||||
| 	{"black",      "Black",      "basecolor_black"}, | ||||
| 	{"red",        "Red",        "basecolor_red"}, | ||||
| 	{"yellow",     "Yellow",     "basecolor_yellow"}, | ||||
| 	{"green",      "Green",      "basecolor_green"}, | ||||
| 	{"cyan",       "Cyan",       "basecolor_cyan"}, | ||||
| 	{"blue",       "Blue",       "basecolor_blue"}, | ||||
| 	{"magenta",    "Magenta",    "basecolor_magenta"}, | ||||
| 	{"orange",     "Orange",     "excolor_orange"}, | ||||
| 	{"violet",     "Violet",     "excolor_violet"}, | ||||
| 	{"brown",      "Brown",      "unicolor_dark_orange"}, | ||||
| 	{"pink",       "Pink",       "unicolor_light_red"}, | ||||
| 	{"dark_grey",  "Dark Grey",  "unicolor_darkgrey"}, | ||||
| 	{"dark_green", "Dark Green", "unicolor_dark_green"}, | ||||
| } | ||||
|  | ||||
| for _, row in ipairs(wool.dyes) do | ||||
| 	local name = row[1] | ||||
| 	local desc = row[2] | ||||
| 	local craft_color_group = row[3] | ||||
| 	-- Node Definition | ||||
| 	minetest.register_node("wool:"..name, { | ||||
| 		description = desc.." Wool", | ||||
| 		tiles = {"wool_"..name..".png"}, | ||||
| 		groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, | ||||
| 	}) | ||||
| 	if craft_color_group then | ||||
| 		-- Crafting from dye and white wool | ||||
| 		minetest.register_craft({ | ||||
| 			type = "shapeless", | ||||
| 			output = 'wool:'..name..' 16', | ||||
| 			recipe = {'group:dye,'..craft_color_group, 'wool:white'}, | ||||
| 		}) | ||||
| 	end | ||||
| end | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_black.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.1 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_blue.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.1 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_brown.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.2 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_cyan.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.2 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_dark_green.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.2 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_dark_grey.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.3 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mods/wool/textures/wool_green.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.3 KiB |