Rename mobs mod to mcl_mobs
[MineClone/MineClone2.git] / mods / MAPGEN / tsm_railcorridors / gameconfig.lua
blobdf86f587825bde66aaac112839c709e537844d23
1 -- This file stores the various node types. This makes it easier to plug this mod into games
2 -- in which you need to change the node names.
4 -- Adapted for MineClone 2!
6 -- Node names (Don't use aliases!)
7 tsm_railcorridors.nodes = {
8 dirt = "mcl_core:dirt",
9 chest = "mcl_chests:chest",
10 rail = "mcl_minecarts:rail",
11 torch_floor = "mcl_torches:torch",
12 torch_wall = "mcl_torches:torch_wall",
13 cobweb = "mcl_core:cobweb",
14 spawner = "mcl_mobspawners:spawner",
17 local mg_name = minetest.get_mapgen_setting("mg_name")
19 if mg_name == "v6" then
20 -- In v6, wood is chosen randomly.
21 --[[ Wood types for the corridors. Corridors are made out of full wood blocks
22 and posts. For each corridor system, a random wood type is chosen with the chance
23 specified in per mille. ]]
24 tsm_railcorridors.nodes.corridor_woods = {
25 { wood = "mcl_core:wood", post = "mcl_fences:fence", chance = 900},
26 { wood = "mcl_core:darkwood", post = "mcl_fences:dark_oak_fence", chance = 100},
28 else
29 -- This generates dark oak wood in mesa biomes and oak wood everywhere else.
30 tsm_railcorridors.nodes.corridor_woods_function = function(pos, node)
31 if minetest.get_item_group(node.name, "hardened_clay") ~= 0 then
32 return "mcl_core:darkwood", "mcl_fences:dark_oak_fence"
33 else
34 return "mcl_core:wood", "mcl_fences:fence"
35 end
36 end
37 end
40 -- TODO: Use minecart with chest instead of normal minecart
41 tsm_railcorridors.carts = { "mcl_minecarts:minecart" }
43 function tsm_railcorridors.on_construct_cart(pos, cart)
44 -- TODO: Fill cart with treasures
45 end
47 -- Fallback function. Returns a random treasure. This function is called for chests
48 -- only if the Treasurer mod is not found.
49 -- pr: A PseudoRandom object
50 function tsm_railcorridors.get_default_treasure(pr)
51 -- UNUSED IN MINECLONE 2!
52 end
54 -- All spawners spawn cave spiders
55 function tsm_railcorridors.on_construct_spawner(pos)
56 mcl_mobspawners.setup_spawner(pos, "mobs_mc:cave_spider", 0, 7)
57 end
59 -- MineClone 2's treasure function. Gets all treasures for a single chest.
60 -- Based on information from Minecraft Wiki.
61 function tsm_railcorridors.get_treasures(pr)
62 local loottable = {
64 stacks_min = 1,
65 stacks_max = 1,
66 items = {
67 { itemstring = "mcl_mobs:nametag", weight = 30 },
68 { itemstring = "mcl_core:apple_gold", weight = 20 },
69 { itemstring = "mcl_books:book", weight = 10 }, -- TODO: Enchanted Book
70 { itemstring = "", weight = 5},
71 { itemstring = "mcl_core:pick_iron", weight = 5 },
72 { itemstring = "mcl_core:apple_gold", weight = 1 }, -- TODO: Enchanted Golden Apple
76 stacks_min = 2,
77 stacks_max = 4,
78 items = {
79 { itemstring = "mcl_farming:bread", weight = 15, amount_min = 1, amount_max = 3 },
80 { itemstring = "mcl_core:coal_lump", weight = 10, amount_min = 3, amount_max = 8 },
81 { itemstring = "mcl_farming:beetroot_seeds", weight = 10, amount_min = 2, amount_max = 4 },
82 { itemstring = "mcl_farming:melon_seeds", weight = 10, amount_min = 2, amount_max = 4 },
83 { itemstring = "mcl_farming:pumpkin_seeds", weight = 10, amount_min = 2, amount_max = 4 },
84 { itemstring = "mcl_core:iron_ingot", weight = 10, amount_min = 1, amount_max = 5 },
85 { itemstring = "mcl_dye:blue", weight = 5, amount_min = 4, amount_max = 9 },
86 { itemstring = "mesecons:redstone", weight = 5, amount_min = 4, amount_max = 9 },
87 { itemstring = "mcl_core:gold_ingot", weight = 5, amount_min = 1, amount_max = 3 },
88 { itemstring = "mcl_core:diamond", weight = 3, amount_min = 1, amount_max = 2 },
92 stacks_min = 3,
93 stacks_max = 3,
94 items = {
95 { itemstring = "mcl_minecarts:rail", weight = 20, amount_min = 4, amount_max = 8 },
96 { itemstring = "mcl_torches:torch", weight = 15, amount_min = 1, amount_max = 16 },
97 { itemstring = "mcl_minecarts:rail", weight = 5, amount_min = 1, amount_max = 4 }, -- TODO: Activator Rail
98 { itemstring = "mcl_minecarts:detector_rail", weight = 5, amount_min = 1, amount_max = 4 },
99 { itemstring = "mcl_minecarts:golden_rail", weight = 5, amount_min = 1, amount_max = 4 },
104 -- Bonus loot for v6 mapgen: Otherwise unobtainable saplings.
105 if mg_name == "v6" then
106 table.insert(loottable, {
107 stacks_min = 1,
108 stacks_max = 3,
109 items = {
110 { itemstring = "mcl_core:darksapling", weight = 1, amount_min = 1, amount_max = 3 },
111 { itemstring = "mcl_core:birchsapling", weight = 1, amount_min = 1, amount_max = 2 },
112 { itemstring = "", weight = 6 },
116 local items = mcl_loot.get_multi_loot(loottable, pr)
118 return items