write something there

This commit is contained in:
N-Nachtigal 2025-05-04 16:01:41 +02:00
commit b4b6c08f4f
8546 changed files with 309825 additions and 0 deletions

View file

@ -0,0 +1,27 @@
quiet = 1
codes = true
exclude_files = {
".luarocks/*",
"worldeditadditions/utils/bit.lua"
}
ignore = {
"631", "61[124]",
"542",
"412",
"321/bit",
"21[123]"
}
-- Read-write globals (i.e. they can be defined)
globals = {
"flowerpot"
}
-- Read-only globals
read_globals = {
"minetest",
"default"
}
std = "max"

20
mods/flowerpot/LICENSE Normal file
View file

@ -0,0 +1,20 @@
flowerpot - a minetest mod that adds a stylish flowerpot
See spdx.org/licenses to see what the License Identifiers used below mean.
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
All source code (lua):
(C) Auke Kok <sofar@foo-projects.org>
LGPL-2.1+
All models:
(C) Auke Kok <sofar@foo-projects.org>
CC-BY-SA-3.0
All Textures:
Public-Domain, see:
https://mods.curse.com/texture-packs/minecraft/227527-isabella-ii
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

6
mods/flowerpot/api.md Normal file
View file

@ -0,0 +1,6 @@
## flowerpot API
`flowerpot.register_node(name)`
* name = node name, e.g. "default:sapling"
* the node must be defined and registered first using `minetest.register_node()`.

304
mods/flowerpot/init.lua Normal file
View file

@ -0,0 +1,304 @@
--[[
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
"flowerpot" 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.
--]]
flowerpot = {}
local f = string.format
-- Translation
local S = minetest.get_translator("flowerpot")
local flower_items_by_pot = {}
-- handle plant insertion into flowerpot
local function flowerpot_on_rightclick(pos, node, clicker, itemstack, pointed_thing)
if not minetest.is_player(clicker) then
return itemstack
end
local player_name = clicker:get_player_name()
if minetest.is_protected(pos, player_name) then
return itemstack
end
local item_name = itemstack:get_name()
local pot_name = "flowerpot:" .. item_name:gsub(":", "_")
local def = minetest.registered_nodes[pot_name]
if not def then
return itemstack
end
minetest.sound_play(def.sounds.place, {pos = pos})
minetest.swap_node(pos, {name = pot_name})
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
end
return itemstack
end
local function get_tile(def)
local tile = def.tiles[1]
if type (tile) == "table" then
return tile.name
end
return tile
end
local old_get_node_drops = minetest.get_node_drops
function minetest.get_node_drops(node, toolname)
local node_name
if type(node) == "table" then
node_name = node.name
elseif type(node) == "string" then
node_name = node
end
if node_name then
local flower_item = flower_items_by_pot[node_name]
if flower_item then
local drops = old_get_node_drops(flower_item, toolname)
if drops then
table.insert(drops, "flowerpot:empty")
return drops
else
return { "flowerpot:empty" }
end
end
end
return old_get_node_drops(node, toolname)
end
function flowerpot.register_node(nodename)
assert(nodename, "no nodename passed")
local nodedef = minetest.registered_nodes[nodename]
if not nodedef then
error(f("%s is not a known node, unable to register flowerpot", nodename))
end
local desc = nodedef.description
local name = nodedef.name:gsub(":", "_")
local tiles
if nodedef.drawtype == "plantlike" then
tiles = {
{name = "flowerpot.png"},
{name = get_tile(nodedef)},
{name = "blank.png"},
}
else
tiles = {
{name = "flowerpot.png"},
{name = "blank.png"},
{name = get_tile(nodedef)},
}
end
flower_items_by_pot["flowerpot:" .. name] = nodename
minetest.register_node(":flowerpot:" .. name, {
description = S("Flowerpot with @1", desc),
drawtype = "mesh",
mesh = "flowerpot.obj",
tiles = tiles,
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
collision_box = {
type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, -1/8, 1/4},
},
selection_box = {
type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4},
},
sounds = default.node_sound_defaults(),
groups = {attached_node = 1, oddly_breakable_by_hand = 1, snappy = 3, not_in_creative_inventory = 1},
flowerpot_plantname = nodename,
node_dig_prediction = "flowerpot:empty",
on_punch = function(pos, node, puncher, pointed_thing)
if not (puncher and puncher:is_player()) then
return
end
if minetest.is_protected(pos, puncher:get_player_name()) then
return
end
local toolname = puncher:get_wielded_item()
if node.name then
local flower_item = flower_items_by_pot[node.name]
if flower_item then
local drops = old_get_node_drops(flower_item, toolname)
minetest.handle_node_drops(pos, drops, puncher)
end
end
minetest.swap_node(pos, {name = "flowerpot:empty"})
end,
})
end
-- empty flowerpot
minetest.register_node("flowerpot:empty", {
description = S("Flowerpot"),
drawtype = "mesh",
mesh = "flowerpot.obj",
inventory_image = "flowerpot_item.png",
wield_image = "flowerpot_item.png",
tiles = {
{name = "flowerpot.png"},
{name = "blank.png"},
{name = "blank.png"},
},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
collision_box = {
type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, -1/8, 1/4},
},
selection_box = {
type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, -1/16, 1/4},
},
sounds = default.node_sound_defaults(),
groups = {attached_node = 1, oddly_breakable_by_hand = 3, cracky = 1, dig_immediate = 3},
on_rightclick = flowerpot_on_rightclick,
})
-- craft
minetest.register_craft({
output = "flowerpot:empty",
recipe = {
{"default:clay_brick", "", "default:clay_brick"},
{"", "default:clay_brick", ""},
}
})
for _, node in pairs({
-- default nodes
"default:acacia_bush_sapling",
"default:acacia_bush_stem",
"default:acacia_sapling",
"default:aspen_sapling",
"default:blueberry_bush_sapling",
"default:pine_bush_sapling",
"default:bush_sapling",
"default:bush_stem",
"default:cactus",
"default:dry_grass_1",
"default:dry_grass_2",
"default:dry_grass_3",
"default:dry_grass_4",
"default:dry_grass_5",
"default:dry_shrub",
"default:emergent_jungle_sapling",
"default:grass_1",
"default:grass_2",
"default:grass_3",
"default:grass_4",
"default:grass_5",
"default:marram_grass_1",
"default:marram_grass_2",
"default:marram_grass_3",
"default:large_cactus_seedling",
"default:junglegrass",
"default:junglesapling",
"default:papyrus",
"default:pine_sapling",
"default:sapling",
"default:fern_1",
"default:fern_2",
"default:fern_3",
-- farming nodes
"farming:cotton_1",
"farming:cotton_2",
"farming:cotton_3",
"farming:cotton_4",
"farming:cotton_5",
"farming:cotton_6",
"farming:cotton_7",
"farming:cotton_8",
"farming:wheat_1",
"farming:wheat_2",
"farming:wheat_3",
"farming:wheat_4",
"farming:wheat_5",
"farming:wheat_6",
"farming:wheat_7",
"farming:wheat_8",
-- flowers nodes
"flowers:dandelion_white",
"flowers:dandelion_yellow",
"flowers:geranium",
"flowers:mushroom_brown",
"flowers:mushroom_red",
"flowers:rose",
"flowers:tulip",
"flowers:viola",
"flowers:chrysanthemum_green",
"flowers:tulip_black",
-- moretrees nodes
"moretrees:beech_sapling",
"moretrees:apple_tree_sapling",
"moretrees:oak_sapling",
"moretrees:sequoia_sapling",
"moretrees:birch_sapling",
"moretrees:palm_sapling",
"moretrees:date_palm_sapling",
"moretrees:spruce_sapling",
"moretrees:cedar_sapling",
"moretrees:poplar_sapling",
"moretrees:poplar_small_sapling",
"moretrees:rubber_tree_sapling",
"moretrees:fir_sapling",
"moretrees:jungletree_sapling",
"moretrees:beech_sapling_ongen",
"moretrees:apple_tree_sapling_ongen",
"moretrees:oak_sapling_ongen",
"moretrees:sequoia_sapling_ongen",
"moretrees:birch_sapling_ongen",
"moretrees:palm_sapling_ongen",
"moretrees:date_palm_sapling_ongen",
"moretrees:spruce_sapling_ongen",
"moretrees:cedar_sapling_ongen",
"moretrees:poplar_sapling_ongen",
"moretrees:poplar_small_sapling_ongen",
"moretrees:rubber_tree_sapling_ongen",
"moretrees:fir_sapling_ongen",
"moretrees:jungletree_sapling_ongen",
-- dryplants nodes
"dryplants:grass",
"dryplants:grass_short",
"dryplants:hay",
"dryplants:juncus",
"dryplants:juncus_02",
"dryplants:reedmace_spikes",
"dryplants:reedmace_top",
"dryplants:reedmace_height_2",
"dryplants:reedmace_height_3",
"dryplants:reedmace_3_spikes",
"dryplants:reedmace",
"dryplants:reedmace_bottom",
"dryplants:reedmace_sapling",
-- poisonivy nodes
"poisonivy:seedling",
"poisonivy:sproutling",
"poisonivy:climbing",
}) do
if minetest.registered_nodes[node] then
flowerpot.register_node(node)
end
end

View file

@ -0,0 +1,7 @@
# textdomain: flowerpot
@1 is not a known node, unable to register flowerpot=@1 is not a known node, unable to register flowerpot
Flowerpot with @1=Flowerpot with @1
Flowerpot=Flowerpot

View file

@ -0,0 +1,7 @@
# textdomain: flowerpot
@1 is not a known node, unable to register flowerpot=@1 ne estas konata nodo, nekapabla registri florpoton
Flowerpot with @1=Florpoto kun @1
Flowerpot=Florpoto

View file

@ -0,0 +1,7 @@
# textdomain: flowerpot
@1 is not a known node, unable to register flowerpot=@1 no es un nodo conocido, no se pudo registrar la maceta
Flowerpot with @1=Maceta con @1
Flowerpot=Maceta

View file

@ -0,0 +1,9 @@
# textdomain: flowerpot
# Translation fr by Louis Royer
@1 is not a known node, unable to register flowerpot=@1 est un block inconnu, impossible denregister le pot de fleurs
Flowerpot with @1=Pot de fleurs avec @1
Flowerpot=Pot de fleurs

4
mods/flowerpot/mod.conf Normal file
View file

@ -0,0 +1,4 @@
name = flowerpot
depends = default
optional_depends = moretrees, dryplants, poisonivy, farming, flowers
description = A stylish flowerpot that can contain most plants.

View file

@ -0,0 +1,234 @@
# Blender v2.78 (sub 0) OBJ File: 'flowerpot.blend'
# www.blender.org
mtllib flowerpot.mtl
o Cube
v 0.187500 -0.437500 -0.187500
v 0.187500 -0.437500 0.187500
v -0.187500 -0.437500 0.187500
v -0.187500 -0.437500 -0.187500
v 0.187500 -0.125000 -0.187500
v 0.187500 -0.125000 0.187500
v -0.187500 -0.125000 0.187500
v -0.187500 -0.125000 -0.187500
v -0.125000 -0.125000 -0.125000
v 0.125000 -0.125000 0.125000
v 0.125000 -0.125000 -0.125000
v -0.125000 -0.125000 -0.125000
v 0.187500 -0.125000 0.125000
v 0.125000 -0.187500 -0.125000
v 0.125000 -0.187500 0.125000
v -0.187500 -0.125000 -0.125000
v 0.187500 -0.125000 -0.125000
v -0.125000 -0.187500 -0.125000
v -0.125000 -0.187500 0.125000
v -0.187500 -0.125000 0.125000
v 0.125000 -0.125000 0.125000
v -0.125000 -0.125000 -0.125000
v -0.125000 -0.125000 0.125000
v -0.125000 -0.125000 -0.125000
v 0.125000 -0.125000 -0.125000
v 0.125000 -0.125000 0.125000
v -0.125000 -0.125000 0.125000
v -0.125000 -0.125000 0.125000
v 0.125000 -0.125000 -0.125000
v 0.125000 -0.125000 0.125000
v 0.125000 -0.125000 -0.125000
v -0.125000 -0.125000 0.125000
v -0.172986 -0.104281 -0.179133
v 0.172986 -0.187289 0.179132
v 0.172986 -0.104282 0.179132
v 0.230648 -0.104282 0.238843
v -0.238843 0.476773 0.230648
v 0.238843 0.476773 -0.230648
v -0.125000 -0.500000 0.125000
v -0.125000 -0.500000 -0.125000
v 0.187500 -0.437500 0.125000
v 0.125000 -0.500000 -0.125000
v -0.187500 -0.437500 -0.125000
v 0.187500 -0.437500 -0.125000
v 0.125000 -0.500000 0.125000
v -0.187500 -0.437500 0.125000
v 0.125000 -0.437500 0.125000
v 0.125000 -0.437500 -0.125000
v -0.125000 -0.437500 -0.125000
v -0.125000 -0.437500 0.125000
v -0.230648 0.476773 -0.238843
v -0.230648 -0.104281 -0.238843
v -0.172986 -0.187289 -0.179133
v 0.230648 0.476773 0.238843
v -0.179133 -0.187289 0.172986
v 0.238843 -0.104282 -0.230648
v -0.238843 -0.104281 0.230648
v 0.179132 -0.187289 -0.172986
v -0.179133 -0.104281 0.172986
v 0.179132 -0.104282 -0.172986
v 0.132813 -0.187289 -0.132812
v 0.132812 -0.187289 0.132813
v -0.132812 -0.187289 -0.132812
v -0.132813 -0.187289 0.132812
v 0.132812 0.476682 0.132813
v -0.132813 0.476682 0.132812
v -0.132812 0.476682 -0.132812
v 0.132813 0.476682 -0.132812
vt 0.6250 0.5000
vt 0.6250 0.7500
vt 0.3750 0.7500
vt 0.3750 0.5000
vt 1.0000 0.5625
vt 1.0000 0.8750
vt 0.9375 0.8750
vt 0.6875 0.8750
vt 0.6250 0.8750
vt 0.6250 0.5625
vt 0.6875 0.5625
vt 0.9375 0.5625
vt 0.3750 0.9375
vt 0.0000 0.9375
vt 0.0000 0.8750
vt 0.3750 0.8750
vt 0.9375 0.9375
vt 0.6875 0.9375
vt 0.6875 0.8750
vt 0.9375 0.8750
vt 0.9375 0.9375
vt 0.3125 0.9375
vt 0.0625 0.9375
vt -0.0000 0.9375
vt -0.0000 0.8750
vt 0.3750 0.8750
vt 0.3750 0.9375
vt 0.0000 0.5625
vt 0.3750 0.5625
vt 0.3125 1.0000
vt 0.0625 1.0000
vt 0.9375 0.9375
vt 0.6875 0.9375
vt 0.6875 0.9375
vt 0.9375 0.9375
vt 1.0000 0.5625
vt 1.0000 0.8750
vt 0.6250 0.8750
vt 0.6250 0.5625
vt 0.6875 0.5625
vt 0.9375 0.5625
vt 0.3750 0.5625
vt 0.0000 0.5625
vt 0.0625 0.9375
vt 0.3125 0.9375
vt 0.3125 1.0000
vt 0.0625 1.0000
vt 0.9375 1.0000
vt 0.6875 1.0000
vt 0.9375 1.0000
vt 0.6875 1.0000
vt 0.0000 0.5000
vt 0.0625 0.5000
vt 0.3125 0.5000
vt 0.3750 0.5000
vt 0.3125 0.5000
vt 0.0625 0.5000
vt 0.0625 0.4375
vt 0.3125 0.4375
vt 0.3750 0.5000
vt 0.0000 0.5000
vt 0.6875 0.5000
vt 0.9375 0.5000
vt 0.6875 0.5000
vt 0.9375 0.5000
vt 0.3750 1.0000
vt 0.3750 0.7500
vt 0.6250 0.7500
vt 0.6250 1.0000
vt 0.6875 0.4375
vt 0.9375 0.4375
vt 0.0625 0.4375
vt 0.3125 0.4375
vt 0.6875 0.4375
vt 0.9375 0.4375
vt 0.0020 0.9983
vt 0.0020 0.1265
vt 0.1265 0.1265
vt 0.1265 0.0020
vt 0.8735 0.0020
vt 0.8735 0.1265
vt 0.9980 0.1265
vt 0.9980 0.9983
vt 0.0020 0.9983
vt 0.9980 0.9983
vt 0.9980 0.1265
vt 0.8735 0.1265
vt 0.8735 0.0020
vt 0.1265 0.0020
vt 0.1265 0.1265
vt 0.0020 0.1265
vt 0.1875 0.8750
vt 0.1875 0.6250
vt 0.4375 0.6250
vt 0.4375 0.8750
vt 0.0625 -0.0000
vt 0.3125 -0.0000
vt 0.3125 0.6250
vt 0.0625 0.6250
vt 0.2500 -0.0000
vt 0.5000 -0.0000
vt 0.5000 0.6250
vt 0.2500 0.6250
vt 0.7500 -0.0000
vt 0.7500 0.6250
vt 0.9375 0.0000
vt 0.6875 -0.0000
vt 0.6875 0.6250
vt 0.9375 0.6250
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 -1.0000 -0.0000
vn 0.7193 0.0000 -0.6947
vn 0.6947 -0.0000 0.7193
g Cube_Cube_pot
usemtl pot
s off
f 18/1/1 19/2/1 15/3/1 14/4/1
f 1/5/2 5/6/2 17/7/2 13/8/2 6/9/2 2/10/2 41/11/2 44/12/2
f 13/13/1 20/14/1 7/15/1 6/16/1
f 32/17/1 24/18/1 16/19/1 20/20/1 27/21/1
f 24/22/1 29/23/1 17/24/1 5/25/1 8/26/1 16/27/1
f 3/28/3 2/29/3 6/16/3 7/15/3
f 29/23/3 24/22/3 18/30/3 14/31/3
f 29/32/1 30/33/1 26/34/1 13/8/1 17/7/1 25/35/1
f 3/36/4 7/37/4 20/20/4 16/19/4 8/38/4 4/39/4 43/40/4 46/41/4
f 4/42/5 8/26/5 5/25/5 1/43/5
f 32/44/5 30/45/5 15/46/5 19/47/5
f 30/33/4 29/32/4 14/48/4 15/49/4
f 24/18/2 32/17/2 19/50/2 18/51/2
f 2/29/6 3/28/6 46/52/6 50/53/6 47/54/6 41/55/6
f 49/56/5 48/57/5 42/58/5 40/59/5
f 48/57/6 49/56/6 43/60/6 4/42/6 1/43/6 44/61/6
f 49/62/6 50/63/6 46/41/6 43/40/6
f 44/12/6 41/11/6 47/64/6 48/65/6
f 40/66/6 42/67/6 45/68/6 39/69/6
f 48/65/2 47/64/2 45/70/2 42/71/2
f 47/54/3 50/53/3 39/72/3 45/73/3
f 50/63/4 49/62/4 40/74/4 39/75/4
g Cube_Cube_plant
usemtl plant
f 54/76/7 36/77/7 35/78/7 34/79/7 53/80/7 33/81/7 52/82/7 51/83/7
f 38/84/8 37/85/8 57/86/8 59/87/8 55/88/8 58/89/8 60/90/8 56/91/8
g Cube_Cube_block
usemtl block
f 67/92/1 66/93/1 65/94/1 68/95/1
f 63/96/4 64/97/4 66/98/4 67/99/4
f 64/100/3 62/101/3 65/102/3 66/103/3
f 62/101/2 61/104/2 68/105/2 65/102/2
f 61/106/5 63/107/5 67/108/5 68/109/5
l 28 23
l 22 9
l 11 31
l 19 28
l 14 11
l 18 22
l 10 21
l 24 12
l 15 10

34
mods/flowerpot/readme.md Normal file
View file

@ -0,0 +1,34 @@
flowerpot
=========
This minetest mod adds a simple, single-node, non-entity flowerpot
that can contain `plantlike` drawtype nodes.
The player can place these pots as normal nodes, and then right-click
the pot with a plant or plantlike node, and the pot then will contain
a slightly smaller version of the plant. If punched, the plant that
was put in the pot will be returned to the puncher.
The concept works through the use of object materials. The empty
flowerpot node has the same model, but part of the mesh is transparent
and therefore not visible. If a plant is inserted, the transparent
textures are replaced with the texture of the plant node, and thus
it looks like the plant is inserted, while effectively the pot is a
single node without metadata.
There are no crafting recipes for each variant. The player can craft
pots and potentially use `/giveme` to give filled versions of the
flowerpot, but the creative inventory does not contain them as they
are easily filled already.
The model was made in blender from scratch by the author.
The texture of the flowerpot itself was created from the flowerpot
texture of the excellent Isabella II texture pack, which is Public
Domain. The texture has been reworked to allow for a more detailed
texturing of the flowerpot model.
The flowerpot mod has an API that can be used by other mods to create
new plant-flowerpot combinations. See api.md for usage information.

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B