[electricity] Give Heater Device and Freezer Device new abilities

This commit is contained in:
IamPyu 2024-09-29 20:50:13 -06:00
parent 6f52213c54
commit 8bcdcf1d49
3 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,7 @@ This update completely breaks the API lol.
- Added Darkstone
- Added Glowslime
- Added Magma
- Give the Heater Device and Freezer Device more abilities with new `heatable` and `coolable` groups
# [Sep 29th 2024] Unnamed Minor Update

View File

@ -110,6 +110,10 @@ PyuTest.make_node("pyutest_core:freezer_device", "Freezer Device", {
if minetest.get_item_group(n.name, "freezable") ~= 0 then
minetest.set_node(p, {name = "pyutest_core:ice_block"})
elseif minetest.get_item_group(n.name, "coolable") ~= 0 then
local def = minetest.registered_nodes[n.name]
local cool_into = def.__cool_into or "pyutest_core:water_source"
minetest.set_node(p, {name = cool_into})
end
end)
end
@ -127,6 +131,10 @@ PyuTest.make_node("pyutest_core:heater_device", "Heater Device", {
local def = minetest.registered_nodes[n.name]
local thaw_into = def.__thaw_into or "pyutest_core:water_source"
minetest.set_node(p, {name = thaw_into})
elseif minetest.get_item_group(n.name, "heatable") ~= 0 then
local def = minetest.registered_nodes[n.name]
local heat_into = def.__heat_into or "pyutest_core:lava_source"
minetest.set_node(p, {name = heat_into})
end
end)
end

View File

@ -56,14 +56,16 @@ end
PyuTest.make_liquid("pyutest_core:water", "Water", {
water = 1,
freezable = 1
freezable = 1,
heatable = 1
}, "pyutest-water.png", 1, {
post_effect_color = {a=60, r=24.7, g=46.3, b=89.4},
paramtype2 = "color",
})
PyuTest.make_liquid("pyutest_core:lava", "Lava", {
lava = 1
lava = 1,
coolable = 1
}, "pyutest-lava.png", 5, {
damage_per_second = 4,
light_source = 8