From 8e1af25738415fe06db5d96995cb641238a56acc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 10 Jan 2022 21:47:26 +0100 Subject: [PATCH] DevTest: Add example nodes for disable_descend --- games/devtest/mods/testnodes/properties.lua | 105 ++++++++++++++++-- .../testnodes_climbable_noclimb_side.png | Bin 0 -> 292 bytes .../testnodes_climbable_noclimb_top.png | Bin 0 -> 172 bytes .../testnodes_climbable_nodescend_side.png | Bin 0 -> 288 bytes .../testnodes_climbable_nodescend_top.png | Bin 0 -> 180 bytes .../testnodes_climbable_nojump_top.png | Bin 0 -> 180 bytes .../textures/testnodes_climbable_top.png | Bin 0 -> 175 bytes 7 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 games/devtest/mods/testnodes/textures/testnodes_climbable_noclimb_side.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_climbable_noclimb_top.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_climbable_nodescend_side.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_climbable_nodescend_top.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_climbable_nojump_top.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_climbable_top.png diff --git a/games/devtest/mods/testnodes/properties.lua b/games/devtest/mods/testnodes/properties.lua index c51db810c..6271f0add 100644 --- a/games/devtest/mods/testnodes/properties.lua +++ b/games/devtest/mods/testnodes/properties.lua @@ -145,6 +145,10 @@ minetest.register_node("testnodes:nojump_walkable", { tiles = {"testnodes_nojump_top.png"}, }) +local climbable_nodebox = { + type = "regular", +} + -- Climbable up and down with jump and sneak keys minetest.register_node("testnodes:climbable", { description = S("Climbable Node").."\n".. @@ -156,8 +160,10 @@ minetest.register_node("testnodes:climbable", { paramtype = "light", sunlight_propagates = true, is_ground_content = false, - tiles ={"testnodes_climbable_side.png"}, - drawtype = "glasslike", + tiles = {"testnodes_climbable_top.png","testnodes_climbable_top.png","testnodes_climbable_side.png"}, + use_texture_alpha = "clip", + drawtype = "nodebox", + node_box = climbable_nodebox, groups = {dig_immediate=3}, }) @@ -169,8 +175,39 @@ minetest.register_node("testnodes:climbable_nojump", { walkable = false, groups = {disable_jump=1, dig_immediate=3}, - drawtype = "glasslike", - tiles ={"testnodes_climbable_nojump_side.png"}, + drawtype = "nodebox", + node_box = climbable_nodebox, + tiles = {"testnodes_climbable_nojump_top.png","testnodes_climbable_nojump_top.png","testnodes_climbable_nojump_side.png"}, + use_texture_alpha = "clip", + paramtype = "light", + sunlight_propagates = true, +}) + + +minetest.register_node("testnodes:climbable_nodescend", { + description = S("Upwards-climbable Node"), + climbable = true, + walkable = false, + + groups = {disable_descend=1, dig_immediate=3}, + drawtype = "nodebox", + node_box = climbable_nodebox, + tiles = {"testnodes_climbable_nodescend_top.png","testnodes_climbable_nodescend_top.png","testnodes_climbable_nodescend_side.png"}, + use_texture_alpha = "clip", + paramtype = "light", + sunlight_propagates = true, +}) + +minetest.register_node("testnodes:climbable_nodescend_nojump", { + description = S("Horizontal-only Climbable Node"), + climbable = true, + walkable = false, + + groups = {disable_jump=1, disable_descend=1, dig_immediate=3}, + drawtype = "nodebox", + node_box = climbable_nodebox, + tiles = {"testnodes_climbable_noclimb_top.png","testnodes_climbable_noclimb_top.png","testnodes_climbable_noclimb_side.png"}, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, }) @@ -198,7 +235,6 @@ minetest.register_node("testnodes:liquid_nojump", { paramtype = "light", pointable = false, liquids_pointable = true, - buildable_to = true, is_ground_content = false, post_effect_color = {a = 70, r = 255, g = 0, b = 200}, }) @@ -228,7 +264,6 @@ minetest.register_node("testnodes:liquidflowing_nojump", { paramtype2 = "flowingliquid", pointable = false, liquids_pointable = true, - buildable_to = true, is_ground_content = false, post_effect_color = {a = 70, r = 255, g = 0, b = 200}, }) @@ -293,7 +328,60 @@ minetest.register_node("testnodes:liquidflowing_noswim", { post_effect_color = {a = 70, r = 255, g = 200, b = 200}, }) +-- A liquid in which you can't actively descend. +-- Note: You'll still descend slowly by doing nothing. +minetest.register_node("testnodes:liquid_nodescend", { + description = S("No-descending Liquid Source Node"), + liquidtype = "source", + liquid_range = 0, + liquid_viscosity = 0, + liquid_alternative_flowing = "testnodes:liquidflowing_nodescend", + liquid_alternative_source = "testnodes:liquid_nodescend", + liquid_renewable = false, + groups = {disable_descend=1, dig_immediate=3}, + walkable = false, + drawtype = "liquid", + tiles = {"testnodes_liquidsource.png^[colorize:#FFFF00:127"}, + special_tiles = { + {name = "testnodes_liquidsource.png^[colorize:#FFFF00:127", backface_culling = false}, + {name = "testnodes_liquidsource.png^[colorize:#FFFF00:127", backface_culling = true}, + }, + use_texture_alpha = "blend", + paramtype = "light", + pointable = false, + liquids_pointable = true, + is_ground_content = false, + post_effect_color = {a = 70, r = 255, g = 255, b = 200}, +}) + +-- A liquid in which you can't actively descend (flowing variant) +minetest.register_node("testnodes:liquidflowing_nodescend", { + description = S("No-descending Flowing Liquid Node"), + liquidtype = "flowing", + liquid_range = 1, + liquid_viscosity = 0, + liquid_alternative_flowing = "testnodes:liquidflowing_nodescend", + liquid_alternative_source = "testnodes:liquid_nodescend", + liquid_renewable = false, + groups = {disable_descend=1, dig_immediate=3}, + walkable = false, + + + drawtype = "flowingliquid", + tiles = {"testnodes_liquidflowing.png^[colorize:#FFFF00:127"}, + special_tiles = { + {name = "testnodes_liquidflowing.png^[colorize:#FFFF00:127", backface_culling = false}, + {name = "testnodes_liquidflowing.png^[colorize:#FFFF00:127", backface_culling = false}, + }, + use_texture_alpha = "blend", + paramtype = "light", + paramtype2 = "flowingliquid", + pointable = false, + liquids_pointable = true, + is_ground_content = false, + post_effect_color = {a = 70, r = 255, g = 255, b = 200}, +}) -- Nodes that modify fall damage (various damage modifiers) for i=-100, 100, 25 do @@ -430,10 +518,11 @@ minetest.register_node("testnodes:climbable_move_resistance_4", { climbable = true, move_resistance = 4, - drawtype = "glasslike", + drawtype = "nodebox", paramtype = "light", sunlight_propagates = true, - tiles = {"testnodes_climbable_resistance_side.png"}, + tiles = {"testnodes_climbable_top.png","testnodes_climbable_top.png","testnodes_climbable_resistance_side.png"}, + use_texture_alpha = "clip", is_ground_content = false, groups = { dig_immediate = 3 }, }) diff --git a/games/devtest/mods/testnodes/textures/testnodes_climbable_noclimb_side.png b/games/devtest/mods/testnodes/textures/testnodes_climbable_noclimb_side.png new file mode 100644 index 0000000000000000000000000000000000000000..899f6c355b81318bbfd51d03779026505e6dce8e GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP#3oDC^wM1FgF`&>!PZ!4!i_=RdZxlVOz~kZ{a<9Qt zW91AcwS*-;0{##RZJ_(4oKcV6!z*#R7d+O7QMpbdWGvtFL4$zY@HJQ$nAnv z literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_climbable_nodescend_side.png b/games/devtest/mods/testnodes/textures/testnodes_climbable_nodescend_side.png new file mode 100644 index 0000000000000000000000000000000000000000..d749e506fd2954e70f40496c28848cb7c6dab506 GIT binary patch literal 288 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP#3oEm+) zQ*s*TJib=xq;F~KJE?Tu1BMw_88yN^!`yi0eiam7nWtT0^nI^>l2*pqBOh*a={fK< zTd3@)KcU!U%w;j*e6&=OX1M?W literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_climbable_nodescend_top.png b/games/devtest/mods/testnodes/textures/testnodes_climbable_nodescend_top.png new file mode 100644 index 0000000000000000000000000000000000000000..17708cfa27b1fca2e894643ed2a1dee8919c2d62 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP#3oEmUx#y*Mhk!zko-U3d7N_4%-pI?Kz;k$x+`<3v z4+n+a literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_climbable_nojump_top.png b/games/devtest/mods/testnodes/textures/testnodes_climbable_nojump_top.png new file mode 100644 index 0000000000000000000000000000000000000000..160c8b730ade6ba19db2f40fccc3050e0f59f75d GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP#3oEmUcI@Rty+9#HPZ!4!i_>o>FJxp;;5ocWmYMCJ zJo>D>5-C@U-j@{r^9D z`njYHR^5pu87G994RrE6Bo(|qJv?Ei&(dGAfO$X5w@}rfzT&f|&T&gE6lQ6%5-S9n O!{F)a=d#Wzp$P!*HZoTL literal 0 HcmV?d00001