mirror of
https://github.com/HybridDog/nether-pack.git
synced 2024-12-25 18:20:23 +01:00
add nether torch crafting, make them ingniter and add vine normalmap
This commit is contained in:
parent
2ddf5c81a4
commit
8797de8748
@ -7,5 +7,5 @@ http://i.imgur.com/pMZYqt9.png
|
|||||||
|
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
— care about nether torches
|
— add nether fences
|
||||||
— find a way to get the perlin noise inside [-1; 1] or use another noise
|
— find a way to get the perlin noise inside [-1; 1] or use another noise
|
||||||
|
@ -137,6 +137,14 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "nether:torch",
|
||||||
|
recipe = {
|
||||||
|
{"nether:bark"},
|
||||||
|
{"group:stick"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "nether:forest_wood",
|
output = "nether:forest_wood",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -162,36 +170,38 @@ minetest.register_craft({
|
|||||||
|
|
||||||
local sound_allowed = true
|
local sound_allowed = true
|
||||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||||
if itemstack:get_name() == "nether:forest_planks"
|
if itemstack:get_name() ~= "nether:forest_planks"
|
||||||
and itemstack:get_count() == 7 then
|
or itemstack:get_count() ~= 7 then
|
||||||
local tree
|
return
|
||||||
for i = 1,9 do
|
end
|
||||||
if old_craft_grid[i]:get_name() == "nether:tree" then
|
local tree
|
||||||
tree = i
|
for i = 1,9 do
|
||||||
break
|
if old_craft_grid[i]:get_name() == "nether:tree" then
|
||||||
end
|
tree = i
|
||||||
end
|
break
|
||||||
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
|
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 not sound_allowed then -- avoid playing the sound multiple times, e.g. when middle mouse click
|
||||||
|
return
|
||||||
|
end
|
||||||
|
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)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -598,7 +598,7 @@ minetest.register_node("nether:torch", {
|
|||||||
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
|
||||||
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
|
||||||
},
|
},
|
||||||
groups = {choppy=2, dig_immediate=3, attached_node=1, hot=2},
|
groups = {choppy=2, dig_immediate=3, attached_node=1, hot=3, igniter=1},
|
||||||
legacy_wallmounted = true,
|
legacy_wallmounted = true,
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
})
|
})
|
||||||
|
BIN
nether/textures/nether_vine_normal.png
Normal file
BIN
nether/textures/nether_vine_normal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 455 B |
Loading…
Reference in New Issue
Block a user