mirror of
				https://github.com/sys4-fr/server-nalc.git
				synced 2025-11-03 21:55:23 +01:00 
			
		
		
		
	Chmod and removal of whitespaces
This commit is contained in:
		@@ -358,7 +358,7 @@ minetest.register_node("default:mg_cherry_sapling", {
 | 
			
		||||
		fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
 | 
			
		||||
	},
 | 
			
		||||
	groups = {snappy=2, dig_immediate=3, not_in_creative_inventory=1, attached_node=1},
 | 
			
		||||
	drop = "default:cherry_sapling", 
 | 
			
		||||
	drop = "default:cherry_sapling",
 | 
			
		||||
	sounds = default.node_sound_leaves_defaults(),
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ minetest.register_node("fishing:bobber_box", {
 | 
			
		||||
		"fishing_bobber.png",
 | 
			
		||||
		"fishing_bobber.png",
 | 
			
		||||
		"fishing_bobber.png^[transformFX"
 | 
			
		||||
	}, -- 
 | 
			
		||||
	}, --
 | 
			
		||||
	groups = {not_in_creative_inventory=1},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ minetest.register_node("fishing:bobber_shark_box", {
 | 
			
		||||
		"fishing_bobber_shark.png",
 | 
			
		||||
		"fishing_bobber_shark.png",
 | 
			
		||||
		"fishing_bobber_shark.png^[transformFX"
 | 
			
		||||
	}, -- 
 | 
			
		||||
	}, --
 | 
			
		||||
	groups = {not_in_creative_inventory=1},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
@@ -42,7 +42,7 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
	baitball = 0,
 | 
			
		||||
	prize = "",
 | 
			
		||||
	bait = "",
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
--  DESTROY BOBBER WHEN PUNCHING IT
 | 
			
		||||
	on_punch = function (self, puncher, time_from_last_punch, tool_capabilities, dir)
 | 
			
		||||
		if not puncher:is_player() then return end
 | 
			
		||||
@@ -60,8 +60,8 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
		minetest.sound_play("fishing_bobber1", { pos = self.object:getpos(), gain = 0.5, })
 | 
			
		||||
		self.object:remove()
 | 
			
		||||
	end,
 | 
			
		||||
	
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--	WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE)
 | 
			
		||||
	on_rightclick = function (self, clicker)
 | 
			
		||||
		local item = clicker:get_wielded_item()
 | 
			
		||||
@@ -90,7 +90,7 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
			-- weither player has fishing pole or not
 | 
			
		||||
			minetest.sound_play("fishing_bobber1", { pos = self.object:getpos(), gain = 0.5, })
 | 
			
		||||
			self.object:remove()
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		elseif item_name == "fishing:baitball_shark" then
 | 
			
		||||
			if not fishing_setting.is_creative_mode then
 | 
			
		||||
				inv:remove_item("main", "fishing:baitball_shark")
 | 
			
		||||
@@ -108,8 +108,8 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
			minetest.sound_play("fishing_baitball", {pos = self.object:getpos(), gain = 0.2, })
 | 
			
		||||
		end
 | 
			
		||||
	end,
 | 
			
		||||
	
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- AS SOON AS THE BOBBER IS PLACED IT WILL ACT LIKE
 | 
			
		||||
	on_step = function(self, dtime)
 | 
			
		||||
		local pos = self.object:getpos()
 | 
			
		||||
@@ -131,12 +131,12 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
			self.object:remove()
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		--rotate bobber
 | 
			
		||||
		if math.random(1, 4) == 1 then
 | 
			
		||||
			self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi))
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		self.timer = self.timer + 1
 | 
			
		||||
		if self.timer < self.randomtime then
 | 
			
		||||
			-- if fish or others items, move bobber to simulate fish on the line
 | 
			
		||||
@@ -151,9 +151,9 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
					self.old_pos2 = true
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
			return	
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		--change item on line
 | 
			
		||||
		self.timer = 0
 | 
			
		||||
		self.prize = ""
 | 
			
		||||
@@ -164,7 +164,7 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
			self.randomtime = math.random(20,60)*10
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		self.randomtime = math.random(1,5)*10
 | 
			
		||||
		local chance = math.random(1, 100)
 | 
			
		||||
		--if 1 you catch a treasure, maybe ...
 | 
			
		||||
@@ -182,7 +182,7 @@ local FISHING_BOBBER_SHARK_ENTITY={
 | 
			
		||||
				self.prize = fishing_setting.prizes["plants"][math.random(1,#fishing_setting.prizes["plants"])]
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		if self.prize ~= "" then
 | 
			
		||||
			pos.y = self.old_pos.y-0.2
 | 
			
		||||
			self.object:moveto(pos, false)
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
-- Wood Fishing Pole
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = "fishing:pole_wood",
 | 
			
		||||
	recipe = { 
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"",            "",            "group:stick"    },
 | 
			
		||||
		{"",            "group:stick", "farming:string" },
 | 
			
		||||
		{"group:stick", "",            "farming:string" },
 | 
			
		||||
@@ -25,7 +25,7 @@ minetest.register_craft({
 | 
			
		||||
if minetest.get_modpath("moreblocks") ~= nil then
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = "fishing:pole_wood",
 | 
			
		||||
	recipe = { 
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"",            "",            "group:stick"     },
 | 
			
		||||
		{"",            "group:stick", "moreblocks:rope" },
 | 
			
		||||
		{"group:stick", "",            "moreblocks:rope" },
 | 
			
		||||
@@ -36,7 +36,7 @@ end
 | 
			
		||||
if minetest.get_modpath("ropes") ~= nil then
 | 
			
		||||
	minetest.register_craft({
 | 
			
		||||
		output = "fishing:pole_wood",
 | 
			
		||||
		recipe = { 
 | 
			
		||||
		recipe = {
 | 
			
		||||
			{"",            "",            "group:stick" },
 | 
			
		||||
			{"",            "group:stick", "ropes:rope"  },
 | 
			
		||||
			{"group:stick", "",            "ropes:rope"  },
 | 
			
		||||
@@ -48,7 +48,7 @@ end
 | 
			
		||||
if minetest.get_modpath("moreores") ~= nil and minetest.get_modpath("mobs") ~= nil then
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = "fishing:pole_perfect",
 | 
			
		||||
	recipe = { 
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"",                            "",                       "moreores:mithril_ingot" },
 | 
			
		||||
		{"", 							"moreores:mithril_ingot", "mobs:spider_cobweb"     },
 | 
			
		||||
		{"moreores:mithril_ingot",      "",                       "mobs:spider_cobweb"     },
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ fishing_setting.file_trophies = minetest.get_worldpath() .. "/fishing_trophies.t
 | 
			
		||||
fishing_setting.file_contest = minetest.get_worldpath() .. "/fishing_contest.txt"
 | 
			
		||||
fishing_setting.settings = {}
 | 
			
		||||
fishing_setting.contest = {}
 | 
			
		||||
--for random object 
 | 
			
		||||
--for random object
 | 
			
		||||
random_objects = {}
 | 
			
		||||
fishing_setting.baits = {}
 | 
			
		||||
fishing_setting.hungry = {}
 | 
			
		||||
@@ -43,7 +43,7 @@ dofile(path .."functions.lua")
 | 
			
		||||
 | 
			
		||||
--default_settings
 | 
			
		||||
fishing_setting.settings["message"] = MESSAGES
 | 
			
		||||
fishing_setting.settings["worm_is_mob"] = WORM_IS_MOB 
 | 
			
		||||
fishing_setting.settings["worm_is_mob"] = WORM_IS_MOB
 | 
			
		||||
fishing_setting.settings["worm_chance"] = WORM_CHANCE
 | 
			
		||||
fishing_setting.settings["new_worm_source"] = NEW_WORM_SOURCE
 | 
			
		||||
fishing_setting.settings["wear_out"] = WEAR_OUT
 | 
			
		||||
@@ -81,7 +81,7 @@ fishing_setting.func.load_contest()
 | 
			
		||||
minetest.register_globalstep(function(dtime)
 | 
			
		||||
	if fishing_setting.contest["contest"] ~= nil and fishing_setting.contest["contest"] == true then
 | 
			
		||||
		fishing_setting.contest["duration"] = fishing_setting.contest["duration"] - dtime
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		if fishing_setting.contest["duration"] < 30 and fishing_setting.contest["warning_said"] ~= true then
 | 
			
		||||
			minetest.chat_send_all(fishing_setting.func.S("WARNING, Fishing contest will finish in 30 seconds."))
 | 
			
		||||
			fishing_setting.contest["warning_said"] = true
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ minetest.register_node("fishing:material_info", {
 | 
			
		||||
	is_ground_content = false,
 | 
			
		||||
	sounds = default.node_sound_wood_defaults(),
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	on_rightclick = function(pos, _, clicker)
 | 
			
		||||
		local formspec = "size[6,8]label[1.7,0;Fishing Info Center]"
 | 
			
		||||
		local y = 1
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ local bobbermax = pole["bobber_max"]
 | 
			
		||||
				--if contest then player must have only 2 boober
 | 
			
		||||
				local bobber_nb = 0
 | 
			
		||||
				local bobber_max
 | 
			
		||||
				if fishing_setting.contest["contest"] ~= nil and fishing_setting.contest["contest"] == true then 
 | 
			
		||||
				if fishing_setting.contest["contest"] ~= nil and fishing_setting.contest["contest"] == true then
 | 
			
		||||
					bobber_max = fishing_setting.contest["bobber_nb"]
 | 
			
		||||
				else
 | 
			
		||||
					bobber_max = bobbermax
 | 
			
		||||
@@ -68,7 +68,7 @@ local bobbermax = pole["bobber_max"]
 | 
			
		||||
				for _,k in  pairs({ 1, 0, -1}) do
 | 
			
		||||
					for _,l in pairs({ -1, 0, 1}) do
 | 
			
		||||
						local node_name = minetest.get_node({x=pt.under.x+l, y=pt.under.y, z=pt.under.z+k}).name
 | 
			
		||||
						if node and string.find(node_name, "water_source") ~= nil 
 | 
			
		||||
						if node and string.find(node_name, "water_source") ~= nil
 | 
			
		||||
						and minetest.get_node({x=pt.under.x+l, y=pt.under.y+1, z=pt.under.z+k}).name == "air" then
 | 
			
		||||
							local empty = true
 | 
			
		||||
							for o, obj in pairs(bobbers) do
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ local stuff = {
 | 
			
		||||
	{"shields",					"shield_enhanced_cactus",	"random",			"a very old Shield."},
 | 
			
		||||
	{"default",					"sword_bronze",				"random",			"a very old Sword."},
 | 
			
		||||
	{"default",					"sword_mese",				"random",			"a very old Sword."},
 | 
			
		||||
	{"default",					"sword_nyan",				"random",			"a very old Sword."}	
 | 
			
		||||
	{"default",					"sword_nyan",				"random",			"a very old Sword."}
 | 
			
		||||
}
 | 
			
		||||
fishing_setting.prizes["stuff"] = fishing_setting.func.ignore_mod(stuff)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								mods/jukebox/sounds/jukebox_song.2.ogg
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/jukebox/sounds/jukebox_song.2.ogg
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								mods/jukebox/sounds/jukebox_song.4.ogg
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/jukebox/sounds/jukebox_song.4.ogg
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								mods/jukebox/sounds/jukebox_song.6.ogg
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/jukebox/sounds/jukebox_song.6.ogg
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -117,7 +117,7 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
 | 
			
		||||
		if quest.tasks then
 | 
			
		||||
			for tname, task in pairs(quest.tasks) do
 | 
			
		||||
				if quests.is_task_visible(pname, mff.QPREFIX .. qname, tname)
 | 
			
		||||
					and not quests.is_task_disabled(pname, mff.QPREFIX .. qname, tname) 
 | 
			
		||||
					and not quests.is_task_disabled(pname, mff.QPREFIX .. qname, tname)
 | 
			
		||||
					and task.objective.dig then
 | 
			
		||||
					if table.contains(task.objective.dig, oldnode.name) then
 | 
			
		||||
						quests.update_quest_task(pname, mff.QPREFIX .. qname, tname, 1)
 | 
			
		||||
@@ -130,7 +130,7 @@ end)
 | 
			
		||||
 | 
			
		||||
minetest.register_on_joinplayer(function (player)
 | 
			
		||||
	local playername = player:get_player_name()
 | 
			
		||||
	for _, qname in ipairs({"still_testing_quests", "still_testing_quests2", "still_testing_quests3"}) do 
 | 
			
		||||
	for _, qname in ipairs({"still_testing_quests", "still_testing_quests2", "still_testing_quests3"}) do
 | 
			
		||||
		if not quests.quest_restarting_in(playername, mff.QPREFIX .. qname) then
 | 
			
		||||
			mff.quests.start_quest(playername, qname)
 | 
			
		||||
		end
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										0
									
								
								mods/pclasses/adventurer.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/pclasses/adventurer.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								mods/pclasses/api.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/pclasses/api.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								mods/pclasses/hunter.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/pclasses/hunter.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								mods/pclasses/warrior.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mods/pclasses/warrior.lua
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -80,7 +80,7 @@ end
 | 
			
		||||
-- * Simple quests are made of a single objective
 | 
			
		||||
-- * Taked quests are made of tasks, allowing simultaneous progress
 | 
			
		||||
--   within the quest as well as branching quest objectives
 | 
			
		||||
-- 
 | 
			
		||||
--
 | 
			
		||||
-- Both quest types are defined by a table, and they share common information:
 | 
			
		||||
--     {
 | 
			
		||||
--       title,            -- Self-explanatory. Should describe the objective for simple quests.
 | 
			
		||||
@@ -94,7 +94,7 @@ end
 | 
			
		||||
--       abortcallback,    -- Called when a player cancels the quest.  function(playername, questname, metadata)
 | 
			
		||||
--       repeating         -- Delay in seconds before the quest becomes available again. If nil, 0 or false, doesn't restart.
 | 
			
		||||
--     }
 | 
			
		||||
-- 
 | 
			
		||||
--
 | 
			
		||||
-- In addition, simple quests have a number-type `max` element indicating the max progress of the quest.
 | 
			
		||||
-- As for tasked quests, they have a table-type `tasks` element which value is like this:
 | 
			
		||||
--     tasks = {
 | 
			
		||||
@@ -106,11 +106,11 @@ end
 | 
			
		||||
--       },
 | 
			
		||||
--       another_task = {
 | 
			
		||||
--         [...],
 | 
			
		||||
--     
 | 
			
		||||
--
 | 
			
		||||
--         requires = {"start"},
 | 
			
		||||
--         -- Table of task names which one must be completed for this task to unlock.
 | 
			
		||||
--         --   To to task completion groups (i.e. where ALL must be compileted), pass said names in a (sub)table.
 | 
			
		||||
--     
 | 
			
		||||
--
 | 
			
		||||
--         availablecallback,
 | 
			
		||||
--         -- Called when the task becomes available. Not called when there are no task requirements (i.e. task is available from the start).
 | 
			
		||||
--         --   function(playername, questname, taskname, enablingtaskname, metadata)
 | 
			
		||||
@@ -123,10 +123,10 @@ end
 | 
			
		||||
--       something = {
 | 
			
		||||
--         [...],
 | 
			
		||||
--         requires = {"start"},
 | 
			
		||||
--     
 | 
			
		||||
--
 | 
			
		||||
--         disables_on = {"another_task"},
 | 
			
		||||
--         -- Same as `requires`, but *disables* the task (it then does not count towards quest completion)
 | 
			
		||||
--     
 | 
			
		||||
--
 | 
			
		||||
--         disablecallback,
 | 
			
		||||
--         -- Called when the task becomes disabled. Not called when the task is disabled upon quest start.
 | 
			
		||||
--         --   function(playername, questname, taskname, disablingtaskname, metadata)
 | 
			
		||||
@@ -160,7 +160,7 @@ function quests.register_quest(questname, quest)
 | 
			
		||||
		autoaccept       = not(quest.autoaccept == false),
 | 
			
		||||
		completecallback = quest.completecallback or empty_callback,
 | 
			
		||||
		abortcallback    = quest.abortcallback or empty_callback,
 | 
			
		||||
		repeating        = quest.repeating or 0 
 | 
			
		||||
		repeating        = quest.repeating or 0
 | 
			
		||||
	}
 | 
			
		||||
	local new_quest = quests.registered_quests[questname]
 | 
			
		||||
	if quest.max ~= nil then -- Simple quest
 | 
			
		||||
 
 | 
			
		||||
@@ -105,7 +105,7 @@ function quests.create_config(playername, integrated)
 | 
			
		||||
		formspec = formspec .. "true"
 | 
			
		||||
	else
 | 
			
		||||
		formspec = formspec ..  "false"
 | 
			
		||||
	end 
 | 
			
		||||
	end
 | 
			
		||||
	formspec = formspec .. "]checkbox[.25,1.25;quests_config_central_message;" .. S("Central messages") .. ";"
 | 
			
		||||
	if(quests.hud[playername] ~= nil and quests.hud[playername].central_message_enabled) then
 | 
			
		||||
		formspec = formspec .. "true"
 | 
			
		||||
@@ -217,7 +217,7 @@ function quests.create_info(playername, questname, taskid, integrated)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- show the player playername his/her questlog
 | 
			
		||||
function quests.show_formspec(playername) 
 | 
			
		||||
function quests.show_formspec(playername)
 | 
			
		||||
	minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -264,7 +264,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
			quests.formspec_lists[playername].id = event.index
 | 
			
		||||
			if formname == "quests:questlog" then
 | 
			
		||||
				minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
			else 
 | 
			
		||||
			else
 | 
			
		||||
				unified_inventory.set_inventory_formspec(player, "quests")
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
@@ -273,7 +273,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
		if quests.formspec_lists[playername].id == nil then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		quests.abort_quest(playername, quests.formspec_lists[playername].list[quests.formspec_lists[playername].id]) 
 | 
			
		||||
		quests.abort_quest(playername, quests.formspec_lists[playername].list[quests.formspec_lists[playername].id])
 | 
			
		||||
		if formname == "quests:questlog" then
 | 
			
		||||
			minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
		else
 | 
			
		||||
@@ -300,7 +300,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
			quests.set_quest_hud_visibility(playername, questname, fields.quests_show_quest_in_hud == "true")
 | 
			
		||||
			if formname == "quests:questlog" then
 | 
			
		||||
				minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
			else 
 | 
			
		||||
			else
 | 
			
		||||
				unified_inventory.set_inventory_formspec(player, "quests")
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
@@ -309,7 +309,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
-- config
 | 
			
		||||
	if (fields["quests_config_enable"]) then
 | 
			
		||||
		quests.hud[playername].autohide = false
 | 
			
		||||
		if (fields["quests_config_enable"] == "true") then	
 | 
			
		||||
		if (fields["quests_config_enable"] == "true") then
 | 
			
		||||
			quests.show_hud(playername)
 | 
			
		||||
		else
 | 
			
		||||
			quests.hide_hud(playername)
 | 
			
		||||
@@ -349,7 +349,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
	if (fields["quests_config_return"]) then
 | 
			
		||||
		if (formname == "quests:config") then
 | 
			
		||||
			minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
		else 
 | 
			
		||||
		else
 | 
			
		||||
			unified_inventory.set_inventory_formspec(player, "quests")
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
@@ -370,17 +370,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
 | 
			
		||||
		if quests.formspec_lists[playername].id == nil then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		quests.abort_quest(playername, quests.formspec_lists[playername].list[quests.formspec_lists[playername].id]) 
 | 
			
		||||
		quests.abort_quest(playername, quests.formspec_lists[playername].list[quests.formspec_lists[playername].id])
 | 
			
		||||
		if formname == "quests:info" then
 | 
			
		||||
			minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
		else 
 | 
			
		||||
		else
 | 
			
		||||
			unified_inventory.set_inventory_formspec(player, "quests")
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	if fields.quests_info_return then
 | 
			
		||||
		if formname == "quests:info" then
 | 
			
		||||
			minetest.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
 | 
			
		||||
		else 
 | 
			
		||||
		else
 | 
			
		||||
			unified_inventory.set_inventory_formspec(player, "quests")
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
 
 | 
			
		||||
@@ -225,7 +225,7 @@ function quests.update_hud(playername)
 | 
			
		||||
	local diff = table_diff(old_hud, new_hud)
 | 
			
		||||
	-- Copy the HUD IDs from the old table to the new one, to avoid loosing them
 | 
			
		||||
	for questname, hud_elms in pairs(old_hud) do
 | 
			
		||||
		for elm_name, elm_def in pairs(hud_elms) do 
 | 
			
		||||
		for elm_name, elm_def in pairs(hud_elms) do
 | 
			
		||||
			if new_hud[questname] and new_hud[questname][elm_name] then
 | 
			
		||||
				new_hud[questname][elm_name].id = elm_def.id
 | 
			
		||||
			end
 | 
			
		||||
@@ -238,7 +238,7 @@ function quests.update_hud(playername)
 | 
			
		||||
					player:hud_remove(elm_def.id)
 | 
			
		||||
				end
 | 
			
		||||
			else
 | 
			
		||||
				for elm_name, elm_def in pairs(hud_elms) do 
 | 
			
		||||
				for elm_name, elm_def in pairs(hud_elms) do
 | 
			
		||||
					if not old_hud[questname] or not old_hud[questname][elm_name] or not old_hud[questname][elm_name].id then
 | 
			
		||||
						new_hud[questname][elm_name].id = player:hud_add(elm_def)
 | 
			
		||||
					else
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
quests.formspec_lists = {}
 | 
			
		||||
function quests.round(num, n) 
 | 
			
		||||
function quests.round(num, n)
 | 
			
		||||
	local mult = 10^(n or 0)
 | 
			
		||||
	return math.floor(num * mult + .5) / mult
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
minetest.register_on_joinplayer(function(player) 
 | 
			
		||||
minetest.register_on_joinplayer(function(player)
 | 
			
		||||
	inventory_plus.register_button(player, "quests")
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ unified_inventory.register_button("quests", {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
unified_inventory.register_page("quests", {
 | 
			
		||||
	get_formspec = function(player) 
 | 
			
		||||
	get_formspec = function(player)
 | 
			
		||||
		local playername = player:get_player_name()
 | 
			
		||||
		local formspec = quests.create_formspec(playername, "1", true)
 | 
			
		||||
		return {formspec = formspec, draw_inventory=false}
 | 
			
		||||
@@ -16,7 +16,7 @@ unified_inventory.register_page("quests", {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
unified_inventory.register_page("quests_successfull", {
 | 
			
		||||
	get_formspec = function(player) 
 | 
			
		||||
	get_formspec = function(player)
 | 
			
		||||
		local playername = player:get_player_name()
 | 
			
		||||
		local formspec = quests.create_formspec(playername, "2", true)
 | 
			
		||||
		return {formspec = formspec, draw_inventory=false}
 | 
			
		||||
@@ -24,7 +24,7 @@ unified_inventory.register_page("quests_successfull", {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
unified_inventory.register_page("quests_failed", {
 | 
			
		||||
	get_formspec = function(player) 
 | 
			
		||||
	get_formspec = function(player)
 | 
			
		||||
		local playername = player:get_player_name()
 | 
			
		||||
		local formspec = quests.create_formspec(playername, "3", true)
 | 
			
		||||
		return {formspec = formspec, draw_inventory=false}
 | 
			
		||||
 
 | 
			
		||||
@@ -109,7 +109,7 @@ function watershed_pinetree(x, y, z, area, data)
 | 
			
		||||
		end
 | 
			
		||||
		-- MFF: Prevent trees from destroying existing blocks
 | 
			
		||||
		local vit = area:index(x, y + j, z)
 | 
			
		||||
		if j == 0 then 
 | 
			
		||||
		if j == 0 then
 | 
			
		||||
			data[vit] = c_wspitree	-- No safety check for the sapling itself
 | 
			
		||||
		else
 | 
			
		||||
			safely_set_block(data, vit, c_wspitree)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user