mirror of
				https://github.com/sys4-fr/server-nalc.git
				synced 2025-11-04 14:05:29 +01:00 
			
		
		
		
	Updated nether mod
- Kept values for pickaxes and tools - Fixed calls of LIGHT_MAX - Fixed typos - Added sound and randomness in craft recipe
This commit is contained in:
		
							
								
								
									
										4
									
								
								mods/nether/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								mods/nether/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
## Generic ignorable patterns and files
 | 
			
		||||
*~
 | 
			
		||||
.*.swp
 | 
			
		||||
debug.txt
 | 
			
		||||
@@ -153,14 +153,47 @@ minetest.register_craft({
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft({ --crafting bad here, needs to become changed
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = "nether:forest_planks 7",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"nether:tree"},
 | 
			
		||||
	},
 | 
			
		||||
	replacements = {{"nether:tree", "nether:bark 4"}},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
local sound_allowed = true
 | 
			
		||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
 | 
			
		||||
	if itemstack:get_name() == "nether:forest_planks"
 | 
			
		||||
	and itemstack:get_count() == 7 then
 | 
			
		||||
		local tree
 | 
			
		||||
		for i = 1,9 do
 | 
			
		||||
			if old_craft_grid[i]:get_name() == "nether:tree" then
 | 
			
		||||
				tree = i
 | 
			
		||||
				break
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
		if not tree then	-- do nth if theres no tree
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		local rdif = math.random(-1,1)	-- add a bit randomness
 | 
			
		||||
		local barkstack = ItemStack("nether:bark "..4-rdif)
 | 
			
		||||
		local inv = player:get_inventory()
 | 
			
		||||
		if not inv:room_for_item("main", barkstack) then	-- disallow crafting if there's not enough free space
 | 
			
		||||
			craft_inv:set_list("craft", old_craft_grid)
 | 
			
		||||
			itemstack:set_name("")
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		itemstack:set_count(7+rdif)
 | 
			
		||||
		inv:add_item("main", barkstack)
 | 
			
		||||
		if sound_allowed then
 | 
			
		||||
			minetest.sound_play("default_wood_footstep", {pos=player:getpos(),  gain=0.25})
 | 
			
		||||
			sound_allowed = false
 | 
			
		||||
			minetest.after(0, function()
 | 
			
		||||
				sound_allowed = true
 | 
			
		||||
			end)
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = "default:paper",
 | 
			
		||||
	recipe = {
 | 
			
		||||
 
 | 
			
		||||
@@ -356,7 +356,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
 | 
			
		||||
	--local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
 | 
			
		||||
	--local perlin3 = minetest.get_perlin(112,3, 0.5, 5)
 | 
			
		||||
 | 
			
		||||
	local side_length = maxp.x - minp.x + 1
 | 
			
		||||
	local side_length = maxp.x - minp.x - 1	-- maybe mistake here
 | 
			
		||||
	local map_lengths_xyz = {x=side_length, y=side_length, z=side_length}
 | 
			
		||||
 | 
			
		||||
	local pmap1 = minetest.get_perlin_map(perlins[1], map_lengths_xyz):get2dMap_flat(minp)
 | 
			
		||||
@@ -389,7 +389,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
 | 
			
		||||
			local test3 = math.abs(pmap3[count])
 | 
			
		||||
 | 
			
		||||
			local t = math.floor(test*3+0.5)
 | 
			
		||||
			local h = 0
 | 
			
		||||
 | 
			
		||||
			if test2 < 0 then
 | 
			
		||||
				h = math.floor(test2*3+0.5)-1
 | 
			
		||||
			else
 | 
			
		||||
 
 | 
			
		||||
@@ -432,7 +432,7 @@ minetest.register_node("nether:vine", {
 | 
			
		||||
 | 
			
		||||
for n,i in pairs({"small", "middle", "big"}) do
 | 
			
		||||
	minetest.register_node("nether:grass_"..i, {
 | 
			
		||||
		description = "Nehter Grass",
 | 
			
		||||
		description = "Nether Grass",
 | 
			
		||||
		drawtype = "plantlike",
 | 
			
		||||
		waving = 1,
 | 
			
		||||
		tiles = {"nether_grass_"..i..".png"},
 | 
			
		||||
@@ -487,7 +487,7 @@ minetest.register_node("nether:tree_sapling", {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_node("nether:tree", {
 | 
			
		||||
	description = "Nehter Trunk",
 | 
			
		||||
	description = "Nether Trunk",
 | 
			
		||||
	tiles = {"nether_tree_top.png", "nether_tree_top.png", "nether_tree.png"},
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	is_ground_content = false,
 | 
			
		||||
@@ -497,7 +497,7 @@ minetest.register_node("nether:tree", {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_node("nether:tree_corner", {
 | 
			
		||||
	description = "Nehter Trunk Corner",
 | 
			
		||||
	description = "Nether Trunk Corner",
 | 
			
		||||
	tiles = {"nether_tree.png^[transformR180", "nether_tree_top.png", "nether_tree_corner.png^[transformFY",
 | 
			
		||||
		"nether_tree_corner.png^[transformR180", "nether_tree.png", "nether_tree_top.png"},
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
@@ -578,14 +578,24 @@ minetest.register_node("nether:dirt_bottom", {
 | 
			
		||||
minetest.register_node("nether:torch", {
 | 
			
		||||
	description = "Nether Torch",
 | 
			
		||||
	drawtype = "torchlike",
 | 
			
		||||
	tiles = {"nether_torch_on_floor.png", "nether_torch_on_ceiling.png", "nether_torch.png"},
 | 
			
		||||
	tiles = {"nether_torch_on_floor.png", "nether_torch_on_ceiling.png",
 | 
			
		||||
		{
 | 
			
		||||
			name = "nether_torch.png",
 | 
			
		||||
			animation = {
 | 
			
		||||
				type = "vertical_frames",
 | 
			
		||||
				aspect_w = 16,
 | 
			
		||||
				aspect_h = 16,
 | 
			
		||||
				length = 2.0,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	inventory_image = "nether_torch_on_floor.png",
 | 
			
		||||
	wield_image = "nether_torch_on_floor.png",
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2 = "wallmounted",
 | 
			
		||||
	sunlight_propagates = true,
 | 
			
		||||
	walkable = false,
 | 
			
		||||
	light_source = LIGHT_MAX-1,
 | 
			
		||||
	light_source = 13,
 | 
			
		||||
	selection_box = {
 | 
			
		||||
		type = "wallmounted",
 | 
			
		||||
		wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
 | 
			
		||||
@@ -603,7 +613,7 @@ minetest.register_node("nether:portal", {
 | 
			
		||||
	tiles = {invisible, invisible, invisible, invisible, "nether_portal_stuff.png"},
 | 
			
		||||
	inventory_image = "nether_portal_stuff.png",
 | 
			
		||||
	wield_image = "nether_portal_stuff.png",
 | 
			
		||||
	light_source = LIGHT_MAX - 2,
 | 
			
		||||
	light_source = 12,
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	sunlight_propagates = true,
 | 
			
		||||
	use_texture_alpha = true,
 | 
			
		||||
@@ -627,12 +637,12 @@ minetest.register_node("nether:portal", {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
minetest.register_craftitem("nether:grass", {
 | 
			
		||||
	description = "Nehter Grass",
 | 
			
		||||
	description = "Nether Grass",
 | 
			
		||||
	inventory_image = "nether_grass.png",
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craftitem("nether:grass_dried", {
 | 
			
		||||
	description = "Dried Nehter Grass",
 | 
			
		||||
	description = "Dried Nether Grass",
 | 
			
		||||
	inventory_image = "nether_grass_dried.png",
 | 
			
		||||
	furnace_burntime = 1,
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
@@ -147,7 +147,6 @@ minetest.register_chatcommand("from_hell", {
 | 
			
		||||
			local stsp_conf = minetest.setting_get("static_spawnpoint")
 | 
			
		||||
			pos_togo = {x = stsp_conf:split(",")[1],y = stsp_conf:split(",")[2],z = stsp_conf:split(",")[3]}
 | 
			
		||||
		end
 | 
			
		||||
		table.foreach(pos_togo,print)
 | 
			
		||||
		player:moveto(pos_togo)
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
@@ -545,7 +544,6 @@ function nether_port(player, pos)
 | 
			
		||||
			local stsp_conf = minetest.setting_get("static_spawnpoint")
 | 
			
		||||
			pos_togo = {x = stsp_conf:split(",")[1],y = stsp_conf:split(",")[2],z = stsp_conf:split(",")[3]}
 | 
			
		||||
		end
 | 
			
		||||
		table.foreach(pos_togo,print)
 | 
			
		||||
		player:moveto(pos_togo)
 | 
			
		||||
	else
 | 
			
		||||
		player:moveto({x=pos.x, y=portal_target+math.random(4), z=pos.z})
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 1.1 KiB  | 
		Reference in New Issue
	
	Block a user