Fixed a few bits and upgraded the main es mod.
125
mods/es/admintnt.lua
Normal file
@ -0,0 +1,125 @@
|
||||
--mod: admin tnt for survival server
|
||||
--Just Test Mods created by maikerumine
|
||||
--inspired by Andrey "lag01" the creator of the original Just Test server.
|
||||
-- Minetest 0.4.14 mod: "es"
|
||||
-- namespace: es
|
||||
--https://github.com/maikerumine
|
||||
|
||||
--License:
|
||||
--~~~~~~~~
|
||||
--Code:
|
||||
--(c) Copyright 2016 maikerumine; modified zlib-License
|
||||
--see "LICENSE.txt" for details.
|
||||
|
||||
--Media(if not stated differently):
|
||||
--(c) Copyright (2014-2016) maikerumine; CC-BY-SA 3.0
|
||||
|
||||
minetest.register_node("es:admin_tnt_fake", {
|
||||
description = "Fake Admin TNT",
|
||||
tiles = {"admin_tnt_top.png", "admin_tnt_bottom.png", "admin_tnt_side.png"},
|
||||
groups = {choppy = 2,immortal = 1},
|
||||
--drop = 'es:admin_tnt_fake',
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = function(pos, puncher)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", puncher:get_player_name() or "")
|
||||
meta:set_string("infotext", "Fake TNT (placed by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("es:admin_tnt", {
|
||||
description = "ADMIN TNT Changes to tnt after 12 hour timer.",
|
||||
paramtype2 = "facedir",
|
||||
place_param2 = 0,
|
||||
tiles = {"admin_tnt_top.png", "admin_tnt_bottom.png", "admin_tnt_side.png"},
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 0,choppy = 1},
|
||||
drop ='es:admin_tnt_fake',
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "ADMIN TNT (placed by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
minetest.after(60, function()
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
|
||||
end)
|
||||
end,
|
||||
on_punch = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "es:griefer_soul_block" then
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
--minetest.set_node(pos, {name="tnt:tnt_burning"}) --sets to instant explosion
|
||||
minetest.set_node(pos, {name="tnt:tnt"}) --sets to regular tnt for controlled demolition
|
||||
boom(pos, 0)
|
||||
end
|
||||
end,
|
||||
on_dig = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "default:axe_mese" then
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
minetest.set_node(pos, {name="tnt:tnt_burning"})
|
||||
boom(pos, 0)
|
||||
minetest.after(2, function()
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
minetest.set_node(pos, {name="es:admin_tnt_fake"})
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("es:admin_tnt_fast", {
|
||||
description = "ADMIN TNT Changes to tnt after 60 second hour timer",
|
||||
paramtype2 = "facedir",
|
||||
place_param2 = 0,
|
||||
tiles = {"admin_tnt_top.png^heart.png", "admin_tnt_bottom.png^heart.png", "admin_tnt_side.png"},
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 0},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "ADMIN TNT FAST (placed by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
end,
|
||||
on_punch = function(pos, node, puncher)
|
||||
if puncher:get_wielded_item():get_name() == "es:griefer_soul_block" then
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
minetest.set_node(pos, {name="tnt:boom"})
|
||||
--minetest.set_node(pos, {name="tnt:tnt"})
|
||||
--boom(pos, 0)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"es:admin_tnt"},
|
||||
interval = 43200,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
if node.name == "es:admin_tnt" then
|
||||
minetest.set_node(pos, {name="tnt:boom"})
|
||||
--boom(pos, 0)
|
||||
end
|
||||
--end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"es:admin_tnt_fast"},
|
||||
interval = 60,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
minetest.sound_play("tnt_ignite", {pos=pos})
|
||||
if node.name == "es:admin_tnt_fast" then
|
||||
--minetest.set_node(pos, {name="tnt:tnt_boom"})
|
||||
minetest.set_node(pos, {name="tnt:tnt_burning"})
|
||||
--boom(pos, 0)
|
||||
end
|
||||
--end
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
--Alias "old"--->"new"
|
||||
------------------------------------------
|
||||
|
||||
--[[
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
--This is to fix the old interaction with my modified 3d_armor mod.
|
||||
@ -52,14 +52,14 @@ minetest.register_alias("bags:small", "unified_inventory:small_esmmese")
|
||||
minetest.register_alias("bags:medium", "unified_inventory:medium_esmmese")
|
||||
minetest.register_alias("bags:large", "unified_inventory:large_esmmese")
|
||||
|
||||
]]
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
--beds
|
||||
minetest.register_alias("beds:bed_bottom_white", "beds:bed_bottom")
|
||||
minetest.register_alias("beds:bed_top_white", "beds:bed_top")
|
||||
|
||||
--[[
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
--carts
|
||||
@ -74,7 +74,6 @@ minetest.register_alias("default:desert_stone_with_iron", "es:desert_stone_with_
|
||||
minetest.register_alias("default:desert_stone_with_gold", "es:desert_stone_with_gold")
|
||||
minetest.register_alias("default:desert_stone_with_coal", "es:desert_stone_with_coal")
|
||||
|
||||
]]
|
||||
--===========================================
|
||||
--===========================================
|
||||
--doors
|
||||
@ -94,14 +93,14 @@ minetest.register_alias("doors:door_steel_b_1", "doors:door_steel_a")
|
||||
minetest.register_alias("doors:door_steel_b_2", "doors:door_steel_b")
|
||||
minetest.register_alias("doors:door_steel_t_2", "doors:hidden")
|
||||
|
||||
--[[
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
--es crushing furnace
|
||||
minetest.register_alias("es:furnace", "es:infiniumblock")
|
||||
minetest.register_alias("es:furnace_active", "es:infiniumblock")
|
||||
minetest.register_alias("es:cfurnace", "es:infiniumblock")
|
||||
minetest.register_alias("es:cfurnace_active", "es:infiniumblock")
|
||||
minetest.register_alias("es:furnace", "es:what")
|
||||
minetest.register_alias("es:furnace_active", "es:what")
|
||||
minetest.register_alias("es:cfurnace", "es:what")
|
||||
minetest.register_alias("es:cfurnace_active", "es:what")
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
@ -190,6 +189,7 @@ minetest.register_alias("meru:stone", "default:sandstone")
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
|
||||
--moreores
|
||||
minetest.register_alias("moreores:mineral_mithril", "default:stone_with_tin")
|
||||
minetest.register_alias("moreores:mineral_silver", "default:stone_with_tin")
|
||||
@ -397,116 +397,8 @@ minetest.register_alias("moretrees:spruce_cone", "farming:melon_8")
|
||||
minetest.register_alias("moretrees:fir_cone", "farming:cocoa_2")
|
||||
minetest.register_alias("moretrees:pine_cone", "farming:cocoa_2")
|
||||
minetest.register_alias("moretrees:acorn", "farming:cocoa_2")
|
||||
]]
|
||||
|
||||
--===========================================
|
||||
--===========================================
|
||||
minetest.register_alias("nsspf:amanita_muscaria", "air")
|
||||
minetest.register_alias("nsspf:amanita_muscaria_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:amanita_muscaria_mycelium", "air")
|
||||
minetest.register_alias("nsspf:amanita_phalloides", "air")
|
||||
minetest.register_alias("nsspf:amanita_phalloides_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:amanita_phalloides_mycelium", "air")
|
||||
minetest.register_alias("nsspf:armillaria_mellea", "air")
|
||||
minetest.register_alias("nsspf:boletus_edulis", "air")
|
||||
minetest.register_alias("nsspf:boletus_edulis_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:boletus_edulis_mycelium", "air")
|
||||
minetest.register_alias("nsspf:boletus_pinophilus", "air")
|
||||
minetest.register_alias("nsspf:boletus_pinophilus_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:boletus_pinophilus_mycelium", "air")
|
||||
minetest.register_alias("nsspf:boletus_satanas", "air")
|
||||
minetest.register_alias("nsspf:boletus_satanas_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:boletus_satanas_mycelium", "air")
|
||||
minetest.register_alias("nsspf:cantharellus_cibarius", "air")
|
||||
minetest.register_alias("nsspf:cantharellus_cibarius_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:cantharellus_cibarius_mycelium", "air")
|
||||
minetest.register_alias("nsspf:clitocybe_glacialis", "air")
|
||||
minetest.register_alias("nsspf:clitocybe_glacialis_fungusdirt", "air")
|
||||
minetest.register_alias("nsspf:clitocybe_glacialis_mycelium", "air")
|
||||
minetest.register_alias("nsspf:clitocybula_azurea", "air")
|
||||
minetest.register_alias("nsspf:cooked_amanita_muscaria", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_amanita_phalloides", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_armillaria_mellea", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_boletus_edulis", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_boletus_pinophilus", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_boletus_satanas", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_cantharellus_cibarius", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_clitocybe_glacialis", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_clitocybula_azurea", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_coprinus_atramentarius", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_fistulina_hepatica", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_ganoderma_lucidum", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_gyromitra_esculenta", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_hygrophorus_goetzii", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_lentinus_strigosus", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_lycoperdon_pyriforme", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_macrolepiota_procera", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_marasmius_haematocephalus", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_morchella_conica", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_mycena_chlorophos", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_panellus_pusillus", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_plectania_nannfeldtii", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_psilocybe_cubensis", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_russula_xerampelina", "default:dirt")
|
||||
minetest.register_alias("nsspf:cooked_suillus_grevillei", "default:dirt")
|
||||
minetest.register_alias("nsspf:coprinus_atramentarius", "air")
|
||||
minetest.register_alias("nsspf:coprinus_atramentarius_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:coprinus_atramentarius_mycelium", "air")
|
||||
minetest.register_alias("nsspf:fistulina_hepatica", "air")
|
||||
minetest.register_alias("nsspf:fomes_fomentarius", "air")
|
||||
minetest.register_alias("nsspf:ganoderma_lucidum", "air")
|
||||
minetest.register_alias("nsspf:gyromitra_esculenta", "air")
|
||||
minetest.register_alias("nsspf:gyromitra_esculenta_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:gyromitra_esculenta_mycelium", "air")
|
||||
minetest.register_alias("nsspf:hygrophorus_goetzii", "air")
|
||||
minetest.register_alias("nsspf:hygrophorus_goetzii_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:hygrophorus_goetzii_mycelium", "air")
|
||||
minetest.register_alias("nsspf:lentinus_strigosus", "air")
|
||||
minetest.register_alias("nsspf:lycoperdon_pyriforme", "air")
|
||||
minetest.register_alias("nsspf:lycoperdon_pyriforme_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:lycoperdon_pyriforme_mycelium", "air")
|
||||
minetest.register_alias("nsspf:macrolepiota_procera", "air")
|
||||
minetest.register_alias("nsspf:macrolepiota_procera_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:macrolepiota_procera_mycelium", "air")
|
||||
minetest.register_alias("nsspf:marasmius_haematocephalus", "air")
|
||||
minetest.register_alias("nsspf:morchella_conica", "air")
|
||||
minetest.register_alias("nsspf:morchella_conica_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:morchella_conica_mycelium", "air")
|
||||
minetest.register_alias("nsspf:mycena_chlorophos", "air")
|
||||
minetest.register_alias("nsspf:mycena_chlorophos_light", "air")
|
||||
minetest.register_alias("nsspf:panellus_pusillus", "air")
|
||||
minetest.register_alias("nsspf:panellus_pusillus_light", "air")
|
||||
minetest.register_alias("nsspf:plectania_nannfeldtii", "air")
|
||||
minetest.register_alias("nsspf:plectania_nannfeldtii_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:plectania_nannfeldtii_mycelium", "air")
|
||||
minetest.register_alias("nsspf:psilocybe_cubensis", "air")
|
||||
minetest.register_alias("nsspf:psilocybe_cubensis_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:psilocybe_cubensis_mycelium", "air")
|
||||
minetest.register_alias("nsspf:russula_xerampelina", "air")
|
||||
minetest.register_alias("nsspf:russula_xerampelina_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:russula_xerampelina_mycelium", "air")
|
||||
minetest.register_alias("nsspf:suillus_grevillei", "air")
|
||||
minetest.register_alias("nsspf:suillus_grevillei_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:suillus_grevillei_mycelium", "air")
|
||||
minetest.register_alias("nsspf:terfezia_arenaria_fruit", "default:dirt")
|
||||
minetest.register_alias("nsspf:terfezia_arenaria_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:terfezia_arenaria_tuber_mycelium", "air")
|
||||
minetest.register_alias("nsspf:tuber_borchii_fruit", "default:dirt")
|
||||
minetest.register_alias("nsspf:tuber_borchii_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:tuber_borchii_tuber_mycelium", "air")
|
||||
minetest.register_alias("nsspf:tuber_magnatum_pico_fruit", "default:dirt")
|
||||
minetest.register_alias("nsspf:tuber_magnatum_pico_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:tuber_magnatum_pico_tuber_mycelium", "air")
|
||||
minetest.register_alias("nsspf:tuber_melanosporum_fruit", "default:dirt")
|
||||
minetest.register_alias("nsspf:tuber_melanosporum_fungusdirt", "default:dirt")
|
||||
minetest.register_alias("nsspf:tuber_melanosporum_tuber_mycelium", "air")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
--===========================================
|
||||
--===========================================
|
||||
--pathv6alt
|
||||
@ -880,7 +772,7 @@ minetest.register_alias("mg_villages:desert_sand_soil", "default:desert_sand")
|
||||
minetest.register_alias("mg_villages:plotmarker", "stairs:slab_stonebrick")
|
||||
minetest.register_alias("mg_villages:lava_flowing_tamed", "default:lava_flowing")
|
||||
minetest.register_alias("mg_villages:lava_source_tamed", "default:lava_source")
|
||||
]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -148,3 +148,69 @@ function ()
|
||||
|
||||
end
|
||||
)
|
||||
--[[
|
||||
--everamaza code
|
||||
minetest.register_privilege("liquid", "Can place liquid source nodes.")
|
||||
minetest.register_privilege("lava", "Can use liquid igniters.")
|
||||
minetest.register_privilege("water", "Can use liquid.")
|
||||
|
||||
|
||||
--lava bucket
|
||||
local old_lava_bucket_place = minetest.registered_items["bucket:bucket_lava"].on_place
|
||||
|
||||
minetest.override_item("bucket:bucket_lava", {
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not minetest.check_player_privs(placer:get_player_name(),
|
||||
{lava = true}) then
|
||||
return itemstack
|
||||
else
|
||||
return old_lava_bucket_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
--water bucket
|
||||
local old_water_bucket_place = minetest.registered_items["bucket:bucket_water"].on_place
|
||||
|
||||
minetest.override_item("bucket:bucket_water", {
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not minetest.check_player_privs(placer:get_player_name(),
|
||||
{water = true}) then
|
||||
return itemstack
|
||||
else
|
||||
return old_water_bucket_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
--source blocks
|
||||
minetest.override_item("default:lava_source", {
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
if not minetest.check_player_privs(placer:get_player_name(),
|
||||
{liquid = true, lava = true}) then
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.override_item("default:water_source", {
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
if not minetest.check_player_privs(placer:get_player_name(),
|
||||
{liquid = true}) then
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.override_item("default:river_water_source", {
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
if not minetest.check_player_privs(placer:get_player_name(),
|
||||
{liquid = true}) then
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
]]
|
1862
mods/es/biome.lua
@ -1,358 +0,0 @@
|
||||
--Extreme Survival created by maikerumine
|
||||
-- Minetest 0.4.13 mod: "Extreme Survival"
|
||||
-- namespace: es
|
||||
--version 1.8
|
||||
--https://github.com/maikerumine
|
||||
|
||||
|
||||
--NODE TWEAKINGS
|
||||
minetest.override_item("default:dirt_with_grass", {
|
||||
description = "Dirt with Grass",
|
||||
tiles = {"default_dry_grass.png", "default_dirt.png",
|
||||
{name = "default_dirt.png^default_dry_grass_side.png",
|
||||
tileable_vertical = false}},
|
||||
groups = {crumbly = 3, soil = 1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.override_item("default:leaves", {
|
||||
description = "Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 1,
|
||||
visual_scale = 1.3,
|
||||
tiles = {"a-leavedead.png"},
|
||||
special_tiles = {"a-leavedead.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
-- player will get sapling with 1/20 chance
|
||||
items = {'default:sapling'},
|
||||
rarity = 20,
|
||||
},
|
||||
{
|
||||
-- player will get leaves only if he get no saplings,
|
||||
-- this is because max_items is 1
|
||||
items = {'default:stick'},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
|
||||
minetest.override_item("default:jungleleaves", {
|
||||
description = "Jungle Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 1,
|
||||
visual_scale = 1.3,
|
||||
tiles = {"a-leavedead.png"},
|
||||
special_tiles = {"a-leavedead.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {'default:junglesapling'}, rarity = 20},
|
||||
{items = {'default:stick'}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.override_item("default:pine_needles",{
|
||||
description = "Pine Needles",
|
||||
drawtype = "allfaces_optional",
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_pine_needles.png^[colorize:white:80"},
|
||||
waving = 1,
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"default:pine_sapling"}, rarity = 20},
|
||||
{items = {"default:stick"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
|
||||
minetest.override_item("default:acacia_leaves", {
|
||||
description = "Acacia Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_acacia_leaves.png^[colorize:brown:120"},
|
||||
waving = 1,
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"default:acacia_sapling"}, rarity = 20},
|
||||
{items = {"default:stick"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.override_item("default:aspen_leaves", {
|
||||
description = "Aspen Leaves",
|
||||
drawtype = "allfaces_optional",
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_aspen_leaves.png^[colorize:brown:80"},
|
||||
waving = 1,
|
||||
paramtype = "light",
|
||||
is_ground_content = false,
|
||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"default:aspen_sapling"}, rarity = 20},
|
||||
{items = {"default:stick"}}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
--
|
||||
-- Plantlife (non-cubic)
|
||||
--
|
||||
|
||||
minetest.override_item("default:cactus", {
|
||||
description = "Cactus",
|
||||
tiles = {"default_cactus_top.png^[colorize:brown:80", "default_cactus_top.png^[colorize:brown:80",
|
||||
"default_cactus_side.png^[colorize:brown:80"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy = 1, choppy = 3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_place = minetest.rotate_node,
|
||||
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_up(pos, node, digger)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.override_item("default:papyrus", {
|
||||
description = "Papyrus",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"default_papyrus.png^[colorize:brown:120"},
|
||||
inventory_image = "default_papyrus.png^[colorize:brown:120",
|
||||
wield_image = "default_papyrus.png^[colorize:brown:120",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_up(pos, node, digger)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.override_item("default:junglegrass", {
|
||||
description = "Jungle Grass",
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_junglegrass.png^[colorize:brown:80"},
|
||||
inventory_image = "default_junglegrass.png^[colorize:brown:80",
|
||||
wield_image = "default_junglegrass.png^[colorize:brown:80",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.override_item("default:grass_1", {
|
||||
description = "Grass",
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
tiles = {"default_grass_1.png^[colorize:brown:80"},
|
||||
-- Use texture of a taller grass stage in inventory
|
||||
inventory_image = "default_grass_3.png^[colorize:brown:80",
|
||||
wield_image = "default_grass_3.png^[colorize:brown:80",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random grass node
|
||||
local stack = ItemStack("default:grass_" .. math.random(1,5))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("default:grass_1 " ..
|
||||
itemstack:get_count() - (1 - ret:get_count()))
|
||||
end,
|
||||
})
|
||||
|
||||
for i = 2, 5 do
|
||||
minetest.override_item("default:grass_" .. i, {
|
||||
description = "Grass",
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
tiles = {"default_grass_" .. i .. ".png^[colorize:brown:80"},
|
||||
inventory_image = "default_grass_" .. i .. ".png^[colorize:brown:80",
|
||||
wield_image = "default_grass_" .. i .. ".png^[colorize:brown:80",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "default:grass_1",
|
||||
groups = {snappy = 3, flora = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, grass = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Liquids
|
||||
--
|
||||
|
||||
minetest.override_item("default:water_source", {
|
||||
inventory_image = minetest.inventorycube("es_toxic_water.png"),
|
||||
drawtype = "liquid",
|
||||
tiles = {
|
||||
{
|
||||
name = "es_toxic_water_source_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2.0,
|
||||
},
|
||||
},
|
||||
},
|
||||
special_tiles = {
|
||||
-- New-style water source material (mostly unused)
|
||||
{
|
||||
name = "es_toxic_water_source_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2.0,
|
||||
},
|
||||
backface_culling = false,
|
||||
},
|
||||
},
|
||||
--alpha = 240,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "default:water_flowing",
|
||||
liquid_alternative_source = "default:water_source",
|
||||
liquid_viscosity = 4,
|
||||
post_effect_color = {a = 213, r = 30, g = 60, b = 90},
|
||||
damage_per_second = 3*2,
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1, radioactive = 2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.override_item("default:water_flowing", {
|
||||
description = "Toxic_Flowing Water",
|
||||
inventory_image = minetest.inventorycube("es_toxic_water.png"),
|
||||
drawtype = "flowingliquid",
|
||||
tiles = {"es_toxic_water.png"},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "es_toxic_water_flowing_animated.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "es_toxic_water_flowing_animated.png",
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
--alpha = 240,
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "flowing",
|
||||
liquid_alternative_flowing = "default:water_flowing",
|
||||
liquid_alternative_source = "default:water_source",
|
||||
liquid_viscosity = 3,
|
||||
post_effect_color = {a = 203, r = 30, g = 60, b = 90},
|
||||
damage_per_second = 3*2,
|
||||
groups = {water = 3, liquid = 3, puts_out_fire = 1, radioactive = 2, not_in_creative_inventory = 1},
|
||||
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.override_item("default:ice", {
|
||||
description = "Ice",
|
||||
tiles = {"default_ice.png^es_toxic_water.png"},
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
2128
mods/es/biome_es.lua
@ -12,17 +12,129 @@
|
||||
--Media(if not stated differently):
|
||||
--(c) Copyright (2014-2015) maikerumine; CC-BY-SA 3.0
|
||||
|
||||
--Default override crafting
|
||||
|
||||
--groups = {not_in_craft_guide=1},
|
||||
|
||||
-- Minetest 0.4 mod: bone_collector
|
||||
-- Bones can be crafted to clay, sand or coal to motivate players clear the playground.
|
||||
--
|
||||
-- See README.txt for licensing and other information.
|
||||
--Lag Block
|
||||
--maikerumine
|
||||
|
||||
|
||||
es = {}
|
||||
|
||||
--CRAFT OVERRIDES
|
||||
--Default override crafting
|
||||
--groups = {not_in_craft_guide=1},
|
||||
--======================================
|
||||
minetest.override_item("default:gold_ingot", {
|
||||
description = "Gold Ingot",
|
||||
inventory_image = "default_gold_ingot.png",
|
||||
stack_max = 999,
|
||||
})
|
||||
|
||||
-- Minetest 0.4 mod: apple_sapling
|
||||
-- Craft a tree sapling from dirt and apple.
|
||||
--
|
||||
-- maikerumine
|
||||
minetest.register_craft({
|
||||
output = 'default:sapling',
|
||||
recipe = {
|
||||
{"default:dirt", "default:dirt", "default:dirt"},
|
||||
{"default:dirt", "default:apple", "default:dirt"},
|
||||
{"default:dirt", "default:dirt", "default:dirt"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:junglesapling',
|
||||
recipe = {
|
||||
{"group:leaves", "default:junglegrass", "group:leaves"},
|
||||
{"default:junglegrass", "default:sapling", "default:junglegrass"},
|
||||
{"group:leaves", "default:junglegrass", "group:leaves"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pine_sapling',
|
||||
recipe = {
|
||||
{"group:leaves", "default:sand", "group:leaves"},
|
||||
{"default:sand", "default:junglesapling", "default:sand"},
|
||||
{"group:leaves", "default:sand", "group:leaves"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:acacia_sapling',
|
||||
recipe = {
|
||||
{"group:leaves", "default:dry_shrub", "group:leaves"},
|
||||
{"default:dry_shrub", "default:pine_sapling", "default:dry_shrub"},
|
||||
{"group:leaves", "default:dry_shrub", "group:leaves"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:aspen_sapling',
|
||||
recipe = {
|
||||
{"group:leaves", "default:papyrus", "group:leaves"},
|
||||
{"default:papyrus", "default:acacia_sapling", "default:papyrus"},
|
||||
{"group:leaves", "default:papyrus", "group:leaves"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "default:dry_shrub",
|
||||
recipe = "default:junglegrass",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'es:heart_block',
|
||||
recipe = {
|
||||
{"default:stone", "default:stone", "default:stone"},
|
||||
{"default:stone", "default:apple", "default:stone"},
|
||||
{"default:stone", "default:stone", "default:stone"},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_obsidian',
|
||||
recipe = {
|
||||
{'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
|
||||
{'', 'es:emerald_crystal', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'es:meselamp_white 3',
|
||||
recipe = {
|
||||
{'', 'default:mese_crystal',''},
|
||||
{'default:mese_crystal', 'default:obsidian_glass', 'default:mese_crystal'},
|
||||
}
|
||||
})
|
||||
|
||||
--[[
|
||||
minetest.register_craft({
|
||||
output = 'es:griefer_soul_block',
|
||||
recipe = {
|
||||
{'es:griefer_soul', 'es:griefer_soul', 'es:griefer_soul'},
|
||||
{'es:griefer_soul', 'es:griefer_soul', 'es:griefer_soul'},
|
||||
{'es:griefer_soul', 'es:griefer_soul', 'es:griefer_soul'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'es:admin_tnt',
|
||||
recipe = {
|
||||
{'default:wood', 'tnt:gunpowder', 'default:wood'},
|
||||
{'tnt:gunpowder', 'es:griefer_soul_block', 'tnt:gunpowder'},
|
||||
{'default:wood', 'tnt:gunpowder', 'default:wood'},
|
||||
}
|
||||
})
|
||||
]]
|
||||
minetest.register_craftitem("es:griefer_soul", {
|
||||
description = "Griefer Soul",
|
||||
inventory_image = "default_coal_lump.png^[colorize:red:120",
|
||||
})
|
||||
|
||||
--Bronze
|
||||
--[[
|
||||
minetest.register_craft({
|
||||
@ -34,38 +146,31 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
]]
|
||||
|
||||
minetest.clear_craft({
|
||||
type = "shapeless",
|
||||
output = "default:bronze_ingot"
|
||||
})
|
||||
|
||||
if basic_machines then
|
||||
if moreores then
|
||||
minetest.register_craft({
|
||||
--type = "shapeless",
|
||||
output = 'default:bronze_ingot 8',
|
||||
recipe = {
|
||||
{'default:copper_ingot', 'basic_machines:charcoal', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'default:coal_lump', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'moreores:tin_ingot', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
--type = "shapeless",
|
||||
output = 'default:bronze_ingot 8',
|
||||
recipe = {
|
||||
{'default:copper_ingot', 'basic_machines:charcoal', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'default:coal_lump', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'default:tin_ingot', 'default:copper_ingot'},
|
||||
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
--DECORATIVE LOGS (NO MOSS OR FUNGI GROWTH)
|
||||
--======================================
|
||||
--Treated logs
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
replacements = {{"es:boneblock", "es:boneblock"}},
|
||||
@ -130,8 +235,7 @@ minetest.register_craft({
|
||||
|
||||
|
||||
|
||||
--Lag Block
|
||||
--======================================
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'es:lag_block',
|
||||
recipe = {
|
||||
@ -151,10 +255,8 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
|
||||
--BONE COLLECTOR
|
||||
-- Minetest 0.4 mod: bone_collector
|
||||
-- Bones can be crafted to clay, sand or coal to motivate players clear the playground.
|
||||
--======================================
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:clay_lump',
|
||||
recipe = {
|
||||
@ -198,7 +300,6 @@ minetest.register_craft({
|
||||
--END BONE COLLECTOR
|
||||
|
||||
--compressed cobble
|
||||
--======================================
|
||||
minetest.register_craft({
|
||||
output = 'es:compressedcobble',
|
||||
recipe = {
|
||||
@ -216,7 +317,6 @@ minetest.register_craft({
|
||||
|
||||
|
||||
--marble and granite bricks
|
||||
--======================================
|
||||
minetest.register_craft({
|
||||
output = 'es:marble_bricks',
|
||||
recipe = {
|
||||
@ -235,7 +335,6 @@ minetest.register_craft({
|
||||
|
||||
|
||||
--MESE
|
||||
--======================================
|
||||
minetest.register_craftitem("es:mesecook_crystal", {
|
||||
description = "Cookable Raw MESE",
|
||||
inventory_image = "default_mineral_mese.png",
|
||||
@ -265,8 +364,6 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
|
||||
--URANIUM
|
||||
--======================================
|
||||
minetest.register_craftitem("es:depleted_uranium_ingot", {
|
||||
description = "Depleted uranium",
|
||||
inventory_image = "technic_uranium_ingot.png",
|
||||
@ -296,8 +393,6 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
--VAULT CHEST
|
||||
--======================================
|
||||
minetest.register_craft({
|
||||
output = "es:vault",
|
||||
recipe = {
|
||||
@ -307,8 +402,6 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
--BONEBLOCK
|
||||
--======================================
|
||||
minetest.register_craft({
|
||||
output = 'es:boneblock',
|
||||
recipe = {
|
||||
@ -318,8 +411,6 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
--WHATBLOCK
|
||||
--======================================
|
||||
minetest.register_craft({
|
||||
output = "es:what",
|
||||
recipe = {
|
||||
@ -399,8 +490,7 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
|
||||
--ES SPECIAL ORES AND BLOCKS
|
||||
--======================================
|
||||
--ES SPECIAL BLOCKS
|
||||
--emerald
|
||||
minetest.register_craft({
|
||||
output = 'es:emeraldblock',
|
||||
@ -541,59 +631,7 @@ minetest.register_craftitem("es:purpellium_lump", {
|
||||
})
|
||||
|
||||
|
||||
--GRINDING
|
||||
--======================================
|
||||
--IF COTTAGES USE FOR GRINDING
|
||||
--place in init in cottages
|
||||
--cottages.handmill_product[ 'es:purpellium_lump' ] = 'es:purpellium_dust 1';
|
||||
--cottages.handmill_product[ 'es:aikerum_crystal' ] = 'es:aikerum_dust 1';
|
||||
--cottages.handmill_product[ 'es:ruby_crystal' ] = 'es:ruby_dust 1';
|
||||
--cottages.handmill_product[ 'es:emerald_crystal' ] = 'es:emerald_dust 1';
|
||||
|
||||
--ES GRINDER:
|
||||
minetest.register_craftitem("es:purpellium_dust", {
|
||||
description = "Purpellium Dust",
|
||||
inventory_image = "dye_violet.png",
|
||||
})
|
||||
minetest.register_craftitem("es:aikerum_dust", {
|
||||
description = "Aikerum Dust",
|
||||
inventory_image = "dye_blue.png",
|
||||
})
|
||||
minetest.register_craftitem("es:ruby_dust", {
|
||||
description = "Ruby Dust",
|
||||
inventory_image = "dye_red.png",
|
||||
})
|
||||
minetest.register_craftitem("es:emerald_dust", {
|
||||
description = "Emerald Dust",
|
||||
inventory_image = "dye_green.png",
|
||||
})
|
||||
|
||||
--[[
|
||||
--ES RUBBER
|
||||
minetest.register_craftitem("es:rubber_dust", {
|
||||
description = "Rubber Dust",
|
||||
inventory_image = "dye_black.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("es:rubber", {
|
||||
description = "Rubber",
|
||||
inventory_image = "black.png^gui_hotbar_selected.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
--type = "shapeless",
|
||||
output = 'es:rubber_dust 12',
|
||||
recipe = {
|
||||
{"default:jungletree", "default:jungletree","default:jungletree"},
|
||||
{"default:jungletree", "default:steel_ingot","default:jungletree"},
|
||||
{"default:jungletree", "default:jungletree","default:jungletree"},
|
||||
},
|
||||
})
|
||||
]]
|
||||
|
||||
|
||||
--POTIONS AND VESSEL CRAFTING
|
||||
--======================================
|
||||
--crafting containers
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
@ -627,6 +665,58 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
|
||||
--IF COTTAGES USE FOR GRINDING
|
||||
--place in init in cottages
|
||||
--cottages.handmill_product[ 'es:purpellium_lump' ] = 'es:purpellium_dust 1';
|
||||
--cottages.handmill_product[ 'es:aikerum_crystal' ] = 'es:aikerum_dust 1';
|
||||
--cottages.handmill_product[ 'es:ruby_crystal' ] = 'es:ruby_dust 1';
|
||||
--cottages.handmill_product[ 'es:emerald_crystal' ] = 'es:emerald_dust 1';
|
||||
|
||||
--ES GRINDER:
|
||||
minetest.register_craftitem("es:purpellium_dust", {
|
||||
description = "Purpellium Dust",
|
||||
inventory_image = "dye_violet.png",
|
||||
})
|
||||
minetest.register_craftitem("es:aikerum_dust", {
|
||||
description = "Aikerum Dust",
|
||||
inventory_image = "dye_blue.png",
|
||||
})
|
||||
minetest.register_craftitem("es:ruby_dust", {
|
||||
description = "Ruby Dust",
|
||||
inventory_image = "dye_red.png",
|
||||
})
|
||||
minetest.register_craftitem("es:emerald_dust", {
|
||||
description = "Emerald Dust",
|
||||
inventory_image = "dye_green.png",
|
||||
})
|
||||
|
||||
--[[[
|
||||
--ES RUBBER
|
||||
minetest.register_craftitem("es:rubber_dust", {
|
||||
description = "Rubber Dust",
|
||||
inventory_image = "dye_black.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("es:rubber", {
|
||||
description = "Rubber",
|
||||
inventory_image = "black.png^gui_hotbar_selected.png",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
--type = "shapeless",
|
||||
output = 'es:rubber_dust 12',
|
||||
recipe = {
|
||||
{"default:jungletree", "default:jungletree","default:jungletree"},
|
||||
{"default:jungletree", "default:steel_ingot","default:jungletree"},
|
||||
{"default:jungletree", "default:jungletree","default:jungletree"},
|
||||
},
|
||||
})
|
||||
]]
|
||||
|
||||
|
||||
|
||||
|
||||
--purpellium potion give endurance
|
||||
minetest.register_node("es:purpellium_container", {
|
||||
description = "Potion to do wonders! (gives 50+ hunger for extra endurance mining.)",
|
||||
@ -839,25 +929,25 @@ minetest.register_craft({
|
||||
output = '3d_armor:helmet_infinium',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:helmet_infinium' },
|
||||
{'es:ruby_container', 'es:helmet_infinium' },
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:chestplate_infinium',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:chestplate_infinium'},
|
||||
{'es:ruby_container', 'es:chestplate_infinium'},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:leggings_infinium',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:leggings_infinium'},
|
||||
{'es:ruby_container', 'es:leggings_infinium'},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:boots_infinium',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:boots_infinium' },
|
||||
{'es:ruby_container', 'es:boots_infinium' },
|
||||
})
|
||||
|
||||
--aikerum armour fix
|
||||
@ -865,25 +955,25 @@ minetest.register_craft({
|
||||
output = '3d_armor:helmet_aikerum',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:helmet_aikerum' },
|
||||
{'es:ruby_container', 'es:helmet_aikerum' },
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:chestplate_aikerum',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:chestplate_aikerum'},
|
||||
{'es:ruby_container', 'es:chestplate_aikerum'},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:leggings_aikerum',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:leggings_aikerum'},
|
||||
{'es:ruby_container', 'es:leggings_aikerum'},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:boots_aikerum',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:boots_aikerum' },
|
||||
{'es:ruby_container', 'es:boots_aikerum' },
|
||||
})
|
||||
|
||||
--emerald armour fix
|
||||
@ -891,30 +981,45 @@ minetest.register_craft({
|
||||
output = '3d_armor:helmet_emerald',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:helmet_emerald' },
|
||||
{'es:ruby_container', 'es:helmet_emerald' },
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:chestplate_emerald',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:chestplate_emerald'},
|
||||
{'es:ruby_container', 'es:chestplate_emerald'},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:leggings_emerald',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:leggings_emerald'},
|
||||
{'es:ruby_container', 'es:leggings_emerald'},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = '3d_armor:boots_emerald',
|
||||
type = "shapeless",
|
||||
recipe =
|
||||
{'es:ruby_container', '3d_armor:boots_emerald' },
|
||||
{'es:ruby_container', 'es:boots_emerald' },
|
||||
})
|
||||
|
||||
|
||||
--WEAPONS AND TOOLS
|
||||
minetest.register_craft({
|
||||
output = 'es:handle',
|
||||
recipe = {
|
||||
{'default:bronze_ingot', 'default:mese_crystal', 'default:bronze_ingot'},
|
||||
{'farming:string', 'default:steel_ingot', 'farming:string'},
|
||||
{'farming:string', 'default:diamond', 'farming:string'},
|
||||
}
|
||||
})
|
||||
minetest.register_craftitem("es:handle", {
|
||||
description = "Extreme Survival Uni-handle",
|
||||
inventory_image = "es_handle.png",
|
||||
--inventory_image = "default_steel_ingot.png^default_diamond.png^default_mese_crystal.png^farming_cotton.png",
|
||||
})
|
||||
|
||||
|
||||
--INGOTS
|
||||
--======================================
|
||||
minetest.register_craft({
|
||||
output = 'es:cookable_emerald_ingot',
|
||||
type = "shapeless",
|
||||
@ -975,281 +1080,270 @@ minetest.register_craftitem("es:cookable_purpellium_ingot", {
|
||||
inventory_image = "default_bronze_ingot.png^[colorize:#FF00FF:200",
|
||||
})
|
||||
|
||||
|
||||
--WEAPONS AND TOOLS
|
||||
--======================================
|
||||
minetest.register_craftitem("es:handle", {
|
||||
description = "Extreme Survival Uni-handle",
|
||||
inventory_image = "es_handle.png",
|
||||
--inventory_image = "default_steel_ingot.png^default_diamond.png^default_mese_crystal.png^farming_cotton.png",
|
||||
})
|
||||
|
||||
local es_hard_tool_craft = tonumber(minetest.settings:get("es_hard_tool_craft"))
|
||||
if es_hard_tool_craft == 1 then
|
||||
minetest.register_craft({
|
||||
output = 'es:handle',
|
||||
recipe = {
|
||||
{'default:bronze_ingot', 'default:mese_crystal', 'default:bronze_ingot'},
|
||||
{'farming:string', 'default:steel_ingot', 'farming:string'},
|
||||
{'farming:string', 'default:diamond', 'farming:string'},
|
||||
}
|
||||
})
|
||||
|
||||
--SWORDS
|
||||
minetest.register_craft({
|
||||
--SWORDS
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_emerald',
|
||||
recipe = {
|
||||
{'es:emerald_ingot'},
|
||||
{'es:emerald_ingot'},
|
||||
{'es:handle'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_ruby',
|
||||
recipe = {
|
||||
{'es:ruby_ingot'},
|
||||
{'es:ruby_ingot'},
|
||||
{'es:handle'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_ingot'},
|
||||
{'es:aikerum_ingot'},
|
||||
{'es:handle'},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_purpellium',
|
||||
recipe = {
|
||||
{'es:purpellium_ingot'},
|
||||
{'es:purpellium_ingot'},
|
||||
{'es:handle'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
--PICKS
|
||||
minetest.register_craft({
|
||||
--PICKS
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_emerald',
|
||||
recipe = {
|
||||
{'es:emerald_ingot', 'es:emerald_ingot', 'es:emerald_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_ruby',
|
||||
recipe = {
|
||||
{'es:ruby_ingot', 'es:ruby_ingot', 'es:ruby_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_ingot', 'es:aikerum_ingot', 'es:aikerum_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_purpellium',
|
||||
recipe = {
|
||||
{'es:purpellium_ingot', 'es:purpellium_ingot', 'es:purpellium_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
--AXES
|
||||
minetest.register_craft({
|
||||
--AXES
|
||||
minetest.register_craft({
|
||||
output = 'es:axe_emerald',
|
||||
recipe = {
|
||||
{'es:emerald_ingot', 'es:emerald_ingot', ''},
|
||||
{'es:emerald_ingot', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:axe_ruby',
|
||||
recipe = {
|
||||
{'es:ruby_ingot', 'es:ruby_ingot', ''},
|
||||
{'es:ruby_ingot', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:axe_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_ingot', 'es:aikerum_ingot', ''},
|
||||
{'es:aikerum_ingot', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
--SHOVELS
|
||||
minetest.register_craft({
|
||||
--SHOVELS
|
||||
minetest.register_craft({
|
||||
output = 'es:shovel_emerald',
|
||||
recipe = {
|
||||
{'', 'es:emerald_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:shovel_ruby',
|
||||
recipe = {
|
||||
{'', 'es:ruby_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:shovel_aikerum',
|
||||
recipe = {
|
||||
{'', 'es:aikerum_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'es:handle', ''},
|
||||
}
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
if es_hard_tool_craft ~= 1 then
|
||||
--OLD EASY CRAFTS
|
||||
--Weapon &Tool Crafting:
|
||||
--SWORDS
|
||||
minetest.register_craft({
|
||||
--[[
|
||||
--OLD EASY CRAFTS
|
||||
--Weapon &Tool Crafting:
|
||||
--SWORDS
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_emerald',
|
||||
recipe = {
|
||||
{'es:emerald_crystal'},
|
||||
{'es:emerald_crystal'},
|
||||
{'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_ruby',
|
||||
recipe = {
|
||||
{'es:ruby_crystal'},
|
||||
{'es:ruby_crystal'},
|
||||
{'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_crystal'},
|
||||
{'es:aikerum_crystal'},
|
||||
{'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:sword_purpellium',
|
||||
recipe = {
|
||||
{'es:purpellium_ingot'},
|
||||
{'es:purpellium_ingot'},
|
||||
{'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
--PICKS
|
||||
minetest.register_craft({
|
||||
--PICKS
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_emerald',
|
||||
recipe = {
|
||||
{'es:emerald_crystal', 'es:emerald_crystal', 'es:emerald_crystal'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_ruby',
|
||||
recipe = {
|
||||
{'es:ruby_crystal', 'es:ruby_crystal', 'es:ruby_crystal'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_crystal', 'es:aikerum_crystal', 'es:aikerum_crystal'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_crystal', 'es:aikerum_crystal', 'es:aikerum_crystal'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'es:pick_purpellium',
|
||||
recipe = {
|
||||
{'es:purpellium_ingot', 'es:purpellium_ingot', 'es:purpellium_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
--AXES
|
||||
minetest.register_craft({
|
||||
--AXES
|
||||
minetest.register_craft({
|
||||
output = 'es:axe_emerald',
|
||||
recipe = {
|
||||
{'es:emerald_crystal', 'es:emerald_crystal', ''},
|
||||
{'es:emerald_crystal', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:axe_ruby',
|
||||
recipe = {
|
||||
{'es:ruby_crystal', 'es:ruby_crystal', ''},
|
||||
{'es:ruby_crystal', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:axe_aikerum',
|
||||
recipe = {
|
||||
{'es:aikerum_crystal', 'es:aikerum_crystal', ''},
|
||||
{'es:aikerum_crystal', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
--SHOVELS
|
||||
minetest.register_craft({
|
||||
--SHOVELS
|
||||
minetest.register_craft({
|
||||
output = 'es:shovel_emerald',
|
||||
recipe = {
|
||||
{'', 'es:emerald_crystal', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'es:shovel_ruby',
|
||||
recipe = {
|
||||
{'', 'es:ruby_crystal', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'es:shovel_aikerum',
|
||||
recipe = {
|
||||
{'', 'es:aikerum_crystal', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
}
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
]]
|
||||
|
||||
--COOKING RECIPIES
|
||||
minetest.register_craft({
|
||||
|
@ -1,7 +1,4 @@
|
||||
default
|
||||
3d_armor?
|
||||
shields?
|
||||
basic_machines?
|
||||
farming?
|
||||
flowers?
|
||||
stairs?
|
||||
|
@ -36,4 +36,54 @@ minetest.register_chatcommand("mapfix", {
|
||||
return true, "Done."
|
||||
end,
|
||||
})
|
||||
--[[
|
||||
--RND CODE
|
||||
--NO GRIEF WITH liquids
|
||||
local function disable_placing_above_ground(name)
|
||||
|
||||
local table = minetest.registered_nodes[name]; if not table then return end
|
||||
local table2 = {}
|
||||
for i,v in pairs(table) do table2[i] = v end
|
||||
table2.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
if pos.y>=0 then minetest.set_node(pos,{name = "air"}) end
|
||||
end
|
||||
minetest.register_node(":"..name, table2)
|
||||
end
|
||||
|
||||
minetest.after(0,function()
|
||||
disable_placing_above_ground("default:water_source");
|
||||
disable_placing_above_ground("default:river_water_source");
|
||||
disable_placing_above_ground("default:lava_source");
|
||||
disable_placing_above_ground("es:toxic_water_source");
|
||||
disable_placing_above_ground("es:mud");
|
||||
-- add here all other sources: toxic water, mud ,....
|
||||
end)
|
||||
]]
|
||||
|
||||
|
||||
--Killme
|
||||
minetest.register_chatcommand("killme", {
|
||||
description = "Kill yourself to respawn",
|
||||
func = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
if minetest.settings:get_bool("enable_damage") then
|
||||
player:set_hp(0)
|
||||
return true
|
||||
else
|
||||
for _, callback in pairs(core.registered_on_respawnplayers) do
|
||||
if callback(player) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- There doesn't seem to be a way to get a default spawn pos from the lua API
|
||||
return false, "No static_spawnpoint defined"
|
||||
end
|
||||
else
|
||||
-- Show error message if used when not logged in, eg: from IRC mod
|
||||
return false, "You need to be online to be killed!"
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
265
mods/es/init.lua
@ -22,239 +22,56 @@ local modpath = minetest.get_modpath("es")
|
||||
es.modpath = modpath
|
||||
|
||||
dofile(modpath.."/alias.lua")
|
||||
|
||||
dofile(modpath.."/biome.lua")
|
||||
--dofile(modpath.."/oregen.lua") --moved to biomes
|
||||
dofile(modpath.."/nodes.lua")
|
||||
dofile(modpath.."/crushingfurnace.lua")
|
||||
dofile(modpath.."/admintnt.lua")
|
||||
dofile(modpath.."/crafting.lua")
|
||||
dofile(modpath.."/antigrief.lua")
|
||||
dofile(modpath.."/itemdrop.lua")
|
||||
dofile(modpath.."/musicmod.lua")
|
||||
dofile(modpath.."/armor.lua")
|
||||
dofile(modpath.."/kill.lua")
|
||||
dofile(modpath.."/shields.lua")
|
||||
dofile(modpath.."/shutdown.lua")
|
||||
dofile(modpath.."/spawn.lua")
|
||||
dofile(modpath.."/crushingfurnace.lua")
|
||||
dofile(modpath.."/tools.lua")
|
||||
|
||||
--builtin stuff
|
||||
dofile(modpath.."/extra.lua")
|
||||
dofile(modpath.."/builtin_flowlib.lua")
|
||||
dofile(modpath.."/flowlib.lua")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dofile(modpath.."/biome.lua")
|
||||
--[[
|
||||
--CONFIG SWITCHES
|
||||
--PASTE IN YOUR CONFIG FILE
|
||||
#--=============================
|
||||
#--=============================
|
||||
es_biome = 1 #--1 is on 0 is off
|
||||
es_armor = 1 #--1 is on 0 is off
|
||||
es_shields = 1 #--1 is on 0 is off
|
||||
es_radioactive = 1 #--1 is on 0 is off
|
||||
es_climate_freeze = 0 #--1 is on 0 is off
|
||||
es_climate_snow = 0 #--1 is on 0 is off
|
||||
es_climate_thaw = 0 #--1 is on 0 is off
|
||||
es_hard_tool_craft = 1 #--1 is on 0 is off
|
||||
es_server = 0 #--1 is on 0 is off
|
||||
es_anticheat = 0 #--1 is on 0 is off
|
||||
es_antigrief = 0 #--1 is on 0 is off
|
||||
es_kill_command = 1 #--1 is on 0 is off
|
||||
es_itemdrop = 1 #--1 is on 0 is off
|
||||
es_musicmod = 1 #--1 is on 0 is off
|
||||
es_skybox_space = 1 #--1 is on 0 is off
|
||||
es_hud_clock = 1 #--1 is on 0 is off
|
||||
es_invisible_tool = 0 #--1 is on 0 is off
|
||||
#--=============================
|
||||
#--=============================
|
||||
]]
|
||||
|
||||
--====================================
|
||||
--====================================
|
||||
|
||||
|
||||
local es_armor = tonumber(minetest.settings:get("es_armor"))
|
||||
if not es_armor then
|
||||
es_armor = 1
|
||||
minetest.settings:set("es_armor",
|
||||
es_armor)
|
||||
end
|
||||
|
||||
local es_shields = tonumber(minetest.settings:get("es_shields"))
|
||||
if not es_shields then
|
||||
es_shields = 1
|
||||
minetest.settings:set("es_shields",
|
||||
es_shields)
|
||||
end
|
||||
|
||||
local es_radioactive = tonumber(minetest.settings:get("es_radioactive"))
|
||||
if not es_radioactive then
|
||||
es_radioactive = 1
|
||||
minetest.settings:set("es_radioactive",
|
||||
es_radioactive)
|
||||
end
|
||||
|
||||
local es_climate_freeze = tonumber(minetest.settings:get("es_climate_freeze"))
|
||||
if not es_climate_freeze then
|
||||
es_climate_freeze = 0
|
||||
minetest.settings:set("es_climate_freeze",
|
||||
es_climate_freeze)
|
||||
end
|
||||
|
||||
local es_climate_snow = tonumber(minetest.settings:get("es_climate_snow"))
|
||||
if not es_climate_snow then
|
||||
es_climate_snow = 0
|
||||
minetest.settings:set("es_climate_snow",
|
||||
es_climate_snow)
|
||||
end
|
||||
|
||||
local es_climate_thaw = tonumber(minetest.settings:get("es_climate_thaw"))
|
||||
if not es_climate_thaw then
|
||||
es_climate_thaw = 0
|
||||
minetest.settings:set("es_climate_thaw",
|
||||
es_climate_thaw)
|
||||
end
|
||||
|
||||
local es_hard_tool_craft = tonumber(minetest.settings:get("es_hard_tool_craft"))
|
||||
if not es_hard_tool_craft then
|
||||
es_hard_tool_craft = 1
|
||||
minetest.settings:set("es_hard_tool_craft",
|
||||
es_hard_tool_craft)
|
||||
end
|
||||
|
||||
local es_server = tonumber(minetest.settings:get("es_server"))
|
||||
if not es_server then
|
||||
es_server = 1
|
||||
minetest.settings:set("es_server",
|
||||
es_server)
|
||||
end
|
||||
|
||||
local es_anticheat = tonumber(minetest.settings:get("es_anticheat"))
|
||||
if not es_anticheat then
|
||||
es_anticheat = 0
|
||||
minetest.settings:set("es_anticheat",
|
||||
es_anticheat)
|
||||
end
|
||||
|
||||
local es_antigrief = tonumber(minetest.settings:get("es_antigrief"))
|
||||
if not es_antigrief then
|
||||
es_antigrief = 0
|
||||
minetest.settings:set("es_antigrief",
|
||||
es_antigrief)
|
||||
end
|
||||
|
||||
local es_kill_command = tonumber(minetest.settings:get("es_kill_command"))
|
||||
if not es_kill_command then
|
||||
es_kill_command = 1
|
||||
minetest.settings:set("es_kill_command",
|
||||
es_kill_command)
|
||||
end
|
||||
|
||||
local es_itemdrop = tonumber(minetest.settings:get("es_itemdrop"))
|
||||
if not es_itemdrop then
|
||||
es_itemdrop = 1
|
||||
minetest.settings:set("es_itemdrop",
|
||||
es_itemdrop)
|
||||
end
|
||||
|
||||
local es_musicmod = tonumber(minetest.settings:get("es_musicmod"))
|
||||
if not es_musicmod then
|
||||
es_musicmod = 1
|
||||
minetest.settings:set("es_musicmod",
|
||||
es_musicmod)
|
||||
end
|
||||
|
||||
local es_skybox_space = tonumber(minetest.settings:get("es_skybox_space"))
|
||||
if not es_skybox_space then
|
||||
es_skybox_space = 1
|
||||
minetest.settings:set("es_skybox_space",
|
||||
es_skybox_space)
|
||||
end
|
||||
|
||||
local es_hud_clock = tonumber(minetest.settings:get("es_hud_clock"))
|
||||
if not es_skybox_space then
|
||||
es_hud_clock = 1
|
||||
minetest.settings:set("es_hud_clock",
|
||||
es_hud_clock)
|
||||
end
|
||||
|
||||
local es_invisible_tool = tonumber(minetest.settings:get("es_invisible_tool"))
|
||||
if not es_skybox_space then
|
||||
es_invisible_tool = 0
|
||||
minetest.settings:set("es_invisible_tool",
|
||||
es_invisible_tool)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
--====================================================================
|
||||
--====================================================================
|
||||
if es_radioactive == 1 then --add radiation
|
||||
dofile(modpath.."/radiation.lua")
|
||||
end
|
||||
if es_climate_freeze == 1 then --add freezing water and thickening ice
|
||||
dofile(minetest.get_modpath("es").."/freeze.lua")
|
||||
end
|
||||
if es_climate_snow == 1 then --add snow spread effect to grasses then to pure snowblock
|
||||
dofile(minetest.get_modpath("es").."/snow.lua")
|
||||
end
|
||||
if es_climate_thaw == 1 then --add thawing ice (caution, it will melt most ice if light is above)
|
||||
dofile(minetest.get_modpath("es").."/thaw.lua")
|
||||
end
|
||||
if es_server == 1 then --server shutdown script and spawning function
|
||||
dofile(minetest.get_modpath("es").."/shutdown.lua")
|
||||
dofile(minetest.get_modpath("es").."/spawn.lua")
|
||||
end
|
||||
if es_anticheat == 1 then --add anti cheating. noclip and fly caught by rnd code
|
||||
dofile(minetest.get_modpath("es").."/antigrief.lua")
|
||||
end
|
||||
if es_antigrief == 1 then --add anti griefing. no add liquid above 0
|
||||
dofile(minetest.get_modpath("es").."/antigrief.lua")
|
||||
end
|
||||
if es_kill_command == 1 then --add self kill command type /killme
|
||||
dofile(minetest.get_modpath("es").."/kill.lua")
|
||||
end
|
||||
if es_itemdrop == 1 then --add item drop
|
||||
dofile(minetest.get_modpath("es").."/itemdrop.lua")
|
||||
end
|
||||
if es_musicmod == 1 then --add music for times of day
|
||||
dofile(minetest.get_modpath("es").."/musicmod.lua")
|
||||
end
|
||||
if es_skybox_space == 1 then --add space realm and pure dark in caves
|
||||
dofile(minetest.get_modpath("es").."/cavespace.lua")
|
||||
end
|
||||
if es_hud_clock == 1 then --add clock to your hud
|
||||
dofile(minetest.get_modpath("es").."/hudclock.lua")
|
||||
end
|
||||
if es_invisible_tool == 1 then --add invisibility command type /i
|
||||
dofile(minetest.get_modpath("es").."/invis.lua")
|
||||
end
|
||||
|
||||
|
||||
--ARMOR
|
||||
if armor then
|
||||
if es_armor == 1 then --add 3d_armor
|
||||
dofile(minetest.get_modpath("es").."/armor.lua")
|
||||
end
|
||||
if es_shields == 1 then --add Shields
|
||||
dofile(minetest.get_modpath("es").."/shields.lua")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--farming redo
|
||||
if farming and redo then
|
||||
if farming then
|
||||
dofile(modpath.."/farming.lua")
|
||||
end
|
||||
|
||||
--flowers on es nodes
|
||||
]]
|
||||
if flowers then
|
||||
dofile(modpath.."/flowers.lua")
|
||||
end
|
||||
|
||||
--MOREBLOCKS / STAIRSPLUS SUPPORT
|
||||
if moreblocks then
|
||||
dofile(modpath.."/mostair.lua")
|
||||
dofile(modpath.."/extra.lua")
|
||||
dofile(modpath.."/item_entity.lua")
|
||||
dofile(modpath.."/builtin_flowlib.lua")
|
||||
dofile(modpath.."/flowlib.lua")
|
||||
dofile(modpath.."/hudclock.lua")
|
||||
dofile(modpath.."/nodes.lua")
|
||||
dofile(modpath.."/oregen.lua")
|
||||
dofile(modpath.."/cavespace.lua")
|
||||
--dofile(modpath.."/invis.lua")
|
||||
--dofile(modpath.."/map.lua")
|
||||
-- Climate very laggy
|
||||
--dofile(minetest.get_modpath("es").."/freeze.lua")
|
||||
--dofile(minetest.get_modpath("es").."/snow.lua")
|
||||
--dofile(minetest.get_modpath("es").."/thaw.lua")
|
||||
|
||||
es.RADIOACTIVE = 1; --1 is on 0 is off
|
||||
--CONFIG SWITCHES
|
||||
--Radioactive materials switch
|
||||
if es.RADIOACTIVE == 1 then --add radiation
|
||||
dofile(modpath.."/radiation.lua")
|
||||
end
|
||||
|
||||
--MOREBLOCKS / STAIRSPLUS SUPPORT
|
||||
--if moreblocks then
|
||||
dofile(modpath.."/mostair.lua")
|
||||
--end
|
||||
|
||||
--STAIR SUPPORT
|
||||
if stairs then
|
||||
dofile(modpath.."/stair.lua")
|
||||
end
|
||||
--if stairs then
|
||||
--dofile(modpath.."/stair.lua")
|
||||
--end
|
||||
|
74
mods/es/item_entity.lua
Normal file
@ -0,0 +1,74 @@
|
||||
-- mods/default/item_entity.lua
|
||||
|
||||
local builtin_item = minetest.registered_entities["__builtin:item"]
|
||||
|
||||
local item = {
|
||||
set_item = function(self, itemstring)
|
||||
builtin_item.set_item(self, itemstring)
|
||||
|
||||
local stack = ItemStack(itemstring)
|
||||
local itemdef = minetest.registered_items[stack:get_name()]
|
||||
if itemdef and itemdef.groups.flammable ~= 0 then
|
||||
self.flammable = itemdef.groups.flammable
|
||||
end
|
||||
end,
|
||||
|
||||
burn_up = function(self)
|
||||
-- disappear in a smoke puff
|
||||
self.object:remove()
|
||||
local p = self.object:getpos()
|
||||
minetest.sound_play("default_item_smoke", {
|
||||
pos = p,
|
||||
max_hear_distance = 8,
|
||||
})
|
||||
minetest.add_particlespawner({
|
||||
amount = 3,
|
||||
time = 0.1,
|
||||
minpos = {x = p.x - 0.1, y = p.y + 0.1, z = p.z - 0.1 },
|
||||
maxpos = {x = p.x + 0.1, y = p.y + 0.2, z = p.z + 0.1 },
|
||||
minvel = {x = 0, y = 2.5, z = 0},
|
||||
maxvel = {x = 0, y = 2.5, z = 0},
|
||||
minacc = {x = -0.15, y = -0.02, z = -0.15},
|
||||
maxacc = {x = 0.15, y = -0.01, z = 0.15},
|
||||
minexptime = 4,
|
||||
maxexptime = 6,
|
||||
minsize = 5,
|
||||
maxsize = 5,
|
||||
collisiondetection = true,
|
||||
texture = "default_item_smoke.png"
|
||||
})
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
builtin_item.on_step(self, dtime)
|
||||
|
||||
if self.flammable then
|
||||
-- flammable, check for igniters
|
||||
self.ignite_timer = (self.ignite_timer or 0) + dtime
|
||||
if self.ignite_timer > 10 then
|
||||
self.ignite_timer = 0
|
||||
|
||||
local node = minetest.get_node_or_nil(self.object:getpos())
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
|
||||
-- Immediately burn up flammable items in lava
|
||||
if minetest.get_item_group(node.name, "lava") > 0 then
|
||||
self:burn_up()
|
||||
else
|
||||
-- otherwise there'll be a chance based on its igniter value
|
||||
local burn_chance = self.flammable
|
||||
* minetest.get_item_group(node.name, "igniter")
|
||||
if burn_chance > 0 and math.random(0, burn_chance) ~= 0 then
|
||||
self:burn_up()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
-- set defined item as new __builtin:item, with the old one as fallback table
|
||||
setmetatable(item, builtin_item)
|
||||
minetest.register_entity(":__builtin:item", item)
|
BIN
mods/es/models/3d_armor_character.blend
Normal file
9156
mods/es/models/3d_armor_character.x
Normal file
@ -18,13 +18,11 @@ minetest.register_globalstep(function(time)
|
||||
if time > 0.8 or time < 0.2 then
|
||||
sound_playing = time + 0.2
|
||||
minetest.sound_play("mm_dark")
|
||||
--minetest.sound_play("mcl_jukebox_track_3")
|
||||
return true
|
||||
end
|
||||
|
||||
sound_playing = time + 0.2
|
||||
minetest.sound_play("mm_light")
|
||||
--minetest.sound_play("mcl_jukebox_track_1")
|
||||
return true
|
||||
end
|
||||
end)
|
||||
|
@ -100,6 +100,38 @@ minetest.register_node("es:lag_ice", {
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:griefer_soul_block", {
|
||||
description = "A Block Of Griefer Souls",
|
||||
paramtype2 = "facedir",
|
||||
place_param2 = 0,
|
||||
tiles = {"bones_front.png^[colorize:red:120", "bones_front.png^[colorize:red:120", "bones_front.png^[colorize:red:120"},
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 2, stone = 1,dig_immediate=2},
|
||||
sounds =default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:heart_block", {
|
||||
description = "Why's Heart Block",
|
||||
paramtype2 = "facedir",
|
||||
place_param2 = 0,
|
||||
tiles = {"default_stone.png^heart.png"},
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 2, stone = 1,dig_immediate=2},
|
||||
sounds =default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:meselamp_white", {
|
||||
description = "Mese Lamp White",
|
||||
drawtype = "glasslike",
|
||||
tiles = {"light.png^default_obsidian_glass.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 2},
|
||||
sounds =default.node_sound_glass_defaults(),
|
||||
light_source = default.LIGHT_MAX,
|
||||
})
|
||||
|
||||
|
||||
|
||||
--tweaks and overrides
|
||||
@ -172,6 +204,65 @@ minetest.register_node( "es:marble_bricks", {
|
||||
groups = {cracky=1, marble=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
--[[
|
||||
--ES OLD_Node Definition
|
||||
minetest.register_node("es:stone_with_emerald", {
|
||||
description = "Emerald Ore",
|
||||
tiles = {"default_stone.png^emerald_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1},
|
||||
drop = "es:emerald_crystal",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:stone_with_ruby", {
|
||||
description = "Ruby Ore",
|
||||
tiles = {"default_stone.png^ruby_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1},
|
||||
drop = "es:ruby_crystal",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:stone_with_aikerum", {
|
||||
description = "Aikerum Ore",
|
||||
tiles = {"default_stone.png^aikerum_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1,level = 2},
|
||||
drop = "es:aikerum_crystal",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:stone_with_infinium", {
|
||||
description = "Infinium Ore - Slightly Radioactive",
|
||||
tiles = {"default_stone.png^infinium_ore.png"},
|
||||
is_ground_content = true,
|
||||
--groups = {cracky=1,level = 2, radioactive = (state == "source" and 2 or 2)},
|
||||
groups = {cracky=1,level = 2, radioactive = 2},
|
||||
drop = "es:infinium_goo",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:stone_with_purpellium", {
|
||||
description = "Purlellium Ore - Oddly interesting",
|
||||
tiles = {"default_stone.png^purpellium_ore.png"},
|
||||
is_ground_content = true,
|
||||
--groups = {cracky=2,level = 2,fall_damage_add_percent = -1000, radioactive = (state == "source" and 2 or 2)},
|
||||
groups = {cracky=2,level = 2,fall_damage_add_percent = -1000, radioactive = 2},
|
||||
drop = "es:purpellium_lump",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("es:depleted_uranium", {
|
||||
description = "Depleted Uranium Ore RADIOACTIVE",
|
||||
tiles = {"default_stone.png^uranium_ore.png"},
|
||||
--groups = {cracky = 3, radioactive = (state == "source" and 3 or 2)},
|
||||
groups = {cracky = 3, radioactive = 3},
|
||||
drop = 'es:depleted_uranium_lump',
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
light_source = 12,
|
||||
})
|
||||
]]
|
||||
|
||||
--ES NEW_Node Definition
|
||||
minetest.register_node("es:stone_with_emeralds", {
|
||||
@ -504,15 +595,8 @@ end
|
||||
--node def
|
||||
minetest.register_node("es:vault", {
|
||||
description = "Use this to store MANY items.",
|
||||
tiles = {
|
||||
"vault.png",
|
||||
"vault.png",
|
||||
"vault.png",
|
||||
"vault.png",
|
||||
"vault.png",
|
||||
--"(vault.png^nyancat_front.png^[colorize:#00FF00:110)"
|
||||
"(default_nc_front.png^[colorize:#00FF00:110)"
|
||||
},
|
||||
tiles = { "vault.png", "vault.png", "vault.png",
|
||||
"vault.png", "vault.png", "(vault.png^nyancat_front.png^[colorize:#00FF00:110)"},
|
||||
inventory_image = "vault.png",
|
||||
light_source = 14,
|
||||
paramtype2 = "facedir",
|
||||
|
@ -12,13 +12,9 @@
|
||||
|
||||
--Media(if not stated differently):
|
||||
--(c) Copyright (2014-2017) maikerumine; CC-BY-SA 3.0
|
||||
if minetest.global_exists("armor") and armor.elements then
|
||||
table.insert(armor.elements, "shield")
|
||||
local mult = armor.config.level_multiplier or 1
|
||||
armor.config.level_multiplier = mult * 0.9
|
||||
end
|
||||
|
||||
--local use_shields = minetest.get_modpath("shields")
|
||||
|
||||
local use_shields = minetest.get_modpath("shields")
|
||||
|
||||
local craft_ingreds = {
|
||||
infinium = "es:infinium_ingot",
|
||||
|
@ -15,13 +15,6 @@
|
||||
|
||||
|
||||
--[[
|
||||
stairs.register_stair_and_slab("wood", "default:wood",
|
||||
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
|
||||
{"default_wood.png"},
|
||||
"Wooden Stair",
|
||||
"Wooden Slab",
|
||||
default.node_sound_wood_defaults())
|
||||
|
||||
function stairs.register_stair_and_slab(subname, recipeitem, groups, images,
|
||||
desc_stair, desc_slab, sounds)
|
||||
stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
|
||||
@ -30,28 +23,28 @@ end
|
||||
]]
|
||||
--TECHNIC STAIRS
|
||||
stairs.register_stair_and_slab("granite", "es:granite",
|
||||
{cracky = 1},
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"technic_granite.png"},
|
||||
"Granite Block Stair",
|
||||
"Granite Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("marble", "es:marble",
|
||||
{cracky = 1},
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"technic_marble.png"},
|
||||
"Marble Block Stair",
|
||||
"Marble Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("marble_bricks", "es:marble_bricks",
|
||||
{cracky = 1},
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"technic_marble_bricks.png" },
|
||||
"Marble Bricks Block Stair",
|
||||
"Marble Bricks Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("granite_bricks", "es:granite_bricks",
|
||||
{cracky = 1},
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"technic_granite_bricks.png" },
|
||||
"Granite Bricks Block Stair",
|
||||
"Granite Bricks Block Slab",
|
||||
@ -59,43 +52,43 @@ stairs.register_stair_and_slab("granite_bricks", "es:granite_bricks",
|
||||
|
||||
|
||||
--Extreme Survival Stairs
|
||||
stairs.register_stair_and_slab("ruby", "es:rubyblock",
|
||||
{cracky = 1},
|
||||
stairs.register_stair_and_slab("Ruby", "es:rubyblock",
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"ruby_block.png"},
|
||||
"Ruby Block Stair",
|
||||
"Ruby Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("emerald", "es:emeraldblock",
|
||||
{cracky = 1},
|
||||
stairs.register_stair_and_slab("Emerald", "es:emeraldblock",
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"emerald_block.png"},
|
||||
"Emerald Block Stair",
|
||||
"Emerald Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("aikerum", "es:aikerumblock",
|
||||
{cracky = 1},
|
||||
stairs.register_stair_and_slab("Aikerum", "es:aikerumblock",
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"aikerum_block.png"},
|
||||
"Aikerum Block Stair",
|
||||
"Aikerum Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("infinium", "es:infiniumblock",
|
||||
{cracky = 1},
|
||||
stairs.register_stair_and_slab("Infinium", "es:infiniumblock",
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"infinium_block.png"},
|
||||
"Infinium Block Stair",
|
||||
"Infinium Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("purpellium", "es:purpelliumblock",
|
||||
{cracky = 1},
|
||||
stairs.register_stair_and_slab("Purpellium", "es:purpelliumblock",
|
||||
{cracky = 1,not_in_craft_guide=1},
|
||||
{"purpellium_block.png"},
|
||||
"Purpellium Block Stair",
|
||||
"Purpellium Block Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab("dirt", "default:dirt",
|
||||
{cracky = 3, crumbly = 3},
|
||||
stairs.register_stair_and_slab("Dirt", "default:dirt",
|
||||
{cracky = 3, crumbly = 3,not_in_craft_guide=1},
|
||||
{"default_dirt.png"},
|
||||
"Dirt Block Stair",
|
||||
"Dirt Block Slab",
|
||||
|
BIN
mods/es/textures/3d_armor_trans.png
Normal file
After Width: | Height: | Size: 75 B |
Before Width: | Height: | Size: 473 B |
BIN
mods/es/textures/admin_tnt_bottom.png
Normal file
After Width: | Height: | Size: 171 B |
BIN
mods/es/textures/admin_tnt_side.png
Normal file
After Width: | Height: | Size: 235 B |
BIN
mods/es/textures/admin_tnt_top.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
mods/es/textures/character_preview.png
Normal file
After Width: | Height: | Size: 256 B |
BIN
mods/es/textures/default_mineral_mese.png
Normal file
After Width: | Height: | Size: 388 B |
BIN
mods/es/textures/depleted_uranium_lump.png
Normal file
After Width: | Height: | Size: 341 B |
BIN
mods/es/textures/es_circle_stone_bricks.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
mods/es/textures/es_depleted_uranium_lump.png
Normal file
After Width: | Height: | Size: 300 B |
BIN
mods/es/textures/flowers_waterlily_bottom.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 600 B |
BIN
mods/es/textures/jt_mods_tool_obsidianpick.png
Normal file
After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 260 B |
@ -205,6 +205,116 @@ minetest.register_tool("es:shovel_aikerum", {
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
--ARMOR_MOD_NAME = minetest.get_current_modname()
|
||||
--dofile(minetest.get_modpath(ARMOR_MOD_NAME).."/armor.lua")
|
||||
local use_3d_armor = minetest.get_modpath("3d_armor")
|
||||
|
||||
--if use_3d_armor then
|
||||
--ARMOR
|
||||
minetest.register_tool("es:helmet_emerald", {
|
||||
description = "Emerald Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_emerald.png",
|
||||
groups = {armor_head = 15, armor_heal = 12, armor_use = 100},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:helmet_infinium", {
|
||||
description = "Infinium Helmet",
|
||||
inventory_image = "3d_armor_inv_helmet_infinium.png",
|
||||
groups = {armor_head = 20, armor_heal = 15, armor_use = 150},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:chestplate_emerald", {
|
||||
description = "Emerald Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_emerald.png",
|
||||
groups = {armor_torso = 20, armor_heal = 12, armor_use = 100},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:chestplate_infinium", {
|
||||
description = "Infinium Chestplate",
|
||||
inventory_image = "3d_armor_inv_chestplate_infinium.png",
|
||||
groups = {armor_torso = 50, armor_heal = 15, armor_use = 150},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:leggings_emerald", {
|
||||
description = "Emerald Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_emerald.png",
|
||||
groups = {armor_legs = 20, armor_heal = 12, armor_use = 100},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:leggings_infinium", {
|
||||
description = "Infinium Leggings",
|
||||
inventory_image = "3d_armor_inv_leggings_infinium.png",
|
||||
groups = {armor_legs = 50, armor_heal = 15, armor_use = 150},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:boots_emerald", {
|
||||
description = "Emerald Boots",
|
||||
inventory_image = "3d_armor_inv_boots_emerald.png",
|
||||
groups = {armor_feet = 15, armor_heal = 12, armor_use = 100},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
minetest.register_tool("es:boots_infinium", {
|
||||
description = "Infinium Boots",
|
||||
inventory_image = "3d_armor_inv_boots_infinium.png",
|
||||
groups = {armor_feet = 30, armor_heal = 15, armor_use = 150},
|
||||
wear = 0,
|
||||
})
|
||||
|
||||
-- Register crafting recipes:
|
||||
|
||||
local craft_ingreds = {
|
||||
|
||||
infinium = "es:infinium_ingot",
|
||||
emerald = "es:emerald_crystal",
|
||||
}
|
||||
|
||||
--end
|
||||
for k, v in pairs(craft_ingreds) do
|
||||
minetest.register_craft({
|
||||
output = "es:helmet_"..k,
|
||||
recipe = {
|
||||
{v, v, v},
|
||||
{v, "", v},
|
||||
{"", "", ""},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "es:chestplate_"..k,
|
||||
recipe = {
|
||||
{v, "", v},
|
||||
{v, v, v},
|
||||
{v, v, v},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "es:leggings_"..k,
|
||||
recipe = {
|
||||
{v, v, v},
|
||||
{v, "", v},
|
||||
{v, "", v},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "es:boots_"..k,
|
||||
recipe = {
|
||||
{v, "", v},
|
||||
{v, "", v},
|
||||
},
|
||||
})
|
||||
--end
|
||||
end]]
|
||||
|
||||
if minetest.get_modpath("toolranks") then
|
||||
--emerald
|
||||
minetest.override_item("es:pick_emerald", {
|
||||
@ -268,3 +378,51 @@ if minetest.get_modpath("toolranks") then
|
||||
after_use = toolranks.new_afteruse})
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
-- mods/jt_mods/tools.lua
|
||||
--Just Test Mods created by maikerumine
|
||||
--inspired by Andrey "lag01" the creator of the original Just Test server.
|
||||
-- Minetest 0.4.14 mod: "jt_mods"
|
||||
-- namespace: jt_mods
|
||||
--https://github.com/maikerumine
|
||||
|
||||
--License:
|
||||
--~~~~~~~~
|
||||
--Code:
|
||||
--(c) Copyright 2016 maikerumine; modified zlib-License
|
||||
--see "LICENSE.txt" for details.
|
||||
|
||||
--Media(if not stated differently):
|
||||
--(c) Copyright (2014-2016) maikerumine; CC-BY-SA 3.0
|
||||
|
||||
minetest.register_tool("es:pick_obsidian", {
|
||||
description = "Obsidian Pickaxe",
|
||||
inventory_image = "jt_mods_tool_obsidianpick.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.1,
|
||||
max_drop_level=3,
|
||||
groupcaps={
|
||||
cracky = {times={[1]=0.3, [2]=0.2, [3]=0.05}, uses=3, maxlevel=3},
|
||||
},
|
||||
damage_groups = {fleshy=6},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_tool("es:pick_admin", {
|
||||
description = "ADMIN Obsidian Pickaxe",
|
||||
inventory_image = "jt_mods_tool_obsidianpick.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.1,
|
||||
max_drop_level=3,
|
||||
groupcaps={
|
||||
cracky = {times={[1]=0.3, [2]=0.2, [3]=0.05}, uses=3000, maxlevel=3},
|
||||
crumbly = {times={[1]=0.3, [2]=0.2, [3]=0.05}, uses=3000, maxlevel=3},
|
||||
snappy = {times={[1]=0.3, [2]=0.2, [3]=0.05}, uses=3000, maxlevel=3},
|
||||
choppy = {times={[1]=0.3, [2]=0.2, [3]=0.05}, uses=3000, maxlevel=3},
|
||||
},
|
||||
damage_groups = {fleshy=60},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ mg_villages.VILLAGE_DETECT_RANGE = 400;
|
||||
mg_villages.REQUIRE_PRIV_FOR_TELEPORT = true;
|
||||
|
||||
-- if set to true, players cannot modify spawned villages without buying the house from the village first
|
||||
mg_villages.ENABLE_PROTECTION = true;
|
||||
mg_villages.ENABLE_PROTECTION = false;
|
||||
|
||||
-- the first village - the one the player spawns in - will be of this type
|
||||
mg_villages.FIRST_VILLAGE_TYPE = 'ruins';
|
||||
|
@ -80,21 +80,27 @@ minetest.register_lbm({
|
||||
local month = tonumber(mymonths.month_counter)
|
||||
local day = tonumber(mymonths.day_counter)
|
||||
|
||||
if month == 11
|
||||
or month == 12
|
||||
or month == 1
|
||||
or month == 2 then
|
||||
if month == 13
|
||||
--or month == 12
|
||||
--or month == 1
|
||||
or month == 14 then
|
||||
if n == 'default:dirt_with_grass' then
|
||||
minetest.set_node(pos, {name = 'mymonths:fall_grass'})
|
||||
--minetest.set_node(pos, {name = 'mymonths:fall_grass'})
|
||||
minetest.set_node(pos, {name = 'default:dirt_with_grass'})
|
||||
end
|
||||
|
||||
elseif month == 4
|
||||
elseif month == 1
|
||||
or month == 2
|
||||
or month == 3
|
||||
or month == 4
|
||||
or month == 5
|
||||
or month == 6
|
||||
or month == 7
|
||||
or month == 8
|
||||
or month == 9
|
||||
or month == 10 then
|
||||
or month == 10
|
||||
or month == 11
|
||||
or month == 12 then
|
||||
if n == 'mymonths:fall_grass' then
|
||||
minetest.set_node(pos, {name = 'default:dirt_with_grass'})
|
||||
end
|
||||
|
@ -2,7 +2,7 @@
|
||||
-- get minetest.conf settings
|
||||
protector = {}
|
||||
protector.mod = "redo"
|
||||
protector.radius = tonumber(minetest.settings:get("protector_radius")) or 5
|
||||
protector.radius = tonumber(minetest.settings:get("protector_radius")) or 3
|
||||
protector.flip = minetest.settings:get_bool("protector_flip") or false
|
||||
protector.hurt = tonumber(minetest.settings:get("protector_hurt")) or 0
|
||||
protector.spawn = tonumber(minetest.settings:get("protector_spawn")
|
||||
|
@ -1,7 +0,0 @@
|
||||
Minetest Game mod: sethome
|
||||
==========================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
sfan5 (MIT)
|
@ -1,97 +0,0 @@
|
||||
|
||||
sethome = {}
|
||||
|
||||
local homes_file = minetest.get_worldpath() .. "/homes"
|
||||
local homepos = {}
|
||||
|
||||
local function loadhomes()
|
||||
local input = io.open(homes_file, "r")
|
||||
if not input then
|
||||
return -- no longer an error
|
||||
end
|
||||
|
||||
-- Iterate over all stored positions in the format "x y z player" for each line
|
||||
for pos, name in input:read("*a"):gmatch("(%S+ %S+ %S+)%s([%w_-]+)[\r\n]") do
|
||||
homepos[name] = minetest.string_to_pos(pos)
|
||||
end
|
||||
input:close()
|
||||
end
|
||||
|
||||
loadhomes()
|
||||
|
||||
sethome.set = function(name, pos)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player or not pos then
|
||||
return false
|
||||
end
|
||||
player:set_attribute("sethome:home", minetest.pos_to_string(pos))
|
||||
|
||||
-- remove `name` from the old storage file
|
||||
local data = {}
|
||||
local output = io.open(homes_file, "w")
|
||||
if output then
|
||||
homepos[name] = nil
|
||||
for i, v in pairs(homepos) do
|
||||
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, i))
|
||||
end
|
||||
output:write(table.concat(data))
|
||||
io.close(output)
|
||||
return true
|
||||
end
|
||||
return true -- if the file doesn't exist - don't return an error.
|
||||
end
|
||||
|
||||
sethome.get = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local pos = minetest.string_to_pos(player:get_attribute("sethome:home"))
|
||||
if pos then
|
||||
return pos
|
||||
end
|
||||
|
||||
-- fetch old entry from storage table
|
||||
pos = homepos[name]
|
||||
if pos then
|
||||
return vector.new(pos)
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
sethome.go = function(name)
|
||||
local pos = sethome.get(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player and pos then
|
||||
player:setpos(pos)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_privilege("home", {
|
||||
description = "Can use /sethome and /home",
|
||||
give_to_singleplayer = false
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("home", {
|
||||
description = "Teleport you to your home point",
|
||||
privs = {home = true},
|
||||
func = function(name)
|
||||
if sethome.go(name) then
|
||||
return true, "Teleported to home!"
|
||||
end
|
||||
return false, "Set a home using /sethome"
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("sethome", {
|
||||
description = "Set your home point",
|
||||
privs = {home = true},
|
||||
func = function(name)
|
||||
name = name or "" -- fallback to blank name if nil
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player and sethome.set(name, player:getpos()) then
|
||||
return true, "Home set!"
|
||||
end
|
||||
return false, "Player not found!"
|
||||
end,
|
||||
})
|
@ -1,24 +0,0 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2014-2016 sfan5
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
@ -270,8 +270,6 @@ SHOOTER_ENTITIES = {
|
||||
"scifi_mobs:xwing",
|
||||
"scifi_mobs:xwing_player",
|
||||
"scifi_mobs:core",
|
||||
|
||||
|
||||
}
|
||||
|
||||
local singleplayer = minetest.is_singleplayer()
|
||||
|
@ -242,15 +242,15 @@ minetest.register_craft({
|
||||
output = "unified_inventory:medium_esmmese",
|
||||
recipe = {
|
||||
{"default:copper_ingot", "default:copper_ingot", },
|
||||
{"bags:small_esmmese", "bags:small_esmmese"},
|
||||
{"bags:small_esmmese", "bags:small_esmmese"},
|
||||
{"unified_inventory:small_esmmese", "unified_inventory:small_esmmese"},
|
||||
{"unified_inventory:small_esmmese", "unified_inventory:small_esmmese"},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "unified_inventory:large_esmmese",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot", },
|
||||
{"bags:medium_esmmese", "bags:medium_esmmese"},
|
||||
{"bags:medium_esmmese", "bags:medium_esmmese"},
|
||||
{"unified_inventory:medium_esmmese", "unified_inventory:medium_esmmese"},
|
||||
{"unified_inventory:medium_esmmese", "unified_inventory:medium_esmmese"},
|
||||
},
|
||||
})
|
14
mods/xtra-esm/smartshop/Readme.txt
Normal file
@ -0,0 +1,14 @@
|
||||
Licenses: code LGPL 2.1 media CC BY-SA 3.0
|
||||
Version: 1
|
||||
Name: smartshop
|
||||
Created by: UjEdwin
|
||||
|
||||
|
||||
Like the title says, this is a smart and easy shop, that will also fit everywhere.
|
||||
|
||||
it is a mix of a vending machine, a shop, item frames and light.
|
||||
|
||||
You can toogle it unlimited or limited if you have give or creative
|
||||
(unlimited will not take or add stuff to its inventory)
|
||||
|
||||
It also works with pipeworks
|
1
mods/xtra-esm/smartshop/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
290
mods/xtra-esm/smartshop/init.lua
Normal file
@ -0,0 +1,290 @@
|
||||
smartshop={user={},tmp={},dir={{x=0,y=0,z=-1},{x=-1,y=0,z=0},{x=0,y=0,z=1},{x=1,y=0,z=0}},dpos={
|
||||
{{x=0.2,y=0.2,z=0},{x=-0.2,y=0.2,z=0},{x=0.2,y=-0.2,z=0},{x=-0.2,y=-0.2,z=0}},
|
||||
{{x=0,y=0.2,z=0.2},{x=0,y=0.2,z=-0.2},{x=0,y=-0.2,z=0.2},{x=0,y=-0.2,z=-0.2}},
|
||||
{{x=-0.2,y=0.2,z=0},{x=0.2,y=0.2,z=0},{x=-0.2,y=-0.2,z=0},{x=0.2,y=-0.2,z=0}},
|
||||
{{x=0,y=0.2,z=-0.2},{x=0,y=0.2,z=0.2},{x=0,y=-0.2,z=-0.2},{x=0,y=-0.2,z=0.2}}}
|
||||
}
|
||||
|
||||
minetest.register_craft({
|
||||
output = "smartshop:shop",
|
||||
recipe = {
|
||||
{"default:chest_locked", "default:chest_locked", "default:chest_locked"},
|
||||
{"default:sign_wall_wood", "default:chest_locked", "default:sign_wall_wood"},
|
||||
{"default:sign_wall_wood", "default:sign_wall_wood", "default:sign_wall_wood"},
|
||||
}
|
||||
})
|
||||
|
||||
smartshop.update=function(pos,stat)
|
||||
--clear
|
||||
local spos=minetest.pos_to_string(pos)
|
||||
for _, ob in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
|
||||
if ob and ob:get_luaentity() and ob:get_luaentity().smartshop and ob:get_luaentity().pos==spos then
|
||||
ob:remove()
|
||||
end
|
||||
end
|
||||
if stat=="clear" then return end
|
||||
--update
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local node=minetest.get_node(pos)
|
||||
local dp = smartshop.dir[node.param2+1]
|
||||
if not dp then return end
|
||||
pos.x = pos.x + dp.x*0.01
|
||||
pos.y = pos.y + dp.y*6.5/16
|
||||
pos.z = pos.z + dp.z*0.01
|
||||
for i=1,4,1 do
|
||||
local item=inv:get_stack("give" .. i,1):get_name()
|
||||
local pos2=smartshop.dpos[node.param2+1][i]
|
||||
if item~="" then
|
||||
smartshop.tmp.item=item
|
||||
smartshop.tmp.pos=spos
|
||||
local e = minetest.env:add_entity({x=pos.x+pos2.x,y=pos.y+pos2.y,z=pos.z+pos2.z},"smartshop:item")
|
||||
e:setyaw(math.pi*2 - node.param2 * math.pi/2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_entity("smartshop:item",{
|
||||
hp_max = 1,
|
||||
visual="wielditem",
|
||||
visual_size={x=.20,y=.20},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
physical=false,
|
||||
textures={"air"},
|
||||
smartshop=true,
|
||||
on_activate = function(self, staticdata)
|
||||
if smartshop.tmp.item ~= nil then
|
||||
self.item=smartshop.tmp.item
|
||||
self.pos=smartshop.tmp.pos
|
||||
smartshop.tmp={}
|
||||
else
|
||||
if staticdata ~= nil and staticdata ~= "" then
|
||||
local data = staticdata:split(';')
|
||||
if data and data[1] and data[2] then
|
||||
self.item = data[1]
|
||||
self.pos = data[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.item ~= nil then
|
||||
self.object:set_properties({textures={self.item}})
|
||||
else
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
if self.item ~= nil and self.pos ~= nil then
|
||||
return self.item .. ';' .. self.pos
|
||||
end
|
||||
return ""
|
||||
end,
|
||||
})
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
local name = ""
|
||||
if player then
|
||||
if minetest.check_player_privs(player, "protection_bypass") then
|
||||
return true
|
||||
end
|
||||
name = player:get_player_name()
|
||||
end
|
||||
if name ~= meta:get_string("owner") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
smartshop.showform=function(pos,player,re)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local creative=meta:get_int("creative")
|
||||
local inv = meta:get_inventory()
|
||||
local gui=""
|
||||
local spos=pos.x .. "," .. pos.y .. "," .. pos.z
|
||||
local owner=meta:get_string("owner")==player:get_player_name()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if re then owner=false end
|
||||
smartshop.user[player:get_player_name()]=pos
|
||||
if owner then
|
||||
gui=""
|
||||
.."size[8,10]"
|
||||
.."button_exit[6,0;1.5,1;customer;Customer]"
|
||||
.."label[0,0.2;Item:]"
|
||||
.."label[0,1.2;Price:]"
|
||||
.."list[nodemeta:" .. spos .. ";give1;2,0;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";pay1;2,1;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";give2;3,0;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";pay2;3,1;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";give3;4,0;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";pay3;4,1;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";give4;5,0;1,1;]"
|
||||
.."list[nodemeta:" .. spos .. ";pay4;5,1;1,1;]"
|
||||
if creative==1 then
|
||||
gui=gui .."label[0.5,-0.4;Your stock is unlimeted becaouse you have creative or give]"
|
||||
.."button[6,1;2.2,1;tooglelime;Toogle lime]"
|
||||
end
|
||||
gui=gui
|
||||
.."list[nodemeta:" .. spos .. ";main;0,2;8,4;]"
|
||||
.."list[current_player;main;0,6.2;8,4;]"
|
||||
.."listring[nodemeta:" .. spos .. ";main]"
|
||||
.."listring[current_player;main]"
|
||||
else
|
||||
gui=""
|
||||
.."size[8,6]"
|
||||
.."list[current_player;main;0,2.2;8,4;]"
|
||||
.."label[0,0.2;Item:]"
|
||||
.."label[0,1.2;Price:]"
|
||||
.."list[nodemeta:" .. spos .. ";give1;2,0;1,1;]"
|
||||
.."item_image_button[2,1;1,1;".. inv:get_stack("pay1",1):get_name() ..";buy1;\n\n\b\b\b\b\b" .. inv:get_stack("pay1",1):get_count() .."]"
|
||||
.."list[nodemeta:" .. spos .. ";give2;3,0;1,1;]"
|
||||
.."item_image_button[3,1;1,1;".. inv:get_stack("pay2",1):get_name() ..";buy2;\n\n\b\b\b\b\b" .. inv:get_stack("pay2",1):get_count() .."]"
|
||||
.."list[nodemeta:" .. spos .. ";give3;4,0;1,1;]"
|
||||
.."item_image_button[4,1;1,1;".. inv:get_stack("pay3",1):get_name() ..";buy3;\n\n\b\b\b\b\b" .. inv:get_stack("pay3",1):get_count() .."]"
|
||||
.."list[nodemeta:" .. spos .. ";give4;5,0;1,1;]"
|
||||
.."item_image_button[5,1;1,1;".. inv:get_stack("pay4",1):get_name() ..";buy4;\n\n\b\b\b\b\b" .. inv:get_stack("pay4",1):get_count() .."]"
|
||||
end
|
||||
minetest.after((0.1), function(gui)
|
||||
return minetest.show_formspec(player:get_player_name(), "smartshop.showform",gui)
|
||||
end, gui)
|
||||
end
|
||||
minetest.register_on_player_receive_fields(function(player, form, pressed)
|
||||
if form=="smartshop.showform" then
|
||||
if pressed.customer then
|
||||
return smartshop.showform(smartshop.user[player:get_player_name()],player,true)
|
||||
elseif pressed.tooglelime then
|
||||
local pos=smartshop.user[player:get_player_name()]
|
||||
local meta=minetest.get_meta(pos)
|
||||
local pname=player:get_player_name()
|
||||
if meta:get_int("type")==0 then
|
||||
meta:set_int("type",1)
|
||||
minetest.chat_send_player(pname, "Your stock is limeted")
|
||||
else
|
||||
meta:set_int("type",0)
|
||||
minetest.chat_send_player(pname, "Your stock is unlimeted")
|
||||
end
|
||||
elseif not pressed.quit then
|
||||
local n=1
|
||||
for i=1,4,1 do
|
||||
n=i
|
||||
if pressed["buy" .. i] then break end
|
||||
end
|
||||
local pos=smartshop.user[player:get_player_name()]
|
||||
local meta=minetest.get_meta(pos)
|
||||
local type=meta:get_int("type")
|
||||
local inv = meta:get_inventory()
|
||||
local pinv=player:get_inventory()
|
||||
local pname=player:get_player_name()
|
||||
if pressed["buy" .. n] then
|
||||
local name=inv:get_stack("give" .. n,1):get_name()
|
||||
local stack=name .." ".. inv:get_stack("give" .. n,1):get_count()
|
||||
local pay=inv:get_stack("pay" .. n,1):get_name() .." ".. inv:get_stack("pay" .. n,1):get_count()
|
||||
if name~="" then
|
||||
if type==1 and inv:room_for_item("main", pay)==false then minetest.chat_send_player(pname, "Error: The owners stock is full, cant receive, exchange aborted.") return end
|
||||
if type==1 and inv:contains_item("main", stack)==false then minetest.chat_send_player(pname, "Error: The owners stock is end.") return end
|
||||
if not pinv:contains_item("main", pay) then minetest.chat_send_player(pname, "Error: You dont have enough in your inventory to buy this, exchange aborted.") return end
|
||||
if not pinv:room_for_item("main", stack) then minetest.chat_send_player(pname, "Error: Your inventory is full, exchange aborted.") return end
|
||||
pinv:remove_item("main", pay)
|
||||
pinv:add_item("main", stack)
|
||||
if type==1 then
|
||||
inv:remove_item("main", stack)
|
||||
inv:add_item("main", pay)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if smartshop.user[player:get_player_name()] then
|
||||
local meta=minetest.get_meta(smartshop.user[player:get_player_name()])
|
||||
if meta:get_string("owner")==player:get_player_name() then
|
||||
smartshop.update(smartshop.user[player:get_player_name()],"update")
|
||||
end
|
||||
--=====================
|
||||
if has_locked_chest_privilege(meta, player) then
|
||||
smartshop.update(smartshop.user[player:get_player_name()],"update")
|
||||
end
|
||||
--=====================
|
||||
end
|
||||
smartshop.user[player:get_player_name()]=nil
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_node("smartshop:shop", {
|
||||
description = "Smartshop",
|
||||
tiles = {"default_chest_top.png^[colorize:#ffffff77^default_obsidian_glass.png"},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1,tubedevice = 1, tubedevice_receiver = 1},
|
||||
drawtype="nodebox",
|
||||
node_box = {type="fixed",fixed={-0.5,-0.5,-0.0,0.5,0.5,0.5}},
|
||||
paramtype2="facedir",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
light_source = 10,
|
||||
tube = {insert_object = function(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local added = inv:add_item("main", stack)
|
||||
return added
|
||||
end,
|
||||
can_insert = function(pos, node, stack, direction)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
return inv:room_for_item("main", stack)
|
||||
end,
|
||||
input_inventory = "main",
|
||||
connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}},
|
||||
after_place_node = function(pos, placer)
|
||||
local meta=minetest.get_meta(pos)
|
||||
meta:set_string("owner",placer:get_player_name())
|
||||
meta:set_string("infotext", "Shop by: " .. placer:get_player_name())
|
||||
meta:set_int("type",1)
|
||||
if minetest.check_player_privs(placer:get_player_name(), {creative=true}) or minetest.check_player_privs(placer:get_player_name(), {give=true}) then
|
||||
meta:set_int("creative",1)
|
||||
meta:set_int("type",0)
|
||||
end
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta=minetest.get_meta(pos)
|
||||
meta:set_int("state", 0)
|
||||
meta:get_inventory():set_size("main", 32)
|
||||
meta:get_inventory():set_size("give1", 1)
|
||||
meta:get_inventory():set_size("pay1", 1)
|
||||
meta:get_inventory():set_size("give2", 1)
|
||||
meta:get_inventory():set_size("pay2", 1)
|
||||
meta:get_inventory():set_size("give3", 1)
|
||||
meta:get_inventory():set_size("pay3", 1)
|
||||
meta:get_inventory():set_size("give4", 1)
|
||||
meta:get_inventory():set_size("pay4", 1)
|
||||
end,
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
smartshop.showform(pos,player)
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
if minetest.get_meta(pos):get_string("owner")==player:get_player_name() then
|
||||
return stack:get_count()
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
if minetest.get_meta(pos):get_string("owner")==player:get_player_name() then
|
||||
return stack:get_count()
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
if minetest.get_meta(pos):get_string("owner")==player:get_player_name() then
|
||||
return count
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
can_dig = function(pos, player)
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
if (meta:get_string("owner")==player:get_player_name() and inv:is_empty("main") and inv:is_empty("pay1") and inv:is_empty("pay2") and inv:is_empty("pay3") and inv:is_empty("pay4") and inv:is_empty("give1") and inv:is_empty("give2") and inv:is_empty("give3") and inv:is_empty("give4")) or meta:get_string("owner")=="" then
|
||||
smartshop.update(pos,"clear")
|
||||
return true
|
||||
end
|
||||
end,
|
||||
})
|
4
mods/xtra-esm/vendor/README.md
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
vendor
|
||||
======
|
||||
|
||||
Minetest mod: Vending machines
|
1
mods/xtra-esm/vendor/depends.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
default
|
73
mods/xtra-esm/vendor/init.lua
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
---
|
||||
--vendor 1.01
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
---
|
||||
|
||||
vendor = {}
|
||||
vendor.version = 1.02
|
||||
|
||||
dofile(minetest.get_modpath("vendor") .. "/vendor.lua")
|
||||
|
||||
minetest.register_node("vendor:vendor", {
|
||||
description = "Vending Machine",
|
||||
tile_images ={"vendor_side.png", "vendor_side.png", "vendor_side.png",
|
||||
"vendor_side.png", "vendor_side.png", "vendor_vendor_front.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
|
||||
after_place_node = vendor.after_place_node,
|
||||
can_dig = vendor.can_dig,
|
||||
on_receive_fields = vendor.on_receive_fields,
|
||||
allow_metadata_inventory_put = vendor.allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_take = vendor.allow_metadata_inventory_take,
|
||||
allow_metadata_inventory_move = vendor.allow_metadata_inventory_move,
|
||||
})
|
||||
|
||||
minetest.register_node("vendor:depositor", {
|
||||
description = "Depositing Machine",
|
||||
tile_images ={"vendor_side.png", "vendor_side.png", "vendor_side.png",
|
||||
"vendor_side.png", "vendor_side.png", "vendor_depositor_front.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
|
||||
after_place_node = vendor.after_place_node,
|
||||
can_dig = vendor.can_dig,
|
||||
on_receive_fields = vendor.on_receive_fields,
|
||||
allow_metadata_inventory_put = vendor.allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_take = vendor.allow_metadata_inventory_take,
|
||||
allow_metadata_inventory_move = vendor.allow_metadata_inventory_move,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'vendor:vendor',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'default:steel_ingot', 'group:wood'},
|
||||
{'group:wood', 'default:steel_ingot', 'group:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'vendor:depositor',
|
||||
recipe = {
|
||||
{'group:wood', 'default:steel_ingot', 'group:wood'},
|
||||
{'group:wood', 'default:steel_ingot', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
}
|
||||
})
|
502
mods/xtra-esm/vendor/license.txt
vendored
Normal file
@ -0,0 +1,502 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
5
mods/xtra-esm/vendor/sounds/sound_license.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
Sounds effects derived from:
|
||||
http://opengameart.org/content/inventory-sound-effects
|
||||
|
||||
Applicable licenses:
|
||||
CC-BY 3.0 CC-BY-SA 3.0 GPL 3.0 GPL 2.0
|
BIN
mods/xtra-esm/vendor/sounds/vendor_vend.ogg
vendored
Normal file
BIN
mods/xtra-esm/vendor/textures/vendor_depositor_front.png
vendored
Normal file
After Width: | Height: | Size: 765 B |
BIN
mods/xtra-esm/vendor/textures/vendor_side.png
vendored
Normal file
After Width: | Height: | Size: 760 B |
BIN
mods/xtra-esm/vendor/textures/vendor_vendor_front.png
vendored
Normal file
After Width: | Height: | Size: 768 B |
223
mods/xtra-esm/vendor/vendor.lua
vendored
Normal file
@ -0,0 +1,223 @@
|
||||
---
|
||||
--vendor
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--Rewrited by Andrej
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
---
|
||||
|
||||
vendor.set_formspec = function(pos, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
local description = minetest.registered_nodes[node.name].description;
|
||||
local number = meta:get_int("number")
|
||||
local cost = meta:get_int("cost")
|
||||
|
||||
meta:set_string("formspec", "size[8,7;]"
|
||||
.."label[0,0;" .. description .. "]"
|
||||
|
||||
.."list[current_name;item;0,1;1,1;]"
|
||||
.."field[1.3,1.3;1,1;number;Count:;" .. number .. "]"
|
||||
|
||||
.."list[current_name;gold;0,2;1,1;]"
|
||||
.."field[1.3,2.3;1,1;cost;Price:;" .. cost .. "]"
|
||||
|
||||
.."button[3,2;2,0.5;save;OK]"
|
||||
.."list[current_player;main;0,3;8,4;]")
|
||||
end
|
||||
|
||||
vendor.on_receive_fields_owner = function(pos, formname, fields, sender)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
local number = tonumber(fields.number)
|
||||
local cost = tonumber(fields.cost)
|
||||
local inv_self = meta:get_inventory()
|
||||
|
||||
local itemstack = inv_self:get_stack("item",1)
|
||||
local itemname=""
|
||||
|
||||
if not( number == nil or number < 1 or number > 99) then
|
||||
meta:set_int("number", number)
|
||||
end
|
||||
|
||||
if not( cost == nil or cost < 1 or cost > 99) then
|
||||
meta:set_int("cost", cost)
|
||||
end
|
||||
|
||||
if( itemstack and itemstack:get_name() ) then
|
||||
itemname=itemstack:get_name()
|
||||
end
|
||||
meta:set_string("itemname", itemname)
|
||||
|
||||
vendor.set_formspec(pos, sender)
|
||||
end
|
||||
|
||||
vendor.on_receive_fields_customer = function(pos, formname, fields, sender)
|
||||
if not fields.save then
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local number = meta:get_int("number")
|
||||
local cost = meta:get_int("cost")
|
||||
local itemname=meta:get_string("itemname")
|
||||
local buysell = "sell"
|
||||
if ( node.name == "vendor:depositor" ) then
|
||||
buysell = "buy"
|
||||
end
|
||||
|
||||
if ( number == nil or number < 1 or number > 99) then
|
||||
return
|
||||
end
|
||||
if ( cost == nil or cost < 1 or cost > 99) then
|
||||
return
|
||||
end
|
||||
if ( itemname == nil or itemname=="") then
|
||||
return
|
||||
end
|
||||
|
||||
local chest = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
if chest.name=="default:chest_locked" and sender and sender:is_player() then
|
||||
local chest_meta = minetest.get_meta({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
local chest_inv = chest_meta:get_inventory()
|
||||
local player_inv = sender:get_inventory()
|
||||
if ( chest_meta:get_string("owner") == meta:get_string("owner") and chest_inv ~= nil and player_inv ~= nil ) then
|
||||
|
||||
local stack = {name=itemname, count=number, wear=0, metadata=""}
|
||||
local price = {name="default:gold_ingot", count=cost, wear=0, metadata=""}
|
||||
if buysell == "sell" then
|
||||
if chest_inv:contains_item("main", stack) and player_inv:contains_item("main", price) and
|
||||
chest_inv:room_for_item("main", price) and player_inv:room_for_item("main", stack) then
|
||||
player_inv:remove_item("main", price)
|
||||
stack = chest_inv:remove_item("main", stack)
|
||||
chest_inv:add_item("main", price)
|
||||
player_inv:add_item("main", stack)
|
||||
minetest.chat_send_player(sender:get_player_name(), "You bought item.")
|
||||
vendor.sound_vend(pos)
|
||||
elseif chest_inv:contains_item("main", stack) and player_inv:contains_item("main", price) then
|
||||
minetest.chat_send_player(sender:get_player_name(), "No room in inventory!")
|
||||
else
|
||||
minetest.chat_send_player(sender:get_player_name(), "Not enough materials!")
|
||||
end
|
||||
else
|
||||
if chest_inv:contains_item("main", price) and player_inv:contains_item("main", stack) and
|
||||
chest_inv:room_for_item("main", stack) and player_inv:room_for_item("main", price) then
|
||||
stack = player_inv:remove_item("main", stack)
|
||||
chest_inv:remove_item("main", price)
|
||||
chest_inv:add_item("main", stack)
|
||||
player_inv:add_item("main", price)
|
||||
minetest.chat_send_player(sender:get_player_name(), "You sold item.")
|
||||
vendor.sound_vend(pos)
|
||||
elseif chest_inv:contains_item("main", price) and player_inv:contains_item("main", stack) then
|
||||
minetest.chat_send_player(sender:get_player_name(), "No room in inventory!")
|
||||
else
|
||||
minetest.chat_send_player(sender:get_player_name(), "Not enough materials!")
|
||||
end
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(sender:get_player_name(), "Wrong chest!")
|
||||
end
|
||||
else
|
||||
if sender and sender:is_player() then
|
||||
minetest.chat_send_player(sender:get_player_name(), "Place chest under machine!")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--do transaction here
|
||||
|
||||
end
|
||||
|
||||
vendor.after_place_node = function(pos, placer)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local description = minetest.registered_nodes[node.name].description;
|
||||
local player_name = placer:get_player_name()
|
||||
inv:set_size("item", 1)
|
||||
inv:set_size("gold", 1)
|
||||
|
||||
inv:set_stack( "gold", 1, "default:gold_ingot" )
|
||||
|
||||
meta:set_string("infotext", player_name.." - "..description)
|
||||
meta:set_int("number", 1)
|
||||
meta:set_int("cost", 1)
|
||||
meta:set_string("itemname", "")
|
||||
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
|
||||
vendor.set_formspec(pos, placer)
|
||||
end
|
||||
|
||||
vendor.can_dig = function(pos, player)
|
||||
local chest = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
local meta_chest = minetest.get_meta({x=pos.x,y=pos.y-1,z=pos.z});
|
||||
if chest.name=="default:chest_locked" then
|
||||
if player and player:is_player() then
|
||||
local owner_chest = meta_chest:get_string("owner")
|
||||
local name = player:get_player_name()
|
||||
if name == owner_chest then
|
||||
return true --chest owner can dig shop
|
||||
end
|
||||
end
|
||||
return false
|
||||
else
|
||||
return true --if no chest, enyone can dig this shop
|
||||
end
|
||||
end
|
||||
|
||||
vendor.on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
|
||||
if sender:get_player_name() == owner then
|
||||
vendor.on_receive_fields_owner(pos, formname, fields, sender)
|
||||
else
|
||||
vendor.on_receive_fields_customer(pos, formname, fields, sender)
|
||||
end
|
||||
end
|
||||
|
||||
vendor.sound_vend = function(pos)
|
||||
minetest.sound_play("vendor_vend", {pos = pos, gain = 1.0, max_hear_distance = 5,})
|
||||
end
|
||||
|
||||
|
||||
vendor.allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
if listname=="item" then
|
||||
local meta = minetest.get_meta(pos);
|
||||
local owner = meta:get_string("owner")
|
||||
local name = player:get_player_name()
|
||||
if name == owner then
|
||||
local inv = meta:get_inventory()
|
||||
if stack==nil then
|
||||
inv:set_stack( "item", 1, nil )
|
||||
else
|
||||
inv:set_stack( "item", 1, stack:get_name() )
|
||||
end
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
vendor.allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
return 0
|
||||
end
|
||||
|
||||
vendor.allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
return 0
|
||||
end
|
4
mods/xtra-esm/vendorgoldblock/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
vendorgoldblock
|
||||
======
|
||||
|
||||
Minetest mod: Goldblock Vending machines
|
1
mods/xtra-esm/vendorgoldblock/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
73
mods/xtra-esm/vendorgoldblock/init.lua
Normal file
@ -0,0 +1,73 @@
|
||||
---
|
||||
--vendorgoldblock 1.01
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
---vendorgoldblock machines made by maikerumine
|
||||
|
||||
vendorgoldblock = {}
|
||||
vendorgoldblock.version = 1.02
|
||||
|
||||
dofile(minetest.get_modpath("vendorgoldblock") .. "/vendor.lua")
|
||||
|
||||
minetest.register_node("vendorgoldblock:vendor", {
|
||||
description = "Goldblock Vending Machine",
|
||||
tile_images ={"vendorg_side.png", "vendorg_side.png", "vendorg_side.png",
|
||||
"vendorg_side.png", "vendorg_side.png", "vendorg_vendor_front.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
|
||||
after_place_node = vendorgoldblock.after_place_node,
|
||||
can_dig = vendorgoldblock.can_dig,
|
||||
on_receive_fields = vendorgoldblock.on_receive_fields,
|
||||
allow_metadata_inventory_put = vendorgoldblock.allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_take = vendorgoldblock.allow_metadata_inventory_take,
|
||||
allow_metadata_inventory_move = vendorgoldblock.allow_metadata_inventory_move,
|
||||
})
|
||||
|
||||
minetest.register_node("vendorgoldblock:depositor", {
|
||||
description = "Goldblock Depositing Machine",
|
||||
tile_images ={"vendorg_side.png", "vendorg_side.png", "vendorg_side.png",
|
||||
"vendorg_side.png", "vendorg_side.png", "vendorg_depositor_front.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||
|
||||
after_place_node = vendorgoldblock.after_place_node,
|
||||
can_dig = vendorgoldblock.can_dig,
|
||||
on_receive_fields = vendorgoldblock.on_receive_fields,
|
||||
allow_metadata_inventory_put = vendorgoldblock.allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_take = vendorgoldblock.allow_metadata_inventory_take,
|
||||
allow_metadata_inventory_move = vendorgoldblock.allow_metadata_inventory_move,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'vendorgoldblock:vendor',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'default:gold_ingot', 'group:wood'},
|
||||
{'group:wood', 'default:gold_ingot', 'group:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'vendorgoldblock:depositor',
|
||||
recipe = {
|
||||
{'group:wood', 'default:gold_ingot', 'group:wood'},
|
||||
{'group:wood', 'default:gold_ingot', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
}
|
||||
})
|
502
mods/xtra-esm/vendorgoldblock/license.txt
Normal file
@ -0,0 +1,502 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
5
mods/xtra-esm/vendorgoldblock/sounds/sound_license.txt
Normal file
@ -0,0 +1,5 @@
|
||||
Sounds effects derived from:
|
||||
http://opengameart.org/content/inventory-sound-effects
|
||||
|
||||
Applicable licenses:
|
||||
CC-BY 3.0 CC-BY-SA 3.0 GPL 3.0 GPL 2.0
|
BIN
mods/xtra-esm/vendorgoldblock/sounds/vendor_vend.ogg
Normal file
After Width: | Height: | Size: 819 B |
BIN
mods/xtra-esm/vendorgoldblock/textures/vendorg_side.png
Normal file
After Width: | Height: | Size: 811 B |
BIN
mods/xtra-esm/vendorgoldblock/textures/vendorg_vendor_front.png
Normal file
After Width: | Height: | Size: 830 B |
223
mods/xtra-esm/vendorgoldblock/vendor.lua
Normal file
@ -0,0 +1,223 @@
|
||||
---
|
||||
--vendorgoldblock
|
||||
--Copyright (C) 2012 Bad_Command
|
||||
--Rewrited by Andrej
|
||||
--
|
||||
--This library is free software; you can redistribute it and/or
|
||||
--modify it under the terms of the GNU Lesser General Public
|
||||
--License as published by the Free Software Foundation; either
|
||||
--version 2.1 of the License, or (at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public
|
||||
--License along with this library; if not, write to the Free Software
|
||||
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
--vendorgoldblock machines made by maikerumine
|
||||
|
||||
vendorgoldblock.set_formspec = function(pos, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
local description = minetest.registered_nodes[node.name].description;
|
||||
local number = meta:get_int("number")
|
||||
local cost = meta:get_int("cost")
|
||||
|
||||
meta:set_string("formspec", "size[8,7;]"
|
||||
.."label[0,0;" .. description .. "]"
|
||||
|
||||
.."list[current_name;item;0,1;1,1;]"
|
||||
.."field[1.3,1.3;1,1;number;Count:;" .. number .. "]"
|
||||
|
||||
.."list[current_name;goldblock;0,2;1,1;]"
|
||||
.."field[1.3,2.3;1,1;cost;Price:;" .. cost .. "]"
|
||||
|
||||
.."button[3,2;2,0.5;save;OK]"
|
||||
.."list[current_player;main;0,3;8,4;]")
|
||||
end
|
||||
|
||||
vendorgoldblock.on_receive_fields_owner = function(pos, formname, fields, sender)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
local number = tonumber(fields.number)
|
||||
local cost = tonumber(fields.cost)
|
||||
local inv_self = meta:get_inventory()
|
||||
|
||||
local itemstack = inv_self:get_stack("item",1)
|
||||
local itemname=""
|
||||
|
||||
if not( number == nil or number < 1 or number > 99) then
|
||||
meta:set_int("number", number)
|
||||
end
|
||||
|
||||
if not( cost == nil or cost < 1 or cost > 99) then
|
||||
meta:set_int("cost", cost)
|
||||
end
|
||||
|
||||
if( itemstack and itemstack:get_name() ) then
|
||||
itemname=itemstack:get_name()
|
||||
end
|
||||
meta:set_string("itemname", itemname)
|
||||
|
||||
vendorgoldblock.set_formspec(pos, sender)
|
||||
end
|
||||
|
||||
vendorgoldblock.on_receive_fields_customer = function(pos, formname, fields, sender)
|
||||
if not fields.save then
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local number = meta:get_int("number")
|
||||
local cost = meta:get_int("cost")
|
||||
local itemname=meta:get_string("itemname")
|
||||
local buysell = "sell"
|
||||
if ( node.name == "vendorgoldblock:depositor" ) then
|
||||
buysell = "buy"
|
||||
end
|
||||
|
||||
if ( number == nil or number < 1 or number > 99) then
|
||||
return
|
||||
end
|
||||
if ( cost == nil or cost < 1 or cost > 99) then
|
||||
return
|
||||
end
|
||||
if ( itemname == nil or itemname=="") then
|
||||
return
|
||||
end
|
||||
|
||||
local chest = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
if chest.name=="default:chest_locked" and sender and sender:is_player() then
|
||||
local chest_meta = minetest.get_meta({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
local chest_inv = chest_meta:get_inventory()
|
||||
local player_inv = sender:get_inventory()
|
||||
if ( chest_meta:get_string("owner") == meta:get_string("owner") and chest_inv ~= nil and player_inv ~= nil ) then
|
||||
|
||||
local stack = {name=itemname, count=number, wear=0, metadata=""}
|
||||
local price = {name="default:goldblock", count=cost, wear=0, metadata=""}
|
||||
if buysell == "sell" then
|
||||
if chest_inv:contains_item("main", stack) and player_inv:contains_item("main", price) and
|
||||
chest_inv:room_for_item("main", price) and player_inv:room_for_item("main", stack) then
|
||||
player_inv:remove_item("main", price)
|
||||
stack = chest_inv:remove_item("main", stack)
|
||||
chest_inv:add_item("main", price)
|
||||
player_inv:add_item("main", stack)
|
||||
minetest.chat_send_player(sender:get_player_name(), "You bought item.")
|
||||
vendorgoldblock.sound_vend(pos)
|
||||
elseif chest_inv:contains_item("main", stack) and player_inv:contains_item("main", price) then
|
||||
minetest.chat_send_player(sender:get_player_name(), "No room in inventory!")
|
||||
else
|
||||
minetest.chat_send_player(sender:get_player_name(), "Not enough materials!")
|
||||
end
|
||||
else
|
||||
if chest_inv:contains_item("main", price) and player_inv:contains_item("main", stack) and
|
||||
chest_inv:room_for_item("main", stack) and player_inv:room_for_item("main", price) then
|
||||
stack = player_inv:remove_item("main", stack)
|
||||
chest_inv:remove_item("main", price)
|
||||
chest_inv:add_item("main", stack)
|
||||
player_inv:add_item("main", price)
|
||||
minetest.chat_send_player(sender:get_player_name(), "You sold item.")
|
||||
vendorgoldblock.sound_vend(pos)
|
||||
elseif chest_inv:contains_item("main", price) and player_inv:contains_item("main", stack) then
|
||||
minetest.chat_send_player(sender:get_player_name(), "No room in inventory!")
|
||||
else
|
||||
minetest.chat_send_player(sender:get_player_name(), "Not enough materials!")
|
||||
end
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(sender:get_player_name(), "Wrong chest!")
|
||||
end
|
||||
else
|
||||
if sender and sender:is_player() then
|
||||
minetest.chat_send_player(sender:get_player_name(), "Place chest under machine!")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--do transaction here
|
||||
|
||||
end
|
||||
|
||||
vendorgoldblock.after_place_node = function(pos, placer)
|
||||
local node = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local description = minetest.registered_nodes[node.name].description;
|
||||
local player_name = placer:get_player_name()
|
||||
inv:set_size("item", 1)
|
||||
inv:set_size("goldblock", 1)
|
||||
|
||||
inv:set_stack( "goldblock", 1, "default:goldblock" )
|
||||
|
||||
meta:set_string("infotext", player_name.." - "..description)
|
||||
meta:set_int("number", 1)
|
||||
meta:set_int("cost", 1)
|
||||
meta:set_string("itemname", "")
|
||||
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
|
||||
vendorgoldblock.set_formspec(pos, placer)
|
||||
end
|
||||
|
||||
vendorgoldblock.can_dig = function(pos, player)
|
||||
local chest = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
|
||||
local meta_chest = minetest.get_meta({x=pos.x,y=pos.y-1,z=pos.z});
|
||||
if chest.name=="default:chest_locked" then
|
||||
if player and player:is_player() then
|
||||
local owner_chest = meta_chest:get_string("owner")
|
||||
local name = player:get_player_name()
|
||||
if name == owner_chest then
|
||||
return true --chest owner can dig shop
|
||||
end
|
||||
end
|
||||
return false
|
||||
else
|
||||
return true --if no chest, enyone can dig this shop
|
||||
end
|
||||
end
|
||||
|
||||
vendorgoldblock.on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
|
||||
if sender:get_player_name() == owner then
|
||||
vendorgoldblock.on_receive_fields_owner(pos, formname, fields, sender)
|
||||
else
|
||||
vendorgoldblock.on_receive_fields_customer(pos, formname, fields, sender)
|
||||
end
|
||||
end
|
||||
|
||||
vendorgoldblock.sound_vend = function(pos)
|
||||
minetest.sound_play("vendor_vend", {pos = pos, gain = 1.0, max_hear_distance = 5,})
|
||||
end
|
||||
|
||||
|
||||
vendorgoldblock.allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
if listname=="item" then
|
||||
local meta = minetest.get_meta(pos);
|
||||
local owner = meta:get_string("owner")
|
||||
local name = player:get_player_name()
|
||||
if name == owner then
|
||||
local inv = meta:get_inventory()
|
||||
if stack==nil then
|
||||
inv:set_stack( "item", 1, nil )
|
||||
else
|
||||
inv:set_stack( "item", 1, stack:get_name() )
|
||||
end
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
vendorgoldblock.allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
return 0
|
||||
end
|
||||
|
||||
vendorgoldblock.allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
return 0
|
||||
end
|