Skip to content

Commit aa9cc39

Browse files
committedFeb 7, 2021
Update game APIs for use_texture_alpha deprecation
1 parent 08b13c9 commit aa9cc39

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed
 

Diff for: ‎mods/default/nodes.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2800,6 +2800,7 @@ minetest.register_node("default:glass", {
28002800
description = S("Glass"),
28012801
drawtype = "glasslike_framed_optional",
28022802
tiles = {"default_glass.png", "default_glass_detail.png"},
2803+
use_texture_alpha = "clip", -- only needed for stairs API
28032804
paramtype = "light",
28042805
paramtype2 = "glasslikeliquidlevel",
28052806
sunlight_propagates = true,
@@ -2812,6 +2813,7 @@ minetest.register_node("default:obsidian_glass", {
28122813
description = S("Obsidian Glass"),
28132814
drawtype = "glasslike_framed_optional",
28142815
tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2816+
use_texture_alpha = "clip", -- only needed for stairs API
28152817
paramtype = "light",
28162818
paramtype2 = "glasslikeliquidlevel",
28172819
is_ground_content = false,

Diff for: ‎mods/stairs/init.lua

+12
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ end
6363

6464
function stairs.register_stair(subname, recipeitem, groups, images, description,
6565
sounds, worldaligntex)
66+
local src_def = minetest.registered_nodes[recipeitem]
67+
6668
-- Set backface culling and world-aligned textures
6769
local stair_images = {}
6870
for i, image in ipairs(images) do
@@ -91,6 +93,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
9193
description = description,
9294
drawtype = "nodebox",
9395
tiles = stair_images,
96+
use_texture_alpha = src_def and src_def.use_texture_alpha,
9497
paramtype = "light",
9598
paramtype2 = "facedir",
9699
is_ground_content = false,
@@ -162,6 +165,8 @@ end
162165

163166
function stairs.register_slab(subname, recipeitem, groups, images, description,
164167
sounds, worldaligntex)
168+
local src_def = minetest.registered_nodes[recipeitem]
169+
165170
-- Set world-aligned textures
166171
local slab_images = {}
167172
for i, image in ipairs(images) do
@@ -186,6 +191,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
186191
description = description,
187192
drawtype = "nodebox",
188193
tiles = slab_images,
194+
use_texture_alpha = src_def and src_def.use_texture_alpha,
189195
paramtype = "light",
190196
paramtype2 = "facedir",
191197
is_ground_content = false,
@@ -297,6 +303,8 @@ end
297303

298304
function stairs.register_stair_inner(subname, recipeitem, groups, images,
299305
description, sounds, worldaligntex, full_description)
306+
local src_def = minetest.registered_nodes[recipeitem]
307+
300308
-- Set backface culling and world-aligned textures
301309
local stair_images = {}
302310
for i, image in ipairs(images) do
@@ -330,6 +338,7 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images,
330338
description = description,
331339
drawtype = "nodebox",
332340
tiles = stair_images,
341+
use_texture_alpha = src_def and src_def.use_texture_alpha,
333342
paramtype = "light",
334343
paramtype2 = "facedir",
335344
is_ground_content = false,
@@ -384,6 +393,8 @@ end
384393

385394
function stairs.register_stair_outer(subname, recipeitem, groups, images,
386395
description, sounds, worldaligntex, full_description)
396+
local src_def = minetest.registered_nodes[recipeitem]
397+
387398
-- Set backface culling and world-aligned textures
388399
local stair_images = {}
389400
for i, image in ipairs(images) do
@@ -417,6 +428,7 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images,
417428
description = description,
418429
drawtype = "nodebox",
419430
tiles = stair_images,
431+
use_texture_alpha = src_def and src_def.use_texture_alpha,
420432
paramtype = "light",
421433
paramtype2 = "facedir",
422434
is_ground_content = false,

Diff for: ‎mods/xpanes/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function xpanes.register_pane(name, def)
116116
groups = flatgroups,
117117
drop = "xpanes:" .. name .. "_flat",
118118
sounds = def.sounds,
119-
use_texture_alpha = def.use_texture_alpha or false,
119+
use_texture_alpha = def.use_texture_alpha and "blend" or "clip",
120120
node_box = {
121121
type = "fixed",
122122
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
@@ -145,7 +145,7 @@ function xpanes.register_pane(name, def)
145145
groups = groups,
146146
drop = "xpanes:" .. name .. "_flat",
147147
sounds = def.sounds,
148-
use_texture_alpha = def.use_texture_alpha or false,
148+
use_texture_alpha = def.use_texture_alpha and "blend" or "clip",
149149
node_box = {
150150
type = "connected",
151151
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},

0 commit comments

Comments
 (0)
Please sign in to comment.