forked from nalc/nalc_game
		
	Bucket: Register river water bucket, add texture
Add groups to registration and use water_bucket group
This commit is contained in:
		| @@ -30,12 +30,14 @@ local function check_protection(pos, name, text) | |||||||
| end | end | ||||||
|  |  | ||||||
| -- Register a new liquid | -- Register a new liquid | ||||||
| --   source = name of the source node | --    source = name of the source node | ||||||
| --   flowing = name of the flowing node | --    flowing = name of the flowing node | ||||||
| --   itemname = name of the new bucket item (or nil if liquid is not takeable) | --    itemname = name of the new bucket item (or nil if liquid is not takeable) | ||||||
| --   inventory_image = texture of the new bucket item (ignored if itemname == nil) | --    inventory_image = texture of the new bucket item (ignored if itemname == nil) | ||||||
|  | --    name = text description of the bucket item | ||||||
|  | --    groups = (optional) groups of the bucket item, for example {water_bucket = 1} | ||||||
| -- This function can be called from any mod (that depends on bucket). | -- This function can be called from any mod (that depends on bucket). | ||||||
| function bucket.register_liquid(source, flowing, itemname, inventory_image, name) | function bucket.register_liquid(source, flowing, itemname, inventory_image, name, groups) | ||||||
| 	bucket.liquids[source] = { | 	bucket.liquids[source] = { | ||||||
| 		source = source, | 		source = source, | ||||||
| 		flowing = flowing, | 		flowing = flowing, | ||||||
| @@ -49,6 +51,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name | |||||||
| 			inventory_image = inventory_image, | 			inventory_image = inventory_image, | ||||||
| 			stack_max = 1, | 			stack_max = 1, | ||||||
| 			liquids_pointable = true, | 			liquids_pointable = true, | ||||||
|  | 			groups = groups, | ||||||
| 			on_place = function(itemstack, user, pointed_thing) | 			on_place = function(itemstack, user, pointed_thing) | ||||||
| 				-- Must be pointing to node | 				-- Must be pointing to node | ||||||
| 				if pointed_thing.type ~= "node" then | 				if pointed_thing.type ~= "node" then | ||||||
| @@ -159,7 +162,17 @@ bucket.register_liquid( | |||||||
| 	"default:water_flowing", | 	"default:water_flowing", | ||||||
| 	"bucket:bucket_water", | 	"bucket:bucket_water", | ||||||
| 	"bucket_water.png", | 	"bucket_water.png", | ||||||
| 	"Water Bucket" | 	"Water Bucket", | ||||||
|  | 	{water_bucket = 1} | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | bucket.register_liquid( | ||||||
|  | 	"default:river_water_source", | ||||||
|  | 	"default:river_water_flowing", | ||||||
|  | 	"bucket:bucket_river_water", | ||||||
|  | 	"bucket_river_water.png", | ||||||
|  | 	"River Water Bucket", | ||||||
|  | 	{water_bucket = 1} | ||||||
| ) | ) | ||||||
|  |  | ||||||
| bucket.register_liquid( | bucket.register_liquid( | ||||||
| @@ -176,3 +189,4 @@ minetest.register_craft({ | |||||||
| 	burntime = 60, | 	burntime = 60, | ||||||
| 	replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}}, | 	replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}}, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								mods/bucket/textures/bucket_river_water.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								mods/bucket/textures/bucket_river_water.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 316 B | 
		Reference in New Issue
	
	Block a user