[Mod] Delete unknown blocks and objects [1] [clean]

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

[Mod] Delete unknown blocks and objects [1] [clean]

by PilzAdam » Mon Aug 13, 2012 11:06

Hello everyone!
This is a very simple mod that deletes unkown blocks and removes unkown entities. Just insert there names in the tables in the first two lines and they will be removed when a player is close to them.

Depends:
nothing

License:
Sourcecode: WTFPL

Download:
http://ompldr.org/vZjM5MA/clean.zip Broken (R.I.P. omploader)
Anyway, here is the init.lua:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_nodes = {"mod:a", "mod:b"}
local old_entities = {}

for _,node_name in ipairs(old_nodes) do
    minetest.register_node(":"..node_name, {
        groups = {old=1},
    })
end

minetest.register_abm({
    nodenames = {"group:old"},
    interval = 1,
    chance = 1,
    action = function(pos, node)
        minetest.env:remove_node(pos)
    end,
})

for _,entity_name in ipairs(old_entities) do
    minetest.register_entity(":"..entity_name, {
        on_activate = function(self, staticdata)
            self.object:remove()
        end,
    })
end
Last edited by PilzAdam on Sat Jun 08, 2013 22:19, edited 1 time in total.
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Aug 13, 2012 11:45

Feature request: renaming/migration

Say when you change the name of your mod, or the node, that you could do something like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
nodeswitch('teacup:teacup','tea:cup')


example use: i have a map that uses staircase, which ive updated and renamed since then to nbu, along with some of the nodenames. I cant switch the old mod for the new mod without ruining my map and i dont want to remove the UB's, just switch 'em :-)
"Fuck the hat." - Paulie Gualtieri
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 13, 2012 11:53

mauvebic wrote:Feature request: renaming/migration

Say when you change the name of your mod, or the node, that you could do something like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
nodeswitch('teacup:teacup','tea:cup')


example use: i have a map that uses staircase, which ive updated and renamed since then to nbu, along with some of the nodenames. I cant switch the old mod for the new mod without ruining my map and i dont want to remove the UB's, just switch 'em :-)

From lua-api.txt
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_alias(new_name, old_name)


After that you can use both in code and game, new_name and old_name.
Last edited by PilzAdam on Mon Aug 13, 2012 11:53, edited 1 time in total.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Mon Aug 13, 2012 13:16

Thank you. +1
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Mon Aug 13, 2012 13:27

+1. Nice.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Thu Aug 16, 2012 16:45

+1
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
RabbiBob
Member
 
Posts: 335
Joined: Sat Jan 28, 2012 22:40

by RabbiBob » Thu Aug 16, 2012 22:42

+1
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Fri Aug 24, 2012 13:25

How to use?

local old_nodes = {xpanes:pane} does not work
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Aug 24, 2012 13:41

rubenwardy wrote:How to use?

local old_nodes = {xpanes:pane} does not work

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_nodes = {"xpanes:pane"}
 

User avatar
xyz
Member
 
Posts: 449
Joined: Thu Nov 10, 2011 14:25

by xyz » Fri Aug 24, 2012 14:06

rubenwardy wrote:How to use?

local old_nodes = {xpanes:pane} does not work

That will not work, to remove panes you should do it in such way:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_nodes = {"xpanes:pane_1", "xpanes:pane_2" [and so on] "xpanes:pane_15"}
 

User avatar
RabbiBob
Member
 
Posts: 335
Joined: Sat Jan 28, 2012 22:40

by RabbiBob » Sun Sep 02, 2012 12:11

Good job on this mod. Came in really handy this morning as I'm resurrecting an old server and tossing out old mods that has been resulting in a load of orphaned nodes. As long as you keep track of the console window to get the name, it's a snap to add them to the init.lua, bump the server and away the blocks go.
 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17

by SegFault22 » Wed Sep 12, 2012 01:53

+1
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.
 

dleong21
 

by dleong21 » Thu Sep 27, 2012 03:30

I'm trying to remove the animals mod as it keeps crashing minetest, I've already removed the mod folder. I try running this mod with the following line
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
 local old_nodes = {"animal_vombie:vombie","animal_dm:dm","animal_big_red:big_red","animal_chicken:chicken","animal_clownfish:clownfish","animal_cow:cow","animal_creeper:creeper","animal_deer:deer","animal_fish_blue_white:fish_blue_white","animal_gull:gull","animal_sheep:sheep","animal_wolf:wolf"}

But this doesnt seem to be working, am I missing something?
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Sep 27, 2012 04:28

use old_entities for animals.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_entities = {"animal_vombie:vombie","animal_dm:dm","animal_big_red:big_red","animal_chicken:chicken","animal_clownfish:clownfish","animal_cow:cow","animal_creeper:creeper","animal_deer:deer","animal_fish_blue_white:fish_blue_white","animal_gull:gull","animal_sheep:sheep","animal_wolf:wolf"}
 

Dragonop
Member
 
Posts: 1178
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop

by Dragonop » Fri Nov 02, 2012 19:39

YOU ARE MY HERO all tose ''old'' trees from mods and that can disapear COOL!
It's "Drag" for the friends.

Sorry I haven't been online as much lately, I'm real busy.
https://forum.minetest.net/download/file.php?id=4472
 

BenAmaranth
Member
 
Posts: 60
Joined: Thu Oct 04, 2012 15:14

by BenAmaranth » Sat Jan 19, 2013 19:46

ModError: Failed to load and run C:\User\Bgreco\Desktop\Newfoldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua
Last edited by BenAmaranth on Sat Jan 19, 2013 19:49, edited 1 time in total.
Air (you hacker you!)
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jan 19, 2013 19:49

BenAmaranth wrote:ModError: Failed to laod and run C:\User\Bgreco\Desktop\Newfoldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua

Can you post the last ~20 lines of your debug.txt in the bin/ folder?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jan 19, 2013 19:57

BenAmaranth wrote:
PilzAdam wrote:
BenAmaranth wrote:ModError: Failed to laod and run C:\User\Bgreco\Desktop\Newfoldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua

Can you post the last ~20 lines of your debug.txt in the bin/ folder?



Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
13:50:18: ERROR[main]: ========== ERROR FROM LUA ===========
13:50:18: ERROR[main]: Failed to load and run script from
13:50:18: ERROR[main]: C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua:
13:50:18: ERROR[main]: ...New foldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua:3: 'in' expected near '}'
13:50:18: ERROR[main]: =======END OF ERROR FROM LUA ========
13:50:18: ERROR[main]: Server: Failed to load and run C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua
13:50:18: INFO[main]: BanManager: saving to C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\worlds\Hmmm\ipban.txt
13:50:19: ERROR[main]: ModError: Failed to load and run C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua
13:50:19: INFO[main]: Searching worlds...
13:50:19: INFO[main]:   In C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\worlds:
13:50:19: INFO[main]: Hmmm moremods
13:50:19: INFO[main]: 2 found.
13:50:19: INFO[main]: Waiting for other menus
13:50:19: INFO[main]: Waited for other menus
13:50:19: VERBOSE[main]: error_message = ModError: Failed to load and run C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\mods\minetest\clean\init.lua
13:50:19: VERBOSE[main]: Check debug.txt for details.
13:50:19: INFO[main]: Created main menu
13:50:19: INFO[main]: locale has been set to:English_United States.1252
13:50:19: INFO[main]: locale has been set to:C
13:50:21: INFO[main]: locale has been set to:English_United States.1252
13:50:21: INFO[main]: locale has been set to:C
13:50:26: INFO[main]: Dropping main menu
13:50:26: INFO[main]: Updating configuration file: "C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\minetest.conf"
13:50:26: INFO[main]: Skipping writing of C:\Users\Bgreco\Desktop\New foldergames\minetest-0.4.4-win32\bin\..\minetest.conf because content wouldn't be modified

Can you post your first 2 lines of the init.lua?
 

BenAmaranth
Member
 
Posts: 60
Joined: Thu Oct 04, 2012 15:14

by BenAmaranth » Sat Jan 19, 2013 20:12

Caught it upon examining the back up. Deleted one of these guys --> }
Air (you hacker you!)
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jan 19, 2013 20:13

BenAmaranth wrote:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_nodes = {"snow:dirt_with_snow", "snow:snow", "snow:ice"}

for _,node}
local old_entities = {_name in ipairs(old_nodes)

You messed it up a bit :-)
Here are the correct first 8 lines:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_nodes = {"snow:dirt_with_snow", "snow:snow", "snow:ice"}
local old_entities = {}

for _,node_name in ipairs(old_nodes) do
    minetest.register_node(":"..node_name, {
        groups = {old=1},
    })
end
 

BenAmaranth
Member
 
Posts: 60
Joined: Thu Oct 04, 2012 15:14

by BenAmaranth » Sat Jan 19, 2013 20:14

Edit: Deleted old posts, thanks PilzAdam
Air (you hacker you!)
 

socramazibi
Member
 
Posts: 81
Joined: Mon Jan 28, 2013 12:29

by socramazibi » Tue Feb 19, 2013 11:19

Thanks, I found it very useful.
Forgive my English, but it is the translator of google.My Spanish.
My mod:
Pictures wool 1.0 3x5 , Charcoal+Textures , Map
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Wed Jun 05, 2013 20:20

Can you upload this to your dropbox or somewhere that actually works :-)
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Wed Jun 05, 2013 21:58

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local old_nodes = {"mod:a", "mod:b"}
local old_entities = {}

for _,node_name in ipairs(old_nodes) do
    minetest.register_node(":"..node_name, {
        groups = {old=1},
    })
end

minetest.register_abm({
    nodenames = {"group:old"},
    interval = 1,
    chance = 1,
    action = function(pos, node)
        minetest.env:remove_node(pos)
    end,
})

for _,entity_name in ipairs(old_entities) do
    minetest.register_entity(":"..entity_name, {
        on_activate = function(self, staticdata)
            self.object:remove()
        end,
    })
end
 

keyxmakerx
Member
 
Posts: 104
Joined: Mon Apr 08, 2013 23:53

by keyxmakerx » Sat Jun 08, 2013 22:18

Any news when the download will be fixed?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jun 08, 2013 22:19

keyxmakerx wrote:Any news when the download will be fixed?

See first post.
 

keyxmakerx
Member
 
Posts: 104
Joined: Mon Apr 08, 2013 23:53

by keyxmakerx » Sat Jun 08, 2013 22:23

PilzAdam wrote:
keyxmakerx wrote:Any news when the download will be fixed?

See first post.


Sorry I'm not understanding. What if I don't know what the unknown blocks were?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Jun 08, 2013 22:26

keyxmakerx wrote:
PilzAdam wrote:
keyxmakerx wrote:Any news when the download will be fixed?

See first post.


Sorry I'm not understanding. What if I don't know what the unknown blocks were?

Then you cant remove them with this mod.
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Sun Jun 09, 2013 01:16

keyxmakerx wrote:
PilzAdam wrote:
keyxmakerx wrote:Any news when the download will be fixed?

See first post.


Sorry I'm not understanding. What if I don't know what the unknown blocks were?


Dig one and watch the console it will say <Player> digs <node name> at <position>
Last edited by BrandonReese on Sun Jun 09, 2013 03:49, edited 1 time in total.
 

keyxmakerx
Member
 
Posts: 104
Joined: Mon Apr 08, 2013 23:53

by keyxmakerx » Sun Jun 09, 2013 04:53

BrandonReese wrote:
keyxmakerx wrote:
PilzAdam wrote:See first post.


Sorry I'm not understanding. What if I don't know what the unknown blocks were?


Dig one and watch the console it will say <Player> digs <node name> at <position>


Thanks! It works now ^^
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 12 guests

cron