add re-written stairs, sofar's skybox, more parts of flowerbeds
BIN
blends/flowerbeds_farmed_plant.blend
Normal file
BIN
blends/flowerbeds_farmed_plant.blend1
Normal file
BIN
blends/water_anim.blend
Normal file
@ -192,28 +192,29 @@ minetest.register_node("core:water_source", {
|
||||
drawtype = "liquid",
|
||||
tiles = {
|
||||
{
|
||||
name = "core_water_source_anim.png",
|
||||
name = "core_water_source_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 3,
|
||||
length = 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "core_water_source_anim.png",
|
||||
name = "core_water_source_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 3,
|
||||
length = 2,
|
||||
},
|
||||
backface_culling = false,
|
||||
},
|
||||
},
|
||||
alpha = 153,
|
||||
--alpha = 153,
|
||||
use_texture_alpha = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
@ -236,27 +237,28 @@ minetest.register_node("core:water_flowing", {
|
||||
tiles = {"core_water.png"},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "core_water_source_anim.png",
|
||||
name = "core_water_flowing_animated.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "core_water_source_anim.png",
|
||||
name = "core_water_flowing_animated.png",
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
alpha = 153,
|
||||
--alpha = 153,
|
||||
use_texture_alpha = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
walkable = false,
|
||||
@ -555,7 +557,7 @@ minetest.register_node("core:birch_log", {
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {tree=1, choppy=3, flammable=2, solid=1},
|
||||
on_place = minetest.rotate_node
|
||||
on_place = minetest.rotate_node,
|
||||
--sounds = {todo},
|
||||
})
|
||||
|
||||
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 461 B After Width: | Height: | Size: 502 B |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 481 B |
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 467 B |
BIN
mods/core/textures/core_water_flowing_animated.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 5.1 KiB |
BIN
mods/core/textures/core_water_source_animated.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 162 B |
52
mods/flowerbeds/init.lua
Normal file
@ -0,0 +1,52 @@
|
||||
-- flowerbeds; Solar Plains
|
||||
|
||||
-- rule 1: namespace everything;
|
||||
|
||||
flowerbeds = {}
|
||||
|
||||
minetest.register_node("flowerbeds:flowerbed", {
|
||||
|
||||
description = "Flowerbed",
|
||||
tiles = {"flowerbeds_bed.png", "core_dirt.png", "core_dirt.png^core_grass_side.png"},
|
||||
|
||||
})
|
||||
|
||||
function flowerbeds.register_flower(texture, desc, node_name, sound_table, dye_colour)
|
||||
|
||||
-- register node as a flower bed grown plant
|
||||
|
||||
minetest.register_node("flowerbeds:grown_"..node_name, {
|
||||
|
||||
description = desc,
|
||||
tiles = {texture},
|
||||
--sounds = sound_table,
|
||||
groups = {plant=1, snappy=3},
|
||||
drawtype = "mesh",
|
||||
mesh = "flowerbeds_plant_bed.b3d",
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
-- register a single flower, as wild ones are like this.
|
||||
|
||||
minetest.register_node("flowerbeds:wild_"..node_name , {
|
||||
|
||||
description = desc,
|
||||
tiles = {texture},
|
||||
groups = {plant=1, snappy=3},
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "meshoptions",
|
||||
--sounds = sound_table
|
||||
waving = 1,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local ret = minetest.item_place_node(itemstack, placer, pointed_thing, mcore.options("cross", true, true, false))
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
flowerbeds.register_flower("flowerbeds_lilac.png", "Lilac", "lilac", {}, "pink")
|
||||
|
BIN
mods/flowerbeds/models/flowerbeds_plant_bed.b3d
Normal file
BIN
mods/flowerbeds/textures/flowerbeds_lilac.png
Normal file
After Width: | Height: | Size: 284 B |
BIN
mods/flowerbeds/textures/flowerbeds_watering_can.png
Normal file
After Width: | Height: | Size: 214 B |
1
mods/skybox/description.txt
Normal file
@ -0,0 +1 @@
|
||||
Allows changing your sky to unimaginably epic scenes.
|
114
mods/skybox/init.lua
Normal file
@ -0,0 +1,114 @@
|
||||
|
||||
--[[
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
||||
--]]
|
||||
|
||||
--
|
||||
-- Builtin sky box textures and color/shadings
|
||||
--
|
||||
|
||||
local skies = {
|
||||
{"DarkStormy", "#1f2226", 0.5},
|
||||
{"CloudyLightRays", "#5f5f5e", 0.9},
|
||||
{"FullMoon", "#24292c", 0.2},
|
||||
{"SunSet", "#72624d", 0.4},
|
||||
{"ThickCloudsWater", "#a57850", 0.8},
|
||||
{"TropicalSunnyDay", "#f1f4ee", 1.0},
|
||||
}
|
||||
|
||||
--
|
||||
-- API
|
||||
--
|
||||
|
||||
skybox = {}
|
||||
|
||||
skybox.set = function(player, number)
|
||||
local sky = skies[number]
|
||||
player:override_day_night_ratio(sky[3])
|
||||
player:set_sky(sky[2], "skybox", {
|
||||
sky[1] .. "Up.jpg",
|
||||
sky[1] .. "Down.jpg",
|
||||
sky[1] .. "Front.jpg",
|
||||
sky[1] .. "Back.jpg",
|
||||
sky[1] .. "Left.jpg",
|
||||
sky[1] .. "Right.jpg",
|
||||
})
|
||||
player:set_attribute("skybox:skybox", sky[1])
|
||||
end
|
||||
|
||||
skybox.add = function(def)
|
||||
table.add(skies, def)
|
||||
end
|
||||
|
||||
skybox.clear = function(player)
|
||||
player:override_day_night_ratio(nil)
|
||||
player:set_sky("white", "regular")
|
||||
player:set_attribute("skybox:skybox", "off")
|
||||
end
|
||||
|
||||
--
|
||||
-- registrations and load/save code
|
||||
--
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local sky = player:get_attribute("skybox:skybox")
|
||||
print(dump(sky))
|
||||
if not sky or sky == "" then
|
||||
skybox.clear(player)
|
||||
else
|
||||
print(dump(skies))
|
||||
for k, v in ipairs(skies) do
|
||||
print(dump(v))
|
||||
if sky == v[1] then
|
||||
skybox.set(player, k)
|
||||
return
|
||||
end
|
||||
end
|
||||
skybox.clear(player)
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_privilege("skybox", {
|
||||
description = "Change sky box for yourself",
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("skybox", {
|
||||
params = "<skybox> or <number> or \"off\" or empty to list skyboxes",
|
||||
description = "Change your sky box set",
|
||||
privs = "skybox",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
if param == nil or param == "" then
|
||||
minetest.chat_send_player(name, "Available sky boxes:")
|
||||
for _, v in ipairs(skies) do
|
||||
minetest.chat_send_player(name,
|
||||
v[1])
|
||||
end
|
||||
return
|
||||
elseif tonumber(param) ~= nil and tonumber(param) >= 1 and tonumber(param) <= table.getn(skies) then
|
||||
skybox.set(player, tonumber(param))
|
||||
return
|
||||
elseif param == "off" then
|
||||
skybox.clear(player)
|
||||
return
|
||||
end
|
||||
for k, v in ipairs(skies) do
|
||||
if v[1] == param then
|
||||
skybox.set(player, k)
|
||||
return
|
||||
end
|
||||
end
|
||||
minetest.chat_send_player(name,
|
||||
"Could not find that sky box.")
|
||||
end
|
||||
})
|
1
mods/skybox/mod.conf
Normal file
@ -0,0 +1 @@
|
||||
name = skybox
|
42
mods/skybox/readme.md
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
## skybox - a player skybox mod (and API!)
|
||||
|
||||
### License of code and artwork
|
||||
|
||||
Copyright (C) 2017 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Provides a basic API for modifying a player sky box in a coherent
|
||||
fashion.
|
||||
|
||||
SkyboxSet by Heiko Irrgang ( http://gamvas.com ) is licensed under
|
||||
the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
Based on a work at http://93i.de.
|
||||
|
||||
### Usage
|
||||
|
||||
The `skybox` privilege allows players to change their own sky boxes.
|
||||
The command allows listing, and changing skyboxes, or turning skybox
|
||||
settings `off`.
|
||||
|
||||
### API
|
||||
|
||||
The `skybox` handle can be used to perform various actions:
|
||||
|
||||
`skybox.clear(player)`
|
||||
-- Reverts the player skybox setting to the default.
|
||||
|
||||
`skybox.set(player, number)`
|
||||
-- Sets the skybox to the `number` in the list of current skyboxes.
|
||||
|
||||
`skybox.add(skyboxdef)`
|
||||
-- Add a new skybox with skyboxdef to the list of available skyboxes.
|
||||
|
||||
|
||||
```
|
||||
skyboxdef = {
|
||||
[1] -- Base name of texture. The 6 textures you need to
|
||||
-- provide need to start with this value, and then
|
||||
-- have "Up", "Down", "Front", "Back", "Left" and
|
||||
-- "Right", Followed by ".jpg" as the file name.
|
||||
[2] -- Sky color (colorstring)
|
||||
[3] -- Day/Night ratio value (float - [0.0, 1.0])
|
BIN
mods/skybox/textures/CloudyLightRaysBack.jpg
Normal file
After Width: | Height: | Size: 804 KiB |
BIN
mods/skybox/textures/CloudyLightRaysDown.jpg
Normal file
After Width: | Height: | Size: 540 KiB |
BIN
mods/skybox/textures/CloudyLightRaysFront.jpg
Normal file
After Width: | Height: | Size: 671 KiB |
BIN
mods/skybox/textures/CloudyLightRaysLeft.jpg
Normal file
After Width: | Height: | Size: 880 KiB |
BIN
mods/skybox/textures/CloudyLightRaysRight.jpg
Normal file
After Width: | Height: | Size: 494 KiB |
BIN
mods/skybox/textures/CloudyLightRaysUp.jpg
Normal file
After Width: | Height: | Size: 519 KiB |
BIN
mods/skybox/textures/DarkStormyBack.jpg
Normal file
After Width: | Height: | Size: 168 KiB |
BIN
mods/skybox/textures/DarkStormyDown.jpg
Normal file
After Width: | Height: | Size: 118 KiB |
BIN
mods/skybox/textures/DarkStormyFront.jpg
Normal file
After Width: | Height: | Size: 173 KiB |
BIN
mods/skybox/textures/DarkStormyLeft.jpg
Normal file
After Width: | Height: | Size: 193 KiB |
BIN
mods/skybox/textures/DarkStormyRight.jpg
Normal file
After Width: | Height: | Size: 266 KiB |
BIN
mods/skybox/textures/DarkStormyUp.jpg
Normal file
After Width: | Height: | Size: 153 KiB |
BIN
mods/skybox/textures/FullMoonBack.jpg
Normal file
After Width: | Height: | Size: 343 KiB |
BIN
mods/skybox/textures/FullMoonDown.jpg
Normal file
After Width: | Height: | Size: 318 KiB |
BIN
mods/skybox/textures/FullMoonFront.jpg
Normal file
After Width: | Height: | Size: 328 KiB |
BIN
mods/skybox/textures/FullMoonLeft.jpg
Normal file
After Width: | Height: | Size: 456 KiB |
BIN
mods/skybox/textures/FullMoonRight.jpg
Normal file
After Width: | Height: | Size: 451 KiB |
BIN
mods/skybox/textures/FullMoonUp.jpg
Normal file
After Width: | Height: | Size: 260 KiB |
8
mods/skybox/textures/LICENSE.txt
Normal file
@ -0,0 +1,8 @@
|
||||
SkyboxSet by Heiko Irrgang ( http://gamvas.com ) is licensed under
|
||||
the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
Based on a work at http://93i.de.
|
||||
|
||||
To view a copy of this license, visit
|
||||
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to
|
||||
Creative Commons, 444 Castro Street, Suite 900, Mountain View,
|
||||
California, 94041, USA.
|
16
mods/skybox/textures/README.txt
Normal file
@ -0,0 +1,16 @@
|
||||
You may use this textures for free in games, even commercial.
|
||||
|
||||
See LICENSE.txt for details.
|
||||
|
||||
Please also have a look on my other projects:
|
||||
|
||||
Gamvas - a HTML5 game engine for the canvas element
|
||||
|
||||
http://gamvas.com
|
||||
|
||||
Brukkon - a puzzle game using the skybox textures
|
||||
|
||||
http://93i.de/cms/products/games/brukkon
|
||||
|
||||
Kind Regards,
|
||||
Heiko Irrgang <hi@93-interactive.com>
|
BIN
mods/skybox/textures/SunSetBack.jpg
Normal file
After Width: | Height: | Size: 218 KiB |
BIN
mods/skybox/textures/SunSetDown.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
mods/skybox/textures/SunSetFront.jpg
Normal file
After Width: | Height: | Size: 220 KiB |
BIN
mods/skybox/textures/SunSetLeft.jpg
Normal file
After Width: | Height: | Size: 366 KiB |
BIN
mods/skybox/textures/SunSetRight.jpg
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
mods/skybox/textures/SunSetUp.jpg
Normal file
After Width: | Height: | Size: 288 KiB |
BIN
mods/skybox/textures/ThickCloudsWaterBack.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
mods/skybox/textures/ThickCloudsWaterDown.jpg
Normal file
After Width: | Height: | Size: 786 KiB |
BIN
mods/skybox/textures/ThickCloudsWaterFront.jpg
Normal file
After Width: | Height: | Size: 1009 KiB |
BIN
mods/skybox/textures/ThickCloudsWaterLeft.jpg
Normal file
After Width: | Height: | Size: 1006 KiB |
BIN
mods/skybox/textures/ThickCloudsWaterRight.jpg
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
mods/skybox/textures/ThickCloudsWaterUp.jpg
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
mods/skybox/textures/TropicalSunnyDayBack.jpg
Normal file
After Width: | Height: | Size: 686 KiB |
BIN
mods/skybox/textures/TropicalSunnyDayDown.jpg
Normal file
After Width: | Height: | Size: 166 KiB |
BIN
mods/skybox/textures/TropicalSunnyDayFront.jpg
Normal file
After Width: | Height: | Size: 590 KiB |
BIN
mods/skybox/textures/TropicalSunnyDayLeft.jpg
Normal file
After Width: | Height: | Size: 554 KiB |
BIN
mods/skybox/textures/TropicalSunnyDayRight.jpg
Normal file
After Width: | Height: | Size: 586 KiB |
BIN
mods/skybox/textures/TropicalSunnyDayUp.jpg
Normal file
After Width: | Height: | Size: 505 KiB |
233
mods/stairs/init.lua
Normal file
@ -0,0 +1,233 @@
|
||||
-- stairs, Jordach / Solar Plains redo
|
||||
|
||||
-- mods depend on us (to provide them with their own stairs, damn socialists!), so lets make a namespace
|
||||
|
||||
stairs = {}
|
||||
|
||||
function stairs.register_stair(subname, groups_table, images, desc, sound_table)
|
||||
|
||||
groups_table.stair = 1
|
||||
|
||||
minetest.register_node(":stairs:stair_" .. subname, {
|
||||
|
||||
description = desc,
|
||||
drawtype = "mesh",
|
||||
mesh = "stairs_stair.obj",
|
||||
tiles = images,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = groups_table,
|
||||
sounds = sound_table,
|
||||
on_place = minetest.rotate_node,
|
||||
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||
},
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||
},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
function stairs.register_slab(subname, groups_table, images, desc, recipeitem, sound_table) -- when did we recruit brick from borderlands 2?
|
||||
|
||||
groups_table.slab = 1
|
||||
|
||||
minetest.register_node(":stairs:slab_" .. subname, {
|
||||
|
||||
description = desc,
|
||||
drawtype = "nodebox",
|
||||
tiles = images,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = groups_table,
|
||||
sounds = sound_table,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
local wielditem = itemstack:get_name()
|
||||
local under = minetest.get_node(pointed_thing.under)
|
||||
|
||||
if under.name == wielditem and recipeitem ~= nil and placer:get_player_control().sneak == false then -- we check for an existing slab, but also check for the recipe item that generates the slab.
|
||||
|
||||
itemstack:take_item()
|
||||
minetest.set_node(pointed_thing.under, {name=recipeitem})
|
||||
return itemstack
|
||||
|
||||
else
|
||||
|
||||
minetest.rotate_node(itemstack, placer, pointed_thing) -- if we cannot convert a slab into a full block, we place a slab with 3 axis rotation.
|
||||
return itemstack
|
||||
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
end
|
||||
|
||||
function stairs.register_stair_and_slab(subname, recipeitem, groups_table, images, desc_stair, desc_slab, sound_table)
|
||||
|
||||
if recipeitem ~= nil then
|
||||
|
||||
-- recipe for stairs;
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'stairs:stair_' .. subname .. ' 8',
|
||||
recipe = {
|
||||
{recipeitem, "", ""},
|
||||
{recipeitem, recipeitem, ""},
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
-- Flipped recipe for the silly minecrafters
|
||||
minetest.register_craft({
|
||||
output = 'stairs:stair_' .. subname .. ' 8',
|
||||
recipe = {
|
||||
{"", "", recipeitem},
|
||||
{"", recipeitem, recipeitem},
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
-- Fuel (Stairs)
|
||||
|
||||
-- we check what node the stair is made from and then figure out time to see how long a stair would burn for
|
||||
-- since a stair contains 75% of the original node's matter, it'll burn for a quarter of the time less,
|
||||
|
||||
local stair_baseburntime = minetest.get_craft_result({
|
||||
|
||||
method = "fuel",
|
||||
width = 1,
|
||||
items = {recipeitem}
|
||||
|
||||
}).time
|
||||
|
||||
if stair_baseburntime > 0 then
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
type = "fuel",
|
||||
recipe = 'stairs:stair_' .. subname,
|
||||
burntime = math.floor(stair_baseburntime * 0.75),
|
||||
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
-- recipe for slabs
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = 'stairs:slab_' .. subname .. ' 6',
|
||||
recipe = {
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- Fuel
|
||||
-- we see what the slab is made from then figure out the time in seconds to see how long a slab would burn for
|
||||
-- usually, a single slab will burn for half the time of a full size node.
|
||||
|
||||
local slab_baseburntime = minetest.get_craft_result({
|
||||
|
||||
method = "fuel",
|
||||
width = 1,
|
||||
items = {recipeitem}
|
||||
|
||||
}).time
|
||||
|
||||
if slab_baseburntime > 0 then
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = 'stairs:slab_' .. subname,
|
||||
burntime = math.floor(slab_baseburntime * 0.5),
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
stairs.register_stair(subname, groups_table, images, desc_stair, sound_table)
|
||||
stairs.register_slab(subname, groups_table, images, desc_slab, recipeitem, sound_table)
|
||||
|
||||
end
|
||||
|
||||
--[[
|
||||
|
||||
Registering your own slabs and stairs:
|
||||
|
||||
Take note that your own mods depends.txt must contain the lines separated with a newline (the enter key), default, stairs
|
||||
|
||||
If you happen to be using Solar Plains as a base, it is: core, stairs
|
||||
|
||||
For this example we are using stairs.register_stair_and_slab(),
|
||||
|
||||
instead of stairs.register_slab() or stairs.register_stair().
|
||||
|
||||
stairs.register_stair_and_slab("string", "string", {table}, {table with "string"}, "string", "string", {table}) is the layout of the function]
|
||||
|
||||
The first argument to register_stair_and_slab is a string, it is used to form the name of the generated stair, eg;
|
||||
|
||||
"cobble" would become "stairs:stair_cobble" and "stairs:slab_cobble"
|
||||
|
||||
The second argument is a string, and is used to become the recipe of both the stair and slab nodes.
|
||||
|
||||
An example block for cobble would look like "core:cobble" or "default:cobble" depending on the installed subgame.
|
||||
|
||||
If the block has a fuel value that can be burnt in a furnace, stairs will automatically figure out the burntime of the stair and slab variants.
|
||||
|
||||
The third arugment is a table for dealing with node groups, digtimes and things like putting fires out or even setting fire to things.
|
||||
|
||||
An example group table for cobble stone would look like: {cracky = 3, solid = 1}
|
||||
|
||||
The fourth argument is a table, but can handle upto six different textures.
|
||||
|
||||
The example layout for cobble is {"cobble.png"}, but Minetest will provide that to the other six faces automatically if you only have a single item.
|
||||
|
||||
If you were to have a different texture on each face, it would look like the following:
|
||||
|
||||
{"texture1.png", "texture2.png", "texture3.png", "texture4.png", "texture5.png", "texture6.png"}
|
||||
|
||||
If you were to remove texture4, texture5 and texture6, three faces of the stair and slab would be texture3. This applies to all blocks and node within Minetest.
|
||||
|
||||
The fifth argument is a string, but is also the description for the registered stair.
|
||||
|
||||
An example would look like "Cobblestone Stair"
|
||||
|
||||
The sixth argument is a string, and like the one before it, it is the description for the registered slab.
|
||||
|
||||
An example would look like "Cobblestone Slab"
|
||||
|
||||
The seventh argument is a table, but also the function in Minetest Game that provides sound.
|
||||
|
||||
An example to give it stone sounds would be: default.node_sound_stone_defaults()
|
||||
|
||||
Remember, you need depends.txt in the same folder as this init.lua.
|
||||
|
||||
Without it, this mod will crash the engine when trying to use default.node_sound_stone_defaults() as it cannot access the "default." namespace.
|
||||
|
||||
If you want to skip certain parts, like the recipe item, just use nil.
|
||||
|
||||
]]
|
||||
|
||||
stairs.register_stair_and_slab("cobble", "core:cobble", {cracky = 3}, {"core_cobble.png"}, "Cobble Stair", "Cobble Slab", {})
|
115
mods/stairs/models/stairs_stair.obj
Normal file
@ -0,0 +1,115 @@
|
||||
# Blender v2.72 (sub 0) OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib stairs.mtl
|
||||
o stairs_top
|
||||
v -0.500000 0.000000 -0.500000
|
||||
v -0.500000 0.000000 0.000000
|
||||
v 0.500000 0.000000 0.000000
|
||||
v 0.500000 0.000000 -0.500000
|
||||
v -0.500000 0.500000 0.000000
|
||||
v 0.500000 0.500000 0.000000
|
||||
v -0.500000 0.500000 0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.000000 0.500000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vn 0.000000 1.000000 0.000000
|
||||
g stairs_top
|
||||
usemtl None
|
||||
s off
|
||||
f 4/1/1 1/2/1 2/3/1 3/4/1
|
||||
f 7/5/1 8/6/1 6/4/1 5/3/1
|
||||
o stairs_bottom
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vn 0.000000 -1.000000 -0.000000
|
||||
g stairs_bottom
|
||||
usemtl None
|
||||
s off
|
||||
f 11/7/2 9/8/2 10/9/2 12/10/2
|
||||
o stairs_right
|
||||
v -0.500000 0.000000 -0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v -0.500000 0.000000 0.000000
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v -0.500000 0.500000 0.000000
|
||||
v -0.500000 0.500000 0.500000
|
||||
vt 0.000000 0.500000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.500000 0.500000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.500000 1.000000
|
||||
vt 1.000000 0.000000
|
||||
vn -1.000000 0.000000 0.000000
|
||||
g stairs_right
|
||||
usemtl None
|
||||
s off
|
||||
f 13/11/3 14/12/3 15/13/3
|
||||
f 15/13/3 18/14/3 17/15/3
|
||||
f 14/12/3 16/16/3 15/13/3
|
||||
f 16/16/3 18/14/3 15/13/3
|
||||
o stairs_left
|
||||
v 0.500000 0.000000 0.000000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v 0.500000 0.000000 -0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v 0.500000 0.500000 0.000000
|
||||
v 0.500000 0.500000 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.500000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vn 1.000000 0.000000 0.000000
|
||||
g stairs_left
|
||||
usemtl None
|
||||
s off
|
||||
f 19/17/4 20/18/4 21/19/4
|
||||
f 19/17/4 23/20/4 24/21/4
|
||||
f 20/18/4 19/17/4 22/22/4
|
||||
f 19/17/4 24/21/4 22/22/4
|
||||
o stairs_back
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v -0.500000 0.500000 0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vt 0.000000 0.000000
|
||||
vn 0.000000 -0.000000 1.000000
|
||||
g stairs_back
|
||||
usemtl None
|
||||
s off
|
||||
f 26/23/5 28/24/5 27/25/5 25/26/5
|
||||
o stairs_front
|
||||
v -0.500000 0.000000 -0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v -0.500000 0.000000 0.000000
|
||||
v 0.500000 0.000000 0.000000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v 0.500000 0.000000 -0.500000
|
||||
v -0.500000 0.500000 0.000000
|
||||
v 0.500000 0.500000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.500000
|
||||
vt 0.000000 0.500000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.000000 1.000000
|
||||
vn 0.000000 0.000000 -1.000000
|
||||
g stairs_front
|
||||
usemtl None
|
||||
s off
|
||||
f 30/27/6 29/28/6 34/29/6 33/30/6
|
||||
f 31/28/6 35/31/6 36/32/6 32/29/6
|