2nd commit

master
Nigel Garnett 2019-07-23 10:39:40 +00:00
commit 9851a0d469
9384 changed files with 1147022 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
# Minetest-mod-collection

1
autorollback/README.md Normal file
View File

@ -0,0 +1 @@
# autorollback

1
autorollback/depends.txt Normal file
View File

@ -0,0 +1 @@
areas

24
autorollback/init.lua Normal file
View File

@ -0,0 +1,24 @@
-- No Protect Autorollback hack Nigel Garnett 2018
-- rolls back the last 24 hours work of any player who
-- leaves the server without any protected areas
local area_count=function(name)
local admin=minetest.check_player_privs(name, areas.adminPrivs)
local areacount=0
for id, area in pairs(areas.areas) do
if admin or areas:isAreaOwner(id, name) then
areacount=areacount+1
end
end
return areacount
end
minetest.register_on_leaveplayer(function(player)
local name=player:get_player_name()
if not (area_count(name)>0) then
minetest.chat_send_all(name.." was rolled back.")
minetest.log(name.." was rolled back.")
minetest.rollback_revert_actions_by("player:"..name,43200)
end
end)

View File

@ -0,0 +1,30 @@
Bonemeal mod [bonemeal]
This mod adds four new items into the game, bones which can be dug from normal
dirt which can be made into bonemeal, mulch which is is crafted using a tree and
8x leaves, and fertiliser which is a mixture of them both.
Each item can be used on saplings and crops for a chance to grow them quicker as
well as dirt which will generate random grass, flowers or whichever decoration
is registered.
Mulch has a strength of 1, Bonemeal 2 and Fertiliser 3 which means the stronger
the item, the more chance of growing saplings in low light, making crops sprout
quicker or simply decorate a larger area with grass and flowers.
The api.txt document shows how to add your own saplings, crops and grasses to
the list by using one of the 3 commands included and the mod.lua file gives you
many examples by using some of the popular mods available.
https://forum.minetest.net/viewtopic.php?f=9&t=16446
Changelog:
- 0.1 - Initial release
- 0.2 - Added global on_use function for bonemeal growth
- 0.3 - Added strength to on_use global for new items (mulch and fertiliser)
- 0.4 - Added Intllib support and fr.txt file
- 0.5 - Added support for default bush and acacia bush saplings
- 0.6 - Using newer functions, Minetest 0.4.16 and above needed to run
Lucky Blocks: 5

View File

@ -0,0 +1,76 @@
Bonemeal API
============
This guide will show you how to add saplings, crops and dirt types for the
bonemeal mod to use from withhin your own mods. Please make sure that bonemeal
appears in the depends.txt file of your mod so everything work properly.
Function Usage
==============
Adding Crops
------------
bonemeal:add_crop({ nodename_start, growing_steps, seed_name })
This command is used to add new crops for bonemeal to work on.
e.g.
bonemeal:add_crop({
{"farming:cotton_", 8, "farming:seed_cotton"},
{"farming:wheat_", 8, "farming:seed_wheat"},
})
Adding Saplings
---------------
bonemeal:add_sapling({ sapling_node, function, soil_type[sand, dirt, nodename] })
This command will add new saplings for bonemeal to grow on sand, soil or a
specified node type.
bonemeal:add_sapling({
{"ethereal:palm_sapling", ethereal.grow_palm_tree, "soil"},
{"ethereal:palm_sapling", ethereal.grow_palm_tree, "sand"},
})
Adding Dirt Decoration
----------------------
bonemeal:add_deco({ dirt_node, {grass_node_list}, {decor_node_list} })
This command will add grass and decoration to specific dirt types, use "" to
add an empty node.
e.g.
bonemeal:add_deco({"default:dirt_with_dry_grass", {"default:dry_grass_1", ""},
{"flowers:rose", "flowers:viola"} })
Global ON_USE Function
----------------------
bonemeal:on_use(pos, strength)
This function can be called from other mods to grow plants using alternative
bonemeal items and have the same effect.
{pos} is the location to apply growing
{strength} is how strong to grow [low of 1 to high of 4]
Note: Higher strength items require lower light levels, and a strength of 4
needs no light at all.
Final Words
===========
I hope this guide helps you add your own plants so you can grow them quickly
with the items included. Please check the mods.lua for more examples.

View File

@ -0,0 +1,7 @@
default
intllib?
farming?
ethereal?
moretrees?
technic_worldgen?
lucky_block?

View File

@ -0,0 +1 @@
Adds bone and bonemeal giving the ability to quickly grow plants and saplings.

493
cleanmods/bonemeal/init.lua Normal file
View File

@ -0,0 +1,493 @@
bonemeal = {}
-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP .. "/intllib.lua")
-- creative check
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function is_creative(name)
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
end
-- default crops
local crops = {
{"farming:cotton_", 8, "farming:seed_cotton"},
{"farming:wheat_", 8, "farming:seed_wheat"},
}
-- special pine check for nearby snow
local function pine_grow(pos)
if minetest.find_node_near(pos, 1,
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
default.grow_new_snowy_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
end
-- default saplings
local saplings = {
{"default:sapling", default.grow_new_apple_tree, "soil"},
{"default:junglesapling", default.grow_new_jungle_tree, "soil"},
{"default:acacia_sapling", default.grow_new_acacia_tree, "soil"},
{"default:aspen_sapling", default.grow_new_aspen_tree, "soil"},
{"default:pine_sapling", pine_grow, "soil"},
{"default:bush_sapling", default.grow_bush, "soil"},
{"default:acacia_bush_sapling", default.grow_acacia_bush, "soil"},
}
-- helper tables ( "" denotes a blank item )
local green_grass = {
"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5", "", ""
}
local dry_grass = {
"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
"default:dry_grass_5", "", ""
}
local flowers = {
"flowers:dandelion_white", "flowers:dandelion_yellow", "flowers:geranium",
"flowers:rose", "flowers:tulip", "flowers:viola", ""
}
-- add additional bakedclay flowers if enabled
if minetest.get_modpath("bakedclay") then
flowers[7] = "bakedclay:delphinium"
flowers[8] = "bakedclay:thistle"
flowers[9] = "bakedclay:lazarus"
flowers[10] = "bakedclay:mannagrass"
flowers[11] = ""
end
-- default biomes deco
local deco = {
{"default:dirt_with_dry_grass", dry_grass, flowers},
{"default:sand", {}, {"default:dry_shrub", "", "", ""} },
{"default:desert_sand", {}, {"default:dry_shrub", "", "", ""} },
{"default:silver_sand", {}, {"default:dry_shrub", "", "", ""} },
}
----- local functions
-- particles
local function particle_effect(pos)
minetest.add_particlespawner({
amount = 4,
time = 0.15,
minpos = pos,
maxpos = pos,
minvel = {x = -1, y = 2, z = -1},
maxvel = {x = 1, y = 4, z = 1},
minacc = {x = -1, y = -1, z = -1},
maxacc = {x = 1, y = 1, z = 1},
minexptime = 1,
maxexptime = 1,
minsize = 1,
maxsize = 3,
texture = "bonemeal_particle.png",
})
end
-- tree type check
local function grow_tree(pos, object)
if type(object) == "table" and object.axiom then
-- grow L-system tree
minetest.remove_node(pos)
minetest.spawn_tree(pos, object)
elseif type(object) == "string" and minetest.registered_nodes[object] then
-- place node
minetest.set_node(pos, {name = object})
elseif type(object) == "function" then
-- function
object(pos)
end
end
-- sapling check
local function check_sapling(pos, nodename)
-- what is sapling placed on?
local under = minetest.get_node({
x = pos.x,
y = pos.y - 1,
z = pos.z
})
local can_grow, grow_on
-- check list for sapling and function
for n = 1, #saplings do
if saplings[n][1] == nodename then
grow_on = saplings[n][3]
-- sapling grows on top of specific node
if grow_on
and grow_on ~= "soil"
and grow_on ~= "sand"
and grow_on == under.name then
can_grow = true
end
-- sapling grows on top of soil (default)
if can_grow == nil
and (grow_on == nil or grow_on == "soil")
and minetest.get_item_group(under.name, "soil") > 0 then
can_grow = true
end
-- sapling grows on top of sand
if can_grow == nil
and grow_on == "sand"
and minetest.get_item_group(under.name, "sand") > 0 then
can_grow = true
end
-- check if we can grow sapling
if can_grow then
particle_effect(pos)
grow_tree(pos, saplings[n][2])
return
end
end
end
end
-- crops check
local function check_crops(pos, nodename, strength)
local stage = ""
-- grow registered crops
for n = 1, #crops do
if string.find(nodename, crops[n][1])
or nodename == crops[n][3] then
-- get stage number or set to 0 for seed
stage = tonumber( nodename:split("_")[2] ) or 0
stage = math.min(stage + strength, crops[n][2])
minetest.set_node(pos, {name = crops[n][1] .. stage})
particle_effect(pos)
return
end
end
end
-- check soil for specific decoration placement
local function check_soil(pos, nodename, strength)
-- set radius according to strength
local side = strength - 1
local tall = math.max(strength - 2, 0)
-- get area of land with free space above
local dirt = minetest.find_nodes_in_area_under_air(
{x = pos.x - side, y = pos.y - tall, z = pos.z - side},
{x = pos.x + side, y = pos.y + tall, z = pos.z + side},
{"group:soil", "group:sand"})
-- set default grass and decoration
local grass = green_grass
local decor = flowers
-- choose grass and decoration to use on dirt patch
for n = 1, #deco do
-- do we have a grass match?
if nodename == deco[n][1] then
grass = deco[n][2] or {}
decor = deco[n][3] or {}
end
end
local pos2, nod
-- loop through soil
for _,n in pairs(dirt) do
pos2 = n
pos2.y = pos2.y + 1
-- place random decoration (rare)
if math.random(1, 5) == 5 then
nod = decor[math.random(1, #decor)] or ""
if nod ~= "" then
minetest.set_node(pos2, {name = nod})
end
else
-- place random grass (common)
nod = #grass > 0 and grass[math.random(1, #grass)] or ""
if nod ~= "" then
minetest.set_node(pos2, {name = nod})
end
end
particle_effect(pos2)
end
end
-- global functions
-- add to sapling list
-- {sapling node, schematic or function name, "soil"|"sand"|specific_node}
--e.g. {"default:sapling", default.grow_new_apple_tree, "soil"}
function bonemeal:add_sapling(list)
for n = 1, #list do
table.insert(saplings, list[n])
end
end
-- add to crop list to force grow
-- {crop name start_, growth steps, seed node (if required)}
-- e.g. {"farming:wheat_", 8, "farming:seed_wheat"}
function bonemeal:add_crop(list)
for n = 1, #list do
table.insert(crops, list[n])
end
end
-- add grass and flower/plant decoration for specific dirt types
-- {dirt_node, {grass_nodes}, {flower_nodes}
-- e.g. {"default:dirt_with_dry_grass", dry_grass, flowers}
function bonemeal:add_deco(list)
for n = 1, #list do
table.insert(deco, list[n])
end
end
-- global on_use function for bonemeal
function bonemeal:on_use(pos, strength)
-- get node pointed at
local node = minetest.get_node(pos)
-- return if nothing there
if node.name == "ignore" then
return
end
-- make sure strength is between 1 and 4
strength = strength or 2
strength = math.max(strength, 1)
strength = math.min(strength, 4)
-- grow grass and flowers
if minetest.get_item_group(node.name, "soil") > 0
or minetest.get_item_group(node.name, "sand") > 0 then
check_soil(pos, node.name, strength)
return
end
-- light check depending on strength (strength of 4 = no light needed)
if (minetest.get_node_light(pos) or 0) < (12 - (strength * 3)) then
return
end
-- check for tree growth if pointing at sapling
if minetest.get_item_group(node.name, "sapling") > 0
and math.random(1, (5 - strength)) == 1 then
check_sapling(pos, node.name)
return
end
-- check for crop growth
check_crops(pos, node.name, strength)
end
----- items
-- mulch (strength 1)
minetest.register_craftitem("bonemeal:mulch", {
description = S("Mulch"),
inventory_image = "bonemeal_mulch.png",
on_use = function(itemstack, user, pointed_thing)
-- did we point at a node?
if pointed_thing.type ~= "node" then
return
end
-- is area protected?
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
return
end
-- take item if not in creative
if not is_creative(user:get_player_name()) then
itemstack:take_item()
end
-- call global on_use function with strength of 1
bonemeal:on_use(pointed_thing.under, 1)
return itemstack
end,
})
-- bonemeal (strength 2)
minetest.register_craftitem("bonemeal:bonemeal", {
description = S("Bone Meal"),
inventory_image = "bonemeal_item.png",
on_use = function(itemstack, user, pointed_thing)
-- did we point at a node?
if pointed_thing.type ~= "node" then
return
end
-- is area protected?
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
return
end
-- take item if not in creative
if not is_creative(user:get_player_name()) then
itemstack:take_item()
end
-- call global on_use function with strength of 2
bonemeal:on_use(pointed_thing.under, 2)
return itemstack
end,
})
-- fertiliser (strength 3)
minetest.register_craftitem("bonemeal:fertiliser", {
description = S("Fertiliser"),
inventory_image = "bonemeal_fertiliser.png",
on_use = function(itemstack, user, pointed_thing)
-- did we point at a node?
if pointed_thing.type ~= "node" then
return
end
-- is area protected?
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
return
end
-- take item if not in creative
if not is_creative(user:get_player_name()) then
itemstack:take_item()
end
-- call global on_use function with strength of 3
bonemeal:on_use(pointed_thing.under, 3)
return itemstack
end,
})
-- bone
minetest.register_craftitem("bonemeal:bone", {
description = S("Bone"),
inventory_image = "bonemeal_bone.png",
})
--- crafting recipes
-- bonemeal (from bone)
minetest.register_craft({
type = "shapeless",
output = "bonemeal:bonemeal 2",
recipe = {"bonemeal:bone"},
})
-- bonemeal (from player bones)
minetest.register_craft({
type = "shapeless",
output = "bonemeal:bonemeal 4",
recipe = {"bones:bones"},
})
-- mulch
minetest.register_craft({
type = "shapeless",
output = "bonemeal:mulch 4",
recipe = {
"group:tree", "group:leaves", "group:leaves",
"group:leaves", "group:leaves", "group:leaves",
"group:leaves", "group:leaves", "group:leaves"
},
})
-- fertiliser
minetest.register_craft({
type = "shapeless",
output = "bonemeal:fertiliser 2",
recipe = {"bonemeal:bonemeal", "bonemeal:mulch"},
})
-- add bones to dirt
minetest.override_item("default:dirt", {
drop = {
max_items = 1,
items = {
{
items = {"bonemeal:bone", "default:dirt"},
rarity = 30,
},
{
items = {"default:dirt"},
}
}
},
})
-- add support for other mods
local path = minetest.get_modpath("bonemeal")
dofile(path .. "/mods.lua")
dofile(path .. "/lucky_block.lua")
print (S("[bonemeal] loaded"))

View File

@ -0,0 +1,45 @@
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 TenPlus1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,7 @@
# init.lua
Mulch = Paillis
Bone Meal = Poudre d'os
Fertiliser = Engrais
Bone = Os
[bonemeal] loaded = [bonemeal] chargé

View File

@ -0,0 +1,7 @@
# init.lua
Mulch =
Bone Meal =
Fertiliser =
Bone =
[bonemeal] loaded =

View File

@ -0,0 +1,24 @@
-- add lucky blocks
local function growy(pos, player)
local dpos = minetest.find_node_near(pos, 1, "group:soil")
if dpos then
bonemeal:on_use(dpos, 5)
end
end
if minetest.get_modpath("lucky_block") then
lucky_block:add_blocks({
{"lig"},
{"dro", {"bonemeal:mulch"}, 10},
{"dro", {"bonemeal:bonemeal"}, 10},
{"dro", {"bonemeal:fertiliser"}, 10},
{"cus", growy},
})
end

View File

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

117
cleanmods/bonemeal/mods.lua Normal file
View File

@ -0,0 +1,117 @@
-- craft bones from animalmaterials into bonemeal
if minetest.get_modpath("animalmaterials") then
minetest.register_craft({
type = "shapeless",
output = "bonemeal:bonemeal 2",
recipe = {"animalmaterials:bone"},
})
end
if farming and farming.mod and farming.mod == "redo" then
bonemeal:add_crop({
{"farming:tomato_", 8},
{"farming:corn_", 8},
{"farming:melon_", 8},
{"farming:pumpkin_", 8},
{"farming:beanpole_", 5},
{"farming:blueberry_", 4},
{"farming:raspberry_", 4},
{"farming:carrot_", 8},
{"farming:cocoa_", 3},
{"farming:coffee_", 5},
{"farming:cucumber_", 4},
{"farming:potato_", 4},
{"farming:grapes_", 8},
{"farming:rhubarb_", 3},
{"farming:barley_", 7},
{"farming:hemp_", 8},
{"farming:chili_", 8},
})
end
if minetest.get_modpath("ethereal") then
bonemeal:add_crop({
{"ethereal:strawberry_", 8},
{"ethereal:onion_", 5},
})
bonemeal:add_sapling({
{"ethereal:palm_sapling", ethereal.grow_palm_tree, "soil"},
{"ethereal:palm_sapling", ethereal.grow_palm_tree, "sand"},
{"ethereal:yellow_tree_sapling", ethereal.grow_yellow_tree, "soil"},
{"ethereal:big_tree_sapling", ethereal.grow_big_tree, "soil"},
{"ethereal:banana_tree_sapling", ethereal.grow_banana_tree, "soil"},
{"ethereal:frost_tree_sapling", ethereal.grow_frost_tree, "soil"},
{"ethereal:mushroom_sapling", ethereal.grow_mushroom_tree, "soil"},
{"ethereal:willow_sapling", ethereal.grow_willow_tree, "soil"},
{"ethereal:redwood_sapling", ethereal.grow_redwood_tree, "soil"},
{"ethereal:orange_tree_sapling", ethereal.grow_orange_tree, "soil"},
{"ethereal:bamboo_sprout", ethereal.grow_bamboo_tree, "soil"},
{"ethereal:birch_sapling", ethereal.grow_birch_tree, "soil"},
})
local grass = {"default:grass_3", "default:grass_4", "default:grass_5", ""}
bonemeal:add_deco({
{"ethereal:crystal_dirt", {"ethereal:crystalgrass", "", "", "", ""}, {}},
{"ethereal:fiery_dirt", {"ethereal:dry_shrub", "", "", "", ""}, {}},
{"ethereal:prairie_dirt", grass, {"flowers:dandelion_white",
"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose",
"flowers:tulip", "flowers:viola", "ethereal:strawberry_7"}},
{"ethereal:gray_dirt", {}, {"ethereal:snowygrass", "", ""}},
{"ethereal:cold_dirt", {}, {"ethereal:snowygrass", "", ""}},
{"ethereal:mushroom_dirt", {}, {"flowers:mushroom_red", "flowers:mushroom_brown", "", "", ""}},
{"ethereal:jungle_dirt", grass, {"default:junglegrass", "", "", ""}},
{"ethereal:grove_dirt", grass, {"ethereal:fern", "", "", ""}},
{"ethereal:bamboo_dirt", grass, {}},
})
end
if minetest.get_modpath("moretrees") then
-- special fir check for snow
local function fir_grow(pos)
if minetest.find_node_near(pos, 1,
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
moretrees.grow_fir_snow(pos)
else
moretrees.grow_fir(pos)
end
end
bonemeal:add_sapling({
{"moretrees:beech_sapling", moretrees.spawn_beech_object, "soil"},
{"moretrees:apple_tree_sapling", moretrees.spawn_apple_tree_object, "soil"},
{"moretrees:oak_sapling", moretrees.spawn_oak_object, "soil"},
{"moretrees:sequoia_sapling", moretrees.spawn_sequoia_object, "soil"},
--{"moretrees:birch_sapling", moretrees.spawn_birch_object, "soil"},
{"moretrees:birch_sapling", moretrees.grow_birch, "soil"},
{"moretrees:palm_sapling", moretrees.spawn_palm_object, "soil"},
{"moretrees:palm_sapling", moretrees.spawn_palm_object, "sand"},
{"moretrees:date_palm_sapling", moretrees.spawn_date_palm_object, "soil"},
{"moretrees:date_palm_sapling", moretrees.spawn_date_palm_object, "sand"},
--{"moretrees:spruce_sapling", moretrees.spawn_spruce_object, "soil"},
{"moretrees:spruce_sapling", moretrees.grow_spruce, "soil"},
{"moretrees:cedar_sapling", moretrees.spawn_cedar_object, "soil"},
{"moretrees:poplar_sapling", moretrees.spawn_poplar_object, "soil"},
{"moretrees:willow_sapling", moretrees.spawn_willow_object, "soil"},
{"moretrees:rubber_tree_sapling", moretrees.spawn_rubber_tree_object, "soil"},
{"moretrees:fir_sapling", fir_grow, "soil"},
})
elseif minetest.get_modpath("technic_worldgen") then
bonemeal:add_sapling({
{"moretrees:rubber_tree_sapling", technic.rubber_tree_model, "soil"},
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

135
cleanmods/candycane/init.lua Executable file
View File

@ -0,0 +1,135 @@
minetest.register_node("candycane:candy_block2", {
description = "Candy Block",
tiles = {"candycane_block.png"},
on_use = minetest.item_eat(2),
is_ground_content = true,
groups = {cracky=3},
})
minetest.register_node("candycane:candy_block", {
description = "Candy Block",
tiles = {"default_stone.png"},
on_use = minetest.item_eat(2),
is_ground_content = true,
groups = {cracky=3},
})
-- minetest.register_node("candycane:candy_cane", {
-- description = "Candy Cane",
-- drawtype = "plantlike",
-- inventory_image = "candycane_cane.png",
-- paramtype="light",
-- visual_scale = 1.0,
-- tiles = {"candycane_cane.png"},
-- on_use = minetest.item_eat(4),
-- groups = {cracky=3},
-- })
--Tool
minetest.register_tool("candycane:pick_candy", {
description = "Candy Pickaxe",
inventory_image = "candycane_tool_pick.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=5},
},
})
minetest.register_tool("candycane:shovel_candy", {
description = "Candy Shovel",
inventory_image = "candycane_tool_shovel.png",
wield_image = "candycane_tool_shovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("candycane:sword_candy", {
description = "Candy Sword",
inventory_image = "candycane_tool_sword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
}
})
minetest.register_tool("candycane:axe_candy", {
description = "Candy Axe",
inventory_image = "candycane_tool_axe.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=7},
},
})
--Craft
minetest.register_craft({
output = 'candycane:pick_candy',
recipe = {
{'candycane:candy_block2', 'candycane:candy_block2', 'candycane:candy_block2'},
{'', 'group:stick', ''},
{'', 'group:stick', ''},
}
})
minetest.register_craft({
output = 'candycane:axe_candy',
recipe = {
{'candycane:candy_block2', 'candycane:candy_block2'},
{'candycane:candy_block2', 'group:stick'},
{'', 'group:stick'},
}
})
minetest.register_craft({
output = 'candycane:sword_candy',
recipe = {
{'candycane:candy_block2'},
{'candycane:candy_block2'},
{'group:stick'},
}
})
minetest.register_craft({
output = 'candycane:shovel_candy',
recipe = {
{'candycane:candy_block2'},
{'group:stick'},
{'group:stick'},
}
})
minetest.register_craft({
type = "cooking",
output = "candycane:candy_cane",
recipe = "candycane:candy_block2",
})
--Ore
-- minetest.register_ore({
-- ore_type = "scatter",
-- ore = "candycane:candy_block",
-- wherein = "default:stone",
-- clust_scarcity = 8*8*8,
-- clust_num_ores = 8,
-- clust_size = 3,
-- height_min = -31000,
-- height_max = 64,
-- })

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

View File

@ -0,0 +1 @@
# christmas_craft

View File

@ -0,0 +1,296 @@
minetest.register_craft({
output = "christmas_craft:christmas_lights 4",
recipe = {
{"farming:string","default:mese_crystal", "farming:string"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:christmas_leaves 4",
recipe = {
{"default:leaves","default:leaves"},
{"default:leaves","default:leaves"},
}
})
minetest.register_craft({
output = "christmas_craft:christmas_wreath ",
recipe = {
{"christmas_craft:christmas_leaves","christmas_craft:christmas_leaves","christmas_craft:christmas_leaves"},
{"christmas_craft:christmas_leaves","","christmas_craft:christmas_leaves"},
{"christmas_craft:christmas_leaves","christmas_craft:red_ribbon","christmas_craft:christmas_leaves"},
}
})
minetest.register_craft({
output = "christmas_craft:snow_block",
recipe = {
{"christmas_craft:snowball","christmas_craft:snowball"},
{"christmas_craft:snowball","christmas_craft:snowball"},
}
})
minetest.register_craft({
output = "christmas_craft:snowman",
recipe = {
{"default:coal_lump","christmas_craft:snowball","default:coal_lump"},
{"christmas_craft:snowball","christmas_craft:snowball","christmas_craft:snowball"},
{"default:coal_lump","default:coal_lump","default:coal_lump"},
}
})
minetest.register_craft({
output = "christmas_craft:christmas_star ",
recipe = {
{"","default:gold_ingot",""},
{"default:gold_ingot","default:gold_ingot","default:gold_ingot"},
{"default:gold_ingot","","default:gold_ingot"},
}
})
minetest.register_craft({
output = "christmas_craft:snowball 4",
recipe = {
{"christmas_craft:snow_block"},
}
})
--------------------------
-- baubles -
--------------------------
minetest.register_craft({
output = "christmas_craft:red_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:red", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:yellow_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:yellow", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:green_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:green", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:blue_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:blue", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:orange_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:orange", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:pink_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:pink", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:violet_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","dye:violet", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
minetest.register_craft({
output = "christmas_craft:silver_baubles 8",
recipe = {
{"default:glass","default:gold_ingot", "default:glass"},
{"default:glass","", "default:glass"},
{"default:glass","default:glass", "default:glass"},
}
})
--------------------------
-- presents -
--------------------------
-- paper colour craft --
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_red',
recipe = {'dye:red','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_blue',
recipe = {'dye:blue','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_green',
recipe = {'dye:green','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_yellow',
recipe = {'dye:yellow','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_yellow',
recipe = {'dye:yellow','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_violet',
recipe = {'dye:violet','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_orange',
recipe = {'dye:orange','default:paper'},
})
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:paper_pink',
recipe = {'dye:pink','default:paper'},
})
-- ribbon craft --
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:red_ribbon',
recipe = {'dye:red','farming:string'},
})
-- wish list craft --
minetest.register_craft({
type = "shapeless",
output = 'christmas_craft:wish_list',
recipe = {'default:stick','default:mese_crystal','default:paper','dye:black'},
})
-- present box --
minetest.register_craft({
output = "christmas_craft:present_box",
recipe = {
{"default:paper","default:paper", "default:paper"},
{"default:paper","christmas_craft:wish_list", "default:paper"},
{"default:paper","default:paper", "default:paper"},
}
})
-- present craft --
minetest.register_craft({
output = "christmas_craft:Christmas_present",
recipe = {
{"default:paper","christmas_craft:red_ribbon", "default:paper"},
{"default:paper","christmas_craft:present_box", "default:paper"},
{"default:paper","christmas_craft:red_ribbon", "default:paper"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_red",
recipe = {
{"christmas_craft:paper_red","christmas_craft:red_ribbon", "christmas_craft:paper_red"},
{"christmas_craft:paper_red","christmas_craft:present_box", "christmas_craft:paper_red"},
{"christmas_craft:paper_red","christmas_craft:red_ribbon", "christmas_craft:paper_red"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_blue",
recipe = {
{"christmas_craft:paper_blue","christmas_craft:red_ribbon", "christmas_craft:paper_blue"},
{"christmas_craft:paper_blue","christmas_craft:present_box", "christmas_craft:paper_blue"},
{"christmas_craft:paper_blue","christmas_craft:red_ribbon", "christmas_craft:paper_blue"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_green",
recipe = {
{"christmas_craft:paper_green","christmas_craft:red_ribbon", "christmas_craft:paper_green"},
{"christmas_craft:paper_green","christmas_craft:present_box", "christmas_craft:paper_green"},
{"christmas_craft:paper_green","christmas_craft:red_ribbon", "christmas_craft:paper_green"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_yellow",
recipe = {
{"christmas_craft:paper_yellow","christmas_craft:red_ribbon", "christmas_craft:paper_yellow"},
{"christmas_craft:paper_yellow","christmas_craft:present_box", "christmas_craft:paper_yellow"},
{"christmas_craft:paper_yellow","christmas_craft:red_ribbon", "christmas_craft:paper_yellow"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_orange",
recipe = {
{"christmas_craft:paper_orange","christmas_craft:red_ribbon", "christmas_craft:paper_orange"},
{"christmas_craft:paper_orange","christmas_craft:present_box", "christmas_craft:paper_orange"},
{"christmas_craft:paper_orange","christmas_craft:red_ribbon", "christmas_craft:paper_orange"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_pink",
recipe = {
{"christmas_craft:paper_pink","christmas_craft:red_ribbon", "christmas_craft:paper_pink"},
{"christmas_craft:paper_pink","christmas_craft:present_box", "christmas_craft:paper_pink"},
{"christmas_craft:paper_pink","christmas_craft:red_ribbon", "christmas_craft:paper_pink"},
}
})
minetest.register_craft({
output = "christmas_craft:Christmas_present_violet",
recipe = {
{"christmas_craft:paper_violet","christmas_craft:red_ribbon", "christmas_craft:paper_violet"},
{"christmas_craft:paper_violet","christmas_craft:present_box", "christmas_craft:paper_violet"},
{"christmas_craft:paper_violet","christmas_craft:red_ribbon", "christmas_craft:paper_violet"},
}
})

View File

@ -0,0 +1 @@
default

View File

@ -0,0 +1,801 @@
--dofile(minetest.get_modpath("christmas_craft").."/mods.lua")--disabled because 4seasons is not installed
dofile(minetest.get_modpath("christmas_craft").."/crafts.lua") --temporary disabled because cristmas is over--
dofile(minetest.get_modpath("christmas_craft").."/settings.lua") -- makes it snow
-- blocks --
minetest.register_node("christmas_craft:snowman", {
description = "Snowman",
tiles = {"snow.png", "snow.png", "snow.png",
"snow.png", "snow.png", "Snowman_F.png"},
is_ground_content = true,
paramtype2 = "facedir",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("christmas_craft:christmas_lights", {
description = "christmas lights",
drawtype = "signlike",
light_source = 10,
walkable = false,
tiles = {
{name="lights_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3.0}},
},
inventory_image = "c_lights.png",
wield_image = "c_lights.png",
paramtype = "light",
paramtype2 = "wallmounted",
selection_box = {
type = "wallmounted",
},
groups = {oddly_breakable_by_hand = 3},
})
minetest.register_node("christmas_craft:christmas_wreath", {
description = "Christmas Wreath",
drawtype = "signlike",
walkable = false,
tiles = {
{name="Wreath.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3.0}},
},
inventory_image = "Wreath.png",
paramtype = "light",
paramtype2 = "wallmounted",
selection_box = {
type = "wallmounted",
},
groups = {oddly_breakable_by_hand = 3},
})
minetest.register_node("christmas_craft:christmas_star", {
description = "christmas Star",
drawtype = "plantlike",
light_source = 10,
tiles = {"star.png"},
is_ground_content = true,
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("christmas_craft:snow_block", {
description = "snow block",
tiles = {"snow.png"},
is_ground_content = true,
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("christmas_craft:christmas_leaves", {
description = "Christmas leaves",
drawtype = "allfaces_optional",
tiles = {"christmas_leaves.png"},
is_ground_content = false,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("christmas_craft:red_baubles", {
description = "Red Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_re.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_re.png","christmas_craft_baubles_side_re.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:yellow_baubles", {
description = "Yellow Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_ye.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_ye.png","christmas_craft_baubles_side_ye.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:green_baubles", {
description = "Green Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_gr.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_gr.png","christmas_craft_baubles_side_gr.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:blue_baubles", {
description = "Blue Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_bl.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_bl.png","christmas_craft_baubles_side_bl.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:orange_baubles", {
description = "Orange Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_or.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_or.png","christmas_craft_baubles_side_or.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:violet_baubles", {
description = "Violet Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_vi.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_vi.png","christmas_craft_baubles_side_vi.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:pink_baubles", {
description = "Pink Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_pi.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_pi.png","christmas_craft_baubles_side_pi.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
minetest.register_node("christmas_craft:silver_baubles", {
description = "Silver Baubles",
drawtype = "nodebox",
tiles = {"christmas_craft_baubles_top_si.png^christmas_craft_baubles_top.png","christmas_craft_baubles_top_si.png","christmas_craft_baubles_side_si.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side,
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
},
},
})
------------
--nodes--
-- presents --
minetest.register_node("christmas_craft:present_box", {
description = "Present Box",
tiles = {"christmas_craft_present_box.png"},
is_ground_content = true,
paramtype = "light",
groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("christmas_craft:Christmas_present", {
description = "Christmas Present",
tiles = {"christmas_craft_present_wh.png^christmas_craft_bow_top.png", "christmas_craft_present_wh.png^christmas_craft_bow_bottom.png", "christmas_craft_present_wh.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 1, min_items = 1, items = {
{items = {'default:bookshelf'}, rarity = 90,},
{items = {'default:pick_mese'}, rarity = 80,},
{items = {'default:shovel_steel'}, rarity = 90,},
{items = {'default:axe_steel'}, rarity = 90,},
{items = {'default:pick_steel'}, rarity = 90,},
{items = {'default:sign_wall'}, rarity = 80,},
{items = {'default:chest'}, rarity = 80,},
{items = {'default:furnace'}, rarity = 80,},
{items = {'default:steelblock'}, rarity = 80,},
{items = {'default:coal_lump'}, rarity = 80,},
{items = {'default:pick_diamond'}, rarity = 75,},
{items = {'default:shovel_diamond'}, rarity = 75,},
{items = {'default:axe_diamond'}, rarity = 75,},
{items = {'default:diamondblock'}, rarity = 75},
{items = {'fake_fire:flint_and_steel'}, rarity = 90,},
{items = {'default:chest_locked'}, rarity = 80,},
{items = {'default:brick'}, rarity = 80,},
{items = {'default:dirt_with_grass'}, rarity = 80,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_green", {
description = "Christmas Present Green ",
tiles = {"christmas_craft_present_gr.png^christmas_craft_bow_top.png", "christmas_craft_present_gr.png^christmas_craft_bow_bottom.png", "christmas_craft_present_gr.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_red", {
description = "Christmas Present Red ",
tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_blue", {
description = "Christmas Present Blue ",
tiles = {"christmas_craft_present_bl.png^christmas_craft_bow_top.png", "christmas_craft_present_bl.png^christmas_craft_bow_bottom.png", "christmas_craft_present_bl.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_yellow", {
description = "Christmas Present Yellow ",
tiles = {"christmas_craft_present_ye.png^christmas_craft_bow_top.png", "christmas_craft_present_ye.png^christmas_craft_bow_bottom.png", "christmas_craft_present_ye.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_red", {
description = "Christmas Present Red ",
tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_violet", {
description = "Christmas Present Violet ",
tiles = {"christmas_craft_present_vi.png^christmas_craft_bow_top.png", "christmas_craft_present_vi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_vi.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_orange", {
description = "Christmas Present Orange ",
tiles = {"christmas_craft_present_or.png^christmas_craft_bow_top.png", "christmas_craft_present_or.png^christmas_craft_bow_bottom.png", "christmas_craft_present_or.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
minetest.register_node("christmas_craft:Christmas_present_pink", {
description = "Christmas Present Pink ",
tiles = {"christmas_craft_present_pi.png^christmas_craft_bow_top.png", "christmas_craft_present_pi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_pi.png^christmas_craft_bow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:bookshelf'}, rarity = 15,},
{items = {'default:pick_mese'}, rarity = 20,},
{items = {'default:shovel_steel'}, rarity = 15,},
{items = {'default:axe_steel'}, rarity = 15,},
{items = {'default:pick_steel'}, rarity = 15,},
{items = {'default:sign_wall'}, rarity = 20,},
{items = {'default:chest'}, rarity = 20,},
{items = {'default:furnace'}, rarity = 20,},
{items = {'default:steelblock'}, rarity = 25,},
{items = {'default:coal_lump'}, rarity = 25,},
{items = {'default:pick_diamond'}, rarity = 30,},
{items = {'default:shovel_diamond'}, rarity = 30,},
{items = {'default:axe_diamond'}, rarity = 30,},
{items = {'default:diamondblock'}, rarity = 30,},
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,},
{items = {'default:dirt_with_grass'}, rarity = 30,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
------------
------------
--Items--
-- paper --
minetest.register_craftitem("christmas_craft:paper_blue", {
description = "Blue paper",
inventory_image = "christmas_craft_paper_bl.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_craftitem("christmas_craft:paper_yellow", {
description = "Yellow paper",
inventory_image = "christmas_craft_paper_ye.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_craftitem("christmas_craft:paper_green", {
description = "Green paper",
inventory_image = "christmas_craft_paper_gr.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_craftitem("christmas_craft:paper_red", {
description = "Red paper",
inventory_image = "christmas_craft_paper_re.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_craftitem("christmas_craft:paper_violet", {
description = "Violet paper",
inventory_image = "christmas_craft_paper_vi.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_craftitem("christmas_craft:paper_orange", {
description = "Orange paper",
inventory_image = "christmas_craft_paper_or.png",
stack_max = 99,
liquids_pointable = false,
})
minetest.register_craftitem("christmas_craft:paper_pink", {
description = "Pink paper",
inventory_image = "christmas_craft_paper_pi.png",
stack_max = 99,
liquids_pointable = false,
})
-- string --
minetest.register_craftitem("christmas_craft:red_ribbon", {
description = "Red Ribbon",
inventory_image = "christmas_craft_red_ribbon.png",
stack_max = 99,
liquids_pointable = false,
})
-- wish list --
minetest.register_craftitem("christmas_craft:wish_list", {
description = "Wish list",
inventory_image = "christmas_craft_which_list.png",
stack_max = 99,
liquids_pointable = false,
})
------------
-- minetest.register_craftitem("christmas_craft:snow_ball", {
-- description = "Snow ball",
-- inventory_image = "snow_ball.png",
-- stack_max = 16,
-- liquids_pointable = false,
--})
-- crafts --
--for craft see in craft.lua
-- override --
--minetest.registered_nodes["default:stick"].drawtype="torchlike";
--minetest.registered_nodes["default:stick"].selection_box = {
-- type = "wallmounted",
-- wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
-- }
minetest.register_node("christmas_craft:branch", {
description = "branch",
drawtype = "torchlike",
--tiles = {"default_torch_on_floor.png", "default_torch_on_ceiling.png", "default_torch.png"},
tiles = {"side_stick.png"},
inventory_image = "default_stick.png",
wield_image = "default_stick.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "wallmounted",
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
},
groups = {choppy=2,dig_immediate=3,flammable=1},
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
})
-- complex node --
snowball_DAMAGE=0.5
snowball_GRAVITY=9
snowball_VELOCITY=19
--Shoot snowball.
local snow_shoot_snowball=function (item, player, pointed_thing)
local playerpos=player:getpos()
local obj=minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, "christmas_craft:snowball_entity")
local dir=player:get_look_dir()
obj:setvelocity({x=dir.x*snowball_VELOCITY, y=dir.y*snowball_VELOCITY, z=dir.z*snowball_VELOCITY})
obj:setacceleration({x=dir.x*-3, y=-snowball_GRAVITY, z=dir.z*-3})
item:take_item()
return item
end
--The snowball Entity
snow_snowball_ENTITY={
physical = false,
timer=0,
damage=1,
gravity=10,
velocity=19,
range=1,
textures = {"snowball.png"},
lastpos={},
collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25},
}
--Snowball_entity.on_step()--> called when snowball is moving.
snow_snowball_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.env:get_node(pos)
--Become item when hitting a node.
if self.lastpos.x~=nil then --If there is no lastpos for some reason.
if node.name ~= "air" then
self.object:remove()
end
if node.name == "default:water_source" then
minetest.sound_play("cannons_splash",
{pos = pos, gain = 1.0, max_hear_distance = 32,})
self.object:remove()
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node
end
minetest.register_entity("christmas_craft:snowball_entity", snow_snowball_ENTITY)
--Snowball.
minetest.register_craftitem("christmas_craft:snowball", {
Description = "Snowball",
inventory_image = "snowball.png",
on_use = snow_shoot_snowball,
})
--Snow.
minetest.register_node("christmas_craft:snow", {
tiles = {"snow.png"},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
param2 = nil,
--param2 is reserved for what vegetation is hiding inside.
--mapgen defines the vegetation.
--1 = Moss
groups = {crumbly=3,melts=1,falling_node=1},
buildable_to = true,
drop = 'christmas_craft:snowball',
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.35, 0.5}
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.35, 0.5}
},
},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45},
}),
})

View File

@ -0,0 +1,87 @@
print (" ---- mods override is Loading! ---- ")
-- leaves --
--minetest.register_node(":4seasons:leaves_winter", {
-- description = "Leaves",
-- drawtype = "allfaces_optional",
-- visual_scale = 1.3,
-- tile_images = {"4seasons_leaves_with_snow.png"},
-- paramtype = "light",
-- groups = {snappy=3, leafdecay=3, flammable=2},
-- drop = {
-- max_items = 1, items = {
-- {items = {'default:sapling'}, rarity = 20,},
-- {items = {'4seasons:leaves_winter'},}
-- }},
-- sounds = default.node_sound_leaves_defaults(),
--})
-- why are u overwriting that? its just the normal 4 season leaves.
-- grass --
minetest.register_node(":4seasons:grass_winter", {
description = "Dirt with snow",
tiles = {"4seasons_snow.png", "default_dirt.png", "default_dirt.png^4seasons_grass_w_snow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {
max_items = 2, items = {
{items = {'default:dirt'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
--normal sand
minetest.register_node(":4seasons:sand_winter", {
description = "Sand with snow",
tiles = {"4seasons_snow.png", "default_sand.png", "default_sand.png^4seasons_sand_w_snow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {'default:sand',
max_items = 2, items = {
{items = {'default:sand'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
--desert sand
minetest.register_node(":4seasons:desertsand_winter", {
description = "Desert Sand with snow",
tiles = {"4seasons_snow.png", "default_desert_sand.png", "default_desert_sand.png^4seasons_desertsand_w_snow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = {'default:desert_sand',
max_items = 2, items = {
{items = {'default:desert_sand'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,},
}},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
--cactus winter
minetest.register_node(":4seasons:cactus_winter", {
description = "Cactus",
tiles = {"4seasons_cactus_wsnow_top.png", "4seasons_cactus_wsnow_top.png", "4seasons_cactus_wsnow_side.png"},
is_ground_content = true,
groups = {snappy=2,choppy=3,flammable=2},
drop = {'default:cactus',
max_items = 2, items = {
{items = {'default:cactus'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,},
}},
sounds = default.node_sound_wood_defaults(),
})

View File

@ -0,0 +1,62 @@
--
-- print (" ---- Overrider christmas_craft = true! ---- ")
--
-- minetest.register_node(":default:dirt_with_grass", {
-- description = "Dirt with Grass",
-- tiles = {"snow.png", "default_dirt.png", "grass_w_snow_side.png"},
-- is_ground_content = true,
-- groups = {crumbly=3,soil=1},
-- drop = {
-- max_items = 2, items = {
-- {items = {'default:dirt'}, rarity = 0,},
-- {items = {'christmas_craft:snowball'}, rarity = 0,},
-- }},
-- sounds = default.node_sound_dirt_defaults({
-- footstep = {name="default_grass_footstep", gain=0.4},
-- }),
-- })
--
-- minetest.register_node(":default:leaves", {
-- description = "Leaves",
-- drawtype = "nodebox",
-- visual_scale = 1.3,
-- tiles = {"snow.png", "christmas_craft_leaves_top.png", "christmas_craft_leaves_side.png"},
-- paramtype = "light",
-- groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
-- drop = {
-- max_items = 1,
-- items = {
-- {
-- -- player will get sapling with 1/20 chance
-- items = {'default:sapling'},
-- rarity = 20,
-- },
-- {
-- -- player will get leaves only if he get no saplings,
-- -- this is because max_items is 1
-- items = {'default:leaves'},
-- }
-- }
-- },
-- sounds = default.node_sound_leaves_defaults(),
-- node_box = {
-- type = "fixed",
-- fixed = {
-- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
-- },
-- },
-- selection_box = {
-- type = "fixed",
-- fixed = {
-- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
-- },
-- },
--
-- })
--
--
--
--
--
-- print (" ---- Overrider christmas_craft [OK] ---- ")
--

View File

@ -0,0 +1,14 @@
--------------------------------------------------
-- CONFIGURATION ---------------------------------
--------------------------------------------------
-------------------------------------------------------------
-- Change settings by changing the values after the "=". ----
-------------------------------------------------------------
-- enabels mod support --
dofile.enable_4seasons = false

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

View File

@ -0,0 +1,23 @@
===FARMING_PLUS MOD for MINETEST===
by PilzAdam
License:
Sourcecode: WTFPL (see below)
Graphics: WTFPL (see below)
See also:
http://minetest.net/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -0,0 +1,71 @@
-- main `S` code in init.lua
local S
S = farming.S
minetest.register_node("farming_plus:banana_sapling", {
description = S("Banana Tree Sapling"),
drawtype = "plantlike",
tiles = {"farming_banana_sapling.png"},
inventory_image = "farming_banana_sapling.png",
wield_image = "farming_banana_sapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("farming_plus:banana_leaves", {
drawtype = "allfaces_optional",
tiles = {"farming_banana_leaves.png"},
paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},
drop = {
max_items = 1,
items = {
{
items = {'farming_plus:banana_sapling'},
rarity = 20,
},
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_abm({
nodenames = {"farming_plus:banana_sapling"},
interval = 60,
chance = 20,
action = function(pos, node)
farming.generate_tree(pos, "default:tree", "farming_plus:banana_leaves", {"default:dirt", "default:dirt_with_grass"}, {["farming_plus:banana"]=20})
end
})
minetest.register_on_generated(function(minp, maxp, blockseed)
if math.random(1, 100) > 5 then
return
end
local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
local pos = minetest.find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
if pos ~= nil then
farming.generate_tree({x=pos.x, y=pos.y+1, z=pos.z}, "default:tree", "farming_plus:banana_leaves", {"default:dirt", "default:dirt_with_grass"}, {["farming_plus:banana"]=10})
end
end)
minetest.register_node("farming_plus:banana", {
description = S("Banana"),
tiles = {"farming_banana.png"},
inventory_image = "farming_banana.png",
wield_image = "farming_banana.png",
drawtype = "torchlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
sounds = default.node_sound_defaults(),
on_use = minetest.item_eat(6),
})

View File

@ -0,0 +1,87 @@
-- main `S` code in init.lua
local S
S = farming.S
minetest.register_craftitem("farming_plus:carrot_seed", {
description = S("Carrot Seeds"),
inventory_image = "farming_carrot_seed.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming_plus:carrot_1")
end
})
minetest.register_node("farming_plus:carrot_1", {
paramtype = "light",
walkable = false,
drawtype = "plantlike",
drop = "",
tiles = {"farming_carrot_1.png"},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+3/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming_plus:carrot_2", {
paramtype = "light",
walkable = false,
drawtype = "plantlike",
drop = "",
tiles = {"farming_carrot_2.png"},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+5/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming_plus:carrot_3", {
paramtype = "light",
walkable = false,
drawtype = "plantlike",
drop = "",
tiles = {"farming_carrot_3.png"},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+12/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming_plus:carrot", {
paramtype = "light",
walkable = false,
drawtype = "plantlike",
tiles = {"farming_carrot_4.png"},
drop = {
max_items = 6,
items = {
{ items = {'farming_plus:carrot_seed'} },
{ items = {'farming_plus:carrot_seed'}, rarity = 2},
{ items = {'farming_plus:carrot_seed'}, rarity = 5},
{ items = {'farming_plus:carrot_item'} },
{ items = {'farming_plus:carrot_item'}, rarity = 2 },
{ items = {'farming_plus:carrot_item'}, rarity = 5 }
}
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craftitem("farming_plus:carrot_item", {
description = S("Carrot"),
inventory_image = "farming_carrot.png",
on_use = minetest.item_eat(3),
})
farming.add_plant("farming_plus:carrot", {"farming_plus:carrot_1", "farming_plus:carrot_2", "farming_plus:carrot_3"}, 50, 20)

View File

@ -0,0 +1,81 @@
-- main `S` code in init.lua
local S
S = farming.S
minetest.register_node("farming_plus:cocoa_sapling", {
description = S("Cocoa Tree Sapling"),
drawtype = "plantlike",
tiles = {"farming_cocoa_sapling.png"},
inventory_image = "farming_cocoa_sapling.png",
wield_image = "farming_cocoa_sapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("farming_plus:cocoa_leaves", {
drawtype = "allfaces_optional",
tiles = {"farming_banana_leaves.png"},
paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},
drop = {
max_items = 1,
items = {
{
items = {'farming_plus:cocoa_sapling'},
rarity = 20,
},
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_abm({
nodenames = {"farming_plus:cocoa_sapling"},
interval = 60,
chance = 20,
action = function(pos, node)
farming.generate_tree(pos, "default:tree", "farming_plus:cocoa_leaves", {"default:sand", "default:desert_sand"}, {["farming_plus:cocoa"]=20})
end
})
minetest.register_on_generated(function(minp, maxp, blockseed)
if math.random(1, 100) > 5 then
return
end
local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
local pos = minetest.find_node_near(tmp, maxp.x-minp.x, {"default:desert_sand"})
if pos ~= nil then
farming.generate_tree({x=pos.x, y=pos.y+1, z=pos.z}, "default:tree", "farming_plus:cocoa_leaves", {"default:sand", "default:desert_sand"}, {["farming_plus:cocoa"]=20})
end
end)
minetest.register_node("farming_plus:cocoa", {
description = S("Cocoa"),
tiles = {"farming_cocoa.png"},
visual_scale = 0.5,
inventory_image = "farming_cocoa.png",
wield_image = "farming_cocoa.png",
drawtype = "torchlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
sounds = default.node_sound_defaults(),
})
minetest.register_craftitem("farming_plus:cocoa_bean", {
description = "Cocoa Bean",
inventory_image = "farming_cocoa_bean.png",
})
minetest.register_craft({
output = "farming_plus:cocoa_bean 10",
type = "shapeless",
recipe = {"farming_plus:cocoa"},
})

View File

@ -0,0 +1,3 @@
default
farming
intllib?

View File

@ -0,0 +1,324 @@
farming.registered_plants = {}
-- Boilerplate to support localized strings if intllib mod is installed.
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
farming.S = intllib.Getter(minetest.get_current_modname())
else
farming.S = function ( s ) return s end
end
function farming.add_plant(full_grown, names, interval, chance)
minetest.register_abm({
nodenames = names,
interval = interval,
chance = chance,
action = function(pos, node)
pos.y = pos.y-1
if minetest.get_node(pos).name ~= "farming:soil_wet" then
return
end
pos.y = pos.y+1
if not minetest.get_node_light(pos) then
return
end
if minetest.get_node_light(pos) < 8 then
return
end
local step = nil
for i,name in ipairs(names) do
if name == node.name then
step = i
break
end
end
if step == nil then
return
end
local new_node = {name=names[step+1]}
if new_node.name == nil then
new_node.name = full_grown
end
minetest.set_node(pos, new_node)
end
})
table.insert(farming.registered_plants, {
full_grown = full_grown,
names = names,
interval = interval,
chance = chance,
})
end
function farming.generate_tree(pos, trunk, leaves, underground, replacements)
pos.y = pos.y-1
local nodename = minetest.get_node(pos).name
local ret = true
for _,name in ipairs(underground) do
if nodename == name then
ret = false
break
end
end
pos.y = pos.y+1
if not minetest.get_node_light(pos) then
return
end
if ret or minetest.get_node_light(pos) < 8 then
return
end
node = {name = ""}
for dy=1,4 do
pos.y = pos.y+dy
if minetest.get_node(pos).name ~= "air" then
return
end
pos.y = pos.y-dy
end
node.name = trunk
for dy=0,4 do
pos.y = pos.y+dy
minetest.set_node(pos, node)
pos.y = pos.y-dy
end
if not replacements then
replacements = {}
end
node.name = leaves
pos.y = pos.y+3
for dx=-2,2 do
for dz=-2,2 do
for dy=0,3 do
pos.x = pos.x+dx
pos.y = pos.y+dy
pos.z = pos.z+dz
if dx == 0 and dz == 0 and dy==3 then
if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then
minetest.set_node(pos, node)
for name,rarity in pairs(replacements) do
if math.random(1, rarity) == 1 then
minetest.set_node(pos, {name=name})
end
end
end
elseif dx == 0 and dz == 0 and dy==4 then
if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then
minetest.set_node(pos, node)
for name,rarity in pairs(replacements) do
if math.random(1, rarity) == 1 then
minetest.set_node(pos, {name=name})
end
end
end
elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, node)
for name,rarity in pairs(replacements) do
if math.random(1, rarity) == 1 then
minetest.set_node(pos, {name=name})
end
end
end
else
if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then
if minetest.get_node(pos).name == "air" and math.random(1, 5) <= 4 then
minetest.set_node(pos, node)
for name,rarity in pairs(replacements) do
if math.random(1, rarity) == 1 then
minetest.set_node(pos, {name=name})
end
end
end
end
end
pos.x = pos.x-dx
pos.y = pos.y-dy
pos.z = pos.z-dz
end
end
end
end
farming.seeds = {
["farming:pumpkin_seed"]=60,
["farming_plus:strawberry_seed"]=30,
["farming_plus:rhubarb_seed"]=30,
["farming_plus:potatoe_seed"]=30,
["farming_plus:tomato_seed"]=30,
["farming_plus:orange_seed"]=30,
["farming_plus:carrot_seed"]=30,
}
-- ========= GENERATE PLANTS IN THE MAP =========
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y >= 2 and minp.y <= 0 then
-- Generate plants (code from flowers)
local perlin1 = minetest.get_perlin(974, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
local divs = (maxp.x-minp.x)/divlen+1;
for divx=0,divs-1 do
for divz=0,divs-1 do
local x0 = minp.x + math.floor((divx+0)*divlen)
local z0 = minp.z + math.floor((divz+0)*divlen)
local x1 = minp.x + math.floor((divx+1)*divlen)
local z1 = minp.z + math.floor((divz+1)*divlen)
-- Determine flowers amount from perlin noise
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 3 * 9)
-- Find random positions for flowers based on this random
local pr = PseudoRandom(seed+456)
for i=0,grass_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
-- Find ground level (0...15)
local ground_y = nil
for y=30,0,-1 do
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
ground_y = y
break
end
end
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
if nn == "default:dirt_with_grass" then
--local plant_choice = pr:next(1, #farming.registered_plants)
local plant_choice = math.floor(perlin1:get2d({x=x,y=z})*(#farming.registered_plants))
local plant = farming.registered_plants[plant_choice]
if plant then
minetest.set_node(p, {name=plant.full_grown})
end
end
end
end
end
end
end
end
end)
function farming.place_seed(itemstack, placer, pointed_thing, plantname)
-- Call on_rightclick if the pointed node defines it
if pointed_thing.type == "node" and placer and
not placer:get_player_control().sneak then
local n = minetest.get_node(pointed_thing.under)
local nn = n.name
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n,
placer, itemstack, pointed_thing) or itemstack, false
end
end
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local above = minetest.get_node(pt.above)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
-- check if pointing at the top of the node
if pt.above.y ~= pt.under.y+1 then
return
end
-- check if you can replace the node above the pointed node
if not minetest.registered_nodes[above.name].buildable_to then
return
end
-- check if pointing at soil
if minetest.get_item_group(under.name, "soil") < 2 then
return
end
-- add the node and remove 1 item from the itemstack
minetest.add_node(pt.above, {name=plantname, param2 = 1})
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end
-- ========= ALIASES FOR FARMING MOD BY SAPIER =========
-- potatoe -> potatoe
minetest.register_alias("farming:potatoe_node", "farming_plus:potatoe")
--minetest.register_alias("farming:potatoe", "farming:potatoe_item") cant do this
minetest.register_alias("farming:potatoe_straw", "farming_plus:potatoe")
minetest.register_alias("farming:seed_potatoe", "farming_plus:potatoe_seed")
for lvl = 1, 6, 1 do
minetest.register_entity(":farming:potatoe_lvl"..lvl, {
on_activate = function(self, staticdata)
minetest.set_node(self.object:getpos(), {name="farming_plus:potatoe_1"})
end
})
end
minetest.register_alias("farming:cotton", "farming:cotton_3")
minetest.register_alias("farming:wheat_harvested", "farming:wheat")
minetest.register_alias("farming:dough", "farming:flour")
minetest.register_abm({
nodenames = {"farming:wheat"},
interval = 1,
chance = 1,
action = function(pos)
minetest.set_node(pos, {name="farming:wheat_8"})
end,
})
-- ========= STRAWBERRIES =========
dofile(minetest.get_modpath("farming_plus").."/strawberries.lua")
-- ========= RHUBARB =========
dofile(minetest.get_modpath("farming_plus").."/rhubarb.lua")
-- ========= POTATOES =========
dofile(minetest.get_modpath("farming_plus").."/potatoes.lua")
-- ========= TOMATOES =========
dofile(minetest.get_modpath("farming_plus").."/tomatoes.lua")
-- ========= ORANGES =========
dofile(minetest.get_modpath("farming_plus").."/oranges.lua")
-- ========= BANANAS =========
dofile(minetest.get_modpath("farming_plus").."/bananas.lua")
-- ========= CARROTS =========
dofile(minetest.get_modpath("farming_plus").."/carrots.lua")
-- ========= COCOA =========
dofile(minetest.get_modpath("farming_plus").."/cocoa.lua")
-- ========= PUMPKIN =========
dofile(minetest.get_modpath("farming_plus").."/pumpkin.lua")
-- ========= WEED =========
dofile(minetest.get_modpath("farming_plus").."/weed.lua")

View File

@ -0,0 +1,50 @@
# Translation by Xanthin
### bananas.lua ###
Banana Tree Sapling = Bananenbaumsetzling
Banana = Banane
### carrots.lua ###
Carrot Seeds = Karottensamen
Carrot = Karotte
### cocoa.lua ###
Cocoa Tree Sapling = Kakaobaumsetzling
Cocoa = Kakao
Cocoa Bean = Kakaobohne
### oranges.lua ###
Orange Seeds = Orangensamen
Orange = Orange
### potatoes.lua ###
Potato Seeds = Kartoffelsamen
Potato = Kartoffel
### pumpkin.lua ###
Pumpkin Seed = Kuerbissamen
Pumpkin = Kuerbis
Pumpkin Face = Kuerbislaterne
Pumpkin Face With Light = Leuchtende Kuerbislaterne
Big Pumpkin = Riesen-Kuerbis
Scarecrow = Vogelscheuche
Scarecrow With Light = Leuchtende Vogelscheuche
Pumpkin Bread = Kuerbisbrot
Pumpkin Flour = Kuerbismehl
### rhubarb.lua ###
Rhubarb Seeds = Rhabarbersamen
Rhubarb = Rhabarber
### strawberries.lua ###
Strawberry Seeds = Erdbeersamen
Strawberry = Erdbeere
### tomatoes.lua ###
Tomato Seeds = Tomatensamen
Tomato = Tomate
### init.lua ###
### weed.lua ###
Weed = Unkraut

Some files were not shown because too many files have changed in this diff Show More