Skip to content

Commit 75f9575

Browse files
Emojigitgrorp
andauthored
Allow to set use_texture_alpha when registering a door
Co-Authored-By: Gregor Parzefall <[email protected]>
1 parent 78de12d commit 75f9575

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

game_api.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ The doors mod allows modders to register custom doors and trapdoors.
228228
gain_open = 0.3, -- optional, defaults to 0.3
229229
gain_close = 0.3, -- optional, defaults to 0.3
230230
protected = false, -- If true, only placer can open the door (locked for others)
231-
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
231+
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing),
232232
-- optional function containing the on_rightclick callback, defaults to a doors.door_toggle-wrapper
233+
use_texture_alpha = "clip",
233234

234235
### Trapdoor definition
235236

@@ -249,10 +250,9 @@ The doors mod allows modders to register custom doors and trapdoors.
249250
gain_open = 0.3, -- optional, defaults to 0.3
250251
gain_close = 0.3, -- optional, defaults to 0.3
251252
protected = false, -- If true, only placer can open the door (locked for others)
252-
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
253-
-- function containing the on_rightclick callback
254-
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
253+
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) ,
255254
-- function containing the on_rightclick callback
255+
use_texture_alpha = "clip",
256256

257257
### Fence gate definition
258258

@@ -262,7 +262,7 @@ The doors mod allows modders to register custom doors and trapdoors.
262262
material = "default:wood",
263263
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
264264
sounds = default.node_sound_wood_defaults(), -- optional
265-
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
265+
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
266266
-- function containing the on_rightclick callback
267267

268268

mods/doors/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ function doors.register(name, def)
446446
def.buildable_to = false
447447
def.selection_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}}
448448
def.collision_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}}
449-
def.use_texture_alpha = "clip"
449+
def.use_texture_alpha = def.use_texture_alpha or "clip"
450450

451451
def.mesh = "door_a.b3d"
452452
minetest.register_node(":" .. name .. "_a", table.copy(def))
@@ -600,7 +600,7 @@ function doors.register_trapdoor(name, def)
600600
def.paramtype = "light"
601601
def.paramtype2 = "facedir"
602602
def.is_ground_content = false
603-
def.use_texture_alpha = "clip"
603+
def.use_texture_alpha = def.use_texture_alpha or "clip"
604604

605605
if def.protected then
606606
def.can_dig = can_dig_door

0 commit comments

Comments
 (0)