From 4dff9943d9ba7b491e6eeb85c581dc8d402e18b8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 16 Oct 2021 13:36:01 +0100 Subject: [PATCH] Fix texture alpha warnings since 5.5.0-dev (#12) --- .luacheckrc | 27 +++++++++++++++++++++++++++ init.lua | 4 +++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..f002be1 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,27 @@ +quiet = 1 +codes = true + +exclude_files = { + ".luarocks/*", + "worldeditadditions/utils/bit.lua" +} + + +ignore = { + "631", "61[124]", + "542", + "412", + "321/bit", + "21[123]" +} + +-- Read-write globals (i.e. they can be defined) +globals = { + "flowerpot" +} +-- Read-only globals +read_globals = { + "minetest", + "default" +} +std = "max" diff --git a/init.lua b/init.lua index 0998e6d..53b4b65 100644 --- a/init.lua +++ b/init.lua @@ -84,7 +84,7 @@ function flowerpot.register_node(nodename) local desc = nodedef.description local name = nodedef.name:gsub(":", "_") - local tiles = {} + local tiles if nodedef.drawtype == "plantlike" then tiles = { @@ -109,6 +109,7 @@ function flowerpot.register_node(nodename) tiles = tiles, paramtype = "light", sunlight_propagates = true, + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true, collision_box = { type = "fixed", fixed = {-1/4, -1/2, -1/4, 1/4, -1/8, 1/4}, @@ -151,6 +152,7 @@ minetest.register_node("flowerpot:empty", { }, paramtype = "light", sunlight_propagates = true, + use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true, collision_box = { type = "fixed", fixed = {-1/4, -1/2, -1/4, 1/4, -1/8, 1/4},