From 8797de874892e3b9a5f9e44d24cf3bc12a33818b Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sat, 5 Dec 2015 12:28:03 +0100 Subject: [PATCH] add nether torch crafting, make them ingniter and add vine normalmap --- README.txt | 2 +- nether/crafting.lua | 66 ++++++++++++++----------- nether/items.lua | 2 +- nether/textures/nether_vine_normal.png | Bin 0 -> 455 bytes 4 files changed, 40 insertions(+), 30 deletions(-) create mode 100644 nether/textures/nether_vine_normal.png diff --git a/README.txt b/README.txt index 1098524..683b2e3 100644 --- a/README.txt +++ b/README.txt @@ -7,5 +7,5 @@ http://i.imgur.com/pMZYqt9.png TODO: -— care about nether torches +— add nether fences — find a way to get the perlin noise inside [-1; 1] or use another noise diff --git a/nether/crafting.lua b/nether/crafting.lua index 8490551..78dfc35 100644 --- a/nether/crafting.lua +++ b/nether/crafting.lua @@ -137,6 +137,14 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "nether:torch", + recipe = { + {"nether:bark"}, + {"group:stick"}, + } +}) + minetest.register_craft({ output = "nether:forest_wood", recipe = { @@ -162,36 +170,38 @@ minetest.register_craft({ 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) + if itemstack:get_name() ~= "nether:forest_planks" + or itemstack:get_count() ~= 7 then + return + end + 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 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) minetest.register_craft({ diff --git a/nether/items.lua b/nether/items.lua index 4c70c52..ce63c4d 100644 --- a/nether/items.lua +++ b/nether/items.lua @@ -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_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, sounds = default.node_sound_defaults(), }) diff --git a/nether/textures/nether_vine_normal.png b/nether/textures/nether_vine_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..8c3c777f47e34581484f9ca0eaa15b3c52efa736 GIT binary patch literal 455 zcmV;&0XY7NP)U5FAdXp&&K?aKi@>lEpu$?*kTZiY(;^JcSyHG!(uf1aX!fuZ@p$6Db;2JHvQ( z0UW21vwp}~!*i%O7yb+Xe3L>0iXo1kcx~bA)8tA{E1Fg*{KH51IPi4fmFT$ ztN>KlW7(&7RigyP1vX~8Qgw+M3)d0pya9GaL^d?RNqrPi{UN$=Wpwa+6ao~6$AP>(R%6#JBb z-f6gbgo1x55XBz~|~jo{7!@>PBSSw0RxIY3crSHkerWjV0&0=eb(cyl0R7WneP xhGWSnQoUs0{5e4Q)}zh>8_vCy*5xJJ@ekWIB=*cwu89Bu002ovPDHLkV1h!t)0O}L literal 0 HcmV?d00001