u
This commit is contained in:
		
							parent
							
								
									4263d2e987
								
							
						
					
					
						commit
						28925ec062
					
				
					 9 changed files with 278 additions and 274 deletions
				
			
		
							
								
								
									
										76
									
								
								init.lua
									
										
									
									
									
								
							
							
						
						
									
										76
									
								
								init.lua
									
										
									
									
									
								
							|  | @ -1,5 +1,5 @@ | |||
| -------------------------------------------------------- | ||||
| -- Minetest :: Generic Flags Mod (flags) | ||||
| -- Minetest :: Pirate Flags Mod (flags) | ||||
| -- | ||||
| -- See README.txt for licensing and other information. | ||||
| -- Made by AwesomeDragon97, Anonymous with code from Wuzzy. | ||||
|  | @ -25,30 +25,34 @@ local rad_90 = pi / 2 | |||
| local DEFAULT_FLAG = minetest.settings:get('default_flag') or 'white' | ||||
| 
 | ||||
| local flag_list = {} | ||||
| if minetest.settings:get_bool('name_flags', true) == true then | ||||
| if minetest.settings:get_bool('color_flags', true) == true then | ||||
| flag_list = { -- generic flags | ||||
| 	"white", | ||||
| --	"red", | ||||
| --	"green", | ||||
| --	"brown", | ||||
| --	"blue", | ||||
| 	"red", | ||||
| 	"green", | ||||
| 	"brown", | ||||
| 	"blue", | ||||
| 	"black", | ||||
| --	"orange", | ||||
| --	"yellow", | ||||
| --	"purple", | ||||
| --	"pink", | ||||
| --	"gray", | ||||
| --	"cyan", | ||||
| --	"magenta", | ||||
| 	"orange", | ||||
| 	"yellow", | ||||
| 	"purple", | ||||
| 	"pink", | ||||
| 	"gray", | ||||
| 	"cyan", | ||||
| 	"magenta", | ||||
| 	"dark_green", | ||||
| 	"dark_gray", | ||||
| 	"pirate", | ||||
| 	"pirate",  -- non generic | ||||
| 	"anarcho", | ||||
| 	"makhno", | ||||
| 	"anonymous", | ||||
| 	"guyfox", | ||||
|   "jollyroger", | ||||
|   "anarchy" } | ||||
|   "anarchy", | ||||
|   "piratepix", | ||||
|   "unso", | ||||
|   "una-unso" | ||||
|  } | ||||
| end | ||||
| 
 | ||||
| local next_flag, prev_flag | ||||
|  | @ -97,7 +101,7 @@ end | |||
| local delete_if_orphan = function( self ) | ||||
| 	local pos = self.object:get_pos( ) | ||||
| 	local node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) | ||||
| 	if node.name ~= "pirate_flag:upper_mast" and node.name ~= "ignore" then | ||||
| 	if node.name ~= "pirate_flags_plus:upper_mast" and node.name ~= "ignore" then | ||||
| 		minetest.log("action", "[flags] Orphan flag entity removed at "..minetest.pos_to_string(pos, 1)) | ||||
| 		self.object:remove( ) | ||||
| 		return true | ||||
|  | @ -105,7 +109,7 @@ local delete_if_orphan = function( self ) | |||
| 	return false | ||||
| end | ||||
| 
 | ||||
| minetest.register_entity( "pirate_flag:wavingflag", { | ||||
| minetest.register_entity( "pirate_flags_plus:wavingflag", { | ||||
| 	initial_properties = { | ||||
| 		physical = false, | ||||
| 		visual = "mesh", | ||||
|  | @ -152,7 +156,7 @@ minetest.register_entity( "pirate_flag:wavingflag", { | |||
| 		for o=1, #objs do | ||||
| 			local obj = objs[o] | ||||
| 			local lua = obj:get_luaentity( ) | ||||
| 			if lua and self ~= lua and lua.name == "pirate_flag:wavingflag" then | ||||
| 			if lua and self ~= lua and lua.name == "pirate_flags_plus:wavingflag" then | ||||
| 				if lua.node_idx == self.node_idx then | ||||
| 					self.object:remove( ) | ||||
| 					return | ||||
|  | @ -244,7 +248,7 @@ if minetest.get_modpath("default") ~= nil then | |||
| 	end | ||||
| end | ||||
| 
 | ||||
| minetest.register_node("pirate_flag:lower_mast", { | ||||
| minetest.register_node("pirate_flags_plus:lower_mast", { | ||||
|         description = ("Flag Pole"), | ||||
|         drawtype = "mesh", | ||||
|         paramtype = "light", | ||||
|  | @ -303,7 +307,7 @@ local function spawn_flag( pos ) | |||
| 	local param2 = minetest.get_node( pos ).param2 | ||||
| 
 | ||||
| 	local flag_pos = get_flag_pos( pos, param2 ) | ||||
| 	local obj = minetest.add_entity( flag_pos, "pirate_flag:wavingflag" ) | ||||
| 	local obj = minetest.add_entity( flag_pos, "pirate_flags_plus:wavingflag" ) | ||||
| 	if not obj or not obj:get_luaentity( ) then | ||||
| 		return | ||||
| 	end | ||||
|  | @ -359,7 +363,7 @@ local function cycle_flag( pos, player, cycle_backwards ) | |||
| 	end | ||||
| end | ||||
| 
 | ||||
| minetest.register_node( "pirate_flag:upper_mast", { | ||||
| minetest.register_node( "pirate_flags_plus:upper_mast", { | ||||
| 	description = ("Flag Pole with Flag"), | ||||
| 	drawtype = "mesh", | ||||
| 	paramtype = "light", | ||||
|  | @ -372,7 +376,7 @@ minetest.register_node( "pirate_flag:upper_mast", { | |||
| 	sounds = metal_sounds, | ||||
| 	is_ground_content = false, | ||||
| 
 | ||||
| 	drop = {"pirate_flag:lower_mast 2", "pirate_flag:upper_mast"}, | ||||
| 	drop = {"pirate_flags_plus:lower_mast 2", "pirate_flags_plus:upper_mast"}, | ||||
| 
 | ||||
|         selection_box = { | ||||
|                 type = "fixed", | ||||
|  | @ -400,7 +404,7 @@ minetest.register_node( "pirate_flag:upper_mast", { | |||
| 
 | ||||
| 		local node = minetest.get_node(pointed_thing.under) | ||||
| 		local node2 = minetest.get_node(pointed_thing.under - vector.new(0, 1, 0)) | ||||
| 		if (node.name ~= "pirate_flag:lower_mast" or node2.name ~= "pirate_flag:lower_mast") then | ||||
| 		if (node.name ~= "pirate_flags_plus:lower_mast" or node2.name ~= "pirate_flags_plus:lower_mast") then | ||||
| 			return itemstack | ||||
| 		end | ||||
| 
 | ||||
|  | @ -417,14 +421,14 @@ minetest.register_node( "pirate_flag:upper_mast", { | |||
| 		local yaw = placer:get_look_horizontal() | ||||
| 		local dir = minetest.yaw_to_dir(yaw) | ||||
| 		local param2 = (minetest.dir_to_facedir(dir) + 3) % 4 | ||||
| 		minetest.set_node(pointed_thing.under - vector.new(0, 1, 0), {name = "pirate_flag:upper_mast", param2 = param2 }) | ||||
| 		minetest.set_node(pointed_thing.under, {name = "pirate_flag:upper_mast_hidden_1"}) | ||||
| 		minetest.set_node(pointed_thing.under - vector.new(0, 1, 0), {name = "pirate_flags_plus:upper_mast", param2 = param2 }) | ||||
| 		minetest.set_node(pointed_thing.under, {name = "pirate_flags_plus:upper_mast_hidden_1"}) | ||||
| 
 | ||||
| 		if not (minetest.is_creative_enabled(pn)) then | ||||
| 			itemstack:take_item() | ||||
| 		end | ||||
| 
 | ||||
| 		local def = minetest.registered_nodes["pirate_flag:upper_mast"] | ||||
| 		local def = minetest.registered_nodes["pirate_flags_plus:upper_mast"] | ||||
| 		if def and def.sounds then | ||||
| 			minetest.sound_play(def.sounds.place, {pos = pos}, true) | ||||
| 		end | ||||
|  | @ -449,7 +453,7 @@ minetest.register_node( "pirate_flag:upper_mast", { | |||
| 
 | ||||
| 	after_destruct = function( pos ) | ||||
| 		local above1 = {x=pos.x, y=pos.y+1, z=pos.z} | ||||
| 		if minetest.get_node( above1 ).name == "pirate_flag:upper_mast_hidden_1" then | ||||
| 		if minetest.get_node( above1 ).name == "pirate_flags_plus:upper_mast_hidden_1" then | ||||
| 			minetest.remove_node( above1 ) | ||||
| 		end | ||||
| 	end, | ||||
|  | @ -481,9 +485,9 @@ minetest.register_node( "pirate_flag:upper_mast", { | |||
| } ) | ||||
| 
 | ||||
| minetest.register_lbm({ | ||||
| 	name = "pirate_flag:respawn_flags", | ||||
| 	name = "pirate_flags_plus:respawn_flags", | ||||
| 	label = "Respawn flags", | ||||
| 	nodenames = {"pirate_flag:upper_mast"}, | ||||
| 	nodenames = {"pirate_flags_plus:upper_mast"}, | ||||
| 	run_at_every_load = true, | ||||
| 	action = function(pos, node) | ||||
| 		local node_idx = minetest.hash_node_position( pos ) | ||||
|  | @ -496,9 +500,9 @@ minetest.register_lbm({ | |||
| }) | ||||
| 
 | ||||
| minetest.register_lbm({ | ||||
| 	name = "pirate_flag:update_node_meta", | ||||
| 	name = "pirate_flags_plus:update_node_meta", | ||||
| 	label = "Update mast node meta", | ||||
| 	nodenames = {"pirate_flag:upper_mast"}, | ||||
| 	nodenames = {"pirate_flags_plus:upper_mast"}, | ||||
| 	run_at_every_load = false, | ||||
| 	action = function(pos, node) | ||||
| 		local meta = minetest.get_meta( pos ) | ||||
|  | @ -515,7 +519,7 @@ local flagpole_material = minetest.settings:get('flagpole_material') or "default | |||
| 
 | ||||
| if minetest.registered_items[flagpole_material] then | ||||
| 	minetest.register_craft({ | ||||
| 		output = "pirate_flag:lower_mast 3", | ||||
| 		output = "pirate_flags_plus:lower_mast 3", | ||||
| 		recipe = { | ||||
| 			{flagpole_material}, | ||||
| 			{flagpole_material}, | ||||
|  | @ -524,7 +528,7 @@ if minetest.registered_items[flagpole_material] then | |||
| 	}) | ||||
| end | ||||
| minetest.register_craft({ | ||||
| 	output = "pirate_flag:upper_mast", | ||||
| 	output = "pirate_flags_plus:upper_mast", | ||||
| 	recipe = { | ||||
| 		{"group:wool", "group:wool", "group:wool"}, | ||||
| 		{"group:wool", "group:wool", "group:wool"}, | ||||
|  | @ -537,7 +541,7 @@ minetest.register_craft({ | |||
| -- This node will be automatically | ||||
| -- added/removed when the upper mast is constructed | ||||
| -- or destructed. | ||||
| minetest.register_node( "pirate_flag:upper_mast_hidden_1", { | ||||
| minetest.register_node( "pirate_flags_plus:upper_mast_hidden_1", { | ||||
| 	drawtype = "airlike", | ||||
| 	pointable = false, | ||||
| 	paramtype = "light", | ||||
|  | @ -574,7 +578,7 @@ end | |||
| 
 | ||||
| flags.set_flag_at = function( pos, flag_name ) | ||||
| 	local node = minetest.get_node( pos ) | ||||
| 	if node.name ~= "pirate_flag:upper_mast" then | ||||
| 	if node.name ~= "pirate_flags_plus:upper_mast" then | ||||
| 		return false | ||||
| 	end | ||||
| 	if not flag_exists( flag_name ) then | ||||
|  | @ -599,7 +603,7 @@ end | |||
| 
 | ||||
| flags.get_flag_at = function( pos ) | ||||
| 	local node = minetest.get_node( pos ) | ||||
| 	if node.name ~= "pirate_flag:upper_mast" then | ||||
| 	if node.name ~= "pirate_flags_plus:upper_mast" then | ||||
| 		return nil | ||||
| 	end | ||||
| 	local meta = minetest.get_meta( pos ) | ||||
|  |  | |||
							
								
								
									
										6
									
								
								mod.conf
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								mod.conf
									
										
									
									
									
								
							|  | @ -1,6 +1,6 @@ | |||
| name = pirate_flag | ||||
| title = Pirate Flags | ||||
| name = pirate_flags_plus | ||||
| title = Pirate Flags Plus | ||||
| author = Anonymous | ||||
| optional_depends = default, screwdriver | ||||
| description = Seven flags based on Generic flags | ||||
| description = Adds a variety of generic animated flags. Original mod is by Wuzzy. Feel free to extend this mod with your own flags. All of my modifications to the original mod are also LGPL-3. | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										
											BIN
										
									
								
								models/.DS_Store
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								models/.DS_Store
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -1,5 +1,5 @@ | |||
| 
 | ||||
| name_flags (Enable types flags) bool true | ||||
| color_flags (Enable single color flags) bool true | ||||
| 
 | ||||
| default_flag (Default flag) string white | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										
											BIN
										
									
								
								textures/flag_piratepix.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/flag_piratepix.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 54 KiB | 
							
								
								
									
										
											BIN
										
									
								
								textures/flag_una-unso.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/flag_una-unso.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 146 KiB | 
							
								
								
									
										
											BIN
										
									
								
								textures/flag_unso.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								textures/flag_unso.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 16 KiB | 
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue