forked from mtcontrib/pipeworks
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			c93df73a5c
			...
			2018-09-13
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					a69c210b56 | ||
| 
						 | 
					cb8a4f3cec | ||
| 
						 | 
					002bcbf850 | ||
| 
						 | 
					6fdda18390 | ||
| 
						 | 
					6492b8ec76 | 
							
								
								
									
										2
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								README
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
				
			|||||||
This mod uses nodeboxes to supply a complete set of 3D pipes and tubes, 
 | 
					This mod uses nodeboxes to supply a complete set of 3D pipes and tubes, 
 | 
				
			||||||
along devices that work with them.
 | 
					along devices that work with them.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
See https://github.com/VanessaE/pipeworks/wiki/ for detailed information about usage of this mod.
 | 
					See https://gitlab.com/VanessaE/pipeworks/wikis/ for detailed information about usage of this mod.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Unlike the previous version of this mod, these pipes are rounded, and when 
 | 
					Unlike the previous version of this mod, these pipes are rounded, and when 
 | 
				
			||||||
placed, they'll automatically join together as needed.  Pipes can go vertically 
 | 
					placed, they'll automatically join together as needed.  Pipes can go vertically 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,11 +66,8 @@ local function run_autocrafter(pos, elapsed)
 | 
				
			|||||||
	local inventory = meta:get_inventory()
 | 
						local inventory = meta:get_inventory()
 | 
				
			||||||
	local craft = get_craft(pos, inventory)
 | 
						local craft = get_craft(pos, inventory)
 | 
				
			||||||
	local output_item = craft.output.item
 | 
						local output_item = craft.output.item
 | 
				
			||||||
	-- NALC: existence de limitgroup ?
 | 
					 | 
				
			||||||
	local limitcraft = minetest.get_item_group(output_item:get_name(), "limitcraft") or 0
 | 
					 | 
				
			||||||
	-- only use crafts that have an actual result
 | 
						-- only use crafts that have an actual result
 | 
				
			||||||
	-- NALC: ou si l'item n'est pas dans le group limitcraft
 | 
						if output_item:is_empty() then
 | 
				
			||||||
	if output_item:is_empty() or limitcraft > 0 then
 | 
					 | 
				
			||||||
		meta:set_string("infotext", "unconfigured Autocrafter: unknown recipe")
 | 
							meta:set_string("infotext", "unconfigured Autocrafter: unknown recipe")
 | 
				
			||||||
		return false
 | 
							return false
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								devices.lua
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								devices.lua
									
									
									
									
									
								
							@@ -738,21 +738,3 @@ new_flow_logic_register.directional_horizonal_rotate(nodename_sp_loaded, true)
 | 
				
			|||||||
minetest.register_alias("pipeworks:valve_off_loaded", "pipeworks:valve_off_empty")
 | 
					minetest.register_alias("pipeworks:valve_off_loaded", "pipeworks:valve_off_empty")
 | 
				
			||||||
minetest.register_alias("pipeworks:entry_panel", "pipeworks:entry_panel_empty")
 | 
					minetest.register_alias("pipeworks:entry_panel", "pipeworks:entry_panel_empty")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_lbm({
 | 
					 | 
				
			||||||
	name = "pipeworks:rotate_valves_flowsensors",
 | 
					 | 
				
			||||||
	label = "Flip pipeworks valves and flow sensors around X/Z",
 | 
					 | 
				
			||||||
	run_at_every_load = false,
 | 
					 | 
				
			||||||
	nodenames = {
 | 
					 | 
				
			||||||
		"pipeworks:flow_sensor_empty",
 | 
					 | 
				
			||||||
		"pipeworks:flow_sensor_loaded",
 | 
					 | 
				
			||||||
		"pipeworks:valve_off_empty",
 | 
					 | 
				
			||||||
		"pipeworks:valve_on_empty",
 | 
					 | 
				
			||||||
		"pipeworks:valve_off_loaded",
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	action = function(pos, node)
 | 
					 | 
				
			||||||
		local dir = minetest.facedir_to_dir(node.param2)
 | 
					 | 
				
			||||||
		local newdir = { x=dir.z, y=dir.y, z=dir.x }
 | 
					 | 
				
			||||||
		local newfdir = minetest.dir_to_facedir(newdir)
 | 
					 | 
				
			||||||
		minetest.swap_node(pos, { name = node.name, param2 = newfdir })
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -350,8 +350,10 @@ luaentity.register_entity("pipeworks:tubed_item", {
 | 
				
			|||||||
					-- compatible with Minetest 0.4.13.
 | 
										-- compatible with Minetest 0.4.13.
 | 
				
			||||||
					-- Using item_drop here makes Minetest 0.4.13 crash.
 | 
										-- Using item_drop here makes Minetest 0.4.13 crash.
 | 
				
			||||||
					local dropped_item = minetest.add_item(self.start_pos, stack)
 | 
										local dropped_item = minetest.add_item(self.start_pos, stack)
 | 
				
			||||||
					dropped_item:set_velocity(vector.multiply(velocity, 5))
 | 
										if dropped_item then
 | 
				
			||||||
					self:remove()
 | 
											dropped_item:set_velocity(vector.multiply(velocity, 5))
 | 
				
			||||||
 | 
											self:remove()
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
					return
 | 
										return
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					velocity = vector.multiply(velocity, -1)
 | 
										velocity = vector.multiply(velocity, -1)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										23
									
								
								wielder.lua
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								wielder.lua
									
									
									
									
									
								
							@@ -331,12 +331,25 @@ if pipeworks.enable_node_breaker then
 | 
				
			|||||||
				virtplayer:set_wielded_item(wieldstack)
 | 
									virtplayer:set_wielded_item(wieldstack)
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
				local under_node = minetest.get_node(pointed_thing.under)
 | 
									local under_node = minetest.get_node(pointed_thing.under)
 | 
				
			||||||
				local on_dig = (minetest.registered_nodes[under_node.name] or {on_dig=minetest.node_dig}).on_dig
 | 
									local def = minetest.registered_nodes[under_node.name]
 | 
				
			||||||
				-- check that the current tool is capable of destroying the target node.
 | 
									if not def then
 | 
				
			||||||
 | 
										-- do not dig an unknown node
 | 
				
			||||||
 | 
										return
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									-- check that the current tool is capable of destroying the
 | 
				
			||||||
 | 
									-- target node.
 | 
				
			||||||
				-- if we can't, don't dig, and leave the wield stack unchanged.
 | 
									-- if we can't, don't dig, and leave the wield stack unchanged.
 | 
				
			||||||
				-- note that wieldstack:get_tool_capabilities() returns hand properties if the item has none of it's own.
 | 
									-- note that wieldstack:get_tool_capabilities() returns hand
 | 
				
			||||||
				if can_tool_dig_node(under_node.name, wieldstack:get_tool_capabilities(), wieldstack:get_name()) then
 | 
									-- properties if the item has none of it's own.
 | 
				
			||||||
					on_dig(pointed_thing.under, under_node, virtplayer)
 | 
									if can_tool_dig_node(under_node.name,
 | 
				
			||||||
 | 
											wieldstack:get_tool_capabilities(),
 | 
				
			||||||
 | 
											wieldstack:get_name()) then
 | 
				
			||||||
 | 
										def.on_dig(pointed_thing.under, under_node, virtplayer)
 | 
				
			||||||
 | 
										local sound = def.sounds and def.sounds.dug
 | 
				
			||||||
 | 
										if sound then
 | 
				
			||||||
 | 
											minetest.sound_play(sound.name,
 | 
				
			||||||
 | 
												{pos=pointed_thing.under, gain=sound.gain})
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
					wieldstack = virtplayer:get_wielded_item()
 | 
										wieldstack = virtplayer:get_wielded_item()
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					--pipeworks.logger(dname.."couldn't dig node!")
 | 
										--pipeworks.logger(dname.."couldn't dig node!")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user