Page 334 of 443

Re: Empire Voxel Building

Posted: Sat Jan 19, 2019 20:08
by v-rob
sorcerykid wrote:
voxelproof wrote:Today comes truly historic moment. I am proud to announce that the work on Empire Voxel Building is nearing its glorious culmination and I hope that if no catastrophic event prevents it, the map will be downloadable in a few weeks time.
Very impressive! Can I request a model of Sears Tower next? That way when I revamp the homepage at searstower.org (currently offline for redesign), I can include a VR walkthrough model to entice visitors to download Minetest :D
Heh. I tried making a model of the Sears Tower in Minetest once a long time ago. I gave up after around 10 floors. Of course, I didn't know about WorldEdit at that point.

Re: Empire Voxel Building

Posted: Sat Jan 19, 2019 21:29
by voxelproof
sorcerykid wrote:
voxelproof wrote:Today comes truly historic moment. I am proud to announce that the work on Empire Voxel Building is nearing its glorious culmination and I hope that if no catastrophic event prevents it, the map will be downloadable in a few weeks time.
Very impressive! Can I request a model of Sears Tower next? That way when I revamp the homepage at searstower.org (currently offline for redesign), I can include a VR walkthrough model to entice visitors to download Minetest :D
First I'd like to polish the model I'm currently working on. This was at first meant to be a purely technical demonstration of possibilities offered by MTG and World Edit, but the project started to live its own life ;) As for the Black Giant I think it would be a little easier than with art deco-styled Empire State, I'll see. Frankly I'd rather focus on my favourite architect, Frank Lloyd Wright whose architectural style I like most of all historic styles.

It would be great to create architectural theme park which would include many world-famous pieces of great artistic architecture, but such project would require more than one builder, especially that I'm determined to make all future models in this not-minecraftish scale.

Re: Post your screenshots!

Posted: Sat Jan 19, 2019 21:34
by Chibi ghost
my pet panda messing about on the sofa
Image

Re: Post your screenshots!

Posted: Sun Jan 20, 2019 01:36
by Christian_Soldier
Chibi ghost wrote:my pet panda messing about on the sofa
Image
Looks more like it's in the wall, lol.

Re: Post your screenshots!

Posted: Sun Jan 20, 2019 10:02
by Chibi ghost
shortly after I took the pic it glitched into the loft XD

Re: Post your screenshots!

Posted: Sun Jan 20, 2019 23:51
by sorcerykid
Today I was testing out my new signs_rx mod, which is a complete overhaul of default signs. It's now possible to view the full text of a sign within a custom sized and colored formspec combined with an advanced markup language specifically tailored for Minetest formspecs with simple-to-use tags for layout and formatting (i.e. color, header, border, rows and columns, etc.) and builtin word-wrapping within all cells.

Image

Image

There's even support for bolded inline text (although it is still very experimental!

The lexer is capable of automatically resizing rows and columns to fit within the dimensions of the formspec and to prevent overruns. Best of all, due to nature of the markup language, a context-sensitive algorithm is able to produce infotext (stripped of all tags, of course) that is still very true to the original as you can see here:

Image

Re: Post your screenshots!

Posted: Sun Jan 20, 2019 23:54
by rubenwardy
Wow nice. Do you mitigate bad text rendering somehow? ie: it's common to see overlapping or out of bounds with text

Edit: I see it's a table, didn't realise it supported merging cells. Tables have to be my favourite element :)

Re: Post your screenshots!

Posted: Mon Jan 21, 2019 00:46
by jp
my new signs_rx mod
Better than this: https://www.youtube.com/watch?v=to2BMSdGwlo

Re: Post your screenshots!

Posted: Mon Jan 21, 2019 14:20
by piecubed
sorcerykid wrote:Today I was testing out my new signs_rx mod, which is a complete overhaul of default signs. It's now possible to view the full text of a sign within a custom sized and colored formspec combined with an advanced markup language specifically tailored for Minetest formspecs with simple-to-use tags for layout and formatting (i.e. color, header, border, rows and columns, etc.) and builtin word-wrapping within all cells.
Github link please?

Re: Post your screenshots!

Posted: Mon Jan 21, 2019 19:29
by Inocudom
jp wrote:
my new signs_rx mod
Better than this: https://www.youtube.com/watch?v=to2BMSdGwlo
Oh, jp, you came back. On the good side, your creation displays the text that is inputted into it.

Re: Post your screenshots!

Posted: Mon Jan 21, 2019 21:10
by joe7575
Machine and Warehouse in XXL build by a player on my server.

Image

Image

Re: Post your screenshots!

Posted: Tue Jan 22, 2019 02:27
by Napiophelios
I couldn't resist, had to see what it would look like in game.
Image
screenshot_20190121_212256.png
screenshot_20190121_212256.png (100.65 KiB) Viewed 1374 times

Re: Post your screenshots!

Posted: Tue Jan 22, 2019 15:49
by Inocudom
Inocudom wrote:Image
I guess Minetest can run on a toaster after all.
Image
I got OpenGL to work properly on this old toaster again.

Re: Post your screenshots!

Posted: Tue Jan 22, 2019 23:44
by Christian_Soldier
Inocudom wrote:
Inocudom wrote:Image
I guess Minetest can run on a toaster after all.
Image
I got OpenGL to work properly on this old toaster again.
How can a game run on a toaster?
Image

Touchdown!

Posted: Wed Jan 23, 2019 09:18
by voxelproof
Now you can see what I needed EVB for. I just wanted a proper mooring mast for MTS Framebuoyant 8D

Image

Image

Image

EDIT:

DOWNLOAD:
viewtopic.php?f=12&t=21963

Re: Post your screenshots!

Posted: Thu Jan 24, 2019 08:44
by jas
Minetest 5.0.0 is going to be great.
Image

Just great.
Image

Re: Post your screenshots!

Posted: Thu Jan 24, 2019 08:51
by nrz
Christian_Soldier wrote:
Inocudom wrote:
Inocudom wrote:Image
I guess Minetest can run on a toaster after all.
Image
I got OpenGL to work properly on this old toaster again.
How can a game run on a toaster?
Image
Maybe using this toaster: https://www.embeddedarm.com/blog/netbsd ... -arm9-sbc/

Thicc dawn

Posted: Thu Jan 24, 2019 15:05
by texmex
Image

Re: Post your screenshots!

Posted: Sat Jan 26, 2019 03:35
by Christian_Soldier
nrz wrote: Maybe using this toaster: https://www.embeddedarm.com/blog/netbsd ... -arm9-sbc/
Oh ok. I didn't know you were using some kind of toaster that doubles as a computer. It seems cool that something like that exists, btw.

Re: Post your screenshots!

Posted: Sat Jan 26, 2019 08:08
by Pudding
I got bored so I decided to forged a few painting.

Image

Re: Post your screenshots!

Posted: Sat Jan 26, 2019 14:49
by sorcerykid
Experimenting with the new player profiles feature on JT2! When completed next week, it will be the full-fledged social media network built on top of Minetest. Below are screenshots of a working prototype on my test server.

Profiles allow users to build a personalized homepage, to describe themselves, their interests, etc. with access to the complete Bedrock Markup Language (currently used in the signs_rx mod) -- which has been extended to with support for embedded images, hyperlinks, and dynamic variables.

By right-clicking any player in game (or typing /whois if they are offline), it is possible to view their profile, leave comments, and request event notifications (via the HUD as well as audio alerts). All comments and followers can be managed via a profile settings panel.

Image

Image

Re: Post your screenshots!

Posted: Sat Jan 26, 2019 15:01
by Hybrid Dog
sorcerykid wrote:Profiles allow users to build a personalized homepage, to describe themselves, their interests, etc. with access to the complete Bedrock Markup Language (also used in the signs_rx mod) -- which has been extended to with support for embedded images, hyperlinks, and dynamic variables.
This makes me think that a mod which converts markdown to a formspec could be a good idea, markdown is well-known and even readable as source after all.

Re: Post your screenshots!

Posted: Sat Jan 26, 2019 19:55
by texmex
Your formspec game is immensely strong, sorcerykid! Do you play on releasing this mod later? It can benefit many servers.

Re: Post your screenshots!

Posted: Sat Jan 26, 2019 22:17
by ShadMOrdre
Soon to be released.

Image
Image

Crafting without formspecs. Inspired by Sokomine's Anvil mod, itemshelf, gramophone and others.

Turned out MC story mode uses this style as well, but had no influence or motivation towards the making of this mod.

This code, hacked from zorman2000s itemshelf mod, belongs within a WIP mod of mine, but I'll post here, in hopes that somone with better code skills can clean it up some, or better yet, give me direction to do this myself. There are still some issues as well, mainly, itemstacks are not handled properly ATM, so use only one item in a stack at a time for now.

Code: Select all

-- Item shelf for generic objects
-- Inventory overlay and blast code taken from vessels mod in MTG
-- All other code by Zorman2000

local function get_shelf_formspec(inv_size)
	return "size[8,8]"..
		default.gui_bg..
		default.gui_bg_img..
		default.gui_slots..

		--"list[context;main;"..(math.abs((inv_size / 2) - 8) / 2)..",0.25;"..(inv_size / 2)..",2;]"..
		"list[context;input;"..(math.abs((inv_size / 2) - 8) / 2)..",0.25;3,3;]"..
		"list[current_player;main;0,3.75;8,1;]"..
		"list[current_player;main;0,5;8,3;8]"..
		"listring[context;main]"..
		"listring[current_player;main]"
end

local temp_texture
local temp_size

local temp_slot

local function get_obj_dir(param2)
	return ((param2 + 1) % 4)
end

local function update_shelf(pos)
	-- Remove all objects
	local objs = minetest.get_objects_inside_radius(pos, 0.875)
	for _,obj in pairs(objs) do
		obj:remove()
	end
	
	-- if not slot then
		-- slot = temp_slot
	-- end

	local node = minetest.get_node(pos)
	local node_dir = minetest.facedir_to_dir(((node.param2 + 2) % 4))
	--local node_dir = minetest.facedir_to_dir(((node.param2) % 4))
	--local node_dir = minetest.facedir_to_dir(((node.param2 + 2)))
	local obj_dir = minetest.facedir_to_dir(get_obj_dir(node.param2))
	local max_shown_items = minetest.get_item_group(node.name, "itemshelf_shown_items")

	-- Calculate initial position for entities
	-- local start_pos = {
	-- 	x=pos.x - (0.25 * obj_dir.x) - (node_dir.x * 0.25),
	-- 	y=pos.y + 0.25,
	-- 	z=pos.z - (0.25 * obj_dir.z) - (node_dir.z * 0.25)
	-- }
	--x = Left,Right;     y = Down/Up;     z = Front/Back;     (axis = neg/pos)
	-- How the below works: Following is a top view of a node
	--                              | +z (N) 0
	--                              |
	-- 					------------------------
	-- 					|           |          |
	-- 					|           |          |
	-- 					|           |          |
	--     -x (W) 3     |           | (0,0)    |      +x (E) 1
	--     -------------|-----------+----------|--------------
	-- 					|           |          |
	-- 					|           |          |
	-- 					|           |          |
	-- 					|           |          |
	-- 					------------------------
	-- 				                |
	-- 								| -z (S) 2

	-- From the picture above, your front could be at either -z, -z, x or z.
	-- To get the entity closer to the front, you need to add a certain amount
	-- (e.g. 0.25) to the x and z coordinates, and then multiply these by the
	-- the node direction (which is a vector pointing outwards of the node face).
	-- Therefore, start_pos is:
	--local displacement = 0.715
	--local displacement = 0.555	
	local displacement = 0.555
	if max_shown_items == 6 then
		displacement = 0.555
	end
	local start_pos = {
		x=pos.x - (obj_dir.x * displacement) + (node_dir.x * 0.25),
		--y=pos.y + 0.2375,
		y=pos.y + 0.5625,
		z=pos.z - (obj_dir.z * displacement) + (node_dir.z * 0.25)
	}
	-- local start_pos = {
		-- x=pos.x - (obj_dir.x) + (node_dir.x * 0.25),
		-- y=pos.y + 0.5625,
		-- z=pos.z - (obj_dir.z) + (node_dir.z * 0.25)
	-- }

	-- Calculate amount of objects in the inventory
	local inv = minetest.get_meta(pos):get_inventory()
	local list = inv:get_list("input")
	local obj_count = 0
	for key,itemstack in pairs(list) do
		if not itemstack:is_empty() then
			obj_count = obj_count + 1
		end
	end
	minetest.log("Found "..dump(obj_count).." items on shelf inventory")
	if obj_count > 0 then
		local shown_items = math.min(#list, max_shown_items)
		for i = 1, shown_items do
			--local i = temp_slot
			local overhead = i
			if i > (shown_items / 3) then
				overhead = i - (shown_items / 3)
			end
			-- if i == ((shown_items / 2) + 1) then
				-- --start_pos.y = start_pos.y - 0.5125
				-- start_pos.z = start_pos.z + 0.2775
			-- end
			-- --local addition = 0.475
			local addition = 0.2775
			-- if shown_items == 6 then
				-- addition = 0.2775
			-- end
			if i == 1 then
				start_pos.x = pos.x - 0.3125
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z + 0.3125
			end
			if i == 2 then
				start_pos.x = pos.x
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z + 0.3125
			end
			if i == 3 then
				start_pos.x = pos.x + 0.3125
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z + 0.3125
			end
			if i == 4 then
				-- start_pos.z = start_pos.z + 0.2775
				
				start_pos.x = pos.x - 0.3125
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z
			end
			if i == 5 then
				start_pos.x = pos.x
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z
			end
			if i == 6 then
				start_pos.x = pos.x + 0.3125
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z
			end
			if i == 7 then
				-- --start_pos.x = start_pos.x - (obj_dir.x * displacement) + (node_dir.x * 0.25)
				-- start_pos.x = start_pos.x - (obj_dir.x * displacement) - ((obj_dir.x * displacement) / 2)
				-- start_pos.z = start_pos.z + 0.2775
				
				start_pos.x = pos.x - 0.3125
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z - 0.3125
			end
			if i == 8 then
				start_pos.x = pos.x
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z - 0.3125
			end
			if i == 9 then
				start_pos.x = pos.x + 0.3125
				start_pos.y = pos.y + 0.5625
				start_pos.z = pos.z - 0.3125
			end
			-- local obj_pos = {
				-- x=start_pos.x + (addition * overhead * obj_dir.x), --- (node_dir.z * overhead * 0.25),
				-- y=start_pos.y,
				-- z=start_pos.z + (addition * overhead * obj_dir.z) --- (node_dir.x * overhead * 0.25),
			-- }
			local obj_pos = {
				x=start_pos.x,
				y=start_pos.y,
				z=start_pos.z,
			}

			if not list[i]:is_empty() then
				minetest.log("Adding item entity at "..minetest.pos_to_string(obj_pos))
				temp_texture = list[i]:get_name()
				temp_size = 0.8/max_shown_items
				minetest.log("Size: "..dump(temp_size))
				local ent = minetest.add_entity(obj_pos, "lib_tools:draft_table_item")
				ent:set_properties({
					wield_item = temp_texture,
					visual_size = {x = 0.8/max_shown_items, y = 0.8/max_shown_items}
				})
			end
		end
	end

end

draft_table = {}

-- Definable properties:
--   - description
--   - textures (if drawtype is nodebox)
--   - nodebox (like default minetest.register_node def)
--   - mesh (like default minetest.register_node def)
--   - item capacity (how many items will fit into the shelf, use even numbers, max 16)
--   - shown_items (how many items to show, will always show first (shown_items/2) items of each row, max 6)
function lib_tools.register_shelf(name, def)
	local drawtype = "nodebox"
	if def.mesh then
		drawtype = "mesh"
	end
	minetest.register_node("lib_tools:"..name, {
		description = def.description,
		tiles = def.textures,
		paramtype = "light",
		paramtype2 = "facedir",
		drawtype = drawtype,
		node_box = def.nodebox,
		mesh = def.mesh,
		groups = {cracky = 2, itemshelves = 1, itemshelf_shown_items = def.shown_items or 4},
		
		on_construct = function(pos)
			-- Initialize inventory
			local meta = minetest.get_meta(pos)
			local inv = meta:get_inventory()
	    	inv:set_size("input", def.capacity or 4)
	    	-- Initialize formspec
	    	--meta:set_string("formspec", get_shelf_formspec(def.capacity or 4))
		end,

		after_place_node = function(pos, placer)
			local meta = minetest.get_meta(pos)
			meta:set_string("owner", placer:get_player_name() or "")
		end,

		on_metadata_inventory_put = update_shelf,
		on_metadata_inventory_take = update_shelf,
		
		allow_metadata_inventory_put = function(pos, listname, index, stack, player)
			local meta = minetest.get_meta(pos)
			if listname~="input" then
				return 0
			end
			-- 	if minetest.get_item_group(stack:get_name(), "music_disc") ~= 0 then
			-- 		return stack:get_count()
			-- 	end
			-- 	return 0
			if meta:get_inventory():room_for_item("input", stack) then
				return stack:get_count()
			end
			return 0
		end,

		allow_metadata_inventory_take = function(pos, listname, index, stack, player)
			if listname~="input" then
				return 0
			end
			return stack:get_count()
		end,
		
		can_dig = function(pos,player)
			local meta  = minetest.get_meta(pos)
			local inv   = meta:get_inventory()
		
			if not inv:is_empty("input") then
				return false
			end
			return true
		end,

		on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
		
			local inv_index = 0
		
			local user_name=clicker:get_player_name()
			local normal,p = place_rotated.get_point(pointed_thing.above,pointed_thing.under,clicker)

			
			if p then
				minetest.chat_send_player(user_name,"Position within node:")
				minetest.chat_send_player(user_name,"X: "..p.x)
				minetest.chat_send_player(user_name,"Y: "..p.y)
				minetest.chat_send_player(user_name,"Z: "..p.z)
				
				if ((p.x >= -0.4375 and p.z >= 0.1875) and (p.x <= -0.1875 and p.z <= 0.4375)) then
				
					inv_index = 1
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= -0.125 and p.z >= 0.1875) and (p.x <= 0.125 and p.z <= 0.4375)) then
				
					inv_index = 2
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= 0.1875 and p.z >= 0.1875) and (p.x <= 0.4375 and p.z <= 0.4375)) then
				
					inv_index = 3
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= -0.4375 and p.z >= -0.125) and (p.x <= -0.1875 and p.z <= 0.125)) then
				
					inv_index = 4
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= -0.125 and p.z >= -0.125) and (p.x <= 0.125 and p.z <= 0.125)) then
				
					inv_index = 5
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= 0.1875 and p.z >= -0.125) and (p.x <= 0.4375 and p.z <= 0.125)) then
				
					inv_index = 6
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= -0.4375 and p.z >= -0.4375) and (p.x <= -0.1875 and p.z <= -0.1875)) then
				
					inv_index = 7
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= -0.125 and p.z >= -0.4375) and (p.x <= 0.125 and p.z <= -0.1875)) then
				
					inv_index = 8
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				elseif ((p.x >= 0.1875 and p.z >= -0.4375) and (p.x <= 0.4375 and p.z <= -0.1875)) then
				
					inv_index = 9
					minetest.chat_send_player(user_name,"inv_index: "..tostring(inv_index))
					
				end
			else
				minetest.chat_send_player(user_name,"Could not get point")
			end

			temp_slot = inv_index
			local meta = minetest.get_meta(pos)
			local inv = meta:get_inventory()

			if inv_index ~= 0 then
				if itemstack:get_count() == 0 then
					if not inv:is_empty("input") then
						local return_stack = inv:get_stack("input", inv_index)
						inv:set_stack("input", inv_index, nil)
						local wield_index = clicker:get_wield_index()
						clicker:get_inventory():set_stack("main", wield_index, return_stack)
						--remove_item(pos, node)
						update_shelf(pos)
						return return_stack
					end		
				end
				local this_def = minetest.registered_nodes[node.name]
				if this_def.allow_metadata_inventory_put(pos, "input", inv_index, itemstack:peek_item(), clicker) > 0 then
					local return_stack = inv:get_stack("input", inv_index)
					
					local p_ctrl = clicker:get_player_control()
					local s
					if p_ctrl.sneak then
						s = itemstack:take_item()
					else
						s = itemstack:take_item(1)
					end
					--inv:add_item("input", s)
					inv:set_stack("input", inv_index, s)
					--update_item(pos,node)
					update_shelf(pos)
					return return_stack
				end
			else
				if not inv:is_empty("input") then
					local craft_recipe = {
						method = "normal",
						width = 3,
						items = {
							inv:get_stack("input", 1),
							inv:get_stack("input", 2),
							inv:get_stack("input", 3),
							inv:get_stack("input", 4),
							inv:get_stack("input", 5),
							inv:get_stack("input", 6),
							inv:get_stack("input", 7),
							inv:get_stack("input", 8),
							inv:get_stack("input", 9)
						}
					}

					local craft_out, dec_inp = minetest.get_craft_result(craft_recipe)
					
					if craft_out.item:get_name() ~= "" then
						minetest.chat_send_player(user_name, "craft_out.item:  " .. craft_out.item:get_name())
						local t_pos = {
							x = pos.x,
							y = pos.y + 0.5625,
							z = pos.z
						}
						inv:set_stack("input", 1, nil)
						inv:set_stack("input", 2, nil)
						inv:set_stack("input", 3, nil)
						inv:set_stack("input", 4, nil)
						inv:set_stack("input", 5, nil)
						inv:set_stack("input", 6, nil)
						inv:set_stack("input", 7, nil)
						inv:set_stack("input", 8, nil)
						inv:set_stack("input", 9, nil)
						update_shelf(pos)
						minetest.add_item(t_pos, craft_out.item:take_item())
						-- local co = craft_out.item:take_item()
						-- return co
						return
					else
						return itemstack
					end
				else
					return itemstack
				end
			end
		end,

		on_punch = function(pos, node, puncher)
			if( not( pos ) or not( node ) or not( puncher )) then
				return
			end

			local wielded = puncher:get_wielded_item()
			local meta = minetest.get_meta(pos)
			local inv  = meta:get_inventory()
			
			if wielded:get_count() == 0 then
				if not inv:is_empty("input") then
					local return_stack = inv:get_stack("input", 1)
					inv:set_stack("input", 1, nil)
					local wield_index = puncher:get_wield_index()
					puncher:get_inventory():set_stack("main", wield_index, return_stack)
					--remove_item(pos, node)
					update_shelf(pos)
				end		
			end
			
			-- -- only punching with the hammer is supposed to work
			-- if wielded:get_name() ~= 'lib_tools:anvil_hammer' then
				-- return
			-- end
			
			local input = inv:get_stack('input',1)
		
			-- -- only tools can be repaired
			-- if( not( input ) 
			-- or input:is_empty()
					-- or input:get_name() == "technic:water_can" 
					-- or input:get_name() == "technic:lava_can" ) then
				-- return
			-- end
		
			-- -- 65535 is max damage
			-- local damage_state = 40-math.floor(input:get_wear()/1638)
		
			-- local tool_name = input:get_name()

			-- local hud2 = nil
			-- local hud3 = nil
			-- if( input:get_wear()>0 ) then
				-- hud2 = puncher:hud_add({
					-- hud_elem_type = "statbar",
					-- text = "default_cloud.png^[colorize:#ff0000:256",
					-- number = 40,
					-- direction = 0, -- left to right
					-- position = {x=0.5, y=0.65},
					-- alignment = {x = 0, y = 0},
					-- offset = {x = -320, y = 0},
					-- size = {x=32, y=32},
				-- })
				-- hud3 = puncher:hud_add({
					-- hud_elem_type = "statbar",
					-- text = "default_cloud.png^[colorize:#00ff00:256",
					-- number = damage_state,
					-- direction = 0, -- left to right
					-- position = {x=0.5, y=0.65},
					-- alignment = {x = 0, y = 0},
					-- offset = {x = -320, y = 0},
					-- size = {x=32, y=32},
				-- })
			-- end
			-- minetest.after(2, function()
				-- if( puncher ) then
					-- puncher:hud_remove(hud2)
					-- puncher:hud_remove(hud3)
				-- end
			-- end)
		
			-- -- tell the player when the job is done
			-- if(   input:get_wear() == 0 ) then
				-- local tool_desc
				-- if minetest.registered_items[tool_name] and minetest.registered_items[tool_name].description then
					-- tool_desc = minetest.registered_items[tool_name].description
				-- else
					-- tool_desc = tool_name
				-- end
				-- minetest.chat_send_player( puncher:get_player_name(), S('Your @1 has been repaired successfully.', tool_desc))
				-- return
			-- else
				-- --pos.y = pos.y + anvil_item_displacement
				-- pos.y = pos.y + 7/16
				-- minetest.sound_play({name="anvil_clang"}, {pos=pos})
				-- minetest.add_particlespawner({
					-- amount = 10,
					-- time = 0.1,
					-- minpos = pos,
					-- maxpos = pos,
					-- minvel = {x=2, y=3, z=2},
					-- maxvel = {x=-2, y=1, z=-2},
					-- minacc = {x=0, y= -10, z=0},
					-- maxacc = {x=0, y= -10, z=0},
					-- minexptime = 0.5,
					-- maxexptime = 1,
					-- minsize = 1,
					-- maxsize = 1,
					-- collisiondetection = true,
					-- vertical = false,
					-- texture = "anvil_spark.png",
				-- })
			-- end
		
			-- -- do the actual repair
			-- input:add_wear( -5000 ) -- equals to what technic toolshop does in 5 seconds
			-- inv:set_stack("input", 1, input)
		
			-- -- damage the hammer slightly
			-- wielded:add_wear( 100 )
			-- puncher:set_wielded_item( wielded )
		end,

		on_dig = function(pos, node, digger)
			-- Clear any object disc
			local objs = minetest.get_objects_inside_radius(pos, 0.7)
			for _,obj in pairs(objs) do
				obj:remove()
			end
			-- Pop-up disc if existing
			local meta = minetest.get_meta(pos)
			local list = meta:get_inventory():get_list("input")
			if list then
				for _,item in pairs(list) do
					local drop_pos = {
						x=math.random(pos.x - 0.5, pos.x + 0.5),
						y=pos.y,
						z=math.random(pos.z - 0.5, pos.z + 0.5)}
					minetest.add_item(pos, item:get_name())
				end
			end
			-- Remove node
			minetest.remove_node(pos)
		end,
		
		on_blast = function(pos)
			local drops = {}
			default.get_inventory_drops(pos, "lib_tools:draft_table", drops)
			drops[#drops + 1] = "lib_tools:draft_table"
			minetest.remove_node(pos)
			return drops
		end
	})
end

-- Entity for shelf
minetest.register_entity("lib_tools:draft_table_item", {
	hp_max = 1,
	visual = "wielditem",
	visual_size = {x = 0.20, y = 0.20},
	collisionbox = {0,0,0, 0,0,0},
	physical = false,
	on_activate = function(self, staticdata)
		-- Staticdata
		local data = {}
		if staticdata ~= nil and staticdata ~= "" then
			local cols = string.split(staticdata, "|")
			data["itemstring"] = cols[1]
			data["visualsize"] = tonumber(cols[2])
		end

		-- Texture
		if temp_texture ~= nil then
			-- Set texture from temp
			self.itemstring = temp_texture
			temp_texture = nil
		elseif staticdata ~= nil and staticdata ~= "" then
			-- Set texture from static data
			self.itemstring = data.itemstring
		end
		-- Set texture if available
		if self.itemstring ~= nil then
			self.wield_item = self.itemstring
		end
		
		-- Visual size
		if temp_size ~= nil then
			self.visualsize = temp_size
			temp_size = nil
		elseif staticdata ~= nil and staticdata ~= "" then
			self.visualsize = data.visualsize
		end
		-- Set visual size if available
		if self.visualsize ~= nil then
			self.visual_size = {x=self.visualsize, y=self.visualsize}
		end

		-- Set object properties
		self.object:set_properties(self)
		
	end,
	get_staticdata = function(self)
		local result = ""
		if self.itemstring ~= nil then
			result = self.itemstring.."|"
		end
		if self.visualsize ~= nil then
			result = result..self.visualsize
		end
		return result
	end,
})

local default_table = {
	type = "fixed",
	fixed = {
		{-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
		{-0.375, -0.5, -0.375, -0.25, 0.375, -0.25}, -- NodeBox3
		{0.25, -0.5, -0.375, 0.375, 0.375, -0.25}, -- NodeBox5
		{-0.375, -0.5, 0.25, -0.25, 0.375, 0.375}, -- NodeBox6
		{0.25, -0.5, 0.25, 0.375, 0.375, 0.375}, -- NodeBox7
		{-0.3125, -0.125, -0.3125, 0.3125, -0.0625, 0.3125}, -- NodeBox8
	}
}



lib_tools.register_shelf("draft_table", {
	description = "Drafting Table (For crafting)",
	textures = {
		"lib_tools_draft_table_top.png",
		"worktable_side.png",
		"worktable_side.png",
		"worktable_side.png",
		"worktable_side.png",
		"worktable_front.png",
	},
	nodebox = default_table,
	capacity = 9,
	shown_items = 9
})


Shad

My Vacations in Ethereal Valleys

Posted: Sun Jan 27, 2019 00:06
by PEAK
… just a photo album
Spoiler
The journey was long, boring,
Image

and uncomfortable.
Image

The Minecart-Service left me somewhere in the middle of Nowhere.
Image

The road to Villa Wellville, B&B
Image

My humble room
Image

That’s what they call Bed & Breakfast
Image

Points of Interest:

Ye Olde Wellville Well
Image

Le Manoir, a little bit eerie
Image

In former times this was a red stone desert…
Image

An ancient building called Flower-Tower
Image

The world’s finest collection of cobble stone
Image

Rent-a-Horse
Image

Cave with Cowquarium
Image

Training for the next moon jump
Image

Promenade at night
Image

Little village
Image

They have a proper station though
Image

Just conquered an igloo!
Image