added code

This commit is contained in:
Red_King_Cyclops 2019-08-11 18:14:06 +00:00
parent ad1fd6820f
commit 0299e66136
5 changed files with 1080 additions and 0 deletions

424
dimensions.lua Normal file
View File

@ -0,0 +1,424 @@
multidimensions.clear_dimensions() -- clear all dimensions
local ores={
["default:stone_with_coal"]=200,
["default:stone_with_iron"]=400,
["default:stone_with_copper"]=500,
["default:stone_with_gold"]=2000,
["default:stone_with_mese"]=10000,
["default:stone_with_diamond"]=20000,
["default:mese"]=40000,
["default:stone_with_metamese"]=40000,
["default:gravel"]={chance=3000,chunk=2,}
}
--Dinosaur Age Dimension
multidimensions.register_dimension("dinosaur_age",{
ground_ores = {
["default:fern_1"] = 2,
["default:fern_2"] = 4,
["default:fern_3"] = 8,
["default:junglegrass"] = 16,
["default:grass_5"] = 16,
["paleotest:Cycad"] = 32,
["paleotest:Horsetails"] = 32,
["time_travel:jungle_tree"] = 256,
},
stone_ores = table.copy(ores), -- works as above, but in stone
dirt_ores = {},
grass_ores = {},
air_ores = {},
water_ores = {},
sand_ores = {},
self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
dim_y = 2000, -- dimension start (don't change if you don't know what you're doing)
dim_height = 999, -- dimension height
dirt_start = 501, -- when dirt begins to appear (default is 501)
dirt_depth = 3, -- dirt depth
ground_limit = 530, -- ground y limit (ground ends here)
water_depth = 8, -- depth fron ground and down
enable_water = nil, -- (nil = true)
terrain_density = 0.4, -- or ground density
flatland = nil, -- (nil = false)
teleporter = false, -- (nil = true) dimension teleporter
gravity = 1, -- (1 = default) dimension gravity
stone = "default:stone",
dirt = "default:dirt",
grass = "default:dirt_with_coniferous_litter",
air = "air",
water = "default:water_source",
sand = "default:sand",
bedrock = "multidimensions:bedrock", -- at dimension edges
map = {
offset = 0,
scale = 1,
spread = {x=100,y=18,z=100},
seeddiff = 24,
octaves = 5,
persist = 0.7,
lacunarity = 1,
flags = "absvalue",
},
--[[
craft = { -- teleport craft recipe
{"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
{"default:wood","default:mese","default:wood",},
{"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
},
]]
--[[
on_generate=function(self,data,id,area,x,y,z)
if y <= self.dirt_start+5 then
data[id] = self.air
else
return
end
return data -- to return changes
end,
]]
-- data: active generating area (VoxelArea)
-- index: data index
-- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
----area: (VoxelArea:new({MinEd...})
sky = {{r=79, g=165, b=92},"plain",{}}, -- same as:set_sky()
on_enter=function(player) --on enter dimension
--pos = player:get_pos()
----pos.y = pos.y - 1
--if minetest.get_node({pos.x, pos.y-1, pos.z}) ~= "multidimensions:teleporter0" and minetest.get_node(pos) ~= "multidimensions:teleporter0" then
-- minetest.set_node(pos, {name="multidimensions:teleporter0"})
--end
end,
on_leave=function(player) --on leave dimension
end,
})
--Ice Age Dimension
multidimensions.register_dimension("ice_age",{
ground_ores = {
["default:snow"] = 100,
["time_travel:snowy_pine_tree"] = 8000,
},
stone_ores = table.copy(ores), -- works as above, but in stone
dirt_ores = {},
grass_ores = {},
air_ores = {},
water_ores = {},
sand_ores = {},
self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
dim_y = 3000, -- dimension start (don't change if you don't know what you're doing)
dim_height = 999, -- dimension height
dirt_start = 501, -- when dirt begins to appear (default is 501)
dirt_depth = 3, -- dirt depth
ground_limit = 530, -- ground y limit (ground ends here)
water_depth = 8, -- depth fron ground and down
enable_water = nil, -- (nil = true)
terrain_density = 0.4, -- or ground density
flatland = nil, -- (nil = false)
teleporter = false, -- (nil = true) dimension teleporter
gravity = 1, -- (1 = default) dimension gravity
stone = "default:stone",
dirt = "default:dirt",
grass = "default:dirt_with_snow",
air = "air",
water = "default:ice",
sand = "default:gravel",
bedrock = "multidimensions:bedrock", -- at dimension edges
map = {
offset = 0,
scale = 1,
spread = {x=100,y=18,z=100},
seeddiff = 24,
octaves = 5,
persist = 0.7,
lacunarity = 1,
flags = "absvalue",
},
--[[
craft = { -- teleport craft recipe
{"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
{"default:wood","default:mese","default:wood",},
{"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
},
]]
--[[
on_generate=function(self,data,id,area,x,y,z)
if y <= self.dirt_start+5 then
data[id] = self.air
else
return
end
return data -- to return changes
end,
]]
-- data: active generating area (VoxelArea)
-- index: data index
-- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
----area: (VoxelArea:new({MinEd...})
--sky = {{r=219, g=168, b=117},"plain",{}}, -- same as:set_sky()
on_enter=function(player) --on enter dimension
end,
on_leave=function(player) --on leave dimension
end,
})
--Prehistoric Australia Dimension
multidimensions.register_dimension("prehistoric_australia",{
ground_ores = {
["default:dry_grass_1"] = 25,
["time_travel:tree"] = 30000,
},
stone_ores = table.copy(ores), -- works as above, but in stone
dirt_ores = {},
grass_ores = {
["time_travel:australia_red_dirt"] = 100,
},
air_ores = {},
water_ores = {},
sand_ores = {
["default:water_source"] = 300,
},
self = {}, -- can contain everything, var like dirt="default:dirt" will be remade to dirt=content_id
dim_y = 4000, -- dimension start (don't change if you don't know what you're doing)
dim_height = 999, -- dimension height
dirt_start = 501, -- when dirt begins to appear (default is 501)
dirt_depth = 3, -- dirt depth
ground_limit = 530, -- ground y limit (ground ends here)
water_depth = 8, -- depth fron ground and down
enable_water = nil, -- (nil = true)
terrain_density = 0.4, -- or ground density
flatland = nil, -- (nil = false)
teleporter = false, -- (nil = true) dimension teleporter
gravity = 1, -- (1 = default) dimension gravity
stone = "default:stone",
dirt = "time_travel:australia_red_stone",
grass = "time_travel:australia_red_gravel",
air = "air",
water = "air",
sand = "time_travel:australia_red_sand",
bedrock = "multidimensions:bedrock", -- at dimension edges
map = {
offset = 0,
scale = 1,
spread = {x=100,y=18,z=100},
seeddiff = 24,
octaves = 5,
persist = 0.7,
lacunarity = 1,
flags = "absvalue",
},
--[[
craft = { -- teleport craft recipe
{"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
{"default:wood","default:mese","default:wood",},
{"default:obsidianbrick", "default:steel_ingot", "default:obsidianbrick"},
},
]]
--[[
on_generate=function(self,data,id,area,x,y,z)
if y <= self.dirt_start+5 then
data[id] = self.air
else
return
end
return data -- to return changes
end,
]]
-- data: active generating area (VoxelArea)
-- index: data index
-- self: {dim_start, dim_end, dim_height, ground_limit, heat, humidity, dirt, stone, grass, air, water, sand, bedrock ... and your inputs
----area: (VoxelArea:new({MinEd...})
--sky = {{r=219, g=168, b=117},"plain",{}}, -- same as:set_sky()
on_enter=function(player) --on enter dimension
end,
on_leave=function(player) --on leave dimension
end,
})
--Water Age Dimension
minetest.register_ore({
ore_type = "stratum",
ore = "multidimensions:bedrock",
wherein = "air",
--clust_scarcity = 9 * 9 * 9,
--clust_num_ores = 12,
--clust_size = 3,
y_min = 5000,
y_max = 5000,
--biomes = {},
np_stratum_thickness = {
offset = 8,
scale = 4,
spread = {x = 100, y = 100, z = 100},
seed = 17,
octaves = 3,
persist = 0.7
},
stratum_thickness = 1,
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:stone",
wherein = "air",
--clust_scarcity = 9 * 9 * 9,
--clust_num_ores = 12,
--clust_size = 3,
y_min = 5001,
y_max = 5500,
--biomes = {},
np_stratum_thickness = {
offset = 8,
scale = 4,
spread = {x = 100, y = 100, z = 100},
seed = 17,
octaves = 3,
persist = 0.7
},
stratum_thickness = 500,
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:sand",
wherein = "air",
--clust_scarcity = 9 * 9 * 9,
--clust_num_ores = 12,
--clust_size = 3,
y_min = 5501,
y_max = 5501,
--biomes = {},
np_stratum_thickness = {
offset = 8,
scale = 4,
spread = {x = 100, y = 100, z = 100},
seed = 17,
octaves = 3,
persist = 0.7
},
stratum_thickness = 1,
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:water_source",
wherein = "air",
--clust_scarcity = 9 * 9 * 9,
--clust_num_ores = 12,
--clust_size = 3,
y_min = 5502,
y_max = 5511,
--biomes = {},
np_stratum_thickness = {
offset = 8,
scale = 4,
spread = {x = 100, y = 100, z = 100},
seed = 17,
octaves = 3,
persist = 0.7
},
stratum_thickness = 10,
})
--[[
minetest.register_ore({
ore_type = "scatter",
ore = "time_travel:coral_reef",
wherein = "default:water_source",
clust_scarcity = 7 * 7 * 7,
clust_num_ores = 5,
clust_size = 1,
y_min = 5502,
y_max = 5502,
})
]]
--LBMs and ABMs
minetest.register_lbm({
name = "time_travel:tree_lbm",
run_at_every_load = true,
nodenames = {"time_travel:jungle_tree", "time_travel:snowy_pine_tree", "time_travel:tree"},
action = function(pos, node)
minetest.set_node(pos, {name = "air"})
local tree=""
if node.name=="time_travel:jungle_tree" then
tree=minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
elseif node.name=="time_travel:snowy_pine_tree" then
tree=minetest.get_modpath("default") .. "/schematics/snowy_pine_tree_from_sapling.mts"
elseif node.name=="time_travel:tree" then
tree=minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
end
minetest.place_schematic({x=pos.x,y=pos.y,z=pos.z}, tree, "random", {}, true)
end,
})
--[[
minetest.register_lbm({
name = "time_travel:coral_reef_lbm",
run_at_every_load = true,
nodenames = {"time_travel:coral_reef"},
action = function(pos, node)
--minetest.set_node(pos, {name = "default:water_source"})
local coral_reef=""
--if node.name=="time_travel:coral_reef" then
coral_reef=minetest.get_modpath("default") .. "/schematics/corals.mts"
--end
minetest.place_schematic(pos, coral_reef, "random", {}, true)
end
})
]]
minetest.register_abm({
nodenames = {"time_travel:australia_red_dirt"},
neighbors = {"default:water_source", "default:water_flowing"},
interval = 5.0,
chance = 1,
action = function(pos, node, active_object_count,
active_object_count_wider)
local pos = {x = pos.x, y = pos.y, z = pos.z}
minetest.set_node(pos, {name = "default:dirt"})
end
})

11
init.lua Normal file
View File

@ -0,0 +1,11 @@
dofile(minetest.get_modpath("time_travel") .. "/nodes.lua")
dofile(minetest.get_modpath("time_travel") .. "/dimensions.lua")
dofile(minetest.get_modpath("time_travel") .. "/spawning.lua")
--[[
List of dimensions:
water_age
dinosaur_age
prehistoric_australia
ice_age
]]

4
mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = time_travel
depends = default, multidimensions, paleotest, mobs
description = Adds in a craftable time machine that can be used to time travel to different time periods of Earth's history. You can now see paleotest's mobs in their natural habitats.
optional_depends = mesecons

426
nodes.lua Normal file
View File

@ -0,0 +1,426 @@
--technical stuff
minetest.register_node("time_travel:jungle_tree", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
minetest.register_node("time_travel:snowy_pine_tree", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
minetest.register_node("time_travel:tree", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
--minetest.register_node("time_travel:coral_reef", {drawtype="airlike",groups = {not_in_creative_inventory=1},})
--australia nodes taken from the australia mod
minetest.register_node("time_travel:australia_red_stone", {
description = "Australian Red Stone",
tiles = {"time_travel_aus_red_stone.png"},
groups = {cracky=3, stone=1},
drop = 'time_travel:australia_red_cobble',
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("time_travel:australia_red_cobble", {
description = "Australian Red cobblestone",
tiles = {"time_travel_aus_red_cobble.png"},
is_ground_content = false,
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
type = "cooking",
output = "time_travel:australia_red_stone",
recipe = "time_travel:australia_red_cobble",
--cooktime = 10,
})
minetest.register_node("time_travel:australia_red_gravel", {
description = "Australian Red Gravel",
tiles = {"time_travel_aus_red_gravel.png"},
groups = {crumbly=2, falling_node=1},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5},
dug = {name="default_gravel_footstep", gain=1.0},
}),
})
minetest.register_node("time_travel:australia_red_stonebrick", {
description = "Australian Red Stone Brick",
tiles = {"time_travel_aus_red_stonebrick.png"},
is_ground_content = false,
groups = {cracky=2, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = 'time_travel:australia_red_stonebrick 4',
recipe = {
{'time_travel:australia_red_stone', 'time_travel:australia_red_stone'},
{'time_travel:australia_red_stone', 'time_travel:australia_red_stone'},
}
})
minetest.register_node("time_travel:australia_red_dirt", {
description = "Australian Red Dirt",
tiles = {"time_travel_aus_red_dirt.png"},
groups = {crumbly=3,soil=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("time_travel:australia_red_sand", {
description = "Australian Red Sand",
tiles = {"time_travel_aus_red_sand.png"},
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
--metamese stuff
minetest.register_craftitem("time_travel:metamese_crystal", {
description = "Metamese Crystal",
inventory_image = "time_travel_metamese_crystal.png",
})
minetest.register_craftitem("time_travel:metamese_crystal_fragment", {
description = "Metamese Crystal Fragment",
inventory_image = "time_travel_metamese_crystal_fragment.png",
})
minetest.register_node("time_travel:stone_with_metamese", {
description = "Metamese Ore",
tiles = {"default_stone.png^time_travel_mineral_metamese.png"},
paramtype = "light",
groups = {cracky = 1},
drop = "time_travel:metamese_crystal",
sounds = default.node_sound_stone_defaults(),
light_source = 6,
})
minetest.register_node("time_travel:metamese_block", {
description = "Metamese Block",
tiles = {"time_travel_metamese_block.png"},
paramtype = "light",
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
light_source = 15,
})
minetest.register_craft({
output = 'time_travel:metamese_block',
recipe = {
{'time_travel:metamese_crystal', 'time_travel:metamese_crystal', 'time_travel:metamese_crystal'},
{'time_travel:metamese_crystal', 'time_travel:metamese_crystal', 'time_travel:metamese_crystal'},
{'time_travel:metamese_crystal', 'time_travel:metamese_crystal', 'time_travel:metamese_crystal'},
}
})
minetest.register_craft({
output = 'time_travel:metamese_crystal 9',
recipe = {
{'time_travel:metamese_block'},
}
})
minetest.register_craft({
output = 'time_travel:metamese_crystal_fragment 9',
recipe = {
{'time_travel:metamese_crystal'},
}
})
minetest.register_craft({
output = "time_travel:metamese_crystal",
recipe = {
{"time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment"},
{"time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment"},
{"time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment", "time_travel:metamese_crystal_fragment"},
}
})
minetest.register_ore({
ore_type = "scatter",
ore = "time_travel:stone_with_metamese",
wherein = "default:stone",
clust_scarcity = 36 * 36 * 36,
clust_num_ores = 3,
clust_size = 2,
y_min = -31000,
y_max = -1024,
})
--time travel stuff
minetest.register_craftitem("time_travel:time_core", {
description = "Time Core",
inventory_image = "time_travel_time_core.png",
})
minetest.register_craft({
output = "time_travel:time_core",
recipe = {
{"default:gold_ingot", "", "default:gold_ingot"},
{"", "time_travel:metamese_crystal", ""},
{"", "default:gold_ingot", ""},
}
})
minetest.register_node("time_travel:time_machine_inactive", {
description = "Inactive Time Machine",
tiles = {
"time_travel_time_machine_top_inactive.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"default_steel_block.png^time_travel_time_core.png",
},
--paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
--light_source = 15,
after_place_node = function(pos, placer, itemstack)
local meta=minetest.get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Time Machine: Water Age")
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
if itemstack:get_name() == "default:junglegrass" and itemstack:get_count() >= 1 then
local taken = itemstack:take_item(1)
local inv = player:get_inventory()
local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
local p = minetest.get_node(pos).param2
minetest.swap_node(pos, {name = "time_travel:time_machine_dinosaur_age",param2=p})
elseif itemstack:get_name() == "default:snow" and itemstack:get_count() >= 1 then
local taken = itemstack:take_item(1)
local inv = player:get_inventory()
local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
local p = minetest.get_node(pos).param2
minetest.swap_node(pos, {name = "time_travel:time_machine_ice_age",param2=p})
elseif itemstack:get_name() == "default:dry_shrub" and itemstack:get_count() >= 1 then
local taken = itemstack:take_item(1)
local inv = player:get_inventory()
local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
local p = minetest.get_node(pos).param2
minetest.swap_node(pos, {name = "time_travel:time_machine_prehistoric_australia",param2=p})
elseif itemstack:get_name() == "default:coral_skeleton" and itemstack:get_count() >= 1 then
local taken = itemstack:take_item(1)
local inv = player:get_inventory()
local added = inv:add_item("main", ItemStack({name = "multidimensions:teleporter0", count = 1}))
local p = minetest.get_node(pos).param2
minetest.swap_node(pos, {name = "time_travel:time_machine_water_age",param2=p})
end
end
})
minetest.register_craft({
output = "time_travel:time_machine_inactive",
recipe = {
{"default:steelblock", "default:mese_crystal", "default:steelblock"},
{"default:mese_crystal", "time_travel:time_core", "default:mese_crystal"},
{"default:steelblock", "default:mese_crystal", "default:steelblock"},
}
})
minetest.register_node("time_travel:time_machine_dinosaur_age", {
description = "Time Machine: Dinosaur Age",
tiles = {
{
name = "time_travel_time_machine_top_dinosaur_age_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.0,
},
},
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"default_steel_block.png^time_travel_time_core.png",
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
light_source = 15,
after_place_node = function(pos, placer, itemstack)
local meta=minetest.get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Time Machine: Dinosaur Age")
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=2000+501+1+2,z=pos.z}
if not minetest.is_protected(pos2, owner) then
multidimensions.move(player,pos2)
end
end,
mesecons = {
receptor = {state = "off"},
effector={
action_on=function(pos, node)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=2000+501+1+2,z=pos.z}
for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
multidimensions.move(ob,pos2)
end
return false
end
}
},
drop = "time_travel:time_machine_inactive"
})
minetest.register_node("time_travel:time_machine_ice_age", {
description = "Time Machine: Ice Age",
tiles = {
{
name = "time_travel_time_machine_top_ice_age_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.0,
},
},
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"default_steel_block.png^time_travel_time_core.png",
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
light_source = 15,
after_place_node = function(pos, placer, itemstack)
local meta=minetest.get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Time Machine: Ice Age")
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=3000+501+1+2,z=pos.z}
if not minetest.is_protected(pos2, owner) then
multidimensions.move(player,pos2)
end
end,
mesecons = {
receptor = {state = "off"},
effector={
action_on=function(pos, node)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=3000+501+1+2,z=pos.z}
for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
multidimensions.move(ob,pos2)
end
return false
end
}
},
drop = "time_travel:time_machine_inactive"
})
minetest.register_node("time_travel:time_machine_prehistoric_australia", {
description = "Time Machine: Prehistoric Australia",
tiles = {
{
name = "time_travel_time_machine_top_prehistoric_australia_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.0,
},
},
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"default_steel_block.png^time_travel_time_core.png",
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
light_source = 15,
after_place_node = function(pos, placer, itemstack)
local meta=minetest.get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Time Machine: Prehistoric Australia")
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=4000+501+1+2,z=pos.z}
if not minetest.is_protected(pos2, owner) then
multidimensions.move(player,pos2)
end
end,
mesecons = {
receptor = {state = "off"},
effector={
action_on=function(pos, node)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=4000+501+1+2,z=pos.z}
for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
multidimensions.move(ob,pos2)
end
return false
end
}
},
drop = "time_travel:time_machine_inactive"
})
minetest.register_node("time_travel:time_machine_water_age", {
description = "Time Machine: Water Age",
tiles = {
{
name = "time_travel_time_machine_top_water_age_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.0,
},
},
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"time_travel_time_machine_side.png",
"default_steel_block.png^time_travel_time_core.png",
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
light_source = 15,
after_place_node = function(pos, placer, itemstack)
local meta=minetest.get_meta(pos)
meta:set_string("owner",placer:get_player_name())
meta:set_string("infotext","Time Machine: Water Age")
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=5000+511+1+2,z=pos.z}
if not minetest.is_protected(pos2, owner) then
multidimensions.move(player,pos2)
end
end,
mesecons = {
receptor = {state = "off"},
effector={
action_on=function(pos, node)
local owner=minetest.get_meta(pos):get_string("owner")
local pos2={x=pos.x,y=5000+511+1+2,z=pos.z}
for i, ob in pairs(minetest.get_objects_inside_radius(pos, 5)) do
multidimensions.move(ob,pos2)
end
return false
end
}
},
drop = "time_travel:time_machine_inactive"
})

215
spawning.lua Normal file
View File

@ -0,0 +1,215 @@
--Dinosaur Age Animals
dinosaur_age_dimension_start = 2000
dinosaur_age_dimension_end = 2999
mobs:spawn({
name = "paleotest:brachiosaurus",
nodes = "default:dirt_with_coniferous_litter", --"default:fern_1",
neighbours = "group:flora",
min_light = 14, --1,
--max_light = 15,
interval = 60,
chance = 800, -- 8000 -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true, --nil,
})
mobs:spawn({
name = "paleotest:elasmosaurus",
nodes = "default:water_source",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:mosasaurus",
nodes = "default:water_source",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:pteranodon",
nodes = "air", --"default:water_source",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:sarcosuchus",
nodes = "default:water_source",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:spinosaurus",
nodes = "default:dirt_with_coniferous_litter",
neighbours = "group:flora",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:stegosaurus",
nodes = "default:dirt_with_coniferous_litter",
neighbours = "group:flora",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:triceratops",
nodes = "default:dirt_with_coniferous_litter",
neighbours = "group:flora",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:tyrannosaurus",
nodes = "default:dirt_with_coniferous_litter",
neighbours = "group:flora",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:velociraptor",
nodes = "default:dirt_with_coniferous_litter",
neighbours = "group:flora",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = dinosaur_age_dimension_start,
max_height = dinosaur_age_dimension_end,
day_toggle = true,
})
--Ice Age Animals
ice_age_dimension_start = 3000
ice_age_dimension_end = 3999
mobs:spawn({
name = "paleotest:dire_wolf",
nodes = "default:dirt_with_snow",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = ice_age_dimension_start,
max_height = ice_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:elasmotherium",
nodes = "default:dirt_with_snow",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = ice_age_dimension_start,
max_height = ice_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:mammoth",
nodes = "default:dirt_with_snow",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = ice_age_dimension_start,
max_height = ice_age_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:smilodon",
nodes = "default:dirt_with_snow",
min_light = 14,
interval = 60,
chance = 800, -- 15000
min_height = ice_age_dimension_start,
max_height = ice_age_dimension_end,
day_toggle = true,
})
--Perhistoric Australia Animals
prehistoric_australia_dimension_start = 4000
prehistoric_australia_dimension_end = 4999
mobs:spawn({
name = "paleotest:procoptodon",
nodes = "time_travel:australia_red_gravel",
neighbors = "group:dry_grass",
min_light = 14,
interval = 60,
chance = 100, -- 15000
min_height = prehistoric_australia_dimension_start,
max_height = prehistoric_australia_dimension_end,
day_toggle = true,
})
mobs:spawn({
name = "paleotest:thylacoleo",
nodes = "time_travel:australia_red_gravel",
neighbors = "group:dry_grass",
min_light = 14,
interval = 60,
chance = 100, -- 15000
min_height = prehistoric_australia_dimension_start,
max_height = prehistoric_australia_dimension_end,
day_toggle = true,
})
--Water Age Animals
water_age_dimension_start = 5000
water_age_dimension_end = 5999
mobs:spawn({
name = "paleotest:dunkleosteus",
nodes = "default:water_source",
min_light = 1,
interval = 1,
chance = 1, -- 15000
min_height = water_age_dimension_start,
max_height = water_age_dimension_end,
day_toggle = true,
})