Initial working proof of concept

master
Aaron Suen 2022-04-01 12:28:30 -04:00
commit 855ef1fefe
7 changed files with 78 additions and 0 deletions

35
.cdbrelease.lua Normal file
View File

@ -0,0 +1,35 @@
-- LUALOCALS < ---------------------------------------------------------
local math, tonumber
= math, tonumber
local math_floor
= math.floor
-- LUALOCALS > ---------------------------------------------------------
local stamp = tonumber("$Format:%at$")
if not stamp then return end
stamp = math_floor((stamp - 1540612800) / 60)
stamp = ("00000000" .. stamp):sub(-8)
-- luacheck: push
-- luacheck: globals config readtext readbinary
readtext = readtext or function() end
readbinary = readbinary or function() end
return {
user = "Warr1024",
pkg = "nc_ad_removal",
version = stamp .. "-$Format:%h$",
type = "mod",
dev_state = "ACTIVELY_DEVELOPED",
title = "Ad Removal for NodeCore",
short_description = "Removes all ads from NodeCore",
tags = {"gui", "hud", "singleplayer"},
license = "MIT",
media_license = "MIT",
repo = "https://gitlab.com/sztest/nc_ad_removal",
issue_tracker = "https://discord.gg/NNYeF6f",
long_description = readtext('README.md')
}
-- luacheck: pop

8
.gitattributes vendored Normal file
View File

@ -0,0 +1,8 @@
.cdbrelease.lua export-subst
.cdb.json export-ignore
.cdb-* export-ignore
.git* export-ignore
.lua* export-ignore
docs export-ignore
src export-ignore
TODO export-ignore

3
.luacheckrc Normal file
View File

@ -0,0 +1,3 @@
globals = {"minetest", "ItemStack", "VoxelArea", "vector", "nodecore", "include", "SecureRandom"}
color = false
quiet = 1

8
.lualocals Normal file
View File

@ -0,0 +1,8 @@
~print
minetest
ItemStack
VoxelArea
vector
nodecore
include
SecureRandom

3
README.md Normal file
View File

@ -0,0 +1,3 @@
This mod removes every ad from NodeCore.
**N.B.** this mod only works (correctly) in English, and will likely break translations. It is not recommended on multiplayer servers.

19
init.lua Normal file
View File

@ -0,0 +1,19 @@
-- LUALOCALS < ---------------------------------------------------------
local nodecore, string
= nodecore, string
local string_gsub, string_upper
= string.gsub, string.upper
-- LUALOCALS > ---------------------------------------------------------
local function adremove(s)
s = string_gsub(s, "Ad(%w)", string_upper)
return string_gsub(s, "[Aa][Dd]", "")
end
nodecore.register_on_register_item({
func = function(_, def)
if not def.description then return end
def.description = adremove(def.description)
end,
retroactive = true
})

2
mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = nc_ad_removal
depends = nc_api_all