Add files via upload

master
starninjas 2021-06-18 16:05:05 -06:00 committed by GitHub
commit 2b80ec4e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 190 additions and 0 deletions

59
LICENSE.md Normal file
View File

@ -0,0 +1,59 @@
License of source code
----------------------
The MIT License (MIT)
Copyright (C) 2021 StarNinjas
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.
For more details:
https://opensource.org/licenses/MIT
Licenses of media (textures)
----------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2021 StarNinjas
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

6
README.md Normal file
View File

@ -0,0 +1,6 @@
Version 1.0
In real life, both copper and bronze will slowly "oxidize" when exposed to oxygen.
This process is sped up by other substances, among them is water.
So, with this mod, when copper or bronze touches water it will slowly turn into "Oxidized Block".
You can also craft "Oxidized Block" by mixing copper or bronze block with a water bucket.

3
depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
stairs?
bucket?

122
init.lua Normal file
View File

@ -0,0 +1,122 @@
--
-- Oxidized Blocks
--
minetest.register_node("xcopper:oxidizedblock", {
description = ("Oxidized Block"),
tiles = {"xcopper_oxidized_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default.node_sound_metal_defaults(),
})
-- Stairs
if minetest.get_modpath("stairs") then
stairs.register_stair(
"oxidized",
"xcopper:oxidizedblock",
{cracky = 1, level = 2},
{"xcopper_oxidized_block.png"},
"Oxidized Stair",
default.node_sound_metal_defaults(),
false
)
stairs.register_slab(
"oxidized",
"xcopper:oxidizedblock",
{cracky = 1, level = 2},
{"xcopper_oxidized_block.png"},
"Oxidized Slab",
default.node_sound_metal_defaults(),
false
)
stairs.register_stair_inner(
"oxidized",
"xcopper:oxidizedblock",
{cracky = 1, level = 2},
{"xcopper_oxidized_block.png"},
"Oxidized Inner Stair",
default.node_sound_metal_defaults(),
false
)
stairs.register_stair_outer(
"oxidized",
"xcopper:oxidizedblock",
{cracky = 1, level = 2},
{"xcopper_oxidized_block.png"},
"Oxidized Outer Stair",
default.node_sound_metal_defaults(),
false
)
end
-- Make Copper and Bronze have the group "oxidizes"
minetest.override_item("default:bronzeblock", {
description = ("Bronze Block"),
tiles = {"default_bronze_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2, oxidizes=3},
sounds = default.node_sound_metal_defaults(),
})
minetest.override_item("default:copperblock", {
description = ("Copper Block"),
tiles = {"default_copper_block.png"},
is_ground_content = false,
groups = {cracky = 1, level = 2, oxidizes=3},
sounds = default.node_sound_metal_defaults(),
})
--
-- Oxidation ABM
--
local oxide_correspondences = {
["default:copperblock"] = "xcopper:oxidizedblock",
["default:bronzeblock"] = "xcopper:oxidizedblock",
["stairs:stair_copperblock"] = "stairs:stair_oxidized",
["stairs:slab_copperblock"] = "stairs:slab_oxidized",
["stairs:stair_inner_copperblock"] = "stairs:stair_inner_oxidized",
["stairs:stair_outer_copperblock"] = "stairs:stair_outer_oxidized",
["stairs:stair_bronzeblock"] = "stairs:stair_oxidized",
["stairs:slab_bronzelock"] = "stairs:slab_oxidized",
["stairs:stair_inner_bronzeblock"] = "stairs:stair_inner_oxidized",
["stairs:stair_outer_bronzeblock"] = "stairs:stair_outer_oxidized",
}
minetest.register_abm({
label = "Oxidation",
nodenames = {"group:oxidizes"},
neighbors = {"group:water"},
interval = 20,
chance = 150,
catch_up = false,
action = function(pos, node)
node.name = oxide_correspondences[node.name]
if node.name then
minetest.set_node(pos, node)
end
end
})
-- You can craft Oxidized Block too
if minetest.get_modpath("bucket") then
minetest.register_craft({
type = "shapeless",
output = "default:oxidizedblock",
recipe = {
"group:oxidizes","bucket:bucket_water"
},
replacements = { {"bucket:bucket_water", "bucket:bucket_empty"} }
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B