Initial working proof of concept
commit
855ef1fefe
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,3 @@
|
|||
globals = {"minetest", "ItemStack", "VoxelArea", "vector", "nodecore", "include", "SecureRandom"}
|
||||
color = false
|
||||
quiet = 1
|
|
@ -0,0 +1,8 @@
|
|||
~print
|
||||
minetest
|
||||
ItemStack
|
||||
VoxelArea
|
||||
vector
|
||||
nodecore
|
||||
include
|
||||
SecureRandom
|
|
@ -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.
|
|
@ -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
|
||||
})
|
Loading…
Reference in New Issue