More textures

This commit is contained in:
Signal 2025-09-14 23:16:35 -04:00
parent 7c08d3f61a
commit b50caa0b53
17 changed files with 68 additions and 7 deletions

View file

@ -72,7 +72,7 @@ function ns.check_recipe(inv, plot)
end
minetest.register_node(":rgt_towns:constructor", {
tiles = {"[fill:16x16:#8af"},
tiles = {"rgt_towns_constructor_top.png", "rgt_towns_constructor_bottom.png", "rgt_towns_constructor_side.png"},
on_construct = function(pos)
local inv = minetest.get_meta(pos):get_inventory()
inv:set_size("main", 9)

View file

@ -149,20 +149,15 @@ function ns.can_build_plot(box, grid)
for name, grid2 in pairs(ns.grids) do
local i = aabb_intersects_sphere(box, grid2.origin, grid2.radius)
if name == grid or i then
ns.add_cube(box.min, box.max, {color = "#fff"})
-- Translate box to grid2 local space and compute candidate cell range
local min = vector.floor((box.min -grid2.origin) /15)
local max = vector.ceil((box.max -grid2.origin) /15)
ns.add_cube(min *15 +grid2.origin, max *15 +grid2.origin)
if grid2.type == "3d" then
-- TODO: implement
else
for x = min.x, max.x do
for z = min.z, max.z do
ns.add_point(vector.new(x,0,z) *15 +grid2.origin)
-- print("Box: "..dump(box).."; min: "..min:to_string().."; max: "..max:to_string())
local plot = db:get("plot:"..name.."_"..x.."_0_"..z)
if plot then
plot = minetest.parse_json(plot)

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B