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

15
mods/geodes/LICENSE.txt Normal file
View file

@ -0,0 +1,15 @@
~~LICENSE~~
Source Code:
(C) AwesomeDragon97
LGPL-3.0
Textures:
(C) AwesomeDragon97
CC-BY-SA-3.0
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.

141
mods/geodes/init.lua Normal file
View file

@ -0,0 +1,141 @@
geodes = {}
local geode_types = {}
minetest.register_node("geodes:calcite", {
description = "Calcite",
tiles = {"calcite.png"},
groups = {cracky = 3, not_in_creative_inventory = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("geodes:amethyst_block", {
description = "Amethyst Block",
tiles = {"amethyst_block.png"},
groups = {cracky = 3, not_in_creative_inventory = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("geodes:basalt", {
description = "Basalt",
tiles = {"basalt.png"},
groups = {cracky = 3, not_in_creative_inventory = 1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("geodes:amethyst_crystal", {
description = "Amethyst Crystal",
tiles = {"amethyst_crystal.png"},
inventory_image = "amethyst_crystal.png",
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "wallmounted",
groups = {cracky = 3, not_in_creative_inventory = 1},
sounds = default.node_sound_stone_defaults(),
node_box = {
type = "fixed",
fixed = {-5/16, -0.5, -5/16, 5/16, 5/16, 5/16}
},
selection_box = {
type = "fixed",
fixed = {-5/16, -0.5, -5/16, 5/16, 5/16, 5/16}
},
})
minetest.register_node("geodes:geode_core", {
groups = {not_in_creative_inventory = 1},
})
minetest.register_ore({
ore_type = "scatter",
ore = "geodes:geode_core",
wherein = "default:stone",
clust_scarcity = 64 * 64 * 64,
clust_num_ores = 1,
clust_size = 1,
y_max = -40,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "geodes:geode_core",
wherein = "air",
clust_scarcity = 64 * 64 * 64,
clust_num_ores = 1,
clust_size = 1,
y_max = -40,
y_min = -31000,
})
minetest.register_lbm({
label = "make_geode",
name = "geodes:create_geode",
nodenames = {"geodes:geode_core"},
run_at_every_load = true,
action = function(pos, node)
if (#geode_types == 0) then
minetest.log('THE GEODES MOD REQUIRES AT LEAST ONE MOD THAT ADDS GEODES TO FUNCTION. PLEASE MAKE SURE THAT THE "amethyst_geodes" MOD IS ENABLED, OR ANOTHER MOD THAT USES THE API IS ENABLED.')
return
end
local pcgr = PcgRandom(minetest.hash_node_position(pos))
local outer, middle, inner, crystal, fill, size_min, size_max = unpack(geode_types[math.random(1, #geode_types)])
local size = pcgr:next(size_min, size_max)
for x = -size, size do
for y = -size, size do
for z = -size, size do
if minetest.get_node(pos + vector.new(x, y, z)).name ~= "air" then
if vector.distance(vector.new(x, y, z), vector.new()) < size then
minetest.set_node(pos + vector.new(x, y, z), {name = outer})
if vector.distance(vector.new(x, y, z), vector.new()) < size - 1 then
minetest.set_node(pos + vector.new(x, y, z), {name = middle})
if vector.distance(vector.new(x, y, z), vector.new()) < size - 2 then
minetest.set_node(pos + vector.new(x, y, z), {name = inner})
if vector.distance(vector.new(x, y, z), vector.new()) < size - 3 then
minetest.set_node(pos + vector.new(x, y, z), {name = fill})
end
end
end
end
end
end
end
end
if crystal ~= fill then
for x = -size +4, size -4 do
for y = -size +4, size -4 do
for z = -size +4, size -4 do
if pcgr:next(0, 10) == 0 and vector.distance(vector.new(x, y, z), vector.new()) >= size - 4 and vector.distance(vector.new(x, y, z), vector.new()) < size - 3 then
if minetest.get_node(pos + vector.new(x, y + 1, z)).name == inner then
minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 0})
elseif minetest.get_node(pos + vector.new(x, y - 1, z)).name == inner then
minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 1})
elseif minetest.get_node(pos + vector.new(x + 1, y, z)).name == inner then
minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 2})
elseif minetest.get_node(pos + vector.new(x - 1, y, z)).name == inner then
minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 3})
elseif minetest.get_node(pos + vector.new(x, y, z + 1)).name == inner then
minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 4})
elseif minetest.get_node(pos + vector.new(x, y, z - 1)).name == inner then
minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 5})
end
end
end
end
end
end
end,
})
function geodes.register_geode(outer, middle, inner, crystal, fill, size_min, size_max)
table.insert(geode_types, {outer, middle, inner, crystal or "air", fill or "air", size_min or 6, size_max or 11})
end

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

@ -0,0 +1,4 @@
name = geodes
title = Geodes
description = Adds an API to make custom geodes.
depends = default

BIN
mods/geodes/textures/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B