1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
SmokeyDope 9fe7bb75f5 add sounds 'zap_on' and 'zap_off'
taken from
https://freesound.org/people/JustHallowed/sounds/691007/
2024-04-30 23:47:32 +00:00
SmokeyDope 88481edac5 add Orb of Exchange texture 2024-04-30 23:44:05 +00:00
SmokeyDope 7608925060 Upload files to "mods/ITEMS/mcl_transmutation" 2024-04-30 23:42:50 +00:00
5 changed files with 54 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,49 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local exchange_node
function exchange_node(itemstack, placer, pointed_thing)
-- Use pointed node's on_rightclick function first, if present
local node = minetest.get_node(pointed_thing.under)
if placer and not placer:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
end
end
-- Node exchange recipes
if node.name == "mcl_core:cobble" then
minetest.sound_play({name="zap_on", pos=pos, gain=1}, true)
minetest.set_node(pointed_thing.under, {name="mcl_deepslate:deepslate_cobbled"})
end
if node.name == "mcl_deepslate:deepslate_cobbled" then
minetest.sound_play({name="zap_off", pos=pos, gain=1}, true)
minetest.set_node(pointed_thing.under, {name="mcl_core:cobble"})
end
if node.name == "mcl_core:stone" then
minetest.set_node(pointed_thing.under, {name="mcl_deepslate:deepslate"})
minetest.sound_play({name="zap_on", pos=pos, gain=1}, true)
end
if node.name == "mcl_deepslate:deepslate" then
minetest.set_node(pointed_thing.under, {name="mcl_core:stone"})
minetest.sound_play({name="zap_off", pos=pos, gain=1}, true)
end
return itemstack
end
--register Orb of Exchange
minetest.register_tool("mcl_transmutation:orb_of_exchange", {
description = "Orb of Exchange",
inventory_image = "mcl_transmutation_orb_of_exchange.png",
wield_scale = wield_scale,
groups = { tool=1},
on_place = exchange_node,
sound = { breaks = "default_tool_breaks" },
_mcl_toollike_wield = true,
})

View File

@ -0,0 +1,5 @@
name = mcl_transmutation
depends = mcl_core,
description = adds orb of exchange
author = SmokeyDope
title = Orb Of Exchange

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B