mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Update game APIs for use_texture_alpha deprecation
This commit is contained in:
parent
08b13c9efb
commit
aa9cc39317
@ -2800,6 +2800,7 @@ minetest.register_node("default:glass", {
|
|||||||
description = S("Glass"),
|
description = S("Glass"),
|
||||||
drawtype = "glasslike_framed_optional",
|
drawtype = "glasslike_framed_optional",
|
||||||
tiles = {"default_glass.png", "default_glass_detail.png"},
|
tiles = {"default_glass.png", "default_glass_detail.png"},
|
||||||
|
use_texture_alpha = "clip", -- only needed for stairs API
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "glasslikeliquidlevel",
|
paramtype2 = "glasslikeliquidlevel",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
@ -2812,6 +2813,7 @@ minetest.register_node("default:obsidian_glass", {
|
|||||||
description = S("Obsidian Glass"),
|
description = S("Obsidian Glass"),
|
||||||
drawtype = "glasslike_framed_optional",
|
drawtype = "glasslike_framed_optional",
|
||||||
tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
|
tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
|
||||||
|
use_texture_alpha = "clip", -- only needed for stairs API
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "glasslikeliquidlevel",
|
paramtype2 = "glasslikeliquidlevel",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
|
@ -63,6 +63,8 @@ end
|
|||||||
|
|
||||||
function stairs.register_stair(subname, recipeitem, groups, images, description,
|
function stairs.register_stair(subname, recipeitem, groups, images, description,
|
||||||
sounds, worldaligntex)
|
sounds, worldaligntex)
|
||||||
|
local src_def = minetest.registered_nodes[recipeitem]
|
||||||
|
|
||||||
-- Set backface culling and world-aligned textures
|
-- Set backface culling and world-aligned textures
|
||||||
local stair_images = {}
|
local stair_images = {}
|
||||||
for i, image in ipairs(images) do
|
for i, image in ipairs(images) do
|
||||||
@ -91,6 +93,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
|
|||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
|
use_texture_alpha = src_def and src_def.use_texture_alpha,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
@ -162,6 +165,8 @@ end
|
|||||||
|
|
||||||
function stairs.register_slab(subname, recipeitem, groups, images, description,
|
function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||||
sounds, worldaligntex)
|
sounds, worldaligntex)
|
||||||
|
local src_def = minetest.registered_nodes[recipeitem]
|
||||||
|
|
||||||
-- Set world-aligned textures
|
-- Set world-aligned textures
|
||||||
local slab_images = {}
|
local slab_images = {}
|
||||||
for i, image in ipairs(images) do
|
for i, image in ipairs(images) do
|
||||||
@ -186,6 +191,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
|||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = slab_images,
|
tiles = slab_images,
|
||||||
|
use_texture_alpha = src_def and src_def.use_texture_alpha,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
@ -297,6 +303,8 @@ end
|
|||||||
|
|
||||||
function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
||||||
description, sounds, worldaligntex, full_description)
|
description, sounds, worldaligntex, full_description)
|
||||||
|
local src_def = minetest.registered_nodes[recipeitem]
|
||||||
|
|
||||||
-- Set backface culling and world-aligned textures
|
-- Set backface culling and world-aligned textures
|
||||||
local stair_images = {}
|
local stair_images = {}
|
||||||
for i, image in ipairs(images) do
|
for i, image in ipairs(images) do
|
||||||
@ -330,6 +338,7 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
|||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
|
use_texture_alpha = src_def and src_def.use_texture_alpha,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
@ -384,6 +393,8 @@ end
|
|||||||
|
|
||||||
function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
||||||
description, sounds, worldaligntex, full_description)
|
description, sounds, worldaligntex, full_description)
|
||||||
|
local src_def = minetest.registered_nodes[recipeitem]
|
||||||
|
|
||||||
-- Set backface culling and world-aligned textures
|
-- Set backface culling and world-aligned textures
|
||||||
local stair_images = {}
|
local stair_images = {}
|
||||||
for i, image in ipairs(images) do
|
for i, image in ipairs(images) do
|
||||||
@ -417,6 +428,7 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
|||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
|
use_texture_alpha = src_def and src_def.use_texture_alpha,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
|
@ -116,7 +116,7 @@ function xpanes.register_pane(name, def)
|
|||||||
groups = flatgroups,
|
groups = flatgroups,
|
||||||
drop = "xpanes:" .. name .. "_flat",
|
drop = "xpanes:" .. name .. "_flat",
|
||||||
sounds = def.sounds,
|
sounds = def.sounds,
|
||||||
use_texture_alpha = def.use_texture_alpha or false,
|
use_texture_alpha = def.use_texture_alpha and "blend" or "clip",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
|
fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}},
|
||||||
@ -145,7 +145,7 @@ function xpanes.register_pane(name, def)
|
|||||||
groups = groups,
|
groups = groups,
|
||||||
drop = "xpanes:" .. name .. "_flat",
|
drop = "xpanes:" .. name .. "_flat",
|
||||||
sounds = def.sounds,
|
sounds = def.sounds,
|
||||||
use_texture_alpha = def.use_texture_alpha or false,
|
use_texture_alpha = def.use_texture_alpha and "blend" or "clip",
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "connected",
|
type = "connected",
|
||||||
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},
|
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},
|
||||||
|
Loading…
Reference in New Issue
Block a user