forked from Mirrorlandia_minetest/minetest
Fix plantlike_rooted
world-aligned node base textures (#12994)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
This commit is contained in:
parent
981d79157a
commit
1f3b5e553b
@ -11,6 +11,21 @@ minetest.register_node("tiled:tiled", {
|
|||||||
groups = {cracky=3},
|
groups = {cracky=3},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node("tiled:tiled_rooted", {
|
||||||
|
description = "Tiled 'plantlike_rooted' Node (world-aligned)".."\n"..
|
||||||
|
"Base node texture spans over a space of 8×8 nodes".."\n"..
|
||||||
|
"A plantlike thing grows on top",
|
||||||
|
paramtype = "light",
|
||||||
|
drawtype = "plantlike_rooted",
|
||||||
|
tiles = {{
|
||||||
|
name = "tiled_tiled.png",
|
||||||
|
align_style = "world",
|
||||||
|
scale = 8,
|
||||||
|
}},
|
||||||
|
special_tiles = {"tiled_tiled_node.png"},
|
||||||
|
groups = {cracky=3},
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_node("tiled:tiled_n", {
|
minetest.register_node("tiled:tiled_n", {
|
||||||
description = "Tiled Node (node-aligned)".."\n"..align_help_n,
|
description = "Tiled Node (node-aligned)".."\n"..align_help_n,
|
||||||
tiles = {{
|
tiles = {{
|
||||||
|
@ -462,7 +462,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
TileDef read_tiledef(lua_State *L, int index, u8 drawtype)
|
TileDef read_tiledef(lua_State *L, int index, u8 drawtype, bool special)
|
||||||
{
|
{
|
||||||
if(index < 0)
|
if(index < 0)
|
||||||
index = lua_gettop(L) + 1 + index;
|
index = lua_gettop(L) + 1 + index;
|
||||||
@ -473,7 +473,6 @@ TileDef read_tiledef(lua_State *L, int index, u8 drawtype)
|
|||||||
bool default_culling = true;
|
bool default_culling = true;
|
||||||
switch (drawtype) {
|
switch (drawtype) {
|
||||||
case NDT_PLANTLIKE:
|
case NDT_PLANTLIKE:
|
||||||
case NDT_PLANTLIKE_ROOTED:
|
|
||||||
case NDT_FIRELIKE:
|
case NDT_FIRELIKE:
|
||||||
default_tiling = false;
|
default_tiling = false;
|
||||||
// "break" is omitted here intentionaly, as PLANTLIKE
|
// "break" is omitted here intentionaly, as PLANTLIKE
|
||||||
@ -483,6 +482,10 @@ TileDef read_tiledef(lua_State *L, int index, u8 drawtype)
|
|||||||
case NDT_LIQUID:
|
case NDT_LIQUID:
|
||||||
default_culling = false;
|
default_culling = false;
|
||||||
break;
|
break;
|
||||||
|
case NDT_PLANTLIKE_ROOTED:
|
||||||
|
default_tiling = !special;
|
||||||
|
default_culling = !special;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -576,7 +579,7 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while(lua_next(L, table) != 0){
|
while(lua_next(L, table) != 0){
|
||||||
// Read tiledef from value
|
// Read tiledef from value
|
||||||
f.tiledef[i] = read_tiledef(L, -1, f.drawtype);
|
f.tiledef[i] = read_tiledef(L, -1, f.drawtype, false);
|
||||||
// removes value, keeps key for next iteration
|
// removes value, keeps key for next iteration
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
i++;
|
i++;
|
||||||
@ -604,7 +607,7 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (lua_next(L, table) != 0) {
|
while (lua_next(L, table) != 0) {
|
||||||
// Read tiledef from value
|
// Read tiledef from value
|
||||||
f.tiledef_overlay[i] = read_tiledef(L, -1, f.drawtype);
|
f.tiledef_overlay[i] = read_tiledef(L, -1, f.drawtype, false);
|
||||||
// removes value, keeps key for next iteration
|
// removes value, keeps key for next iteration
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
i++;
|
i++;
|
||||||
@ -632,7 +635,7 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while(lua_next(L, table) != 0){
|
while(lua_next(L, table) != 0){
|
||||||
// Read tiledef from value
|
// Read tiledef from value
|
||||||
f.tiledef_special[i] = read_tiledef(L, -1, f.drawtype);
|
f.tiledef_special[i] = read_tiledef(L, -1, f.drawtype, true);
|
||||||
// removes value, keeps key for next iteration
|
// removes value, keeps key for next iteration
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
i++;
|
i++;
|
||||||
|
@ -85,7 +85,7 @@ void push_palette (lua_State *L,
|
|||||||
const std::vector<video::SColor> *palette);
|
const std::vector<video::SColor> *palette);
|
||||||
|
|
||||||
TileDef read_tiledef (lua_State *L, int index,
|
TileDef read_tiledef (lua_State *L, int index,
|
||||||
u8 drawtype);
|
u8 drawtype, bool special);
|
||||||
|
|
||||||
void read_soundspec (lua_State *L, int index,
|
void read_soundspec (lua_State *L, int index,
|
||||||
SimpleSoundSpec &spec);
|
SimpleSoundSpec &spec);
|
||||||
|
Loading…
Reference in New Issue
Block a user