mirror of
				https://github.com/luanti-org/minetest_game.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Vessels: Improve code style
This commit is contained in:
		@@ -2,24 +2,24 @@
 | 
			
		||||
-- See README.txt for licensing and other information.
 | 
			
		||||
 | 
			
		||||
local vessels_shelf_formspec =
 | 
			
		||||
	"size[8,7;]"..
 | 
			
		||||
	default.gui_bg..
 | 
			
		||||
	default.gui_bg_img..
 | 
			
		||||
	default.gui_slots..
 | 
			
		||||
	"list[context;vessels;0,0.3;8,2;]"..
 | 
			
		||||
	"list[current_player;main;0,2.85;8,1;]"..
 | 
			
		||||
	"list[current_player;main;0,4.08;8,3;8]"..
 | 
			
		||||
	"listring[context;vessels]"..
 | 
			
		||||
	"listring[current_player;main]"..
 | 
			
		||||
	default.get_hotbar_bg(0,2.85)
 | 
			
		||||
	"size[8,7;]" ..
 | 
			
		||||
	default.gui_bg ..
 | 
			
		||||
	default.gui_bg_img ..
 | 
			
		||||
	default.gui_slots ..
 | 
			
		||||
	"list[context;vessels;0,0.3;8,2;]" ..
 | 
			
		||||
	"list[current_player;main;0,2.85;8,1;]" ..
 | 
			
		||||
	"list[current_player;main;0,4.08;8,3;8]" ..
 | 
			
		||||
	"listring[context;vessels]" ..
 | 
			
		||||
	"listring[current_player;main]" ..
 | 
			
		||||
	default.get_hotbar_bg(0, 2.85)
 | 
			
		||||
 | 
			
		||||
minetest.register_node("vessels:shelf", {
 | 
			
		||||
	description = "Vessels shelf",
 | 
			
		||||
	description = "Vessels Shelf",
 | 
			
		||||
	tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
 | 
			
		||||
		"default_wood.png", "vessels_shelf.png", "vessels_shelf.png"},
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	is_ground_content = false,
 | 
			
		||||
	groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
 | 
			
		||||
	groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
 | 
			
		||||
	sounds = default.node_sound_wood_defaults(),
 | 
			
		||||
 | 
			
		||||
	on_construct = function(pos)
 | 
			
		||||
@@ -53,18 +53,18 @@ minetest.register_node("vessels:shelf", {
 | 
			
		||||
	on_blast = function(pos)
 | 
			
		||||
		local drops = {}
 | 
			
		||||
		default.get_inventory_drops(pos, "vessels", drops)
 | 
			
		||||
		drops[#drops+1] = "vessels:shelf"
 | 
			
		||||
		drops[#drops + 1] = "vessels:shelf"
 | 
			
		||||
		minetest.remove_node(pos)
 | 
			
		||||
		return drops
 | 
			
		||||
	end,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = 'vessels:shelf',
 | 
			
		||||
	output = "vessels:shelf",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{'group:wood', 'group:wood', 'group:wood'},
 | 
			
		||||
		{'group:vessel', 'group:vessel', 'group:vessel'},
 | 
			
		||||
		{'group:wood', 'group:wood', 'group:wood'},
 | 
			
		||||
		{"group:wood", "group:wood", "group:wood"},
 | 
			
		||||
		{"group:vessel", "group:vessel", "group:vessel"},
 | 
			
		||||
		{"group:wood", "group:wood", "group:wood"},
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
@@ -81,16 +81,16 @@ minetest.register_node("vessels:glass_bottle", {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
		fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
 | 
			
		||||
	},
 | 
			
		||||
	groups = {vessel=1,dig_immediate=3,attached_node=1},
 | 
			
		||||
	groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
 | 
			
		||||
	sounds = default.node_sound_glass_defaults(),
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft( {
 | 
			
		||||
	output = "vessels:glass_bottle 10",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{ "default:glass", "", "default:glass" },
 | 
			
		||||
		{ "default:glass", "", "default:glass" },
 | 
			
		||||
		{ "", "default:glass", "" }
 | 
			
		||||
		{"default:glass", "", "default:glass"},
 | 
			
		||||
		{"default:glass", "", "default:glass"},
 | 
			
		||||
		{"", "default:glass", ""}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
@@ -107,16 +107,16 @@ minetest.register_node("vessels:drinking_glass", {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
		fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
 | 
			
		||||
	},
 | 
			
		||||
	groups = {vessel=1,dig_immediate=3,attached_node=1},
 | 
			
		||||
	groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
 | 
			
		||||
	sounds = default.node_sound_glass_defaults(),
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft( {
 | 
			
		||||
	output = "vessels:drinking_glass 14",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{ "default:glass", "", "default:glass" },
 | 
			
		||||
		{ "default:glass", "", "default:glass" },
 | 
			
		||||
		{ "default:glass", "default:glass", "default:glass" }
 | 
			
		||||
		{"default:glass", "", "default:glass"},
 | 
			
		||||
		{"default:glass", "", "default:glass"},
 | 
			
		||||
		{"default:glass", "default:glass", "default:glass"}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
@@ -133,21 +133,21 @@ minetest.register_node("vessels:steel_bottle", {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
		fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
 | 
			
		||||
	},
 | 
			
		||||
	groups = {vessel=1,dig_immediate=3,attached_node=1},
 | 
			
		||||
	groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
 | 
			
		||||
	sounds = default.node_sound_defaults(),
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft( {
 | 
			
		||||
	output = "vessels:steel_bottle 5",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{ "default:steel_ingot", "", "default:steel_ingot" },
 | 
			
		||||
		{ "default:steel_ingot", "", "default:steel_ingot" },
 | 
			
		||||
		{ "", "default:steel_ingot", "" }
 | 
			
		||||
		{"default:steel_ingot", "", "default:steel_ingot"},
 | 
			
		||||
		{"default:steel_ingot", "", "default:steel_ingot"},
 | 
			
		||||
		{"", "default:steel_ingot", ""}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- Make sure we can recycle them
 | 
			
		||||
-- Glass and steel recycling
 | 
			
		||||
 | 
			
		||||
minetest.register_craftitem("vessels:glass_fragments", {
 | 
			
		||||
	description = "Pile of Glass Fragments",
 | 
			
		||||
@@ -183,4 +183,3 @@ minetest.register_craft( {
 | 
			
		||||
	output = "default:steel_ingot",
 | 
			
		||||
	recipe = "vessels:steel_bottle",
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user