Skip to content

Commit

Permalink
RTM will be pleased!
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaz1 committed Sep 25, 2014
1 parent f6eea41 commit 8974f39
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 71 deletions.
5 changes: 4 additions & 1 deletion mods/give_initial_stuff/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ minetest.register_on_newplayer(function(player)
print("on_newplayer")
minetest.log("action", "Giving initial stuff to player "..player:get_player_name())
player:get_inventory():add_item('main', 'default:pick_steel')
player:get_inventory():add_item('main', 'default:torch 99')
player:get_inventory():add_item('main', 'moontest:light_stick 99')
player:get_inventory():add_item('main', 'default:axe_steel')
player:get_inventory():add_item('main', 'default:shovel_steel')
player:get_inventory():add_item('main', 'default:wood 99')
Expand All @@ -18,3 +18,6 @@ minetest.register_on_newplayer(function(player)
end
end)

minetest.register_on_respawnplayer(function(player)
player:get_inventory():add_item('main', 'moontest:spacesuit')
end)
63 changes: 12 additions & 51 deletions mods/moontest/nodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -457,57 +457,6 @@ minetest.register_node("moontest:light_stick", {
sounds = default.node_sound_defaults(),
})

--define unlit torch
minetest.register_node("moontest:unlit_torch", {
description = "Unlit Torch",
drawtype = "torchlike",
tiles = {"moontest_unlit_torch_on_floor.png", "moontest_unlit_torch_on_ceiling.png", "moontest_unlit_torch.png"},
inventory_image = "default_torch_on_floor.png",
wield_image = "moontest_unlit_torch_on_floor.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
light_source = 0,
selection_box = {
type = "wallmounted",
wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
},
groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
--check if the player is holding a stick to relight it
if player:get_wielded_item():get_name() == "default:stick" then
--store whether the area is in a vacuum
local is_vacuum = false
--check in a three-node cube around the torch for vacuum
for x=-1,1 do
for y=-1,1 do
for z=-1,1 do
local vpos = {x=pos.x+x,y=pos.y+y,z=pos.z+z}
--this is a vacuum!
if minetest.get_node(vpos).name == "moontest:vacuum" then
is_vacuum = true
break
end
end
end
end
--if those loops didn't find vacuum, assume air
if is_vacuum ~= true then
local par2 = node.param2 --store the rotation of the old torch
minetest.set_node(pos, {name="default:torch", param2=par2})
else
print("this is a vacuum!") --you idiot!
end
end
end,
})

--
-- Ores
--
Expand Down Expand Up @@ -585,3 +534,15 @@ minetest.register_node("moontest:lunariumore", {
drop = "moontest:lunarium_lump",
sounds = default.node_sound_stone_defaults(),
})

minetest.register_alias("default:stone", "moontest:stone")
minetest.register_alias("default:cobble", "moontest:cobble")
minetest.register_alias("default:tree", "moontest:tree")
minetest.register_alias("default:torch", "moontest:light_stick")
minetest.register_alias("default:stone_with_coal", "moontest:phosphorusore")
minetest.register_alias("default:stone_with_iron", "moontest:ironore")
minetest.register_alias("default:stone_with_diamond", "moontest:diamondore")
minetest.register_alias("default:stone_with_copper", "moontest:copperore")



Binary file added mods/moontest/textures/moontest_cobble.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mods/moontest/textures/moontest_light_stick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mods/moontest/textures/moontest_light_stick_on_ceiling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mods/moontest/textures/moontest_light_stick_on_floor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 16 additions & 19 deletions mods/sky/init.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

-- Set time to midnight.
--[[ Set time to midnight.
minetest.register_on_joinplayer(function(player)
minetest.set_timeofday(0.22)
minetest.setting_set("time_speed", 0)
minetest.set_time_speed(0)
end)

]]--
-- Disable clouds and enable them again when player leaves the game. (Experimental)
minetest.register_on_joinplayer(function(player)
minetest.setting_set("enable_clouds", 0)
Expand All @@ -14,19 +13,17 @@ minetest.register_on_leaveplayer(function(player)
end)

-- Sky textures
if minetest.setting_get("newsky") == "1" then
minetest.register_on_joinplayer(function(player)
minetest.after(0, function()
skytextures ={
"sky_pos_y.png",
"sky_neg_y.png",
"sky_pos_z.png",
"sky_neg_z.png",
"sky_neg_x.png",
"sky_pos_x.png",
}

player:set_sky({r=0, g=0, b=0, a=0},"skybox", skytextures)
end)
minetest.register_on_joinplayer(function(player)
minetest.after(0, function()
skytextures ={
"sky_pos_y.png",
"sky_neg_y.png",
"sky_pos_z.png",
"sky_neg_z.png",
"sky_neg_x.png",
"sky_pos_x.png",
}
player:set_sky({r=0, g=0, b=0, a=0},"skybox", skytextures)
end)
end
end)

0 comments on commit 8974f39

Please sign in to comment.