mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
Merge pull request 'fix_copper_blocks' (#3390) from fix_copper_blocks into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3390 Reviewed-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land> Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
commit
d72a674097
@ -3,43 +3,15 @@
|
||||
local function register_oxidation_abm(abm_name, node_name, oxidized_variant)
|
||||
minetest.register_abm({
|
||||
label = abm_name,
|
||||
nodenames = {node_name},
|
||||
nodenames = { node_name },
|
||||
interval = 500,
|
||||
chance = 3,
|
||||
action = function(pos, node)
|
||||
minetest.swap_node(pos, {name = oxidized_variant, param2 = node.param2})
|
||||
minetest.swap_node(pos, { name = oxidized_variant, param2 = node.param2 })
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
function waxing_copper_block(pos, node, player, itemstack, convert_to)
|
||||
if itemstack:get_name() == "mcl_honey:honeycomb" then
|
||||
node.name = convert_to
|
||||
minetest.set_node(pos, node)
|
||||
awards.unlock(player:get_player_name(), "mcl:wax_on")
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function scraping_copper_block(pos, node, player, itemstack, convert_to)
|
||||
if itemstack:get_name():find("axe") then
|
||||
node.name = convert_to
|
||||
minetest.set_node(pos, node)
|
||||
awards.unlock(player:get_player_name(), "mcl:wax_off")
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
local tool = itemstack:get_name()
|
||||
local wear = mcl_autogroup.get_wear(tool, "axey")
|
||||
itemstack:add_wear(wear)
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
local stairs = {
|
||||
{"stair", "exposed", "_inner", "cut_inner"},
|
||||
@ -62,148 +34,42 @@ local stairs = {
|
||||
{"stair", "weathered", "", "exposed_cut"},
|
||||
}]]
|
||||
|
||||
--[[
|
||||
local function anti_oxidation_particles(pointed_thing)
|
||||
local pos = pointed_thing.under
|
||||
minetest.add_particlespawner({
|
||||
amount = 8,
|
||||
time = 1,
|
||||
minpos = {x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
|
||||
maxpos = {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
|
||||
minvel = {x = 0, y = 0, z = 0},
|
||||
maxvel = {x = 0, y = 0, z = 0},
|
||||
minacc = {x = 0, y = 0, z = 0},
|
||||
maxacc = {x = 0, y = 0, z = 0},
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 2.5,
|
||||
collisiondetection = false,
|
||||
vertical = false,
|
||||
texture = "mcl_copper_anti_oxidation_particle.png",
|
||||
glow = 5,
|
||||
})
|
||||
end
|
||||
|
||||
local function add_wear(placer, itemstack)
|
||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||
local tool = itemstack:get_name()
|
||||
local wear = mcl_autogroup.get_wear(tool, "axey")
|
||||
itemstack:add_wear(wear)
|
||||
end
|
||||
end
|
||||
|
||||
local function anti_oxidation(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
|
||||
|
||||
if not placer:get_player_control().sneak and noddef.on_rightclick then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
||||
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
|
||||
minetest.record_protection_violation(pointed_thing.under, placer:get_player_name())
|
||||
return itemstack
|
||||
end
|
||||
|
||||
if noddef._mcl_stripped_variant == nil then
|
||||
for _, c in pairs(stairs) do
|
||||
if noddef.name == "mcl_stairs:"..c[1].."_copper_"..c[2].."_cut"..c[3] then
|
||||
minetest.swap_node(pointed_thing.under, {name="mcl_stairs:"..c[1].."_copper_"..c[4], param2=node.param2})
|
||||
anti_oxidation_particles(pointed_thing)
|
||||
add_wear(placer, itemstack)
|
||||
end
|
||||
end
|
||||
if noddef._mcl_anti_oxidation_variant ~= nil then
|
||||
minetest.swap_node(pointed_thing.under, {name=noddef._mcl_anti_oxidation_variant, param2=node.param2})
|
||||
anti_oxidation_particles(pointed_thing)
|
||||
add_wear(placer, itemstack)
|
||||
end
|
||||
elseif noddef._mcl_stripped_variant ~= nil then
|
||||
minetest.swap_node(pointed_thing.under, {name=noddef._mcl_stripped_variant, param2=node.param2})
|
||||
add_wear(placer, itemstack)
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local function register_axe_override(axe_name)
|
||||
minetest.override_item("mcl_tools:axe_"..axe_name, {
|
||||
on_place = anti_oxidation,
|
||||
})
|
||||
end]]
|
||||
|
||||
--[[ Commented out for now because there the discussion how to handle this is ongoing
|
||||
local stonelike = {"mcl_core:stone", "mcl_core:diorite", "mcl_core:andesite", "mcl_core:granite"}
|
||||
if not deepslate_mod then
|
||||
if minetest.settings:get_bool("mcl_generate_ores", true) then
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "mcl_copper:stone_with_copper",
|
||||
wherein = stonelike,
|
||||
clust_scarcity = 830,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 3,
|
||||
y_min = mcl_vars.mg_overworld_min,
|
||||
y_max = mcl_worlds.layer_to_y(39),
|
||||
})
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "mcl_copper:stone_with_copper",
|
||||
wherein = stonelike,
|
||||
clust_scarcity = 1660,
|
||||
clust_num_ores = 4,
|
||||
clust_size = 2,
|
||||
y_min = mcl_worlds.layer_to_y(40),
|
||||
y_max = mcl_worlds.layer_to_y(63),
|
||||
})
|
||||
end
|
||||
end
|
||||
--]]
|
||||
local block_oxidation = {
|
||||
{"", "_exposed"},
|
||||
{"_cut", "_exposed_cut"},
|
||||
{"_exposed", "_weathered"},
|
||||
{"_exposed_cut", "_weathered_cut"},
|
||||
{"_weathered", "_oxidized"},
|
||||
{"_weathered_cut", "_oxidized_cut"}
|
||||
{ "", "_exposed" },
|
||||
{ "_cut", "_exposed_cut" },
|
||||
{ "_exposed", "_weathered" },
|
||||
{ "_exposed_cut", "_weathered_cut" },
|
||||
{ "_weathered", "_oxidized" },
|
||||
{ "_weathered_cut", "_oxidized_cut" }
|
||||
}
|
||||
|
||||
local stair_oxidation = {
|
||||
{"slab", "cut", "exposed_cut"},
|
||||
{"slab", "exposed_cut", "weathered_cut"},
|
||||
{"slab", "weathered_cut", "oxidized_cut"},
|
||||
{"slab", "cut_top", "exposed_cut_top"},
|
||||
{"slab", "exposed_cut_top", "weathered_cut_top"},
|
||||
{"slab", "weathered_cut_top", "oxidized_cut_double"},
|
||||
{"slab", "cut_double", "exposed_cut_double"},
|
||||
{"slab", "exposed_cut_double", "weathered_cut_double"},
|
||||
{"slab", "weathered_cut_double", "oxidized_cut_double"},
|
||||
{"stair", "cut", "exposed_cut"},
|
||||
{"stair", "exposed_cut", "weathered_cut"},
|
||||
{"stair", "weathered_cut", "oxidized_cut"},
|
||||
{"stair", "cut_inner", "exposed_cut_inner"},
|
||||
{"stair", "exposed_cut_inner", "weathered_cut_inner"},
|
||||
{"stair", "weathered_cut_inner", "oxidized_cut_inner"},
|
||||
{"stair", "cut_outer", "exposed_cut_outer"},
|
||||
{"stair", "exposed_cut_outer", "weathered_cut_outer"},
|
||||
{"stair", "weathered_cut_outer", "oxidized_cut_outer"}
|
||||
{ "slab", "cut", "exposed_cut" },
|
||||
{ "slab", "exposed_cut", "weathered_cut" },
|
||||
{ "slab", "weathered_cut", "oxidized_cut" },
|
||||
{ "slab", "cut_top", "exposed_cut_top" },
|
||||
{ "slab", "exposed_cut_top", "weathered_cut_top" },
|
||||
{ "slab", "weathered_cut_top", "oxidized_cut_double" },
|
||||
{ "slab", "cut_double", "exposed_cut_double" },
|
||||
{ "slab", "exposed_cut_double", "weathered_cut_double" },
|
||||
{ "slab", "weathered_cut_double", "oxidized_cut_double" },
|
||||
{ "stair", "cut", "exposed_cut" },
|
||||
{ "stair", "exposed_cut", "weathered_cut" },
|
||||
{ "stair", "weathered_cut", "oxidized_cut" },
|
||||
{ "stair", "cut_inner", "exposed_cut_inner" },
|
||||
{ "stair", "exposed_cut_inner", "weathered_cut_inner" },
|
||||
{ "stair", "weathered_cut_inner", "oxidized_cut_inner" },
|
||||
{ "stair", "cut_outer", "exposed_cut_outer" },
|
||||
{ "stair", "exposed_cut_outer", "weathered_cut_outer" },
|
||||
{ "stair", "weathered_cut_outer", "oxidized_cut_outer" }
|
||||
}
|
||||
|
||||
for _, b in pairs(block_oxidation) do
|
||||
register_oxidation_abm("Copper oxidation", "mcl_copper:block"..b[1], "mcl_copper:block"..b[2])
|
||||
register_oxidation_abm("Copper oxidation", "mcl_copper:block" .. b[1], "mcl_copper:block" .. b[2])
|
||||
end
|
||||
|
||||
for _, s in pairs(stair_oxidation) do
|
||||
register_oxidation_abm("Copper oxidation", "mcl_stairs:"..s[1].."_copper_"..s[2], "mcl_stairs:"..s[1].."_copper_"..s[3])
|
||||
register_oxidation_abm("Copper oxidation", "mcl_stairs:" .. s[1] .. "_copper_" .. s[2], "mcl_stairs:" .. s[1] .. "_copper_" .. s[3])
|
||||
-- TODO: Make stairs and slabs be waxable / scrapable. Place the Node overrides here, just like they are on the copper nodes, and it will work properly. May need to update mcl_honey to call the waxing function for stairs and slabs.
|
||||
end
|
||||
|
||||
--local axes = {"wood", "stone", "iron", "gold", "diamond"}
|
||||
--[[
|
||||
for _, axe in pairs(axes) do
|
||||
register_axe_override(axe)
|
||||
end
|
||||
]]
|
||||
|
@ -1,5 +1,7 @@
|
||||
local path = minetest.get_modpath("mcl_copper")
|
||||
|
||||
mcl_copper = {} -- initialize global variable.
|
||||
|
||||
dofile(path .. "/functions.lua")
|
||||
dofile(path .. "/nodes.lua")
|
||||
dofile(path .. "/items.lua")
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = mcl_copper
|
||||
author = NO11
|
||||
depends = mcl_core, mcl_sounds, mcl_stairs
|
||||
depends = mcl_core, mcl_sounds, mcl_stairs, mcl_util
|
||||
description = Adds Copper Ore, blocks and items.
|
||||
|
@ -12,7 +12,6 @@ minetest.register_node("mcl_copper:stone_with_copper", {
|
||||
_mcl_hardness = 3,
|
||||
_mcl_silk_touch_drop = true,
|
||||
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_raw", {
|
||||
@ -35,7 +34,7 @@ minetest.register_node("mcl_copper:block", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 3,
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block") end,
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block", {
|
||||
@ -47,7 +46,7 @@ minetest.register_node("mcl_copper:waxed_block", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 3,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_exposed", {
|
||||
@ -59,8 +58,8 @@ minetest.register_node("mcl_copper:block_exposed", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
_mcl_anti_oxidation_varient = "mcl_copper:block",
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_exposed") end,
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_exposed",
|
||||
_mcl_stripped_variant = "mcl_copper:block",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_exposed", {
|
||||
@ -72,7 +71,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_weathered", {
|
||||
@ -84,8 +83,8 @@ minetest.register_node("mcl_copper:block_weathered", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
_mcl_anti_oxidation_varient = "mcl_copper:block_exposed",
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_weathered") end,
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_weathered",
|
||||
_mcl_stripped_variant = "mcl_copper:block_exposed",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_weathered", {
|
||||
@ -97,7 +96,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_exposed") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_exposed",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_oxidized", {
|
||||
@ -109,8 +108,8 @@ minetest.register_node("mcl_copper:block_oxidized", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
_mcl_anti_oxidation_varient = "mcl_copper:block_weathered",
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_oxidized") end,
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_oxidized",
|
||||
_mcl_stripped_variant = "mcl_copper:block_weathered",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_oxidized", {
|
||||
@ -122,7 +121,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_weathered") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_weathered",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_cut", {
|
||||
@ -134,7 +133,7 @@ minetest.register_node("mcl_copper:block_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_cut") end,
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_cut", {
|
||||
@ -146,7 +145,7 @@ minetest.register_node("mcl_copper:waxed_block_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_cut") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_exposed_cut", {
|
||||
@ -158,8 +157,8 @@ minetest.register_node("mcl_copper:block_exposed_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
_mcl_anti_oxidation_varient = "mcl_copper:block_cut",
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_exposed_cut") end,
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_exposed_cut",
|
||||
_mcl_stripped_variant = "mcl_copper:block_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_exposed_cut", {
|
||||
@ -171,7 +170,7 @@ minetest.register_node("mcl_copper:waxed_block_exposed_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_cut") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_weathered_cut", {
|
||||
@ -183,8 +182,8 @@ minetest.register_node("mcl_copper:block_weathered_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
_mcl_anti_oxidation_varient = "mcl_copper:block_exposed_cut",
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_weathered_cut") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_exposed_cut",
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_weathered_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_weathered_cut", {
|
||||
@ -196,7 +195,7 @@ minetest.register_node("mcl_copper:waxed_block_weathered_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_exposed_cut") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_exposed_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:block_oxidized_cut", {
|
||||
@ -208,8 +207,8 @@ minetest.register_node("mcl_copper:block_oxidized_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
_mcl_anti_oxidation_varient = "mcl_copper:block_weathered_cut",
|
||||
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_oxidized_cut") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_weathered_cut",
|
||||
_mcl_copper_waxed_variant = "mcl_copper:waxed_block_oxidized_cut",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_copper:waxed_block_oxidized_cut", {
|
||||
@ -221,7 +220,7 @@ minetest.register_node("mcl_copper:waxed_block_oxidized_cut", {
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_weathered_cut") end,
|
||||
_mcl_stripped_variant = "mcl_copper:block_weathered_cut",
|
||||
})
|
||||
|
||||
mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut",
|
||||
|
@ -1,10 +1,32 @@
|
||||
---------------
|
||||
---- Honey ----
|
||||
---------------
|
||||
mcl_honey = {}
|
||||
|
||||
-- Variables
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local alldirs = {{x=0,y=0,z=1}, {x=1,y=0,z=0}, {x=0,y=0,z=-1}, {x=-1,y=0,z=0}, {x=0,y=-1,z=0}, {x=0,y=1,z=0}}
|
||||
local alldirs = { { x = 0, y = 0, z = 1 }, { x = 1, y = 0, z = 0 }, { x = 0, y = 0, z = -1 }, { x = -1, y = 0, z = 0 }, { x = 0, y = -1, z = 0 }, { x = 0, y = 1, z = 0 } }
|
||||
|
||||
-- Waxing Function
|
||||
function mcl_honey.wax_block(pos, node, player, itemstack)
|
||||
-- prevent modification of protected nodes.
|
||||
if mcl_util.check_position_protection(pos, player) then
|
||||
return
|
||||
end
|
||||
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
|
||||
if def and def._mcl_copper_waxed_variant then
|
||||
node.name = def._mcl_copper_waxed_variant
|
||||
end
|
||||
|
||||
minetest.set_node(pos, node)
|
||||
awards.unlock(player:get_player_name(), "mcl:wax_on")
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Honeycomb
|
||||
minetest.register_craftitem("mcl_honey:honeycomb", {
|
||||
@ -13,6 +35,16 @@ minetest.register_craftitem("mcl_honey:honeycomb", {
|
||||
_doc_items_usagehelp = S("Use on copper blocks to prevent further oxidation."),
|
||||
inventory_image = "mcl_honey_honeycomb.png",
|
||||
groups = { craftitem = 1 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return itemstack
|
||||
end
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local pos = pointed_thing.under
|
||||
|
||||
-- wax the block. This is the only viable usage of honeycomb's on_place. If it "fails" to wax, then nothing is changed.
|
||||
return mcl_honey.wax_block(pos, node, placer, itemstack)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_honey:honeycomb_block", {
|
||||
@ -23,10 +55,10 @@ minetest.register_node("mcl_honey:honeycomb_block", {
|
||||
},
|
||||
groups = { handy = 1, deco_block = 1 },
|
||||
sounds = {
|
||||
dig = {name="slimenodes_dug", gain=0.6, pitch=1.2},
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.3},
|
||||
dig = { name = "slimenodes_dug", gain = 0.6, pitch = 1.2 },
|
||||
dug = { name = "slimenodes_dug", gain = 0.6 },
|
||||
place = { name = "slimenodes_place", gain = 0.6 },
|
||||
footstep = { name = "slimenodes_step", gain = 0.3 },
|
||||
},
|
||||
_mcl_blast_resistance = 0.6,
|
||||
_mcl_hardness = 0.6,
|
||||
@ -38,7 +70,7 @@ minetest.register_craftitem("mcl_honey:honey_bottle", {
|
||||
_doc_items_longdesc = S("Honey Bottle is used to craft honey blocks and to restore hunger points."),
|
||||
_doc_items_usagehelp = S("Drinking will restore 6 hunger points. Can also be used to craft honey blocks."),
|
||||
inventory_image = "mcl_honey_honey_bottle.png",
|
||||
groups = { craftitem = 1, food = 3, eatable = 6, can_eat_when_full=1 },
|
||||
groups = { craftitem = 1, food = 3, eatable = 6, can_eat_when_full = 1 },
|
||||
on_place = minetest.item_eat(6, "mcl_potions:glass_bottle"),
|
||||
on_secondary_use = minetest.item_eat(6, "mcl_potions:glass_bottle"),
|
||||
_mcl_saturation = 1.2,
|
||||
@ -48,21 +80,21 @@ minetest.register_craftitem("mcl_honey:honey_bottle", {
|
||||
minetest.register_node("mcl_honey:honey_block", {
|
||||
description = S("Honey Block"),
|
||||
_doc_items_longdesc = S("Honey Block. Used as a decoration and in redstone. Is sticky on some sides."),
|
||||
tiles = {"mcl_honey_block_side.png"},
|
||||
tiles = { "mcl_honey_block_side.png" },
|
||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true,
|
||||
groups = { handy = 1, deco_block = 1, fall_damage_add_percent = -80 },
|
||||
sounds = {
|
||||
dug = {name="slimenodes_dug", gain=0.6},
|
||||
place = {name="slimenodes_place", gain=0.6},
|
||||
footstep = {name="slimenodes_step", gain=0.3},
|
||||
dug = { name = "slimenodes_dug", gain = 0.6 },
|
||||
place = { name = "slimenodes_place", gain = 0.6 },
|
||||
footstep = { name = "slimenodes_step", gain = 0.3 },
|
||||
},
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
{ -0.4, -0.4, -0.4, 0.4, 0.4, 0.4 },
|
||||
{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
@ -90,7 +122,7 @@ minetest.register_node("mcl_honey:honey_block", {
|
||||
elseif name == "mesecons_pistons:piston_down_sticky_off" or name == "mesecons_pistons:piston_down_normal_off" then
|
||||
piston, piston_down = true, true
|
||||
end
|
||||
if not( (piston_side and (n-1==neighbor_node.param2)) or (piston_up and (n==5)) or (piston_down and (n==6)) ) then
|
||||
if not ((piston_side and (n - 1 == neighbor_node.param2)) or (piston_up and (n == 5)) or (piston_down and (n == 6))) then
|
||||
if piston and piston_pos then
|
||||
if piston_pos.x == neighbor_pos.x and piston_pos.y == neighbor_pos.y and piston_pos.z == neighbor_pos.z then
|
||||
-- Loopback to the same piston! Preventing unwanted behavior:
|
||||
|
@ -2,3 +2,4 @@ name = mcl_honey
|
||||
author = PrairieWind
|
||||
description = MineClone 2 mod that adds honey and honeycomb and the respective block versions.
|
||||
depends = mesecons_mvps
|
||||
optional = mcl_copper
|
||||
|
Loading…
Reference in New Issue
Block a user