too many to list, see changelog.

master
NathanSalapat 2017-05-14 20:00:15 -05:00
parent 3833f7bde1
commit 030b90c17c
64 changed files with 2109 additions and 156 deletions

View File

@ -1,5 +1,14 @@
2017-05-14:
Added the beach and snowy_tundra biomes.
Moved a few colboxes and models to common mod.
Added a corner rail to the spawn mod.
Fixed the outside corner mesh in the spawn mod.
Finally got around to creating a new player texture.
Added the mymonths mod, stripped most of the features, leaving just the bare bones.
2017-05-12:
Added Creative and SFinv from Minetest_game.
Created Common, which will house many common functions and bits of code.
2017-05-11:
Added Screwdriver mod from Minetest_game.

View File

@ -3,6 +3,12 @@ Any mod listed here that has contributors other than myself should have a licens
Commands:
Common:
Code
Nathan Salapat (LGPL 2.1)
Media
Nathan Salapat (CC BY-SA 3.0)
Creative:
Code
kilbith & celeron55 (MIT)
@ -14,8 +20,6 @@ Gamer:
With a few tweaks by Nathan Salapat (LGPL 2.1)
Media
gamer_model.b3d: MirceaKitsune (CC BY-SA 3.0)
gamer_skin.png: Jordach (CC BY-SA 3.0)
everything else: Nathan Salapat (CC BY-SA 3.0)
Ground:
Code

View File

@ -1,5 +1,8 @@
--Privs
minetest.register_privilege("msg", {
description = "private message players.",
give_to_singleplayer = false
})
--Commands
minetest.register_chatcommand("msg", {

12
mods/common/colbox.lua Normal file
View File

@ -0,0 +1,12 @@
common.colbox_stair = {
type = 'fixed',
fixed = {
{-.5, -.5, -.5, .5, 0, .5},
{-.5, 0, 0, .5, .5, .5},
}}
common.colbox_1_5_slab = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
}}

30
mods/common/formspec.lua Normal file
View File

@ -0,0 +1,30 @@
-- Create the trash field
local trash = minetest.create_detached_inventory("trash", {
-- Allow the stack to be placed and remove it in on_put()
-- This allows the creative inventory to restore the stack
allow_put = function(inv, listname, index, stack, player)
return stack:get_count()
end,
on_put = function(inv, listname)
inv:set_list(listname, {})
end,
})
trash:set_size("main", 1)
common.gui_bg = 'bgcolor[#080808BB;true]'
common.gui_bg_img = 'background[5,5;1,1;gui_background.png;true]'
common.gui_slots = 'listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]'
common.gui_survival_form = 'size[8,7.5]'..
common.gui_bg..
common.gui_bg_img..
common.gui_slots..
'list[current_player;main;0,3.5;8,1;]'..
'list[current_player;main;0,4.5;8,3;8]'..
'list[current_player;craft;0,0;3,3;]'..
'list[current_player;craftpreview;4,1;1,1;]'..
'image[3,1;1,1;common_arrow.png'..
'image[4,3.3;1,1;creative_trash_icon.png'..
'list[detached:trash;main;4,3.3;1,1;]'..
'listring[current_player;main]'..
'listring[current_player;craft]'

View File

4
mods/common/init.lua Normal file
View File

@ -0,0 +1,4 @@
common = {}
dofile(minetest.get_modpath('common')..'/colbox.lua')
dofile(minetest.get_modpath('common')..'/formspec.lua')

View File

Before

Width:  |  Height:  |  Size: 680 B

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

View File

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 390 B

View File

@ -1 +1,2 @@
common
sfinv

View File

@ -32,6 +32,7 @@ if creative_mode_cache then
snappy = caps,
choppy = caps,
oddly_breakable_by_hand = caps,
spawn = caps,
},
damage_groups = {fleshy = 10},
}

View File

@ -90,7 +90,7 @@ function creative.register_tab(name, title, items)
return sfinv.make_formspec(player, context,
"label[6.2,3.35;" .. minetest.colorize("#FFFF00", tostring(pagenum)) .. " / " .. tostring(pagemax) .. "]" ..
[[
image[4.06,3.4;0.8,0.8;creative_trash_icon.png]
image[4,3.3;1,1;creative_trash_icon.png]
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]
list[current_player;main;0,4.7;8,1;]
list[current_player;main;0,5.85;8,3;8]
@ -108,8 +108,8 @@ function creative.register_tab(name, title, items)
"field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" ..
"listring[detached:creative_" .. player_name .. ";main]" ..
"list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" ..
-- gamer.get_hotbar_bg(0,4.7) ..
gamer.gui_bg .. gamer.gui_bg_img .. gamer.gui_slots
-- common.get_hotbar_bg(0,4.7) ..
common.gui_bg .. common.gui_bg_img .. common.gui_slots
.. creative.formspec_add, false)
end,
on_enter = function(self, player, context)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 274 B

View File

@ -2,11 +2,11 @@ Authors of source code
----------------------
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
Various Minetest developers and contributors (LGPL 2.1)
With a few tweaks by Nathan Salapat
With a few tweaks by Nathan Salapat (LGPL 2.1)
-----Media-----
MirceaKitsune (CC BY-SA 3.0):
character.x
character.b3d
Jordach (CC BY-SA 3.0):
character.png

View File

@ -1,22 +1,5 @@
gamer = {}
-- GUI related stuff
gamer.gui_bg = 'bgcolor[#080808BB;true]'
gamer.gui_bg_img = 'background[5,5;1,1;gui_background.png;true]'
gamer.gui_slots = 'listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]'
gamer.gui_survival_form = 'size[8,7.5]'..
gamer.gui_bg..
gamer.gui_bg_img..
gamer.gui_slots..
'list[current_player;main;0,3.5;8,1;]'..
'list[current_player;main;0,4.5;8,3;8]'..
'list[current_player;craft;0,0;3,3;]'..
'list[current_player;craftpreview;4,1;1,1;]'..
'image[3,1;1,1;gui_furnace_arrow_bg.png^[transformR270]'..
'listring[current_player;main]'..
'listring[current_player;craft]'
minetest.register_item(':', {
type = 'none',
wield_image = 'wieldhand.png',
@ -127,7 +110,7 @@ minetest.register_on_joinplayer(function(player)
-- set GUI
if not minetest.setting_getbool('creative_mode') then
player:set_inventory_formspec(gamer.gui_survival_form)
player:set_inventory_formspec(common.gui_survival_form)
end
player:hud_set_hotbar_image('gui_hotbar.png')
player:hud_set_hotbar_selected_image('gui_hotbar_selected.png')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

1
mods/ground/depends.txt Normal file
View File

@ -0,0 +1 @@
common

View File

@ -47,8 +47,8 @@ minetest.register_biome({
--node_river_water = '',
node_riverbed = 'ground:sand',
depth_riverbed = 2,
y_min = 6,
y_max = 15,
y_min = 6, --lowest point possible for biome to exist.
y_max = 15, --highest point possible for biome to exist.
heat_point = 50,
humidity_point = 35,
})
@ -67,10 +67,10 @@ minetest.register_biome({
--node_river_water = "",
node_riverbed = "ground:sand",
depth_riverbed = 2,
y_min = 5,
y_min = 20,
y_max = 5,
heat_point = 50,
humidity_point = 35,
humidity_point = 45,
})
minetest.register_biome({
@ -87,8 +87,37 @@ minetest.register_biome({
--node_river_water = "",
node_riverbed = "ground:sand",
depth_riverbed = 2,
y_min = 5,
y_max = 5,
y_min = 30,
y_max = -10,
heat_point = 92,
humidity_point = 16,
})
minetest.register_biome({
name = 'snowy_tundra',
node_top = 'ground:dirt_with_snow',
depth_top = 1,
node_filler = 'ground:dirt',
depth_filler = 4,
node_stone = 'ground:desert_stone',
node_riverbed = 'ground:sand',
depth_riverbed = 1,
y_min = 12,
y_max = 60,
heat_point = 10,
humidity_point = 47,
})
minetest.register_biome({
name = 'beach',
node_top = 'ground:sand',
depth_top = 4,
node_filler = 'ground:gravel',
depth_filler = 10,
node_riverbed = 'ground:dirt',
depth_riverbed = 2,
y_min = -5,
y_max = 15,
heat_point = 65,
humidity_point = 70,
})

View File

@ -21,7 +21,7 @@ minetest.register_node('ground:gravel', {
minetest.register_node('ground:dirt', {
description = 'Dirt',
tiles = {'ground_dirt.png'},
groups = {crumbly=3},
groups = {crumbly=3, soil=1},
})
minetest.register_node('ground:dirt_with_grass', {
@ -51,21 +51,11 @@ minetest.register_node('ground:snowblock', {
minetest.register_node('ground:snow', {
description = 'Snow',
drawtype = 'mesh',
mesh = '2-10-slab.obj',
mesh = '1-5_slab.obj',
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
}
},
collision_box = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
}
},
selection_box = common.colbox_1_5_slab,
collision_box = common.colbox_1_5_slab,
tiles = {'ground_snow.png'},
groups = {crumbly=3, falling_node=1},
})

View File

@ -0,0 +1,22 @@
Year
12 months
14 days per month
2 weeks per month
7 days per week
4 seasons
42 days per season
function month(day)
return (((day - 35) % 168) / (168/12)) + 1
end
what needs saved
day_counter
month
month_counter
season
day_speed
night_speed

55
mods/mymonths/README Normal file
View File

@ -0,0 +1,55 @@
Mod is by Don and Nathan with optimizations from Snoopy.
Mymonths is licenced as DWYWPL
Fall leaf textures are modified from original default textures by Cisoun (WTFPL) and Paramat. (CC BY-SA 3.0)
The rain and snow code comes from the weather mod
from topic - https://forum.minetest.net/viewtopic.php?t=5245
by Jeija
- Code: LGPL
- Textures:
- Snow cover: WTFPL
- Rain / Snow: CC-BY-SA 3.0, credit goes to TeddyDesTodes, from his weather branch at https://github.com/TeddyDesTodes/minetest/tree/weather
- Sound Effects:
- mymonths_rain & mymonths_rain1: CC0 by Q.K.
This mod adds months, weeks and days to Minetest.
A Minetest year has 12 months with 2 weeks per month. Each week has 7 days.
The weather is depended on the time of year. If it is winter then it will snow spring has rain etc.
Leaves turn color in the fall and the the tree will have no leaves or apples through the winter.
The leaves grow back in the spring and the apples later in the year.
Acacia trees will bloom in January
The desert and savannah biomes do not get rain or snow but do have sand storms.
The snow biomes do not get rain.
The trees in these biomes do not loose their leaves.
Each morning at 6am a chat message will say the date. If the day is a holiday it will show in chat with the morning date.
If you are caught in a storm you will need to seek shelter. Rain or snow does nothing but if you are in a storm, snowstorm,
sandstorm or hail you will receive damage. You need to cover yourself so you do not receive damage.
Chat Commands
You need the priv mymonths to set mymonth things. You do not need it to check the weather.
/setweather rain,storm,snow,snowstorm,sandstorm,hail
/setmonth - can be either 1-12,January-December,january-december or jan-dec
/setday 1-14
No priv needed for these commands
/weather - tell you what the weather is
/date - tells you what the time and date is
/holidays - gives a list of holidays. These are Minetest holidays made up by me. I will not add real holidays.
Holidays were added to give players a bit of fun.

262
mods/mymonths/abms.lua Normal file
View File

@ -0,0 +1,262 @@
local function level_snow(pos, node, depth)
local sides = {
{x=pos.x - 1, y=pos.y, z=pos.z},
{x=pos.x - 1, y=pos.y, z=pos.z + 1},
{x=pos.x, y=pos.y, z=pos.z + 1},
{x=pos.x + 1, y=pos.y, z=pos.z + 1},
{x=pos.x + 1, y=pos.y, z=pos.z},
{x=pos.x + 1, y=pos.y, z=pos.z - 1},
{x=pos.x, y=pos.y, z=pos.z - 1},
{x=pos.x - 1, y=pos.y, z=pos.z - 1},
}
local snow_level = {}
snow_level["air"] = {"mymonths:snow_cover_1", 0}
snow_level["ground:snow"] = {"mymonths:snow_cover_3", 2}
snow_level["mymonths:snow_cover_1"] = {"mymonths:snow_cover_2", 1}
snow_level["mymonths:snow_cover_2"] = {"mymonths:snow_cover_3", 2}
snow_level["mymonths:snow_cover_3"] = {"mymonths:snow_cover_4", 3}
snow_level["mymonths:snow_cover_4"] = {"mymonths:snow_cover_5", 4}
snow_level["mymonths:snow_cover_5"] = {"ground:snowblock", 5}
for i = 1,8 do
local temp_node = minetest.get_node_or_nil(sides[i])
-- check if node exsists and block is solid
if temp_node ~= nil and snow_level[temp_node.name] ~= nil then
-- check the difference in snow heights
if snow_level[node.name][2] - snow_level[temp_node.name][2] > 2 then
-- shift the node down till it can be filled
if temp_node.name == "air" then
while minetest.get_node_or_nil({x=sides[i].x, y=sides[i].y - 1, z=sides[i].z}) ~= nil and
snow_level[minetest.get_node_or_nil({x=sides[i].x, y=sides[i].y - 1, z=sides[i].z}).name] ~= nil do
sides[i].y = sides[i].y - 1
end
if depth > 4 or level_snow(sides[i], temp_node, depth + 1) then
temp_node = minetest.get_node_or_nil(sides[i])
end
end
minetest.set_node(sides[i], {name = snow_level[temp_node.name][1]})
return false
end
end
end
return true
end
local function is_inside(pos)
if minetest.get_node_light({x=pos.x,y=pos.y+1,z=pos.z}, 0.5) ~= 15 then
return true
end
local temp_node = minetest.get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
for i = 2,50 do
if temp_node ~= nil and temp_node.name ~= "air" then
return true
end
temp_node = minetest.get_node_or_nil({x=pos.x,y=pos.y+i,z=pos.z})
end
return false
end
local function get_melt_prob(pos)
local list1 = minetest.find_nodes_in_area({x=pos.x-3,y=pos.y-2,z=pos.z-3},
{x=pos.x+3,y=pos.y+1,z=pos.z+3},{"ground:ice", "ground:snowblock"})
local list2 = minetest.find_nodes_in_area({x=pos.x-3,y=pos.y-2,z=pos.z-3},
{x=pos.x+3,y=pos.y+1,z=pos.z+3},{"mymonths:snow_cover_5",
"mymonths:snow_cover_4","mymonths:snow_cover_3","mymonths:snow_cover_2","mymonths:snow_cover_1"})
local list3 = minetest.find_nodes_in_area({x=pos.x-3,y=pos.y-2,z=pos.z-3},
{x=pos.x+3,y=pos.y+1,z=pos.z+3},{"ground:dirt_with_snow", "default:pine_tree"})
-- list1 is snow blocks and ice, list 2 is snow cover nodes, list3 is snow dirt and pine trees
local count = 2.25 * table.getn(list1) + table.getn(list2) + 2 * table.getn(list3)
local prob = 1 - count/196
prob = math.max(tonumber(string.format("%.2f", prob * 10)), 0.01)
prob = 1 / (prob / 200)
prob = math.min(tonumber(string.format("%04d", prob)), 1000)
return prob
end
--Places Snow on ground
if mymonths.snow_on_ground == true then
minetest.register_abm({
nodenames = {"group:leaves", "group:soil", "ground:snowblock"},
neighbors = {"air"},
interval = 8,
chance = 20,
action = function (pos, node)
if mymonths.weather == "snow" or mymonths.weather == "snowstorm" then
local biome_jungle = minetest.find_node_near(pos, 5, "default:jungletree", "default:junglegrass")
pos.y = pos.y + 1 -- check above node
local na = minetest.get_node(pos)
if biome_jungle == nil then
if not is_inside(pos) and na.name == "air" then
minetest.set_node(pos, {name = "mymonths:snow_cover_1"})
end
end
end
end
})
--Replace grass and flowers with snow
minetest.register_abm({
nodenames = {"group:flora", "mymonths:puddle", "group:plant"},
neighbors = {"air"},
interval = 8,
chance = 20,
action = function (pos, node)
if mymonths.weather == "snow" or mymonths.weather == "snowstorm" then
local biome_jungle = minetest.find_node_near(pos, 5, "default:jungletree","default:junglegrass")
if biome_jungle == nil then
if not is_inside(pos) then
minetest.set_node(pos, {name="mymonths:snow_cover_1"})
end
end
end
end
})
-- Changes snow to larger snow
minetest.register_abm({
nodenames = {"mymonths:snow_cover_1", "mymonths:snow_cover_2", "mymonths:snow_cover_3", "mymonths:snow_cover_4", "mymonths:snow_cover_5", "ground:snow"},
neighbors = {"group:soil", "ground:snowblock"},
interval = 20,
chance = 40,
action = function (pos, node)
if mymonths.weather2 == "snow" or mymonths.weather2 == "snowstorm" then
if mymonths.weather2 == "snow" and math.random(1, 4) ~= 1 then
return
end
if node.name == "mymonths:snow_cover_1" then
minetest.set_node(pos, {name = "mymonths:snow_cover_2"})
elseif node.name == "mymonths:snow_cover_2" or node.name == "ground:snow" then
minetest.set_node(pos, {name = "mymonths:snow_cover_3"})
elseif node.name == "mymonths:snow_cover_3" then
minetest.set_node(pos, {name = "mymonths:snow_cover_4"})
elseif node.name == "mymonths:snow_cover_4" then
minetest.set_node(pos, {name = "mymonths:snow_cover_5"})
elseif node.name == "mymonths:snow_cover_5" then
local depth = 2
local snow_biome = minetest.find_node_near(pos, 5, {"ground:ice"})
-- checks the number of snow blocks below to determine if snow is too deep
local count = 0
for i = 1, depth do
local new_pos_y = pos.y - i
local temp_node = minetest.get_node_or_nil({x=pos.x, y=new_pos_y, z=pos.z})
if temp_node ~= nil then
if temp_node.name == "ground:snowblock" then
count = count + 1
end
end
end
if level_snow(pos, node, 0) and (count ~= depth or snow_biome) then
minetest.set_node(pos, {name = "ground:snowblock"})
end
end
end
end
})
-- Snow Melting
minetest.register_abm({
nodenames = {"mymonths:snow_cover_1", "mymonths:snow_cover_2", "mymonths:snow_cover_3", "mymonths:snow_cover_4", "mymonths:snow_cover_5", "ground:snowblock", "ground:snow"},
neighbors = {"air"},
interval = 10,
chance = 1,
action = function (pos, node)
if mymonths.month_counter == 12 or mymonths.month_counter == 1 or mymonths.month_counter == 2 then
return
end
local melt_prob = get_melt_prob(pos)
if melt_prob == 1000 then
return
end
if math.random(1, melt_prob) == 1 then
-- check if there is any blocks above it
while minetest.get_node_or_nil({x=pos.x, y=pos.y + 1, z=pos.z}) and
minetest.get_node_or_nil({x=pos.x, y=pos.y + 1, z=pos.z}).name ~= "air" do
pos.y = pos.y + 1
node = minetest.get_node_or_nil(pos)
end
if node.name == "mymonths:snow_cover_2" or node.name == "ground:snow" then
minetest.set_node(pos, {name = "mymonths:snow_cover_1"})
elseif node.name == "mymonths:snow_cover_3" then
minetest.set_node(pos, {name = "mymonths:snow_cover_2"})
elseif node.name == "mymonths:snow_cover_4" then
minetest.set_node(pos, {name = "mymonths:snow_cover_3"})
elseif node.name == "mymonths:snow_cover_5" then
minetest.set_node(pos, {name = "mymonths:snow_cover_4"})
elseif node.name == "default:snowblock" then
minetest.set_node(pos, {name = "mymonths:snow_cover_5"})
elseif node.name == "mymonths:snow_cover_1" then
local nu = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nu.name == "ground:dirt_with_grass" or nu.name == "ground:dirt" then
minetest.set_node(pos, {name = "mymonths:puddle"})
else
minetest.remove_node(pos)
end
end
end
end
})
end -- END IF
if mymonths.use_puddles == true then
-- Makes Puddles when raining
minetest.register_abm({
nodenames = {"group:soil"},
neighbors = {"default:air"},
interval = 10,
chance = 50,
action = function (pos, node)
if mymonths.weather == "rain" then
-- return if puddle found nearby
if minetest.find_node_near(pos, 20, "mymonths:puddle") then
return
end
pos.y = pos.y + 1
-- otherwise place puddle in empty space
if minetest.get_node_light(pos, 0.5) == 15
and minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "mymonths:puddle"})
end
end
end
})
-- Makes puddles dry up when not raining
minetest.register_abm({
nodenames = {"mymonths:puddle"},
neighbors = {"air"},
interval = 5,
chance = 5,
action = function (pos, node)
if mymonths.weather == "clear" then
minetest.remove_node(pos)
elseif mymonths.weather == "snow"
or mymonths.weather == "snowstorm" then
minetest.set_node(pos, {name = "mymonths:snow_cover_1"})
end
end
})
end -- END IF

266
mods/mymonths/command.lua Normal file
View File

@ -0,0 +1,266 @@
--Sets the privs for changing settings
minetest.register_privilege("mymonths", {
description = "Change the weather and date",
give_to_singleplayer = false
})
-- Set weather
if mymonths.use_weather == true then
minetest.register_chatcommand("setweather", {
params = "<mymonths>",
description = "Set weather to rain, snow, wind or clear",
privs = {mymonths = true},
func = function(name, param)
if param == "rain"
or param == "storm"
or param == "snow"
or param == "snowstorm"
or param == "sandstorm"
or param == "hail"
or param == "clear" then
mymonths.weather = param
mymonths.save_table()
else
minetest.chat_send_player(name,
"invalid input - use rain, storm, snow, snowstorm, sandstorm, hail or clear.")
return
end
end
})
end -- END IF
--Set month
minetest.register_chatcommand("setmonth", {
params = "",
description = "Set the month. Use the number 1-12 or the name",
privs = {mymonths = true},
func = function(name, param)
if param == "1"
or param == "January"
or param == "january"
or param == "jan" then
mymonths.month = "January"
mymonths.month_counter = 1
minetest.chat_send_player(name," Month has been changed to January")
elseif param == "2"
or param == "February"
or param == "february"
or param == "feb" then
mymonths.month = "Febuary"
mymonths.month_counter = 2
minetest.chat_send_player(name, "Month has been changed to Febuary")
elseif param == "3"
or param == "March"
or param == "march"
or param == "mar" then
mymonths.month = "March"
mymonths.month_counter = 3
minetest.chat_send_player(name, "Month has been changed to March")
elseif param == "4"
or param == "April"
or param == "april"
or param == "apr" then
mymonths.month = "April"
mymonths.month_counter = 4
minetest.chat_send_player(name, "Month has been changed to April")
elseif param == "5"
or param == "May"
or param == "may" then
mymonths.month = "May"
mymonths.month_counter = 5
minetest.chat_send_player(name, "Month has been changed to May")
elseif param == "6"
or param == "June"
or param == "june"
or param == "jun" then
mymonths.month = "June"
mymonths.month_counter = 6
minetest.chat_send_player(name, "Month has been changed to June")
elseif param == "7"
or param == "July"
or param == "july"
or param == "jul" then
mymonths.month = "July"
mymonths.month_counter = 7
minetest.chat_send_player(name, "Month has been changed to July")
elseif param == "8"
or param == "August"
or param == "august"
or param == "aug" then
mymonths.month = "Augest"
mymonths.month_counter = 8
minetest.chat_send_player(name, "Month has been changed to August")
elseif param == "9"
or param == "September"
or param == "september"
or param == "sep" then
mymonths.month = "September"
mymonths.month_counter = 9
minetest.chat_send_player(name, "Month has been changed to September")
elseif param == "10"
or param == "October"
or param == "october"
or param == "oct" then
mymonths.month = "October"
mymonths.month_counter = 10
minetest.chat_send_player(name, "Month has been changed to October")
elseif param == "11"
or param == "November"
or param == "november"
or param == "nov" then
mymonths.month = "November"
mymonths.month_counter = 11
minetest.chat_send_player(name, "Month has been changed to November")
elseif param == "12"
or param == "December"
or param == "december"
or param == "dec"then
mymonths.month = "December"
mymonths.month_counter = 12
minetest.chat_send_player(name, "Month has been changed to December")
else
minetest.chat_send_player(name, "invalid input")
return
end
mymonths.save_table()
end
})
--Set Days
minetest.register_chatcommand("setday", {
params = "",
description = "Set the day of the month",
privs = {mymonths = true},
func = function(name, param)
local d = tonumber(param)
if d then
for day = 1, 14 do
if tonumber(param) >= 15 then
return
end
if tonumber(param) == day then
mymonths.day_counter = tonumber(day)
end
end
end
end
})
--Weather
if mymonths.use_weather == true then
minetest.register_chatcommand("weather", {
params = "",
description = "Tells player the weather",
func = function(name, param)
minetest.chat_send_player(name,"The weather is " .. mymonths.weather2)
end
})
end -- END IF
--Time and Date
minetest.register_chatcommand("date", {
params = "",
description = "Say the date in chat",
func = function(name, param)
local t = tostring(minetest.get_timeofday() * 2400)
local tt = string.find(t, "%p",1)
tt = tt or "0" -- if nil then force value
local th = string.sub(t, tt-4,tt-3)
local tm = string.sub(t, tt-2,tt-1)
local m = (tm/100)*60
local mx = m+1000
local my = ".00"
local mz = mx..my
local mf = string.find(mz, "%p",1)
local mi = string.sub(mx,mf-2,mf-1)
local ampm = "am"
th = th or 0 -- if nil then force value
if tonumber(th..tm) >= 1201
and tonumber(th) <= 2400 then
ampm = "pm"
th = th - 12
if th == 0 then
th = 12
end
else
ampm = "am"
if th == 0
or th == "" then
th = 12
end
end
minetest.chat_send_player(name, "The time is " ..th.. ":"
.. mi .. " " .. ampm .. " on " .. mymonths.day_name
.. " " .. mymonths.month .. " " .. mymonths.day_counter)
end
})
--Gives list of holidays
minetest.register_chatcommand("holidays", {
params = "",
description = "Say the date in chat",
func = function(name, param)
minetest.chat_send_player(name, "New Years Day - January 1")
minetest.chat_send_player(name, "Friendship Day - March 12")
minetest.chat_send_player(name, "Miners Day - April 10")
minetest.chat_send_player(name, "Minetest Day - June 5")
minetest.chat_send_player(name, "Builders Day - Augest 12")
minetest.chat_send_player(name, "Harvest Day - October 8")
minetest.chat_send_player(name, "New Years Eve - December 14")
end
})

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
Adds days of the week and months. Also weather, including rain and snow.

View File

@ -0,0 +1,58 @@
-- Save table to file
function mymonths.save_table()
local data = mymonths
local f, err = io.open(minetest.get_worldpath() .. "/mymonths_data", "w")
if err then
return err
end
f:write(minetest.serialize(data))
f:close()
end
-- Reads saved file
function mymonths.read_mymonths()
local f, err = io.open(minetest.get_worldpath() .. "/mymonths_data", "r")
local data = minetest.deserialize(f:read("*a"))
f:close()
return data
end
-- Saves the table every 10 seconds
local tmr = 0
minetest.register_globalstep(function(dtime)
tmr = tmr + dtime
if tmr >= 10 then
tmr = 0
mymonths.save_table()
end
end)
-- Check to see if file exists and if not sets default values.
local f, err = io.open(minetest.get_worldpath().."/mymonths_data", "r")
if f == nil then
mymonths.day_counter = 1
mymonths.month_counter = 6
mymonths.month = "June"
mymonths.weather = "clear"
mymonths.day_name = "Monday"
else
mymonths.day_counter = mymonths.read_mymonths().day_counter
mymonths.month_counter = mymonths.read_mymonths().month_counter
mymonths.month = mymonths.read_mymonths().month
mymonths.weather = mymonths.read_mymonths().weather
mymonths.day_name = mymonths.read_mymonths().day_name
end

55
mods/mymonths/init.lua Normal file
View File

@ -0,0 +1,55 @@
--Settings
mymonths = {}
--Turn damage on or off. This will make storms and hail cause damage to players
mymonths.damage = false
--You can turn weather off; this will put snow and puddles off too
mymonths.use_weather = true
--Have snow accumulate on the ground
mymonths.snow_on_ground = true
--Puddles appear when raining
mymonths.use_puddles = true
if minetest.get_modpath("lightning") then
lightning.auto = false
end
local modpath = minetest.get_modpath("mymonths")
local input = io.open(modpath .. "/settings.txt", "r")
if input then
dofile(modpath .. "/settings.txt")
input:close()
input = nil
end
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/abms.lua")
dofile(modpath .. "/command.lua")
dofile(modpath .. "/months.lua")
if mymonths.use_weather == true then
dofile(modpath .. "/weather.lua")
else
mymonths.snow_on_ground = false
mymonths.use_puddles = false
end
if mymonths.snow_on_ground == false then
minetest.register_alias("mymonths:snow_cover_1", "air")
minetest.register_alias("mymonths:snow_cover_2", "air")
minetest.register_alias("mymonths:snow_cover_3", "air")
minetest.register_alias("mymonths:snow_cover_4", "air")
minetest.register_alias("mymonths:snow_cover_5", "air")
end
if mymonths.use_puddles == false then
minetest.register_alias("mymonths:puddle", "air")
end

13
mods/mymonths/licence.txt Normal file
View File

@ -0,0 +1,13 @@
DO WHAT YOU WANT TO PUBLIC LICENSE
or abbreviated DWYWPL
December 2nd 2015
License Copyright (C) 2015 Michael Tomaino (PlatinumArts@gmail.com)
www.sandboxgamemaker.com/DWYWPL/
DO WHAT YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1. You are allowed to do whatever you want to with what content is using this license.
2. This content is provided 'as-is', without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this content.

1
mods/mymonths/mod.conf Normal file
View File

@ -0,0 +1 @@
name = mymonths

163
mods/mymonths/months.lua Normal file
View File

@ -0,0 +1,163 @@
local timechange = 0
local gm = 0
local gn = 0
-- Set holidays
local hol = {
{"12", 14, "It is New Years Eve!"},
{"1", 1, "It is New Years Day!"},
{"3", 12, "It is Friendship Day!"},
{"6", 5, "It is Minetest Day!"},
{"4", 10, "It is Miners Day!"},
{"8", 12, "It is Builders Day!"},
{"10", 8, "It is Harvest Day!"},
}
-- Set days
local days = {
{1, 8, 15, 22, "Monday"},
{2, 9, 16, 23, "Tuesday"},
{3, 10, 17, 24, "Wednesday"},
{4, 11, 18, 25, "Thursday"},
{5, 12, 19, 26, "Friday"},
{6, 13, 20, 27, "Saturday"},
{7, 14, 21, 28, "Sunday"},
}
-- this stops undeclared variable errors
local t1, t2, t3, t4, t5 = 0, 0, 0, 0, 0
-- Set months
local mon = {
{1, "January", t5, t1, .9},
{2, "February", t5, t1, .9},
{3, "March", t4, t2, 1},
{4, "April", t4, t2, 1},
{5, "May", t3, t3, 1},
{6, "June", t3, t3, 1.1},
{7, "July", t1, t5, 1.2},
{8, "August", t1, t5, 1.5},
{9, "September",t3, t3, 1},
{10, "October", t3, t3, 1},
{11, "November", t4, t2, .9},
{12, "December", t4, t2, .9},
}
-- Sets Month and length of day
local timer = 0
minetest.register_globalstep(function(dtime)
-- Checks every X seconds
timer = timer + dtime
--do not change because it will effect other values
if timer < 3 then
return
end
timer = 0
--Day Night Speeds (Thanks to sofar for this)
local dc = tonumber(mymonths.day_counter)
local mc = tonumber(mymonths.month_counter)
local x = ((mc-1)*28)+dc
local ratio = ((math.cos((x / 168) * 2 * math.pi) * 0.8) / 2.0) + 0.5
local nightratio = math.floor(72*(ratio+0.5))
local dayratio = math.floor(72/(ratio+0.5))
--Checks for morning
local time_in_seconds = minetest.get_timeofday() * 24000
if time_in_seconds >= 12001
and timechange == 0 then
timechange = 1
gm = 1
end
if time_in_seconds <= 12000
and timechange == 1 then
timechange = 0
mymonths.day_counter = mymonths.day_counter + 1
end
if mymonths.day_counter >= 29 then
mymonths.month_counter = mymonths.month_counter + 1
mymonths.day_counter = 1
end
if tonumber(mymonths.month_counter) == nil then
mymonths.monthcounter = 6
elseif tonumber(mymonths.month_counter) >= 13 then
mymonths.month_counter = 1
mymonths.day_counter = 1
end
-- Sets time speed in the morning
if time_in_seconds >= 6000
and time_in_seconds <= 12000
and gm == 1 then
minetest.setting_set("time_speed", dayratio)
minetest.chat_send_all("Good Morning! It is "..mymonths.day_name.." "..mymonths.month.." "..mymonths.day_counter)
--minetest.chat_send_all("Time speed is "..dayratio.." and "..nightratio)
---Holidays
for i in ipairs(hol) do
local h1 = hol[i][1]
local h2 = hol[i][2]
local h3 = hol[i][3]
if mymonths.month_counter == h1
and mymonths.day_counter == h2 then
minetest.chat_send_all(h3)
end
end
gm = 0
gn = 1
end
--Months
for i in ipairs(mon) do
local m1 = mon[i][1]
local m2 = mon[i][2]
local m3 = mon[i][3]
local m4 = mon[i][4]
local m5 = mon[i][5]
if mymonths.month_counter == m1 then
mymonths.month = m2
mymonths.day_speed = m3
mymonths.night_speed = m4
end
end
if time_in_seconds >= 22000
and time_in_seconds <= 24000
and gn == 1 then
minetest.setting_set("time_speed", nightratio)
gn = 0
end
-- Set the name of the day
for i in ipairs(days) do
local w1 = days[i][1]
local w2 = days[i][2]
local dy = days[i][3]
if mymonths.day_counter == w1
or mymonths.day_counter == w2 then
mymonths.day_name = dy
end
end
end)

35
mods/mymonths/roadmap.txt Normal file
View File

@ -0,0 +1,35 @@
Add more blocks that snow will land on
Add more items that change with the seasons
- dirt with grass - grass turns brown in the fall
- jungle trees have moss during the wet season (spring)
- acorns on pine trees in the fall
- flowers die in the fall and re grow in the spring
Add support for moretrees and plantlife.
- make deciduous trees leaves change
-
Add support for mobs
- Animals that hibernate would not spawn in the winter
- More rabbits in the late spring
Weather
- Make better weather textures
- Find a way to make weather work better/less lag
- make sky change when raining/snowing
- raindrops in water
- lightning
- better/more sounds
Months/Days
- make it so mods can register holidays
- make an easy api for other mods to use this
Farming
- making farming a seasonal thing
- crops only grow from april to oct
- make a greenhouse mod so crops can be grown year round
- make crops full maturity at the right time of year
- make crops yeild more since they will take longer to grow
- add support for other farming mods (farming redo, farmingplus, crops etc)

View File

@ -0,0 +1,23 @@
--Turn damage on or off. This will make storms and hail cause damage
mymonths.damage = false
------------------------------------------------------------------------
--You can turn weather off
mymonths.use_weather = true
------------------------------------------------------------------------
--Leaves change color in the fall.
mymonths.leaves = true
------------------------------------------------------------------------
--Have snow accumulate on the ground
mymonths.snow_on_ground = true
------------------------------------------------------------------------
--Puddles appear when raining
mymonths.use_puddles = true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

676
mods/mymonths/weather.lua Normal file
View File

@ -0,0 +1,676 @@
local function is_inside(pos)
if minetest.get_node_light({x=pos.x,y=pos.y+1,z=pos.z}, 0.5) ~= 15 then
return true
end
local temp_node = minetest.get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
for i = 2,50 do
if temp_node ~= nil and temp_node.name ~= "air" then
return true
end
temp_node = minetest.get_node_or_nil({x=pos.x,y=pos.y+i,z=pos.z})
end
return false
end
--Sets the weather types for each month
local t = 0
minetest.register_globalstep(function(dtime)
local month = mymonths.month_counter
t = t + dtime
if t < 5 then
return
end
t = 0
if minetest.get_modpath("lightning") then
if mymonths.weather == "storm" then
lightning.strike()
end
end
if mymonths.weather ~= "clear" then
if math.random(1, 100) == 1 then
mymonths.weather = "clear"
minetest.chat_send_all("Clear skys!")
end
else
-- January
if tonumber(month) == 1 then
if math.random(1, 2000) == 1 then
mymonths.weather = "snow"
minetest.chat_send_all("It is Snowing")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "snowstorm"
minetest.chat_send_all("It's a Snow Storm")
end
-- February
elseif tonumber(month) == 2 then
if math.random(1, 1000) == 1 then
mymonths.weather = "snow"
minetest.chat_send_all("It is Snowing")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "snowstorm"
minetest.chat_send_all("It's a Snow storm")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "hail"
minetest.chat_send_all("It is Hailing")
end
-- March
elseif tonumber(month) == 3 then
if math.random(1, 1000) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 2500) == 2 then
mymonths.weather = "snow"
minetest.chat_send_all("It is Snowing")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "hail"
minetest.chat_send_all("It is Hailing")
end
-- April
elseif tonumber(month) == 4 then
if math.random(1, 1000) == 1 then
mymonths.weather = "rain"
end
-- May
elseif tonumber(month) == 5 then
if math.random(1, 1500) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "storm"
minetest.chat_send_all("It's a Storm")
end
-- June
elseif tonumber(month) == 6 then
if math.random(1, 5000) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "storm"
minetest.chat_send_all("It's a Storm")
end
-- July
elseif tonumber(month) == 7 then
if math.random(1, 5000) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "storm"
minetest.chat_send_all("It's a Storm")
end
-- August
elseif tonumber(month) == 8 then
if math.random(1, 5000) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "storm"
minetest.chat_send_all("It's a Storm")
end
-- September
elseif tonumber(month) == 9 then
if math.random(1, 1500) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 2500) == 1 then
mymonths.weather = "storm"
minetest.chat_send_all("It's a Storm")
end
-- October
elseif tonumber(month) == 10 then
if math.random(1, 1000) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 2500) == 1 then
mymonths.weather = "storm"
minetest.chat_send_all("It's a Storm")
end
-- November
elseif tonumber(month) == 11 then
if math.random(1, 1000) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 2000) == 2 then
mymonths.weather = "snow"
minetest.chat_send_all("It is Snowing")
end
-- December
elseif tonumber(month) == 12 then
if math.random(1, 2500) == 1 then
mymonths.weather = "rain"
minetest.chat_send_all("It is Raining")
elseif math.random(1, 1000) == 1 then
mymonths.weather = "snow"
minetest.chat_send_all("It is Snowing")
elseif math.random(1, 5000) == 1 then
mymonths.weather = "hail"
minetest.chat_send_all("It is Hailing")
end
end
end
end)
-- Weather vectors and some particles are from jeija's weather mod
addvectors = function (v1, v2)
return {x = v1.x + v2.x, y = v1.y + v2.y, z = v1.z + v2.z}
end
hp_t = 0
--structure:
--[[
active_particlespawners = {
[player_name] = {
pSpawnerId1,
pSpawnerId2,
...
pSpawnerIdn
}
}
]]--
mymonths.active_particlespawners={}
--used to determine if to remove old and add new particle spawners
mymonths.last_weather2="none"
function mymonths.update_weather_particles(player)
mymonths.remove_weather_particles(player)
local name=player:get_player_name()
local minp = {x = -20, y = 7, z = -20}
local maxp = {x = 20, y = 7, z = 20}
local minps = {x =-20, y = 0, z = -20}
local maxps = {x = 20, y = 3, z = 20}
local minp_deep = {x = -20, y = 3.2, z = -20}
local maxp_deep = {x = 20, y = 2.6, z = 20}
local vel_rain = {x = 0, y = -4, z = 0}
local acc_rain = {x = 0, y = -9.81, z = 0}
local vel_snow = {x = 0, y = -0.4, z = 0}
local acc_snow = {x = 0, y = -0.5, z = 0}
local vel_sand = {x = 1, y = -0.1, z = 0}
local acc_sand = {x = 2, y = 0, z = 0}
local l={}
if mymonths.weather2 == "storm" then
l[1] = minetest.add_particlespawner({
amount = 4000,
time = 0,
minpos = minp,
maxpos = maxp,
minvel = vel_rain,
maxvel = vel_rain,
minacc = acc_rain,
maxacc = acc_rain,
minexptime = 0.8,
maxexptime = 0.8,
minsize = 25,
maxsize = 40,
collisiondetection = false,
vertical = true,
texture = "weather_rain_dark.png",
playername = name,
attached = player
})
elseif mymonths.weather2 == "rain" then
l[1] = minetest.add_particlespawner({
amount = 1500,
time = 0,
minpos = minp,
maxpos = maxp,
minvel = vel_rain,
maxvel = vel_rain,
minacc = acc_rain,
maxacc = acc_rain,
minexptime = 0.6,
maxexptime = 0.8,
minsize = 25,
maxsize = 25,
collisiondetection = false,
vertical = true,
texture = "weather_rain.png",
playername = name,
attached = player
})
elseif mymonths.weather2 == "snow" then
l[1] = minetest.add_particlespawner({
amount = 400,
time = 0,
minpos = minp,
maxpos = maxp,
minvel = vel_snow,
maxvel = vel_snow,
minacc = acc_snow,
maxacc = acc_snow,
minexptime = 4,
maxexptime = 8,
minsize = 15,
maxsize = 25,
collisiondetection = false,
vertical = true,
texture = "weather_snow.png",
playername = name,
attached = player
})
l[2] = minetest.add_particlespawner({
amount = 400,
time = 0,
minpos = minp_deep,
maxpos = maxp_deep,
minvel = vel_snow,
maxvel = vel_snow,
minacc = acc_snow,
maxacc = acc_snow,
minexptime = 4,
maxexptime = 6,
minesize = 15,
maxsize = 25,
collisiondetection = false,
vertical = true,
texture = "weather_snow.png",
playername = name,
attached = player
})
elseif mymonths.weather2 == "snowstorm" then
l[1] = minetest.add_particlespawner({
amount = 2500,
time = 0,
minpos = minp,
maxpos = maxp,
minvel = vel_snow,
maxvel = vel_snow,
minacc = acc_snow,
maxacc = acc_snow,
minexptime = 4,
maxexptime = 6,
minesize = 15,
maxsize = 35,
collisiondetection = false,
vertical = true,
texture = "weather_snow.png",
playername = name,
attached = player
})
l[2] = minetest.add_particlespawner({
amount = 2500,
time = 0,
minpos = minp_deep,
maxpos = maxp_deep,
minvel = vel_snow,
maxvel = vel_snow,
minacc = acc_snow,
maxacc = acc_snow,
minexptime = 4,
maxexptime = 6,
minesize = 15,
maxsize = 25,
collisiondetection = false,
vertical = true,
texture = "weather_snow.png",
playername = name,
attached = player
})
elseif mymonths.weather2 == "sandstorm" then
l[1] = minetest.add_particlespawner({
amount = 3500,
time = 0,
minpos = minps,
maxpos = maxps,
minvel = vel_sand,
maxvel = vel_sand,
minacc = acc_sand,
maxacc = acc_sand,
minexptime = 4,
maxexptime = 4,
minesize = 5,
maxsize = 10,
collisiondetection = false,
vertical = true,
texture = "weather_sand.png",
playername = name,
attached = player
})
elseif mymonths.weather2 == "hail" then
l[1] = minetest.add_particlespawner({
amount = 3500,
time = 0,
minpos = minp,
maxpos = maxp,
minvel = vel_rain,
maxvel = vel_rain,
minacc = acc_rain,
maxacc = acc_rain,
minexptime = 1,
maxexptime = 1,
minesize = 5,
maxsize = 10,
collisiondetection = true,
vertical = true,
texture = "weather_hail.png",
playername = name,
attached = player
})
end
mymonths.active_particlespawners[name]=l
end
function mymonths.remove_weather_particles(player)
local pname=player:get_player_name()
if not mymonths.active_particlespawners[pname] then return end
for _,pid in ipairs(mymonths.active_particlespawners[pname]) do
minetest.delete_particlespawner(pid)
end
mymonths.active_particlespawners[pname]={}
end
minetest.register_on_joinplayer(function()
--enforce weather particle re-initialization on next step
mymonths.last_weather2=""
end)
minetest.register_globalstep(function(dtime)
hp_t = hp_t + dtime
if hp_t <= 0.2 then
return
end
mymonths.weather2 = mymonths.weather
for _, player in ipairs(minetest.get_connected_players()) do
local ppos = player:getpos()
local hp = player:get_hp()
local name = player:get_player_name()
local nodein = minetest.get_node(ppos)
local nodeu = minetest.get_node({x = ppos.x, y = ppos.y - 1, z = ppos.z})
local biome_jungle = minetest.find_node_near(ppos, 8, "default:jungletree", "default:junglegrass")
local biome_desert = minetest.find_node_near(ppos, 8, "default:desert_sand", "default:desert_stone")
local biome_snow = minetest.find_node_near(ppos, 8, "default:snow", "default:snowblock", "default:dirt_with_snow",
"default:ice", "default:pine_tree", "mymonths:snow_cover_5")
-- slows players walk in snow
if nodein.name == "mymonths:snow_cover_1" then
player:set_physics_override(0.95, 1, 1, true, false)
elseif nodein.name == "mymonths:snow_cover_2" then
player:set_physics_override(0.8, 1, 1, true, false)
elseif nodein.name == "mymonths:snow_cover_3" then
player:set_physics_override(0.65, 1, 1, true, false)
elseif nodein.name == "mymonths:snow_cover_4" then
player:set_physics_override(0.5, 1, 1, true, false)
elseif nodein.name == "mymonths:snow_cover_5" then
player:set_physics_override(0.35, 1, 1, true, false)
else
player:set_physics_override(1, 1, 1, true, false)
end
-- checks if there is any weather
if mymonths.weather2 == "none" then
return
end
-- check light to make sure player is outside
if is_inside(ppos) then
return
end
-- changes weather based on biome
-- Jungle
if biome_jungle ~= nil then
if mymonths.weather == "snow" then
mymonths.weather2 = "rain"
elseif mymonths.weather == "snowstorm"
or mymonths.weather == "hail" then
mymonths.weather2 = "storm"
end
-- Desert
elseif biome_desert ~= nil then
if mymonths.weather == "snow"
or mymonths.weather == "rain" then
mymonths.weather2 = "clear"
elseif mymonths.weather == "snowstorm"
or mymonths.weather == "hail"
or mymonths.weather == "storm" then
mymonths.weather2 = "sandstorm"
end
-- Snow
elseif biome_snow ~= nil then
if mymonths.weather == "rain" then
mymonths.weather2 = "snow"
elseif mymonths.weather == "storm" then
mymonths.weather2 = "snowstorm"
end
else
mymonths.weather2 = mymonths.weather
end
if mymonths.weather2 ~= mymonths.last_weather2 then
mymonths.update_weather_particles(player)
mymonths.last_weather2 = mymonths.weather2
end
if mymonths.weather2 == "storm" then
if not is_inside(ppos) and mymonths.damage == true then
if hp_t >= 15 then
player:set_hp(hp - 1)
hp_t = 0
end
end
if math.random(1, 200) == 1 then
minetest.sound_play("mymonths_thunder", {
pos = ppos,
max_hear_distance = 10,
gain = 10.0,
})
end
elseif mymonths.weather2 == "snowstorm" then
if not is_inside(ppos) and mymonths.damage == true then
if hp_t >= 15 then
player:set_hp(hp - 1)
hp_t = 0
end
end
elseif mymonths.weather2 == "sandstorm" then
if not is_inside(ppos) and mymonths.damage == true then
if hp_t >= 15 then
player:set_hp(hp - 1)
hp_t = 0
end
end
elseif mymonths.weather2 == "hail" then
if not is_inside(ppos) and mymonths.damage == true then
if hp_t >= 15 then
player:set_hp(hp - 1)
hp_t = 0
end
end
end
biome_jungle = nil
biome_snow = nil
biome_desert = nil
end
end)
local t2 = 0
minetest.register_globalstep(function(dtime)
for _, player in ipairs(minetest.get_connected_players()) do
local ppos = player:getpos()
t2 = t2 + dtime
if t2 < 1 then
return
end
t2 = 0
if mymonths.weather2 == "rain"
or mymonths.weather2 == "storm" then
minetest.sound_play("mymonths_rain1", {
pos = ppos,
max_hear_distance = 10,
gain = 2.0,
})
end
end
end)
--Puddle node
local puddle_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.375, 0.125, -0.4875, 0.3125},
{-0.25, -0.5, -0.3125, 0.3125, -0.4925, 0.25},
{-0.3125, -0.5, -0.1875, 0.375, -0.4975, 0.1875},
}
}
minetest.register_node("mymonths:puddle", {
tiles = {"weather_puddle.png"},
drawtype = "nodebox",
paramtype = "light",
pointable = false,
buildable_to = true,
alpha = 50,
node_box = puddle_box,
selection_box = puddle_box,
groups = {not_in_creative_inventory = 1, crumbly = 3, attached_node = 0, falling_node = 1},
drop = "",
})
--Snow Nodes
local snow = {
{"mymonths:snow_cover_1","1", -0.4},
{"mymonths:snow_cover_2","2", -0.2},
{"mymonths:snow_cover_3","3", 0},
{"mymonths:snow_cover_4","4", 0.2},
{"mymonths:snow_cover_5","5", 0.5},
}
for i in ipairs(snow) do
local itm = snow[i][1]
local num = snow[i][2]
local box = snow[i][3]
minetest.register_node(itm, {
tiles = {"weather_snow_cover.png"},
drawtype = "nodebox",
paramtype = "light",
buildable_to = true,
walkable = false,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, box, 0.5}
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, box, 0.5}
},
groups = {not_in_creative_inventory = 0, crumbly = 3, attached_node = 0, falling_node = 1},
drop = "default:snow " .. num,
})
end

View File

@ -35,17 +35,17 @@ function sfinv.get_nav_fs(player, context, nav, current_idx)
end
end
local theme_main = "bgcolor[#080808BB;true]" .. gamer.gui_bg ..
gamer.gui_bg_img
local theme_main = "bgcolor[#080808BB;true]" .. common.gui_bg ..
common.gui_bg_img
local theme_inv = gamer.gui_slots .. [[
list[current_player;main;0,4.7;8,1;]
list[current_player;main;0,5.85;8,3;8]
local theme_inv = common.gui_slots .. [[
list[current_player;main;0,3.5;8,1;]
list[current_player;main;0,4.5;8,3;8]
]]
function sfinv.make_formspec(player, context, content, show_inv, size)
local tmp = {
size or "size[8,8.6]",
size or "size[8,7.5]",
theme_main,
sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx),
content

View File

@ -1 +1 @@
gamer
common

View File

@ -4,19 +4,13 @@ sfinv.register_page("sfinv:crafting", {
title = "Crafting",
get = function(self, player, context)
return sfinv.make_formspec(player, context, [[
list[current_player;craft;1.75,0.5;3,3;]
list[current_player;craftpreview;5.75,1.5;1,1;]
image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]
list[current_player;craft;0,0;3,3;]
list[current_player;craftpreview;4,1;1,1;]
image[3,1;1,1;common_arrow.png]
image[7,2;1,1;creative_trash_icon.png]
list[detached:trash;main;7,2;1,1;]
listring[current_player;main]
listring[current_player;craft]
image[0,4.75;1,1;gui_hb_bg.png]
image[1,4.75;1,1;gui_hb_bg.png]
image[2,4.75;1,1;gui_hb_bg.png]
image[3,4.75;1,1;gui_hb_bg.png]
image[4,4.75;1,1;gui_hb_bg.png]
image[5,4.75;1,1;gui_hb_bg.png]
image[6,4.75;1,1;gui_hb_bg.png]
image[7,4.75;1,1;gui_hb_bg.png]
]], true)
end
})

Binary file not shown.

Binary file not shown.

View File

@ -33,8 +33,9 @@ wall_computer_status =
minetest.register_node('spawn:wall_computer', {
description = 'Spaceship computer',
tiles = {'spawn_wall.png'},
tiles = {'spawn_wall.png', 'spawn_wall.png', 'spawn_wall.png', 'spawn_wall.png', 'spawn_wall.png',{name = 'spawn_wall.png^spawn_wall_computer.png', tileable_vertical = false}},
groups = {spawn=1},
paramtype2 = 'facedir',
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string('formspec', wall_computer_home)

1
mods/spawn/depends.txt Normal file
View File

@ -0,0 +1 @@
common

View File

@ -28,14 +28,6 @@ local colbox_floor_angle = {
}
}
local colbox_ramp_2 = {
type = 'fixed',
fixed = {
{-.5, -.5, -.5, .5, 0, .5},
{-.5, 0, 0, .5, .5, .5},
}
}
local colbox_ramp_1 = {
type = 'fixed',
fixed = {
@ -77,8 +69,8 @@ minetest.register_node('spawn:ramp2', {
paramtype = "light",
paramtype2 = "facedir",
light_source = 2,
selection_box = colbox_ramp_2,
collision_box = colbox_ramp_2,
selection_box = common.colbox_stair,
collision_box = common.colbox_stair,
tiles = {'spawn_floor_blank.png'},
groups = {spawn=1}
})
@ -89,8 +81,8 @@ minetest.register_node('spawn:stairs', {
mesh = 'spawn_stairs.obj',
paramtype = "light",
paramtype2 = "facedir",
selection_box = colbox_ramp_2,
collision_box = colbox_ramp_2,
selection_box = common.colbox_stair,
collision_box = common.colbox_stair,
tiles = {'spawn_rail_blank.png', 'spawn_floor_blank.png'},
groups = {spawn=1}
})

View File

@ -1,49 +1,49 @@
# Blender v2.77 (sub 1) OBJ File: 'SpaceShip.blend'
# Blender v2.78 (sub 4) OBJ File: 'SpaceShip.blend'
# www.blender.org
o Edge_Corner_Outside_Cube.003
v 0.500000 0.400000 -0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 0.200000 0.500000
v 0.500000 0.500000 0.500000
v -0.500000 0.400000 -0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 0.200000 -0.500000
v 0.500000 0.500000 -0.500000
v -0.500000 0.400000 0.500000
v -0.500000 0.500000 0.500000
vt 0.0000 1.0000
vt 1.0000 1.0000
vt 1.0000 0.0000
vt 0.0000 0.0000
vt 1.0000 1.0000
vt 0.0000 1.0000
vt 0.0000 0.0000
vt 1.0000 0.0000
vt 0.6033 0.9961
vt 0.7035 0.9961
vt 0.7035 0.0000
vt 0.4027 0.0000
vt 0.7025 0.0000
vt 1.0000 0.0000
vt 0.9008 1.0000
vt 0.1008 1.0000
vt 0.0000 1.0000
vt 0.0000 -0.0000
vt 0.1008 -0.0000
vt 0.2057 1.0000
vt 0.1065 1.0000
vt 0.1065 0.0000
vt 0.4040 0.0000
vn -0.0990 -0.9901 -0.0990
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.0000 0.0000 1.0000
vn -1.0000 0.0000 -0.0000
v 0.500000 0.400000 0.500000
v 0.500000 0.500000 0.500000
vt -0.000000 0.000000
vt 0.000000 1.000000
vt 1.000000 1.000000
vt 1.000000 -0.000000
vt 0.000000 1.000000
vt -0.000000 0.000000
vt 1.000000 -0.000000
vt 1.000000 1.000000
vt 0.603269 0.996063
vt 0.703532 0.996063
vt 0.703532 0.000000
vt 0.402743 0.000000
vt 0.702497 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.900832 1.000000
vt 0.100848 1.000000
vt 0.000000 -0.000000
vt 0.100848 -0.000000
vt 0.205699 1.000000
vt 0.106532 1.000000
vt 0.106532 0.000000
vt 0.404035 0.000000
vn -0.0990 -0.9901 0.0990
vn 0.0000 1.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 -0.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
g Edge_Corner_Outside_Cube.003_1
s off
f 3/1/1 7/2/1 5/3/1 1/4/1
f 8/5/2 4/6/2 2/7/2 6/8/2
g Edge_Corner_Outside_Cube.003_2
f 1/9/3 2/10/3 4/11/3 3/12/3
f 3/13/4 4/14/4 8/5/4 7/15/4
f 7/16/5 8/17/5 6/18/5 5/19/5
f 3/13/4 4/14/4 8/15/4 7/16/4
f 7/17/5 8/5/5 6/18/5 5/19/5
f 5/20/6 6/21/6 2/22/6 1/23/6

View File

@ -1,46 +1,46 @@
# Blender v2.77 (sub 1) OBJ File: 'SpaceShip.blend'
# Blender v2.78 (sub 0) OBJ File: 'SpaceShip.blend'
# www.blender.org
o Fence_Angle_Cube.018
v -0.494975 0.200000 0.268701
v -0.494975 0.300000 0.268701
v 0.268701 0.200000 -0.494975
v 0.268701 0.300000 -0.494975
v -0.388909 0.200000 0.374767
v -0.388909 0.300000 0.374767
v 0.374767 0.200000 -0.388909
v 0.374767 0.300000 -0.388909
v -0.494975 -0.500000 0.268701
v -0.494975 -0.400000 0.268701
v 0.268701 -0.500000 -0.494975
v 0.268701 -0.400000 -0.494975
v -0.388909 -0.500000 0.374767
v -0.388909 -0.400000 0.374767
v 0.374767 -0.500000 -0.388909
v 0.374767 -0.400000 -0.388909
v -0.268701 0.210000 0.226274
v -0.339411 0.210000 0.155564
v -0.197990 0.210000 0.155564
v -0.268701 0.210000 0.084853
v -0.268701 -0.410000 0.226274
v -0.339411 -0.410000 0.155564
v -0.197990 -0.410000 0.155564
v -0.268701 -0.410000 0.084853
v 0.155563 0.210000 -0.197990
v 0.084853 0.210000 -0.268701
v 0.226274 0.210000 -0.268701
v 0.155563 0.210000 -0.339411
v 0.155563 -0.410000 -0.197990
v 0.084853 -0.410000 -0.268701
v 0.226274 -0.410000 -0.268701
v 0.155563 -0.410000 -0.339411
v -0.056569 0.210000 0.014142
v -0.127279 0.210000 -0.056569
v 0.014142 0.210000 -0.056569
v -0.056569 0.210000 -0.127279
v -0.056569 -0.410000 0.014142
v -0.127279 -0.410000 -0.056569
v 0.014142 -0.410000 -0.056569
v -0.056569 -0.410000 -0.127279
v -0.494975 0.200000 0.368701
v -0.494975 0.300000 0.368701
v 0.268701 0.200000 -0.394975
v 0.268701 0.300000 -0.394975
v -0.388909 0.200000 0.474767
v -0.388909 0.300000 0.474767
v 0.374767 0.200000 -0.288909
v 0.374767 0.300000 -0.288909
v -0.494975 -0.500000 0.368701
v -0.494975 -0.400000 0.368701
v 0.268701 -0.500000 -0.394975
v 0.268701 -0.400000 -0.394975
v -0.388909 -0.500000 0.474767
v -0.388909 -0.400000 0.474767
v 0.374767 -0.500000 -0.288909
v 0.374767 -0.400000 -0.288909
v -0.268701 0.210000 0.326274
v -0.339411 0.210000 0.255564
v -0.197990 0.210000 0.255564
v -0.268701 0.210000 0.184853
v -0.268701 -0.410000 0.326274
v -0.339411 -0.410000 0.255564
v -0.197990 -0.410000 0.255564
v -0.268701 -0.410000 0.184853
v 0.155563 0.210000 -0.097990
v 0.084853 0.210000 -0.168701
v 0.226274 0.210000 -0.168701
v 0.155563 0.210000 -0.239411
v 0.155563 -0.410000 -0.097990
v 0.084853 -0.410000 -0.168701
v 0.226274 -0.410000 -0.168701
v 0.155563 -0.410000 -0.239411
v -0.056569 0.210000 0.114142
v -0.127279 0.210000 0.043431
v 0.014142 0.210000 0.043431
v -0.056569 0.210000 -0.027279
v -0.056569 -0.410000 0.114142
v -0.127279 -0.410000 0.043431
v 0.014142 -0.410000 0.043431
v -0.056569 -0.410000 -0.027279
vt 0.5188 0.0784
vt 0.5969 0.0784
vt 0.5969 0.9219
@ -105,6 +105,7 @@ vn 0.7071 0.0000 0.7071
vn -0.7071 0.0000 0.7071
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
g Fence_Angle_Cube.018_1
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/4/2 4/5/2 8/6/2 7/7/2
@ -118,6 +119,7 @@ f 15/22/3 16/23/3 14/24/3 13/25/3
f 13/26/4 14/27/4 10/28/4 9/15/4
f 11/18/5 15/21/5 13/26/5 9/15/5
f 16/23/6 12/17/6 10/16/6 14/24/6
g Fence_Angle_Cube.018_2
f 19/29/3 17/30/3 21/31/3 23/32/3
f 20/33/2 19/29/2 23/32/2 24/34/2
f 18/35/1 20/33/1 24/34/1 22/36/1

View File

@ -0,0 +1,256 @@
# Blender v2.78 (sub 0) OBJ File: 'SpaceShip.blend'
# www.blender.org
o Fence_Corner_Cube.002
v -0.340000 0.200000 0.340000
v -0.340000 0.300000 0.340000
v 0.500000 0.200000 0.340000
v 0.500000 0.300000 0.340000
v -0.340000 0.200000 0.490000
v -0.340000 0.300000 0.490000
v 0.500000 0.200000 0.490000
v 0.500000 0.300000 0.490000
v -0.490000 -0.500000 0.340000
v -0.490000 -0.400000 0.340000
v 0.500000 -0.500000 0.340000
v 0.500000 -0.400000 0.340000
v -0.490000 -0.500000 0.490000
v -0.490000 -0.400000 0.490000
v 0.500000 -0.500000 0.490000
v 0.500000 -0.400000 0.490000
v -0.350000 0.210000 0.470000
v -0.350000 0.210000 0.370000
v -0.250000 0.210000 0.470000
v -0.250000 0.210000 0.370000
v -0.350000 -0.410000 0.470000
v -0.350000 -0.410000 0.370000
v -0.250000 -0.410000 0.470000
v -0.250000 -0.410000 0.370000
v 0.250000 0.210000 0.470000
v 0.250000 0.210000 0.370000
v 0.350000 0.210000 0.470000
v 0.350000 0.210000 0.370000
v 0.250000 -0.410000 0.470000
v 0.250000 -0.410000 0.370000
v 0.350000 -0.410000 0.470000
v 0.350000 -0.410000 0.370000
v -0.050000 0.210000 0.470000
v -0.050000 0.210000 0.370000
v 0.050000 0.210000 0.470000
v 0.050000 0.210000 0.370000
v -0.050000 -0.410000 0.470000
v -0.050000 -0.410000 0.370000
v 0.050000 -0.410000 0.470000
v 0.050000 -0.410000 0.370000
v -0.340000 0.200000 -0.500000
v -0.340000 0.300000 -0.500000
v -0.340000 0.200000 0.490000
v -0.340000 0.300000 0.490000
v -0.490000 0.200000 -0.500000
v -0.490000 0.300000 -0.500000
v -0.490000 0.200000 0.490000
v -0.490000 0.300000 0.490000
v -0.340000 -0.500000 -0.500000
v -0.340000 -0.400000 -0.500000
v -0.340000 -0.500000 0.340000
v -0.340000 -0.400000 0.340000
v -0.490000 -0.500000 -0.500000
v -0.490000 -0.400000 -0.500000
v -0.490000 -0.500000 0.340000
v -0.490000 -0.400000 0.340000
v -0.470000 0.210000 -0.350071
v -0.370000 0.210000 -0.350071
v -0.470000 0.210000 -0.250071
v -0.370000 0.210000 -0.250071
v -0.470000 -0.410000 -0.350071
v -0.370000 -0.410000 -0.350071
v -0.470000 -0.410000 -0.250071
v -0.370000 -0.410000 -0.250071
v -0.470000 0.210000 0.249929
v -0.370000 0.210000 0.249929
v -0.470000 0.210000 0.349929
v -0.370000 0.210000 0.349929
v -0.470000 -0.410000 0.249929
v -0.370000 -0.410000 0.249929
v -0.470000 -0.410000 0.349929
v -0.370000 -0.410000 0.349929
v -0.470000 0.210000 -0.050071
v -0.370000 0.210000 -0.050071
v -0.470000 0.210000 0.049929
v -0.370000 0.210000 0.049929
v -0.470000 -0.410000 -0.050071
v -0.370000 -0.410000 -0.050071
v -0.470000 -0.410000 0.049929
v -0.370000 -0.410000 0.049929
vt 0.5111 0.0835
vt 0.5944 0.0835
vt 0.5944 0.9167
vt 0.5111 0.9167
vt 0.5111 1.0000
vt 0.3861 1.0000
vt 0.3861 0.9167
vt 0.8027 0.9167
vt 0.7194 0.9167
vt 0.7194 0.0835
vt 0.8027 0.0835
vt 0.3861 0.0835
vt 0.3861 0.0001
vt 0.5111 0.0001
vt 0.5111 0.0835
vt 0.5944 0.0835
vt 0.5944 0.9167
vt 0.5111 0.9167
vt 0.5111 1.0000
vt 0.3861 1.0000
vt 0.3861 0.9167
vt 0.8027 0.9167
vt 0.7194 0.9167
vt 0.7194 0.0835
vt 0.8027 0.0835
vt 0.3861 0.0835
vt 0.3861 0.0001
vt 0.5111 0.0001
vt 0.5111 0.0835
vt 0.5944 0.0835
vt 0.5944 0.9167
vt 0.5111 0.9167
vt 0.5111 1.0000
vt 0.3861 1.0000
vt 0.3861 0.9167
vt 0.8027 0.9167
vt 0.7194 0.9167
vt 0.7194 0.0835
vt 0.8027 0.0835
vt 0.3861 0.0835
vt 0.3861 0.0001
vt 0.5111 0.0001
vt 0.5111 0.0835
vt 0.5944 0.0835
vt 0.5944 0.9167
vt 0.5111 0.9167
vt 0.5111 1.0000
vt 0.3861 1.0000
vt 0.3861 0.9167
vt 0.8027 0.9167
vt 0.7194 0.9167
vt 0.7194 0.0835
vt 0.8027 0.0835
vt 0.3861 0.0835
vt 0.3861 0.0001
vt 0.5111 0.0001
vt 0.0000 0.1563
vt 0.0000 0.0000
vt 1.0000 -0.0000
vt 1.0000 0.1562
vt 0.0000 0.3125
vt 1.0000 0.3125
vt 0.0000 0.4688
vt 1.0000 0.4687
vt 0.0000 0.6250
vt 0.9998 0.6250
vt 0.0000 0.1563
vt 0.0000 0.0000
vt 1.0000 -0.0000
vt 1.0000 0.1562
vt 0.0000 0.3125
vt 1.0000 0.3125
vt 0.0000 0.4688
vt 1.0000 0.4687
vt 0.0000 0.6250
vt 0.9998 0.6250
vt 0.0000 0.1563
vt 0.0000 0.0000
vt 1.0000 -0.0000
vt 1.0000 0.1562
vt 0.0000 0.3125
vt 1.0000 0.3125
vt 0.0000 0.4688
vt 1.0000 0.4687
vt 0.0000 0.6250
vt 0.9998 0.6250
vt 0.0000 0.1563
vt 0.0000 0.0000
vt 1.0000 -0.0000
vt 1.0000 0.1562
vt 0.0000 0.3125
vt 1.0000 0.3125
vt 0.0000 0.4688
vt 1.0000 0.4687
vt 0.0000 0.6250
vt 0.9998 0.6250
vt 0.0000 0.1563
vt 0.0000 0.0000
vt 1.0000 -0.0000
vt 1.0000 0.1562
vt 0.0000 0.3125
vt 1.0000 0.3125
vt 0.0000 0.4688
vt 1.0000 0.4687
vt 0.0000 0.6250
vt 0.9998 0.6250
vt 0.0000 0.1563
vt 0.0000 0.0000
vt 1.0000 -0.0000
vt 1.0000 0.1562
vt 0.0000 0.3125
vt 1.0000 0.3125
vt 0.0000 0.4688
vt 1.0000 0.4687
vt 0.0000 0.6250
vt 0.9998 0.6250
vn -0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
g Fence_Corner_Cube.002_1
s off
f 1/1/1 2/2/1 4/3/1 3/4/1
f 3/4/2 4/5/2 8/6/2 7/7/2
f 7/8/3 8/9/3 6/10/3 5/11/3
f 5/12/4 6/13/4 2/14/4 1/1/4
f 3/4/5 7/7/5 5/12/5 1/1/5
f 8/9/6 4/3/6 2/2/6 6/10/6
f 9/15/1 10/16/1 12/17/1 11/18/1
f 11/18/2 12/19/2 16/20/2 15/21/2
f 15/22/3 16/23/3 14/24/3 13/25/3
f 13/26/4 14/27/4 10/28/4 9/15/4
f 11/18/5 15/21/5 13/26/5 9/15/5
f 16/23/6 12/17/6 10/16/6 14/24/6
f 41/29/2 42/30/2 44/31/2 43/32/2
f 43/32/3 44/33/3 48/34/3 47/35/3
f 47/36/4 48/37/4 46/38/4 45/39/4
f 45/40/1 46/41/1 42/42/1 41/29/1
f 43/32/5 47/35/5 45/40/5 41/29/5
f 48/37/6 44/31/6 42/30/6 46/38/6
f 49/43/2 50/44/2 52/45/2 51/46/2
f 51/46/3 52/47/3 56/48/3 55/49/3
f 55/50/4 56/51/4 54/52/4 53/53/4
f 53/54/1 54/55/1 50/56/1 49/43/1
f 51/46/5 55/49/5 53/54/5 49/43/5
f 56/51/6 52/45/6 50/44/6 54/52/6
g Fence_Corner_Cube.002_2
f 19/57/3 17/58/3 21/59/3 23/60/3
f 20/61/2 19/57/2 23/60/2 24/62/2
f 18/63/1 20/61/1 24/62/1 22/64/1
f 17/65/4 18/63/4 22/64/4 21/66/4
f 27/67/3 25/68/3 29/69/3 31/70/3
f 28/71/2 27/67/2 31/70/2 32/72/2
f 26/73/1 28/71/1 32/72/1 30/74/1
f 25/75/4 26/73/4 30/74/4 29/76/4
f 35/77/3 33/78/3 37/79/3 39/80/3
f 36/81/2 35/77/2 39/80/2 40/82/2
f 34/83/1 36/81/1 40/82/1 38/84/1
f 33/85/4 34/83/4 38/84/4 37/86/4
f 59/87/4 57/88/4 61/89/4 63/90/4
f 60/91/3 59/87/3 63/90/3 64/92/3
f 58/93/2 60/91/2 64/92/2 62/94/2
f 57/95/1 58/93/1 62/94/1 61/96/1
f 67/97/4 65/98/4 69/99/4 71/100/4
f 68/101/3 67/97/3 71/100/3 72/102/3
f 66/103/2 68/101/2 72/102/2 70/104/2
f 65/105/1 66/103/1 70/104/1 69/106/1
f 75/107/4 73/108/4 77/109/4 79/110/4
f 76/111/3 75/107/3 79/110/3 80/112/3
f 74/113/2 76/111/2 80/112/2 78/114/2
f 73/115/1 74/113/1 78/114/1 77/116/1

View File

@ -27,6 +27,14 @@ local colbox_rail_double = {
}
}
local colbox_rail_corner = {
type = 'fixed',
fixed = {
{.4, -.5, -.5, .5, .3, .5},
{-.5, -.5, .4, .5, .3, .5}
}
}
for i in ipairs (ship_parts_colors) do
local shipcol = ship_parts_colors[i][1]
local shipval = ship_parts_colors[i][2]
@ -35,7 +43,8 @@ for i in ipairs (ship_parts_colors) do
local ship_rail = { -- description, name, model, texture, colbox
{shipcol..' Rail Angled', shipdesc..'ra', 'rail_angle', '(spawn_rail_overlay.png^['..shipval..')', colbox_rail_angle},
{shipcol..' Rail Single', shipdesc..'rs', 'rail_single', '(spawn_rail_overlay.png^['..shipval..')', colbox_rail_single},
{shipcol..' Rail Double', shipdesc..'rd', 'rail_double', '(spawn_rail_overlay.png^['..shipval..')', colbox_rail_double}
{shipcol..' Rail Double', shipdesc..'rd', 'rail_double', '(spawn_rail_overlay.png^['..shipval..')', colbox_rail_double},
{shipcol..' Rail Corner', shipdesc..'rc', 'rail_corner', '(spawn_rail_overlay.png^['..shipval..')', colbox_rail_corner}
}
for i in ipairs (ship_rail) do
@ -54,7 +63,7 @@ for i in ipairs (ship_parts_colors) do
light_source = 4,
selection_box = colbox,
collision_box = colbox,
tiles = {'spawn_rail_blank.png^'..tex, 'spawn_floor_blank.png'},
tiles = {'spawn_rail_blank.png^'..tex},
groups = {oddly_breakable_by_hand=3}
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

View File

@ -68,7 +68,7 @@ minetest.register_node('spawn:vending1', {
minetest.register_node('spawn:vending', {
description = 'Vending Machine',
tiles = {'spawn_vending.png', 'spawn_vending.png', 'spawn_vending.png', 'spawn_vending.png', 'spawn_vending.png', 'spawn_vending_on.png'},
groups = {spawn=1},
groups = {spawn=1, not_in_creative_inventory=1},
paramtype = 'light',
paramtype2 = 'facedir',
drop = 'spawn:vending1',