From 692fd3d65952bc041fe32fe10b66e4b927d64d9f Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 15 Jul 2016 21:18:56 -0500 Subject: [PATCH] Add transparent texture --- mods/adventuretest/textures/transparent.png | Bin 0 -> 128 bytes mods/mobs/npcs/blacksmith.lua | 21 +++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) create mode 100644 mods/adventuretest/textures/transparent.png diff --git a/mods/adventuretest/textures/transparent.png b/mods/adventuretest/textures/transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..0353f32b7589e4f60ec1e052de863d74aab75dd7 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blwj^(N7lyYW7}l1m4iw=m@Q5sC zVBi)8VMc~ob0mO*>?NMQuIvxk1(<}CrtQ4{1t`Sp>Eal|aXmQ!2!LEx2FAG0T2??7 NgQu&X%Q~loCIAr58$JL4 literal 0 HcmV?d00001 diff --git a/mods/mobs/npcs/blacksmith.lua b/mods/mobs/npcs/blacksmith.lua index 10b2517..b2a8e6e 100644 --- a/mods/mobs/npcs/blacksmith.lua +++ b/mods/mobs/npcs/blacksmith.lua @@ -28,8 +28,7 @@ mobs:register_mob("mobs:blacksmith",{ if self.state ~= "path" and self.state ~= "working" then blacksmith_formspec(self,clicker) else - minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.6}) - mobs.put_icon(self,"mobs:icon_notice",5) + minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.5}) end end, walk_chance = 1, @@ -62,6 +61,7 @@ mobs:register_mob("mobs:blacksmith",{ lifetimer = false, avoid_nodes = {"fire:basic_flame","default:water_source","default:water_flowing","default:lava_source","default:lava_flowing"}, avoid_range = 4, + icon = "mobs:icon_sell", }) -- list of active blacksmiths... I'm not sure how this is going to work when an entity is unloaded @@ -71,8 +71,7 @@ function blacksmith_formspec(self,player) local name = player:get_player_name() if active_blacksmiths[name] == nil then mobs:face_pos(self,player:getpos()) - minetest.sound_play("mobs_blacksmith_what",{pos=self.object:getpos(),max_hear_distance=12,gain=0.6}) - mobs.put_icon(self,"mobs:icon_notice",5) + minetest.sound_play("mobs_blacksmith_what",{pos=self.object:getpos(),max_hear_distance=12,gain=0.5}) active_blacksmiths[name] = {entity=self,inventory=nil,player=player,furnace=nil,active=false} local formspec = "size[8,6.25]".. "list[current_player;main;0,2.5;8,4;]".. @@ -82,8 +81,7 @@ function blacksmith_formspec(self,player) "button_exit[5,1;2,1;cancel;Cancel]" minetest.show_formspec(name,"blacksmith",formspec) else - minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.6}) - mobs.put_icon(self,"mobs:icon_notice",5) + minetest.sound_play("mobs_blacksmith_sorry",{pos=self.object:getpos(),max_hear_distance=12,gain=0.5}) end end @@ -114,7 +112,6 @@ minetest.register_on_player_receive_fields(function(player,formname,fields) local stack = inv:get_stack("src",1) if stack:get_count() == 0 then chat.local_chat(player:getpos(),"Blacksmith: Please give me something to smelt",3) - mobs.put_icon(blacksmith,"mobs:icon_notice",5) active_blacksmiths[name] = nil return else @@ -138,8 +135,7 @@ minetest.register_on_player_receive_fields(function(player,formname,fields) local crNeeded = (stack:get_count() * 2) if money.get(name) < crNeeded then chat.local_chat(player:getpos(),"Blacksmith: Sorry, you don't have enough money. I charge 2cr per lump.") - minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.6}) - mobs.put_icon(blacksmith,"mobs:icon_notice",5) + minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.5}) active_blacksmiths[name] = nil return end @@ -154,15 +150,13 @@ minetest.register_on_player_receive_fields(function(player,formname,fields) end) else chat.local_chat(player:getpos(),"Blacksmith: Sorry, I can't get to the furance.",3) - minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.6}) - mobs.put_icon(blacksmith,"mobs:icon_notice",5) + minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.5}) active_blacksmiths[name] = nil return end else chat.local_chat(player:getpos(),"Blacksmith: Sorry, I don't see a furance in this area.",3) - minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.6}) - mobs.put_icon(blacksmith,"mobs:icon_notice",5) + minetest.sound_play("mobs_blacksmith_sorry",{pos=blacksmith.object:getpos(),max_hear_distance=12,gain=0.5}) active_blacksmiths[name] = nil -- TODO Get invnetory and throw item toward player end @@ -207,7 +201,6 @@ function blacksmith_globalstep(dtime) bs.entity.state = "standing" bs.entity.set_animation(bs.entity,"stand") chat.local_chat(bs.entity.object:getpos(),"Blacksmith: "..name.." your ingots are ready!",25) - mobs.put_icon(bs.entity,"mobs:icon_notice",5) active_blacksmiths[name] = nil -- I think it's all byref so bs = nil should also work meta:set_int("in_use",0) end