Add things

This commit is contained in:
Signal 2025-10-27 22:05:23 -04:00
parent 4d8312b79d
commit 00e1fd985d
28 changed files with 395 additions and 31 deletions

View file

@ -36,7 +36,24 @@ function say(msg)
minetest.chat_send_all("# Server: "..msg)
end
rgt = {}
rgt = {
horizontal_neighbor_offests = {
vector.new(0,0,1),
vector.new(0,0,-1),
vector.new(1,0,0),
vector.new(-1,0,0),
vector.new(1,0,1),
vector.new(1,0,-1),
vector.new(-1,0,1),
vector.new(-1,0,-1),
},
adjacent_horizontal_neighbor_offests = {
vector.new(0,0,1),
vector.new(0,0,-1),
vector.new(1,0,0),
vector.new(-1,0,0),
}
}
local ns = rgt
function ns.register_node(name, def)

View file

@ -20,9 +20,11 @@ minetest.register_entity(":red_glazed_terracotta:chest_display", {
e._pos = minetest.deserialize(data)
ns.chests[vector.to_string(e._pos)] = e
e.users = {}
e.object:set_animation({x=0,y=0}, 1, 0.1, false)
end,
on_deactivate = function(e)
ns.chests[vector.to_string(e._pos)] = nil
e.object:set_animation({x=0,y=0}, 1, 0.1, false)
end,
get_staticdata = function(e)
return minetest.serialize(e._pos)
@ -44,8 +46,10 @@ rgt.register_node("chest", {
paramtype2 = "4dir",
mesh = "rgt_chest.gltf",
tiles = {"rgt_chest.png"},
on_place = function(s, p, pt)
return minetest.item_place_node(ItemStack("real_chest"), p, pt)
on_construct = function(pos)
local node = minetest.get_node(pos)
node.name = "real_chest"
minetest.set_node(pos, node)
end
})
@ -103,7 +107,7 @@ rgt.register_node("real_chest", {
for i = 1, inv:get_size("inv") do
local item = minetest.add_item(pos, inv:get_stack("inv", i))
if item then
item:set_velocity(vector.random_direction() *math.random(1, 3))
item:set_velocity(vector.random_direction() *math.random(2, 3))
end
end
e.object:remove()

View file

@ -0,0 +1,139 @@
local function can_work(node, m, inv)
-- Do we have an input item?
local input = inv:get_stack("input", 1)
if input:get_count() > 0 then
-- Would melting this item exceed our fluid capacity?
local fluid = m:get_float "fluid"
local capacity = m:get_int "fluid_capacity"
if capacity -fluid >= 1 then
return true
end
end
return false
end
local function update_formspec(m, progress)
progress = progress or m:get_int "progress"
local fluid = m:get_float "fluid"
local capacity = m:get_int "fluid_capacity"
local progressbar = progress == 0 and "rgt_progress_bg.png^[transformR270" or "rgt_progress_bg.png^[lowpart:"..progress..":rgt_progress_bg_active.png^[transformR270"
local fluidcontainer = fluid == 0 and "rgt_fluid_container_bg.png" or "rgt_fluid_container_bg.png^[lowpart:"..(fluid /capacity *100)..":rgt_fluid_container_bg_filled.png"
local fs = {"\
formspec_version[10]\
size[12,12]\
", ui.list("context", "input", 2, 2, 1, 1), "\
image[4,2;1,1;", progressbar, "]\
image[7,1;1,3;", minetest.formspec_escape(fluidcontainer), "]\
label[0.5,0.5;", fluid, " / ", capacity, "]\
"}
fs[#fs +1] = ui.list("current_player", "main", 1.125, 6.5, 8, 4)
fs[#fs +1] = "\
listring[]"
m:set_string("formspec", table.concat(fs))
end
local function deactivate(pos, node, m)
m:set_string("active", "false")
m:set_int("progress", 0)
update_formspec(m)
node.name = "arc_furnace_idle"
minetest.swap_node(pos, node)
end
local function update(pos, elapsed)
local node = minetest.get_node(pos)
local m = minetest.get_meta(pos)
local inv = m:get_inventory()
local active = m:get_string("active") == "true"
if can_work(node, m, inv) then
if not active then
active = true
m:set_string("active", "true")
node.name = "arc_furnace_active"
minetest.swap_node(pos, node)
end
local progress = m:get_int("progress") +20
if progress >= 100 then
local fluid = m:get_float "fluid"
fluid = fluid +1
m:set_float("fluid", fluid)
-- Consume an item.
local s = inv:get_stack("input", 1)
s:take_item()
inv:set_stack("input", 1, s)
progress = 0
end
m:set_int("progress", progress)
update_formspec(m, progress)
elseif active then
active = false
deactivate(pos, node, m)
end
return true--minetest.get_node_timer(pos):start(active and 1 or 1)
end
rgt_machines.register_machine("arc_furnace", {
states = {
idle = {
tiles = {"rgt_iron_block.png", "rgt_iron_block.png", "rgt_iron_block.png", "rgt_iron_block.png", "rgt_iron_block.png", "rgt_arc_furnace_front.png"}
},
active = {
tiles = {"rgt_iron_block.png", "rgt_iron_block.png", "rgt_iron_block.png", "rgt_iron_block.png", "rgt_iron_block.png", "rgt_arc_furnace_front_active.png"},
drop = "arc_furnace_idle"
}
},
paramtype2 = "4dir",
groups = {dig_immediate = 3},
on_construct = function(pos)
local m = minetest.get_meta(pos)
local inv = m:get_inventory()
inv:set_size("input", 1)
m:set_int("fluid_capacity", 10)
m:set_string("active", "false")
update_formspec(m)
minetest.get_node_timer(pos):start(1)
end,
on_destruct = function(pos)
local m = minetest.get_meta(pos)
local inv = m:get_inventory()
for i = 1, inv:get_size("input") do
local item = minetest.add_item(pos, inv:get_stack("input", i))
if item then
item:set_velocity(vector.random_direction() *math.random(2, 3))
end
end
end,
allow_metadata_inventory_put = function(pos, list, idx, s, p)
local inv = minetest.get_meta(pos):get_inventory()
local meltable = minetest.registered_items[s:get_name()].groups.arc_furnace_meltable
if meltable then
if inv:room_for_item("input", s) then
return s:get_count()
elseif inv:room_for_item("input", s:take_item()) then
return s:get_stack_max() -inv:get_stack("input", 1):get_count()
end
end
return 0
end,
on_metadata_inventory_put = function(pos, list)
end,
on_metadata_inventory_take = function(pos, list)
end,
on_timer = update
})

View file

@ -0,0 +1,2 @@
name = rgt_arc_furnace
depends = rgt_machines_core

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View file

@ -0,0 +1,11 @@
local ns = rgt_machines
function ns.create_fluid_tank(m)
end
function ns.make_fluid_display(x, y, fliud, max, amount)
local fs = {}
return table.concat(fs)
end

View file

@ -1,3 +1,9 @@
--[[
List of machines:
- Arc furnace: Melts materials into their liquid form
--]]
rgt_machines = {
registered_machines = {}
}
@ -25,3 +31,6 @@ function ns.register_machine(name, def)
end
end
include "fluids.lua"
include "pipes.lua"

View file

@ -0,0 +1 @@
{"asset":{"version":"2.0","generator":"Blockbench 4.12.5 glTF exporter"},"scenes":[{"nodes":[1],"name":"blockbench_export"}],"scene":0,"nodes":[{"name":"cube","mesh":0},{"children":[0]}],"bufferViews":[{"buffer":0,"byteOffset":0,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":288,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":576,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":768,"byteLength":72,"target":34963}],"buffers":[{"byteLength":840,"uri":"data:application/octet-stream;base64,AADwPwAA8D8AAKBAAADwPwAA8D8AAKDAAADwPwAA8L8AAKBAAADwPwAA8L8AAKDAAADwvwAA8D8AAKDAAADwvwAA8D8AAKBAAADwvwAA8L8AAKDAAADwvwAA8L8AAKBAAADwvwAA8D8AAKDAAADwPwAA8D8AAKDAAADwvwAA8D8AAKBAAADwPwAA8D8AAKBAAADwvwAA8L8AAKBAAADwPwAA8L8AAKBAAADwvwAA8L8AAKDAAADwPwAA8L8AAKDAAADwvwAA8D8AAKBAAADwPwAA8D8AAKBAAADwvwAA8L8AAKBAAADwPwAA8L8AAKBAAADwPwAA8D8AAKDAAADwvwAA8D8AAKDAAADwPwAA8L8AAKDAAADwvwAA8L8AAKDAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIA+AAAAAAAAAAAAAMA9AACAPgAAwD0AAAAAAADAPQAAgD4AAMA9AAAAAAAAQD4AAIA+AABAPgAAwD0AAOA+AAAAAAAA4D4AAMA9AABAPgAAAAAAAEA+AABAPgAAQD4AAMA9AABAPgAAQD4AAOA+AADAPQAA4D4AAKA+AACwPgAA0D4AALA+AACgPgAA4D4AANA+AADgPgAAoD4AAIA+AADQPgAAgD4AAKA+AACwPgAA0D4AALA+AAACAAEAAgADAAEABAAGAAUABgAHAAUACAAKAAkACgALAAkADAAOAA0ADgAPAA0AEAASABEAEgATABEAFAAWABUAFgAXABUA"}],"accessors":[{"bufferView":0,"componentType":5126,"count":24,"max":[1.875,1.875,5],"min":[-1.875,-1.875,-5],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":24,"max":[0.40625,0.4375],"min":[0,0],"type":"VEC2"},{"bufferView":3,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"}],"materials":[{"pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":1,"baseColorTexture":{"index":0}},"alphaMode":"MASK","alphaCutoff":0.05,"doubleSided":true}],"textures":[{"sampler":0,"source":0,"name":"rgt_pipe_straight"}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071}],"images":[{"mimeType":"image/png","name":"rgt_pipe_straight.png","uri":"rgt_pipe_straight.png"}],"meshes":[{"primitives":[{"mode":4,"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]}]}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"asset":{"version":"2.0","generator":"Blockbench 4.12.5 glTF exporter"},"scenes":[{"nodes":[2],"name":"blockbench_export"}],"scene":0,"nodes":[{"name":"cube","mesh":0},{"name":"cube","mesh":1},{"children":[0,1]}],"bufferViews":[{"buffer":0,"byteOffset":0,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":288,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":576,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":768,"byteLength":72,"target":34963},{"buffer":0,"byteOffset":840,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":1128,"byteLength":288,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":1416,"byteLength":192,"target":34962,"byteStride":8},{"buffer":0,"byteOffset":1608,"byteLength":72,"target":34963}],"buffers":[{"byteLength":1680,"uri":"data:application/octet-stream;base64,AAAgQAAAIEAAAHDAAAAgQAAAIEAAAKDAAAAgQAAAIMAAAHDAAAAgQAAAIMAAAKDAAAAgwAAAIEAAAKDAAAAgwAAAIEAAAHDAAAAgwAAAIMAAAKDAAAAgwAAAIMAAAHDAAAAgwAAAIEAAAKDAAAAgQAAAIEAAAKDAAAAgwAAAIEAAAHDAAAAgQAAAIEAAAHDAAAAgwAAAIMAAAHDAAAAgQAAAIMAAAHDAAAAgwAAAIMAAAKDAAAAgQAAAIMAAAKDAAAAgwAAAIEAAAHDAAAAgQAAAIEAAAHDAAAAgwAAAIMAAAHDAAAAgQAAAIMAAAHDAAAAgQAAAIEAAAKDAAAAgwAAAIEAAAKDAAAAgQAAAIMAAAKDAAAAgwAAAIMAAAKDAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AADAPgAAAAAAANA+AAAAAAAAwD4AAAA+AADQPgAAAD4AANA+AAAAAAAA4D4AAAAAAADQPgAAAD4AAOA+AAAAPgAACD8AAJA+AADQPgAAkD4AAAg/AACAPgAA0D4AAIA+AAAIPwAAkD4AANA+AACQPgAACD8AAKA+AADQPgAAoD4AAIA+AAAAAAAAwD4AAAAAAACAPgAAAD4AAMA+AAAAPgAAQD4AAEA+AACgPgAAQD4AAEA+AACgPgAAoD4AAKA+AAACAAEAAgADAAEABAAGAAUABgAHAAUACAAKAAkACgALAAkADAAOAA0ADgAPAA0AEAASABEAEgATABEAFAAWABUAFgAXABUAAADwPwAA8D8AAKBAAADwPwAA8D8AAHDAAADwPwAA8L8AAKBAAADwPwAA8L8AAHDAAADwvwAA8D8AAHDAAADwvwAA8D8AAKBAAADwvwAA8L8AAHDAAADwvwAA8L8AAKBAAADwvwAA8D8AAHDAAADwPwAA8D8AAHDAAADwvwAA8D8AAKBAAADwPwAA8D8AAKBAAADwvwAA8L8AAKBAAADwPwAA8L8AAKBAAADwvwAA8L8AAHDAAADwPwAA8L8AAHDAAADwvwAA8D8AAKBAAADwPwAA8D8AAKBAAADwvwAA8L8AAKBAAADwPwAA8L8AAKBAAADwPwAA8D8AAHDAAADwvwAA8D8AAHDAAADwPwAA8L8AAHDAAADwvwAA8L8AAHDAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAgL8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAPQAAAAAAAIA+AAAAAAAAAD0AAMA9AACAPgAAwD0AAAA9AADAPQAAgD4AAMA9AAAAPQAAQD4AAIA+AABAPgAAwD0AANA+AAAAAAAA0D4AAMA9AABAPgAAAAAAAEA+AABAPgAAQD4AAMA9AABAPgAAQD4AANA+AADAPQAA0D4AAKA+AACwPgAA0D4AALA+AACgPgAA4D4AANA+AADgPgAAoD4AAIA+AADQPgAAgD4AAKA+AACwPgAA0D4AALA+AAACAAEAAgADAAEABAAGAAUABgAHAAUACAAKAAkACgALAAkADAAOAA0ADgAPAA0AEAASABEAEgATABEAFAAWABUAFgAXABUA"}],"accessors":[{"bufferView":0,"componentType":5126,"count":24,"max":[2.5,2.5,-3.75],"min":[-2.5,-2.5,-5],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":24,"max":[0.53125,0.3125],"min":[0.1875,0],"type":"VEC2"},{"bufferView":3,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"},{"bufferView":4,"componentType":5126,"count":24,"max":[1.875,1.875,5],"min":[-1.875,-1.875,-3.75],"type":"VEC3"},{"bufferView":5,"componentType":5126,"count":24,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":6,"componentType":5126,"count":24,"max":[0.40625,0.4375],"min":[0,0],"type":"VEC2"},{"bufferView":7,"componentType":5123,"count":36,"max":[23],"min":[0],"type":"SCALAR"}],"materials":[{"pbrMetallicRoughness":{"metallicFactor":0,"roughnessFactor":1,"baseColorTexture":{"index":0}},"alphaMode":"MASK","alphaCutoff":0.05,"doubleSided":true}],"textures":[{"sampler":0,"source":0,"name":"rgt_pipe_straight"}],"samplers":[{"magFilter":9728,"minFilter":9728,"wrapS":33071,"wrapT":33071}],"images":[{"mimeType":"image/png","name":"rgt_pipe_straight.png","uri":"rgt_pipe_straight.png"}],"meshes":[{"primitives":[{"mode":4,"attributes":{"POSITION":0,"NORMAL":1,"TEXCOORD_0":2},"indices":3,"material":0}]},{"primitives":[{"mode":4,"attributes":{"POSITION":4,"NORMAL":5,"TEXCOORD_0":6},"indices":7,"material":0}]}]}

View file

@ -0,0 +1,102 @@
local ns = rgt_machines
local function update_pipe(pos, leaf)
local node = minetest.get_node(pos)
local neighbors = {}
local dir
local pipe
for _, offset in ipairs(rgt.adjacent_horizontal_neighbor_offests) do
pipe = minetest.get_node(pos +offset)
if minetest.get_item_group(pipe.name, "pipe_straight") > 0 then
neighbors[#neighbors +1] = offset
end
end
if #neighbors == 0 then
node.name = "pipe_straight_double_cap"
minetest.swap_node(pos, node)
elseif #neighbors == 1 then
node.name = "pipe_straight_single_cap"
node.param2 = minetest.dir_to_facedir(-neighbors[1])
minetest.swap_node(pos, node)
elseif #neighbors == 2 then
node.name = "pipe_straight"
node.param2 = minetest.dir_to_facedir(neighbors[1])
minetest.swap_node(pos, node)
else
end
if not leaf then
for _, x in ipairs(neighbors) do
update_pipe(pos +x, true)
end
end
end
rgt.register_node("pipe_straight", {
drawtype = "mesh",
mesh = "rgt_pipe_straight.gltf",
tiles = {"rgt_pipe_straight.png"},
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {pipe = 1, pipe_straight = 1, dig_immediate = 3},
drop = "pipe_straight",
on_construct = function(pos)
update_pipe(pos)
end,
after_destruct = function(pos)
for _, offset in ipairs(rgt.adjacent_horizontal_neighbor_offests) do
pipe = minetest.get_node(pos +offset)
if minetest.get_item_group(pipe.name, "pipe_straight") > 0 then
update_pipe(pos +offset, true)
end
end
end
})
rgt.register_node("pipe_straight_single_cap", {
drawtype = "mesh",
mesh = "rgt_pipe_straight_single_cap.gltf",
tiles = {"rgt_pipe_straight.png"},
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {pipe = 1, pipe_straight = 1, dig_immediate = 3},
drop = "pipe_straight",
on_construct = function(pos)
update_pipe(pos)
end,
after_destruct = function(pos)
for _, offset in ipairs(rgt.adjacent_horizontal_neighbor_offests) do
pipe = minetest.get_node(pos +offset)
if minetest.get_item_group(pipe.name, "pipe_straight") > 0 then
update_pipe(pos +offset, true)
end
end
end
})
rgt.register_node("pipe_straight_double_cap", {
drawtype = "mesh",
mesh = "rgt_pipe_straight_double_cap.gltf",
tiles = {"rgt_pipe_straight.png"},
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {pipe = 1, pipe_straight = 1, dig_immediate = 3},
drop = "pipe_straight",
on_construct = function(pos)
update_pipe(pos)
end,
after_destruct = function(pos)
for _, offset in ipairs(rgt.adjacent_horizontal_neighbor_offests) do
pipe = minetest.get_node(pos +offset)
if minetest.get_item_group(pipe.name, "pipe_straight") > 0 then
update_pipe(pos +offset, true)
end
end
end
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

View file

@ -16,9 +16,45 @@
- Gravel
--]]
-- MARK: - Coal
rgt.register_item("coal_lump", {
inventory_image = "rgt_coal_lump.png",
groups = {furnace_fuel = 1}
})
rgt.register_node("coal_ore", {
tiles = {"rgt_stone.png^rgt_coal_ore.png"},
drop = "coal_lump",
groups = {stone = 1}
})
minetest.register_ore {
ore_type = "scatter",
ore = "coal_ore",
wherein = "stone",
clust_scarcity = 4 * 4 * 4,
clust_num_ores = 8,
clust_size = 3,
noise_params = {
offset = 0,
scale = 1,
spread = {x = 100, y = 100, z = 100},
seed = 1189,
octaves = 3,
persistence = 0.7
},
}
-- MARK: - Iron
rgt.register_item("iron_ingot", {
inventory_image = "rgt_iron_ingot.png",
groups = {furnace_fuel = 1}
groups = {arc_furnace_meltable = 1}
})
rgt.register_item("iron_lump", {
@ -57,7 +93,7 @@ minetest.register_ore {
}
-- MARK: - Gold
rgt.register_item("gold_ingot", {
inventory_image = "rgt_gold_ingot.png",

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

View file

@ -49,7 +49,8 @@ Player = {
e:update_hp(p:get_hp())
e.object:set_formspec_prepend [[
bgcolor[#000;true]
formspec_version[10]
bgcolor[#000;true;#000c]
background9[0,0;0,0;rgt_container_bg.png;true;16,16]
style_type[button;border=false;bgimg=rgt_button_bg.png;bgimg_middle=8,8]
listcolors[#fff0;#fff3;#0000;#444;#aaa]
@ -417,15 +418,6 @@ setmetatable(Player, {
__call = function(_, ...) return Player.new(...) end
})
minetest.register_craftitem(":red_glazed_terracotta:hand", {
inventory_image = "rgt_dirt.png",
tool_capabilities = {
groupcaps = {
hand_breakable = {times = {[3] = 0.7}, uses = 0, maxlevel = 1}
}
}
})
minetest.register_alias("hand", "red_glazed_terracotta:hand")
-- TODO: Replace builtin health system with custom health system
minetest.hud_replace_builtin("health", {

View file

@ -41,6 +41,22 @@ function ns.button(x --[[Float]], y --[[Float]], width --[[Float]], height --[[F
return string.format("button[%f,%f;%f,%f;%s;%s]\n", x, y, name or "", label or "")
end
function ns.list(location, list, x, y, w, h)
local out = {}
for a = 0, w -1 do
for b = 0, h -1 do
out[#out +1] = "\
image["
out[#out +1] = a *1.25 +x -0.0625
out[#out +1] = ","
out[#out +1] = b *1.25 +y -0.0625
out[#out +1] = ";1.14,1.14;rgt_other_button_bg.png;8,8]"
end
end
out[#out +1] = string.format("list[%s;%s;%f,%f;%i,%i]", location, list, x, y, w, h)
return table.concat(out)
end
local function show_test_view()
ui.begin()
end

View file

@ -135,6 +135,7 @@ rgt.register_node("glass", {
drawtype = "glasslike",
paramtype = "light",
tiles = {{name = "rgt_glass.png", align_style = "world"}},
use_texture_alpha = "clip",
_variants = "all",
groups = {dig_immediate = 3}
})
@ -228,21 +229,6 @@ minetest.register_alias("mapgen_water_source", "red_glazed_terracotta:water")
minetest.register_alias("mapgen_river_water_source", "red_glazed_terracotta:river_water")
-- Remove
minetest.register_alias("adrift:stone", "red_glazed_terracotta:stone")
minetest.register_alias("adrift:dirt", "red_glazed_terracotta:dirt")
minetest.register_alias("adrift:dirt_grass", "red_glazed_terracotta:dirt_grass")
minetest.register_alias("adrift:water", "red_glazed_terracotta:water")
--minetest.register_decoration {
-- deco_type = "schematic",
-- place_on = "dirt_grass",
-- y_min = 1,
-- fill_ratio = 0.01,
-- schematic = minetest.get_modpath(minetest.get_current_modname()).."/schems/tree.mts",
-- flags = "place_center_x, place_center_z",
-- place_offset_y = 1,
--}
rgt.register_node("light", {
tiles = {"[fill:1x1:0,0:#fed"},
@ -260,6 +246,18 @@ minetest.register_ore {
}
--minetest.register_decoration {
-- deco_type = "schematic",
-- place_on = "dirt_grass",
-- biomes = {"forest"},
-- y_min = 1,
-- fill_ratio = 0.01,
-- schematic = minetest.get_modpath(minetest.get_current_modname()).."/schems/tree.mts",
-- flags = "place_center_x, place_center_z",
-- place_offset_y = 1,
--}
minetest.register_biome{
name = "plains",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 367 B

Before After
Before After

View file

@ -15,10 +15,45 @@ function ns.register_slab(def)
}))
end
function ns.update_stair(pos, basename, leaf)
local node = minetest.get_node(pos)
local neighbors = {}
local dir
local pipe
for _, offset in ipairs(rgt.adjacent_horizontal_neighbor_offests) do
pipe = minetest.get_node(pos +offset)
if minetest.get_item_group(pipe.name, basename.."_stair") > 0 then
neighbors[#neighbors +1] = offset
end
end
if #neighbors == 1 then
node.name = basename.."_stair"
node.param2 = minetest.dir_to_facedir(-neighbors[1]:rotate(vector.new(0, math.pi /2, 0)))
minetest.swap_node(pos, node)
elseif #neighbors > 1 then
-- Just ue the first two neighbors.
if neighbors[1].x ~= 0 and neighbors[2].x ~= 0 or neighbors[1].z ~= 0 and neighbors[2].z ~= 0 then
node.name = basename.."_stair"
node.param2 = minetest.dir_to_facedir(neighbors[1])
end
minetest.swap_node(pos, node)
end
if not leaf then
for _, x in ipairs(neighbors) do
update_pipe(pos +x, true)
end
end
end
function ns.register_stair(def)
def = table.copy(def)
def._variants = nil
def.groups[def._name.."_stair"] = 1
rgt.register_node(def._name.."_stair", extend(table.copy(def), {
drawtype = "nodebox",
node_box = {