Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@ -0,0 +1,108 @@ |
|||
# Spawners # |
|||
This MOD for Minetest let the player craft mob and ore Spawner blocks. Mobs/Ores are spawning randomly in a short intervals. |
|||
|
|||
From version 0.6 Pyramids can be spawned in desert and environmental spwaners are added. Environmental spawners are used for spawning inside of temples and dungeons (mapgen v6 default minetest game). - Thanks to BlockMen. These kind of spawners are very rarely dropping real mob spawners, in any other case they don't drop anything. |
|||
|
|||
Easy to implement new mob mods just look in to config.lua. |
|||
New features can be enabled/disabled in settings.txt file. |
|||
|
|||
Currently it works with [Pyramids Mummy](https://forum.minetest.net/viewtopic.php?id=7063), [Mobs Redo](https://forum.minetest.net/viewtopic.php?f=11&t=9917) and [Creatures](https://forum.minetest.net/viewtopic.php?f=11&t=8638). |
|||
|
|||
![spawners_promo.jpg](https://bitbucket.org/repo/y69Me7/images/3793257566-spawners_promo.jpg) |
|||
![spawner_waiting_medium.gif](https://bitbucket.org/repo/y69Me7/images/246761582-spawner_waiting_medium.gif) ![spawner_animated_medium.gif](https://bitbucket.org/repo/y69Me7/images/1359872529-spawner_animated_medium.gif) |
|||
|
|||
## YouTube video ## |
|||
[Minetest - spawners MOD v0.1](https://youtu.be/TlaMVl0ZDtw) |
|||
|
|||
## Mod dependencies ## |
|||
* default |
|||
* fake_fire? |
|||
* xpanes? |
|||
* mobs? |
|||
* creatures? |
|||
* pyramids? |
|||
|
|||
mobs redo, creatures are supported mods |
|||
|
|||
fake_fire, xpanes for recipes |
|||
|
|||
## Links ## |
|||
[[Mod]Minetest Forum Page](https://forum.minetest.net/viewtopic.php?f=11&t=13857) |
|||
|
|||
[[Server]Minetest Forum Page](https://forum.minetest.net/viewtopic.php?f=10&t=13727) - try this MOD on this server |
|||
|
|||
[G+ Collection](https://plus.google.com/collection/06fEx) |
|||
|
|||
[G+ Community](https://plus.google.com/communities/105201070842404099845) |
|||
|
|||
## License ## |
|||
WTFPL |
|||
|
|||
## Changelog ## |
|||
### 0.6 ### |
|||
* inherited BlockMen Pyramid mod, so now Spawners can spawn Pyramids in desert (mapgen v6) |
|||
* spawning Pyramids work independently from BlockMen Pyramids mod (can be removed) but works also besides BlockMen Pyramid mod |
|||
* added more various loot (default) in pyramids chests and higher up the chance of spawning more loot |
|||
* added new environmental spawners |
|||
* added generation of environmental spawners for default mapgen v6 temples and dungeons |
|||
* addend new config parameter 'disable' for night_only attribute in config file |
|||
* added new attribute 'env' in config file for defining environmental spawners |
|||
* added settings.txt file for enable/disable new features (pyramids, mapgen spawners..) |
|||
* fixed abm catch_up (disabled), now it works |
|||
|
|||
### 0.5.1 ### |
|||
* added mobs redo stone monster spawner (re-done from BlockMen Pyramids) |
|||
|
|||
### 0.5 ### |
|||
* new mobs redo sheep textures |
|||
* added mobs redo spider spawner |
|||
* added oerrki spawner for creatures mod |
|||
* added screenshot and description for MODs in-game tab |
|||
* added pyramids mod to optional dependencies |
|||
|
|||
### 0.4 ### |
|||
* NEW added ore spawners - iron, gold and copper |
|||
* ore spawners have chance to spawn 2 ores from 1 ingot |
|||
* ore spawners have formspec |
|||
* new sounds for ore spawners |
|||
* added particle effect for ore spawners |
|||
* re-done all textures from scratch (mob and ore spawners) |
|||
* adjusted mob spawners ABM |
|||
* added maximum stacked items for spawners to max 1 |
|||
* mob spawners fixed name conflicts in config file warthog vs. pumba |
|||
|
|||
### 0.3 ### |
|||
* new folder and file structure |
|||
* more convenient disable/enable, add/remove new MODs in config.lua file - added property for custom sounds |
|||
* added sound for bunny |
|||
* fixed sound for pyramids:mummy |
|||
* added footsteps and dug sounds for the spawners |
|||
* shorter and more effective code, easier to read, fixed variable namings |
|||
* ABM tweak - longer delay to trigger but bigger chance for spawn entity |
|||
* disabled ABM catch_up |
|||
* added normal map texture for default spawner |
|||
|
|||
### 0.2 ### |
|||
* support pyramids mod - mummy |
|||
* support creatures mod |
|||
* shorten the code - more effecient |
|||
|
|||
### 0.1 ### |
|||
* Initial Release |
|||
* detects only 6 nodes for 'air' around the spawner [top, bottom, left, right, front, back] afterwards it will check the node above and below the found 'air' node - so there is enough space to spawn someone |
|||
* always picks random side from where the mob will spawn |
|||
* detects for light and time of day - spawn mobs only at night if 'only_night' set to true |
|||
* status 'waiting' - blue sparkles, for not enough light (day spawners) or too much light for night spawners |
|||
* status 'default/inactive' i.e. if the spawner is closed from each side or there is no space to spawn mob |
|||
* status 'active' when spawner is active and is spawning mobs |
|||
* status 'overheat' when there is too much 'max_objects_per_block' (prevents from server errors), max value is taken from minetest.conf |
|||
* easy to configure, add and remove MODs for mobs |
|||
* only [Mobs Redo](https://github.com/tenplus1/mobs) from tenplus1 is added for now |
|||
* added recipes for all spawners, it's expensive so it will not get overcrowded on the server only with spawners |
|||
* almost everything is done dynamically |
|||
* spawners emit small amount of light |
|||
* active and overheated spawner can cause fire to flammable nodes around it |
|||
* spawners are active only if player is in radius (21) |
|||
* spawners are diggable only with steel pickaxe and above, so no noob griefers can raid your base too easy |
|||
* mobs play sound when spawned |
|||
* animated textures |
@ -0,0 +1,403 @@ |
|||
local max_obj_per_mapblock = tonumber(minetest.setting_get("max_objects_per_block")) |
|||
|
|||
-- |
|||
-- * CREATE ALL SPAWNERS NODES * |
|||
-- |
|||
|
|||
function spawners.create(mob_name, mod_prefix, size, offset, mesh, texture, night_only, sound_custom, env) |
|||
|
|||
-- |
|||
-- DUMMY INSIDE THE SPAWNER |
|||
-- |
|||
|
|||
local dummy_definition = { |
|||
hp_max = 1, |
|||
physical = true, |
|||
collisionbox = {0,0,0,0,0,0}, |
|||
visual = "mesh", |
|||
visual_size = size, |
|||
mesh = mesh, |
|||
textures = texture, |
|||
makes_footstep_sound = false, |
|||
timer = 0, |
|||
automatic_rotate = math.pi * -3, |
|||
m_name = "dummy" |
|||
} |
|||
|
|||
dummy_definition.on_activate = function(self) |
|||
self.object:setvelocity({x=0, y=0, z=0}) |
|||
self.object:setacceleration({x=0, y=0, z=0}) |
|||
self.object:set_armor_groups({immortal=1}) |
|||
end |
|||
|
|||
-- remove dummy after dug up the spawner |
|||
dummy_definition.on_step = function(self, dtime) |
|||
self.timer = self.timer + dtime |
|||
local n = minetest.get_node_or_nil(self.object:getpos()) |
|||
if self.timer > 2 then |
|||
if n and n.name and n.name ~= "spawners:"..mod_prefix.."_"..mob_name.."_spawner_active" and n.name ~= "spawners:"..mod_prefix.."_"..mob_name.."_spawner_active_env" then |
|||
self.object:remove() |
|||
end |
|||
end |
|||
end |
|||
|
|||
minetest.register_entity("spawners:dummy_"..mod_prefix.."_"..mob_name, dummy_definition) |
|||
|
|||
-- |
|||
-- * CRAFTING SPAWNERS * |
|||
-- |
|||
|
|||
if not env then |
|||
|
|||
-- print("[Mod][Spawners] Registering Crafting Spawner.") |
|||
|
|||
-- |
|||
-- ACTIVE SPAWNER |
|||
-- |
|||
|
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_active", { |
|||
description = mod_prefix.."_"..mob_name.." spawner active", |
|||
paramtype = "light", |
|||
light_source = 4, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
damage_per_second = 4, |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..mod_prefix.."_"..mob_name.."_spawner", |
|||
on_construct = function(pos) |
|||
pos.y = pos.y + offset |
|||
minetest.add_entity(pos,"spawners:dummy_"..mod_prefix.."_"..mob_name) |
|||
end, |
|||
}) |
|||
|
|||
-- |
|||
-- WAITING SPAWNER |
|||
-- |
|||
|
|||
-- waiting for light - everything is ok but too much light or not enough light |
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting", { |
|||
description = mod_prefix.."_"..mob_name.." spawner waiting", |
|||
paramtype = "light", |
|||
light_source = 2, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_waiting_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..mod_prefix.."_"..mob_name.."_spawner", |
|||
}) |
|||
|
|||
-- |
|||
-- INACTIVE SPAWNER (DEFAULT) |
|||
-- |
|||
|
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner", { |
|||
description = mod_prefix.."_"..mob_name.." spawner", |
|||
paramtype = "light", |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = {"spawners_spawner.png"}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2}, |
|||
stack_max = 1, |
|||
on_construct = function(pos) |
|||
local random_pos, waiting = spawners.check_node_status(pos, mob_name, night_only) |
|||
|
|||
if random_pos then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_active"}) |
|||
elseif waiting then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting"}) |
|||
else |
|||
end |
|||
end, |
|||
}) |
|||
|
|||
-- |
|||
-- OVERHEATED SPAWNER |
|||
-- |
|||
|
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_overheat", { |
|||
description = mod_prefix.."_"..mob_name.." spawner overheated", |
|||
paramtype = "light", |
|||
light_source = 2, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
damage_per_second = 4, |
|||
sunlight_propagates = true, |
|||
tiles = {"spawners_spawner.png^[colorize:#FF000030"}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..mod_prefix.."_"..mob_name.."_spawner", |
|||
on_construct = function(pos) |
|||
minetest.get_node_timer(pos):start(60) |
|||
end, |
|||
on_timer = function(pos, elapsed) |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner"}) |
|||
end, |
|||
}) |
|||
|
|||
else |
|||
|
|||
-- |
|||
-- * ENVIRONMENTAL SPAWNERS * |
|||
-- |
|||
|
|||
-- minetest.log("action", "[Mod][Spawners] Registering Environmental Spawner.") |
|||
|
|||
-- |
|||
-- ACTIVE SPAWNER ENV |
|||
-- |
|||
|
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_active_env", { |
|||
description = mod_prefix.."_"..mob_name.." spawner active env", |
|||
paramtype = "light", |
|||
light_source = 4, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
damage_per_second = 4, |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, |
|||
drop = { |
|||
max_items = 1, |
|||
items = { |
|||
{items = {"spawners:"..mod_prefix.."_"..mob_name.."_spawner"}, rarity = 20} |
|||
} |
|||
}, |
|||
on_construct = function(pos) |
|||
pos.y = pos.y + offset |
|||
minetest.add_entity(pos,"spawners:dummy_"..mod_prefix.."_"..mob_name) |
|||
end, |
|||
}) |
|||
|
|||
-- |
|||
-- WAITING SPAWNER ENV |
|||
-- |
|||
|
|||
-- waiting for light - everything is ok but too much light or not enough light |
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting_env", { |
|||
description = mod_prefix.."_"..mob_name.." spawner waiting env", |
|||
paramtype = "light", |
|||
light_source = 2, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_waiting_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,not_in_creative_inventory=1}, |
|||
drop = { |
|||
max_items = 1, |
|||
items = { |
|||
{items = {"spawners:"..mod_prefix.."_"..mob_name.."_spawner"}, rarity = 20} |
|||
} |
|||
}, |
|||
}) |
|||
|
|||
-- |
|||
-- INACTIVE SPAWNER (DEFAULT) ENV |
|||
-- |
|||
|
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_env", { |
|||
description = mod_prefix.."_"..mob_name.." spawner env", |
|||
paramtype = "light", |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = {"spawners_spawner.png"}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,not_in_creative_inventory=1}, |
|||
stack_max = 1, |
|||
drop = { |
|||
max_items = 1, |
|||
items = { |
|||
{items = {"spawners:"..mod_prefix.."_"..mob_name.."_spawner"}, rarity = 20} |
|||
} |
|||
}, |
|||
on_construct = function(pos) |
|||
local random_pos, waiting = spawners.check_node_status(pos, mob_name, night_only) |
|||
|
|||
if random_pos then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_active_env"}) |
|||
elseif waiting then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting_env"}) |
|||
else |
|||
end |
|||
end, |
|||
}) |
|||
|
|||
-- |
|||
-- OVERHEATED SPAWNER ENV |
|||
-- |
|||
|
|||
minetest.register_node("spawners:"..mod_prefix.."_"..mob_name.."_spawner_overheat_env", { |
|||
description = mod_prefix.."_"..mob_name.." spawner overheated env", |
|||
paramtype = "light", |
|||
light_source = 2, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
damage_per_second = 4, |
|||
sunlight_propagates = true, |
|||
tiles = {"spawners_spawner.png^[colorize:#FF000030"}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, |
|||
drop = { |
|||
max_items = 1, |
|||
items = { |
|||
{items = {"spawners:"..mod_prefix.."_"..mob_name.."_spawner"}, rarity = 20} |
|||
} |
|||
}, |
|||
on_construct = function(pos) |
|||
minetest.get_node_timer(pos):start(60) |
|||
end, |
|||
on_timer = function(pos, elapsed) |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_env"}) |
|||
end, |
|||
}) |
|||
end |
|||
|
|||
-- |
|||
-- * ABM * |
|||
-- |
|||
|
|||
minetest.register_abm({ |
|||
nodenames = { |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_active", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_overheat", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_env", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_active_env", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_overheat_env", |
|||
"spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting_env" |
|||
}, |
|||
neighbors = {"air"}, |
|||
interval = 10.0, |
|||
chance = 6, |
|||
catch_up = false, |
|||
action = function(pos, node, active_object_count, active_object_count_wider) |
|||
|
|||
local random_pos, waiting = spawners.check_node_status(pos, mob_name, night_only) |
|||
|
|||
-- additional name extention for environmental spawners |
|||
local ext |
|||
local env_ext = string.sub(node.name, string.len(node.name) - 3) |
|||
|
|||
if env_ext and env_ext == "_env" then |
|||
ext = "_env" |
|||
else |
|||
ext = "" |
|||
end |
|||
|
|||
-- minetest.log("action", "[Mod][Spawners] checking for: "..mob_name.." at "..minetest.pos_to_string(pos)) |
|||
|
|||
if random_pos then |
|||
|
|||
-- do not spawn if too many active entities in map block and call cooldown |
|||
if active_object_count_wider > max_obj_per_mapblock then |
|||
|
|||
-- make sure the right node status is shown |
|||
if node.name ~= "spawners:"..mob_name.."_spawner_overheat"..ext then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_overheat"..ext}) |
|||
end |
|||
|
|||
-- extend the timeout if still too many entities in map block |
|||
if node.name == "spawners:"..mod_prefix.."_"..mob_name.."_spawner_overheat"..ext then |
|||
minetest.get_node_timer(pos):stop() |
|||
minetest.get_node_timer(pos):start(60) |
|||
end |
|||
|
|||
return |
|||
end |
|||
-- make sure the right node status is shown |
|||
if node.name ~= "spawners:"..mod_prefix.."_"..mob_name.."_spawner_active"..ext then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_active"..ext}) |
|||
end |
|||
|
|||
-- enough place to spawn more mobs |
|||
spawners.start_spawning(random_pos, 1, "spawners:"..mob_name, mod_prefix, sound_custom) |
|||
|
|||
elseif waiting then |
|||
-- waiting status |
|||
if node.name ~= "spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting"..ext then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner_waiting"..ext}) |
|||
end |
|||
else |
|||
-- no random_pos found |
|||
if minetest.get_node_timer(pos):is_started() then |
|||
minetest.get_node_timer(pos):stop() |
|||
end |
|||
|
|||
if node.name ~= "spawners:"..mod_prefix.."_"..mob_name.."_spawner"..ext then |
|||
minetest.set_node(pos, {name="spawners:"..mod_prefix.."_"..mob_name.."_spawner"..ext}) |
|||
end |
|||
end |
|||
|
|||
end |
|||
}) |
|||
|
|||
end |
|||
|
|||
-- |
|||
-- CALL 'CREATE' FOR ALL SPAWNERS |
|||
-- |
|||
|
|||
for i, mob_table in ipairs(spawners.mob_tables) do |
|||
if mob_table then |
|||
|
|||
spawners.create(mob_table.name, mob_table.mod_prefix, mob_table.dummy_size, mob_table.dummy_offset, mob_table.dummy_mesh, mob_table.dummy_texture, mob_table.night_only, mob_table.sound_custom, mob_table.env) |
|||
end |
|||
end |
@ -0,0 +1,335 @@ |
|||
-- Formspecs |
|||
local ore_formspec = |
|||
"size[8,8.5]".. |
|||
default.gui_bg.. |
|||
default.gui_bg_img.. |
|||
default.gui_slots.. |
|||
"label[2,1.7;Input Ingot]".. |
|||
"list[current_name;fuel;3.5,1.5;1,1;]".. |
|||
"list[current_player;main;0,4.25;8,1;]".. |
|||
"list[current_player;main;0,5.5;8,3;8]".. |
|||
"button_exit[5,1.5;2,1;exit;Save]".. |
|||
"listring[current_name;fuel]".. |
|||
"listring[current_player;main]".. |
|||
default.get_hotbar_bg(0, 4.25) |
|||
|
|||
function spawners.get_formspec(pos) |
|||
|
|||
-- Inizialize metadata |
|||
local meta = minetest.get_meta(pos) |
|||
|
|||
-- Inizialize inventory |
|||
local inv = meta:get_inventory() |
|||
for listname, size in pairs({ |
|||
fuel = 1, |
|||
}) do |
|||
if inv:get_size(listname) ~= size then |
|||
inv:set_size(listname, size) |
|||
end |
|||
end |
|||
|
|||
-- Update formspec, infotext and node |
|||
meta:set_string("formspec", ore_formspec) |
|||
end |
|||
|
|||
local function can_dig(pos, player) |
|||
local meta = minetest.get_meta(pos); |
|||
local inv = meta:get_inventory() |
|||
return inv:is_empty("fuel") |
|||
end |
|||
|
|||
local function allow_metadata_inventory_put(pos, listname, index, stack, player) |
|||
if minetest.is_protected(pos, player:get_player_name()) then |
|||
minetest.record_protection_violation(pos, player:get_player_name()) |
|||
return |
|||
end |
|||
local meta = minetest.get_meta(pos) |
|||
local inv = meta:get_inventory() |
|||
local ingot = minetest.get_node_or_nil(pos).name |
|||
|
|||
ingot = string.split(ingot, ":") |
|||
ingot = string.split(ingot[2], "_") |
|||
|
|||
if ingot[3] == "iron" then |
|||
ingot[3] = "steel" |
|||
end |
|||
|
|||
if stack:get_name() == "default:"..ingot[3].."_ingot" then |
|||
return stack:get_count() |
|||
else |
|||
return 0 |
|||
end |
|||
end |
|||
|
|||
local function allow_metadata_inventory_take(pos, listname, index, stack, player) |
|||
if minetest.is_protected(pos, player:get_player_name()) then |
|||
minetest.record_protection_violation(pos, player:get_player_name()) |
|||
return 0 |
|||
end |
|||
return stack:get_count() |
|||
end |
|||
|
|||
local function on_receive_fields(pos, formname, fields, sender) |
|||
local ore_node = minetest.get_node_or_nil(pos) |
|||
|
|||
if minetest.is_protected(pos, sender:get_player_name()) then |
|||
minetest.record_protection_violation(pos, sender:get_player_name()) |
|||
return |
|||
end |
|||
|
|||
-- get the ore name |
|||
local ingot = ore_node.name |
|||
ingot = string.split(ingot, ":") |
|||
ingot = string.split(ingot[2], "_") |
|||
|
|||
local meta = minetest.get_meta(pos) |
|||
local inv = meta:get_inventory() |
|||
local fuellist = inv:get_list("fuel") |
|||
|
|||
if inv:is_empty("fuel") then |
|||
if ore_node.name ~= "spawners:stone_with_"..ingot[3].."_spawner" then |
|||
minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner"}) |
|||
end |
|||
meta:set_string("infotext", ingot[3].." ore spawner is empty") |
|||
else |
|||
meta:set_string("infotext", ingot[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
end |
|||
|
|||
-- fix iron vs. steel issue |
|||
if ingot[3] == "iron" then |
|||
ingot[3] = "steel" |
|||
end |
|||
|
|||
if not fuellist[1]:is_empty() and inv:get_stack("fuel", 1):get_name() == "default:"..ingot[3].."_ingot" then |
|||
|
|||
-- fix iron vs. steel issue |
|||
if ingot[3] == "steel" then |
|||
ingot[3] = "iron" |
|||
end |
|||
|
|||
local waiting, found_node = spawners.check_node_status_ores(pos, "stone_with_"..ingot[3], "default:stone") |
|||
|
|||
if found_node then |
|||
minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner_active"}) |
|||
elseif waiting then |
|||
minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner_waiting"}) |
|||
|
|||
meta:set_string("infotext", "Waiting status - player was away or no stone around, "..ingot[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
else |
|||
return |
|||
end |
|||
end |
|||
end |
|||
|
|||
-- Ores creation |
|||
function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_custom) |
|||
-- dummy inside the spawner |
|||
local dummy_ore_definition = { |
|||
hp_max = 1, |
|||
physical = false, |
|||
collisionbox = {0,0,0,0,0,0}, |
|||
visual = "wielditem", |
|||
visual_size = size, |
|||
timer = 0, |
|||
textures={"default:"..ore_name}, |
|||
makes_footstep_sound = false, |
|||
automatic_rotate = math.pi * -3, |
|||
m_name = "dummy_ore" |
|||
} |
|||
|
|||
local ore = string.split(ore_name, "_") |
|||
|
|||
dummy_ore_definition.on_activate = function(self) |
|||
self.object:setvelocity({x=0, y=0, z=0}) |
|||
self.object:setacceleration({x=0, y=0, z=0}) |
|||
self.object:set_armor_groups({immortal=1}) |
|||
end |
|||
|
|||
-- remove dummy after dug up the spawner |
|||
dummy_ore_definition.on_step = function(self, dtime) |
|||
self.timer = self.timer + dtime |
|||
local n = minetest.get_node_or_nil(self.object:getpos()) |
|||
if self.timer > 2 then |
|||
if n and n.name and n.name ~= "spawners:"..ore_name.."_spawner_active" and n.name ~= "spawners:"..ore_name.."_spawner_waiting" and n.name ~= "spawners:"..ore_name.."_spawner" then |
|||
self.object:remove() |
|||
end |
|||
end |
|||
end |
|||
|
|||
minetest.register_entity("spawners:dummy_ore_"..ore_name, dummy_ore_definition) |
|||
|
|||
-- node spawner active |
|||
minetest.register_node("spawners:"..ore_name.."_spawner_active", { |
|||
description = ore_name.." spawner active", |
|||
paramtype = "light", |
|||
light_source = 4, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
damage_per_second = 4, |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..ore_name.."_spawner", |
|||
can_dig = can_dig, |
|||
allow_metadata_inventory_put = allow_metadata_inventory_put, |
|||
allow_metadata_inventory_take = allow_metadata_inventory_take, |
|||
on_receive_fields = on_receive_fields, |
|||
}) |
|||
|
|||
-- node spawner waiting - no stone around or no fuel |
|||
minetest.register_node("spawners:"..ore_name.."_spawner_waiting", { |
|||
description = ore_name.." spawner waiting", |
|||
paramtype = "light", |
|||
light_source = 2, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_waiting_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..ore_name.."_spawner", |
|||
can_dig = can_dig, |
|||
allow_metadata_inventory_put = allow_metadata_inventory_put, |
|||
allow_metadata_inventory_take = allow_metadata_inventory_take, |
|||
on_receive_fields = on_receive_fields, |
|||
}) |
|||
|
|||
-- node spawner inactive (default) |
|||
minetest.register_node("spawners:"..ore_name.."_spawner", { |
|||
description = ore_name.." spawner", |
|||
paramtype = "light", |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = {"spawners_spawner.png"}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2}, |
|||
stack_max = 1, |
|||
on_construct = function(pos) |
|||
local meta = minetest.get_meta(pos) |
|||
spawners.get_formspec(pos) |
|||
pos.y = pos.y + offset |
|||
minetest.add_entity(pos,"spawners:dummy_ore_"..ore_name) |
|||
meta:set_string("infotext", ore[3].." ore spawner is empty") |
|||
end, |
|||
|
|||
can_dig = can_dig, |
|||
|
|||
allow_metadata_inventory_put = allow_metadata_inventory_put, |
|||
allow_metadata_inventory_take = allow_metadata_inventory_take, |
|||
on_receive_fields = on_receive_fields, |
|||
}) |
|||
|
|||
-- ABM |
|||
minetest.register_abm({ |
|||
nodenames = {"spawners:"..ore_name.."_spawner_active", "spawners:"..ore_name.."_spawner_waiting"}, |
|||
interval = 5.0, |
|||
chance = 5, |
|||
action = function(pos, node, active_object_count, active_object_count_wider) |
|||
|
|||
local waiting, found_node = spawners.check_node_status_ores(pos, ore_name, "default:stone") |
|||
|
|||
|
|||
local meta = minetest.get_meta(pos) |
|||
local inv = meta:get_inventory() |
|||
|
|||
if found_node then |
|||
-- make sure the right node status is shown |
|||
if node.name ~= "spawners:"..ore_name.."_spawner_active" then |
|||
minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner_active"}) |
|||
end |
|||
|
|||
|
|||
-- take fuel |
|||
local stack = inv:get_stack("fuel", 1) |
|||
stack:take_item() |
|||
|
|||
|
|||
inv:set_stack("fuel", 1, stack) |
|||
|
|||
meta:set_string("infotext", ore[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
|
|||
-- enough place to spawn more ores |
|||
spawners.start_spawning_ores(found_node, "default:"..ore_name, sound_custom) |
|||
|
|||
-- empty / no fuel |
|||
if inv:is_empty("fuel") then |
|||
minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner"}) |
|||
meta:set_string("infotext", ore[3].." ore spawner is empty.") |
|||
|
|||
end |
|||
else |
|||
-- waiting status |
|||
if node.name ~= "spawners:"..ore_name.."_spawner_waiting" then |
|||
minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner_waiting"}) |
|||
|
|||
meta:set_string("infotext", "Waiting status - player was away or no stone around, "..ore[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
end |
|||
end |
|||
|
|||
end |
|||
}) |
|||
|
|||
end |
|||
|
|||
-- default:stone_with_gold |
|||
spawners.create_ore("stone_with_gold", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") |
|||
|
|||
-- default:stone_with_iron |
|||
spawners.create_ore("stone_with_iron", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") |
|||
|
|||
-- default:stone_with_copper |
|||
spawners.create_ore("stone_with_copper", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") |
|||
|
|||
|
|||
-- recipes |
|||
minetest.register_craft({ |
|||
output = "spawners:stone_with_gold_spawner", |
|||
recipe = { |
|||
{"default:diamondblock", "fire:flint_and_steel", "default:diamondblock"}, |
|||
{"xpanes:bar_flat", "default:goldblock", "xpanes:bar_flat"}, |
|||
{"default:diamondblock", "xpanes:bar_flat", "default:diamondblock"}, |
|||
} |
|||
}) |
|||
|
|||
minetest.register_craft({ |
|||
output = "spawners:stone_with_iron_spawner", |
|||
recipe = { |
|||
{"default:diamondblock", "fire:flint_and_steel", "default:diamondblock"}, |
|||
{"xpanes:bar_flat", "default:steelblock", "xpanes:bar_flat"}, |
|||
{"default:diamondblock", "xpanes:bar_flat", "default:diamondblock"}, |
|||
} |
|||
}) |
|||
|
|||
minetest.register_craft({ |
|||
output = "spawners:stone_with_copper_spawner", |
|||
recipe = { |
|||
{"default:diamondblock", "fire:flint_and_steel", "default:diamondblock"}, |
|||
{"xpanes:bar_flat", "default:copperblock", "xpanes:bar_flat"}, |
|||
{"default:diamondblock", "xpanes:bar_flat", "default:diamondblock"}, |
|||
} |
|||
}) |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@ -0,0 +1,335 @@ |
|||
-- Formspecs |
|||
local ore_formspec = |
|||
"size[8,8.5]".. |
|||
default.gui_bg.. |
|||
default.gui_bg_img.. |
|||
default.gui_slots.. |
|||
"label[2,1.7;Input Ingot]".. |
|||
"list[current_name;fuel;3.5,1.5;1,1;]".. |
|||
"list[current_player;main;0,4.25;8,1;]".. |
|||
"list[current_player;main;0,5.5;8,3;8]".. |
|||
"button_exit[5,1.5;2,1;exit;Save]".. |
|||
"listring[current_name;fuel]".. |
|||
"listring[current_player;main]".. |
|||
default.get_hotbar_bg(0, 4.25) |
|||
|
|||
function spawners.get_formspec(pos) |
|||
|
|||
-- Inizialize metadata |
|||
local meta = minetest.get_meta(pos) |
|||
|
|||
-- Inizialize inventory |
|||
local inv = meta:get_inventory() |
|||
for listname, size in pairs({ |
|||
fuel = 1, |
|||
}) do |
|||
if inv:get_size(listname) ~= size then |
|||
inv:set_size(listname, size) |
|||
end |
|||
end |
|||
|
|||
-- Update formspec, infotext and node |
|||
meta:set_string("formspec", ore_formspec) |
|||
end |
|||
|
|||
local function can_dig(pos, player) |
|||
local meta = minetest.get_meta(pos); |
|||
local inv = meta:get_inventory() |
|||
return inv:is_empty("fuel") |
|||
end |
|||
|
|||
local function allow_metadata_inventory_put(pos, listname, index, stack, player) |
|||
if minetest.is_protected(pos, player:get_player_name()) then |
|||
minetest.record_protection_violation(pos, player:get_player_name()) |
|||
return |
|||
end |
|||
local meta = minetest.get_meta(pos) |
|||
local inv = meta:get_inventory() |
|||
local ingot = minetest.get_node_or_nil(pos).name |
|||
|
|||
ingot = string.split(ingot, ":") |
|||
ingot = string.split(ingot[2], "_") |
|||
|
|||
if ingot[3] == "iron" then |
|||
ingot[3] = "steel" |
|||
end |
|||
|
|||
if stack:get_name() == "default:"..ingot[3].."_ingot" then |
|||
return stack:get_count() |
|||
else |
|||
return 0 |
|||
end |
|||
end |
|||
|
|||
local function allow_metadata_inventory_take(pos, listname, index, stack, player) |
|||
if minetest.is_protected(pos, player:get_player_name()) then |
|||
minetest.record_protection_violation(pos, player:get_player_name()) |
|||
return 0 |
|||
end |
|||
return stack:get_count() |
|||
end |
|||
|
|||
local function on_receive_fields(pos, formname, fields, sender) |
|||
local ore_node = minetest.get_node_or_nil(pos) |
|||
|
|||
if minetest.is_protected(pos, sender:get_player_name()) then |
|||
minetest.record_protection_violation(pos, sender:get_player_name()) |
|||
return |
|||
end |
|||
|
|||
-- get the ore name |
|||
local ingot = ore_node.name |
|||
ingot = string.split(ingot, ":") |
|||
ingot = string.split(ingot[2], "_") |
|||
|
|||
local meta = minetest.get_meta(pos) |
|||
local inv = meta:get_inventory() |
|||
local fuellist = inv:get_list("fuel") |
|||
|
|||
if inv:is_empty("fuel") then |
|||
if ore_node.name ~= "spawners:stone_with_"..ingot[3].."_spawner" then |
|||
minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner"}) |
|||
end |
|||
meta:set_string("infotext", ingot[3].." ore spawner is empty") |
|||
else |
|||
meta:set_string("infotext", ingot[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
end |
|||
|
|||
-- fix iron vs. steel issue |
|||
if ingot[3] == "iron" then |
|||
ingot[3] = "steel" |
|||
end |
|||
|
|||
if not fuellist[1]:is_empty() and inv:get_stack("fuel", 1):get_name() == "default:"..ingot[3].."_ingot" then |
|||
|
|||
-- fix iron vs. steel issue |
|||
if ingot[3] == "steel" then |
|||
ingot[3] = "iron" |
|||
end |
|||
|
|||
local waiting, found_node = spawners.check_node_status_ores(pos, "stone_with_"..ingot[3], "default:stone") |
|||
|
|||
if found_node then |
|||
minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner_active"}) |
|||
elseif waiting then |
|||
minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner_waiting"}) |
|||
|
|||
meta:set_string("infotext", "Waiting status - player was away or no stone around, "..ingot[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
else |
|||
return |
|||
end |
|||
end |
|||
end |
|||
|
|||
-- Ores creation |
|||
function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_custom) |
|||
-- dummy inside the spawner |
|||
local dummy_ore_definition = { |
|||
hp_max = 1, |
|||
physical = false, |
|||
collisionbox = {0,0,0,0,0,0}, |
|||
visual = "wielditem", |
|||
visual_size = size, |
|||
timer = 0, |
|||
textures={"default:"..ore_name}, |
|||
makes_footstep_sound = false, |
|||
automatic_rotate = math.pi * -3, |
|||
m_name = "dummy_ore" |
|||
} |
|||
|
|||
local ore = string.split(ore_name, "_") |
|||
|
|||
dummy_ore_definition.on_activate = function(self) |
|||
self.object:setvelocity({x=0, y=0, z=0}) |
|||
self.object:setacceleration({x=0, y=0, z=0}) |
|||
self.object:set_armor_groups({immortal=1}) |
|||
end |
|||
|
|||
-- remove dummy after dug up the spawner |
|||
dummy_ore_definition.on_step = function(self, dtime) |
|||
self.timer = self.timer + dtime |
|||
local n = minetest.get_node_or_nil(self.object:getpos()) |
|||
if self.timer > 2 then |
|||
if n and n.name and n.name ~= "spawners:"..ore_name.."_spawner_active" and n.name ~= "spawners:"..ore_name.."_spawner_waiting" and n.name ~= "spawners:"..ore_name.."_spawner" then |
|||
self.object:remove() |
|||
end |
|||
end |
|||
end |
|||
|
|||
minetest.register_entity("spawners:dummy_ore_"..ore_name, dummy_ore_definition) |
|||
|
|||
-- node spawner active |
|||
minetest.register_node("spawners:"..ore_name.."_spawner_active", { |
|||
description = ore_name.." spawner active", |
|||
paramtype = "light", |
|||
light_source = 4, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
damage_per_second = 4, |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..ore_name.."_spawner", |
|||
can_dig = can_dig, |
|||
allow_metadata_inventory_put = allow_metadata_inventory_put, |
|||
allow_metadata_inventory_take = allow_metadata_inventory_take, |
|||
on_receive_fields = on_receive_fields, |
|||
}) |
|||
|
|||
-- node spawner waiting - no stone around or no fuel |
|||
minetest.register_node("spawners:"..ore_name.."_spawner_waiting", { |
|||
description = ore_name.." spawner waiting", |
|||
paramtype = "light", |
|||
light_source = 2, |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = { |
|||
{ |
|||
name = "spawners_spawner_waiting_animated.png", |
|||
animation = { |
|||
type = "vertical_frames", |
|||
aspect_w = 32, |
|||
aspect_h = 32, |
|||
length = 2.0 |
|||
}, |
|||
} |
|||
}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2,not_in_creative_inventory=1}, |
|||
drop = "spawners:"..ore_name.."_spawner", |
|||
can_dig = can_dig, |
|||
allow_metadata_inventory_put = allow_metadata_inventory_put, |
|||
allow_metadata_inventory_take = allow_metadata_inventory_take, |
|||
on_receive_fields = on_receive_fields, |
|||
}) |
|||
|
|||
-- node spawner inactive (default) |
|||
minetest.register_node("spawners:"..ore_name.."_spawner", { |
|||
description = ore_name.." spawner", |
|||
paramtype = "light", |
|||
drawtype = "allfaces", |
|||
walkable = true, |
|||
sounds = default.node_sound_stone_defaults(), |
|||
sunlight_propagates = true, |
|||
tiles = {"spawners_spawner.png"}, |
|||
is_ground_content = true, |
|||
groups = {cracky=1,level=2}, |
|||
stack_max = 1, |
|||
on_construct = function(pos) |
|||
local meta = minetest.get_meta(pos) |
|||
spawners.get_formspec(pos) |
|||
pos.y = pos.y + offset |
|||
minetest.add_entity(pos,"spawners:dummy_ore_"..ore_name) |
|||
meta:set_string("infotext", ore[3].." ore spawner is empty") |
|||
end, |
|||
|
|||
can_dig = can_dig, |
|||
|
|||
allow_metadata_inventory_put = allow_metadata_inventory_put, |
|||
allow_metadata_inventory_take = allow_metadata_inventory_take, |
|||
on_receive_fields = on_receive_fields, |
|||
}) |
|||
|
|||
-- ABM |
|||
minetest.register_abm({ |
|||
nodenames = {"spawners:"..ore_name.."_spawner_active", "spawners:"..ore_name.."_spawner_waiting"}, |
|||
interval = 5.0, |
|||
chance = 5, |
|||
action = function(pos, node, active_object_count, active_object_count_wider) |
|||
|
|||
local waiting, found_node = spawners.check_node_status_ores(pos, ore_name, "default:stone") |
|||
|
|||
|
|||
local meta = minetest.get_meta(pos) |
|||
local inv = meta:get_inventory() |
|||
|
|||
if found_node then |
|||
-- make sure the right node status is shown |
|||
if node.name ~= "spawners:"..ore_name.."_spawner_active" then |
|||
minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner_active"}) |
|||
end |
|||
|
|||
|
|||
-- take fuel |
|||
local stack = inv:get_stack("fuel", 1) |
|||
stack:take_item() |
|||
|
|||
|
|||
inv:set_stack("fuel", 1, stack) |
|||
|
|||
meta:set_string("infotext", ore[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
|
|||
-- enough place to spawn more ores |
|||
spawners.start_spawning_ores(found_node, "default:"..ore_name, sound_custom) |
|||
|
|||
-- empty / no fuel |
|||
if inv:is_empty("fuel") then |
|||
minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner"}) |
|||
meta:set_string("infotext", ore[3].." ore spawner is empty.") |
|||
|
|||
end |
|||
else |
|||
-- waiting status |
|||
if node.name ~= "spawners:"..ore_name.."_spawner_waiting" then |
|||
minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner_waiting"}) |
|||
|
|||
meta:set_string("infotext", "Waiting status - player was away or no stone around, "..ore[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) |
|||
end |
|||
end |
|||
|
|||
end |
|||
}) |
|||
|
|||
end |
|||
|
|||
-- default:stone_with_gold |
|||
-- spawners.create_ore("stone_with_gold", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") |
|||
|
|||
-- default:stone_with_iron |
|||
-- spawners.create_ore("stone_with_iron", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") |
|||
|
|||
-- default:stone_with_copper |
|||
-- spawners.create_ore("stone_with_copper", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") |
|||
|
|||
|
|||
-- recipes |
|||
-- minetest.register_craft({ |
|||
-- output = "spawners:stone_with_gold_spawner", |
|||
-- recipe = { |
|||
-- {"default:diamondblock", "fire:flint_and_steel", "default:diamondblock"}, |
|||
-- {"xpanes:bar_flat", "default:goldblock", "xpanes:bar_flat"}, |
|||
-- {"default:diamondblock", "xpanes:bar_flat", "default:diamondblock"}, |
|||
-- } |
|||
-- }) |
|||
|
|||
-- minetest.register_craft({ |
|||
-- output = "spawners:stone_with_iron_spawner", |
|||
-- recipe = { |
|||
-- {"default:diamondblock", "fire:flint_and_steel", "default:diamondblock"}, |
|||
-- {"xpanes:bar_flat", "default:steelblock", "xpanes:bar_flat"}, |
|||
-- {"default:diamondblock", "xpanes:bar_flat", "default:diamondblock"}, |
|||
-- } |
|||
-- }) |
|||
|
|||
-- minetest.register_craft({ |
|||
-- output = "spawners:stone_with_copper_spawner", |
|||
-- recipe = { |
|||
-- {"default:diamondblock", "fire:flint_and_steel", "default:diamondblock"}, |
|||
-- {"xpanes:bar_flat", "default:copperblock", "xpanes:bar_flat"}, |
|||
-- {"default:diamondblock", "xpanes:bar_flat", "default:diamondblock"}, |
|||
-- } |
|||
-- }) |