[Mod] Cleaner [cleaner]

Post Reply
User avatar
AntumDeluge
Member
Posts: 217
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

[Mod] Cleaner [cleaner]

by AntumDeluge » Post

Cleaner - Remove Unknown Entities, Nodes, & Items

Description:

A mod that can be used to remove/replace unknown entities, nodes, & items. Originally forked from PilzAdam's clean mod.

Image

Licensing:
  • Code: MIT
  • Textures: CC0
Requirements:
  • Minetest 0.4.16 or newer
  • Depends: none
Usage:

There are three files in the world path that can be edited: clean_entities.json, clean_nodes.json, & clean_items.json. If they do not already exist when the server is started they will be created automatically.

They are formatted as follows:

Code: Select all

{
  "remove":
  [
    "creatures:ghost",
    "creatures:sheep",
  ],
  "replace":
  {
    "biofuel:biofuel":"default:leaves",
    "helicopter:heli":"default:copper_lump",
    "unifieddyes:airbrush":"default:coal_lump",
  },
}
remove key works for nodes & entities. replace key works for nodes & items. Their functions are self-explanatory.

Links:
Releases:
  • Image
Last edited by AntumDeluge on Sat Jul 31, 2021 06:33, edited 11 times in total.

John_Constructor
Member
Posts: 76
Joined: Thu Jun 01, 2017 20:06
GitHub: John-Constructor
In-game: Nooberton
Location: On Minetest 24/7

Re: [Mod] Cleaner [0.4] [cleaner]

by John_Constructor » Post

This might be helpful! Definitely for those who have an ore mod and might want to disable it for their world.
Constructing mechs and wingless aircraft since 2016.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Cleaner [0.4] [cleaner]

by azekill_DIABLO » Post

+1 definitivly needed
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

IanniPowerup!!!
Member
Posts: 100
Joined: Wed Nov 29, 2017 17:33
In-game: IanniPowerup
Contact:

Re: [Mod] Cleaner [0.4] [cleaner]

by IanniPowerup!!! » Post

doesnt work :(

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Cleaner [0.4] [cleaner]

by Grizzly Adam » Post

Does work. Thank you.
Check out my Mods: BBQ Mod Crops Plus

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

Re: [Mod] Cleaner [0.4] [cleaner]

by neko259 » Post

It would be better to add not only nodes to remove but node substitutes too. Sometimes a node was renamed or moved to other mod and can be simply replaced.

mase
Member
Posts: 91
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Cleaner [0.4] [cleaner]

by mase » Post

How can I get rid of whole node or entity groups, for example all zombies,
or all kind of trails from the trails mod?

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Cleaner [0.4] [cleaner]

by bell07 » Post

Please use register_lbm with run_at_every_load instead of register_abm to clean nodes. Should use less ressources.

User avatar
AntumDeluge
Member
Posts: 217
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

Re: [Mod] Cleaner [0.4] [cleaner]

by AntumDeluge » Post

Thank you bell07. I will check that out.

mase
Member
Posts: 91
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Cleaner [0.4] [cleaner]

by mase » Post

Does this mod remove all unknown objects on server start, or only when a player is near?

User avatar
AntumDeluge
Member
Posts: 217
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

Re: [Mod] Cleaner [0.4] [cleaner]

by AntumDeluge » Post

mase wrote:Does this mod remove all unknown objects on server start, or only when a player is near?
As I understand it, only when a player is near. But it's been a while since I looked at the code.

User avatar
AntumDeluge
Member
Posts: 217
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

Re: [Mod] Cleaner [cleaner] (v1.0)

by AntumDeluge » Post

bell07 wrote:
Sun Jul 15, 2018 19:39
Please use register_lbm with run_at_every_load instead of register_abm to clean nodes. Should use less ressources.
Added to my TODO list. I am active again.

User avatar
AntumDeluge
Member
Posts: 217
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

Re: [Mod] Cleaner [cleaner] (v1.0)

by AntumDeluge » Post

neko259 wrote:
Mon Dec 25, 2017 11:05
It would be better to add not only nodes to remove but node substitutes too. Sometimes a node was renamed or moved to other mod and can be simply replaced.
Done.

User avatar
AntumDeluge
Member
Posts: 217
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

Re: [Mod] Cleaner [0.4] [cleaner]

by AntumDeluge » Post

bell07 wrote:
Sun Jul 15, 2018 19:39
Please use register_lbm with run_at_every_load instead of register_abm to clean nodes. Should use less ressources.
Done: 2c127af

User avatar
Alatarius
Member
Posts: 28
Joined: Mon Apr 24, 2023 03:38
GitHub: Alatarius

Re: [Mod] Cleaner [cleaner]

by Alatarius » Post

Can you use wildcards with this, for example, mobs_animal:*

I only ask this specifically because I uninstalled the mobs_animal mod from TenPlus1 and now I have well over 50 entities to remove. And to have to go through this that many times is undoable but my server has become so big that it can't be deleted and it was a group decision to use a new animal mod.

Slightly
Member
Posts: 56
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Cleaner [cleaner]

by Slightly » Post

Alatarius wrote:
Sun Jun 18, 2023 01:40
Can you use wildcards with this, for example, mobs_animal:*

I only ask this specifically because I uninstalled the mobs_animal mod from TenPlus1 and now I have well over 50 entities to remove.
When I removed animals from the mobs_animal mod in my singleplayer, I added lines like this to the init file and it worked great. I would probably put in the mod temporarily with the files for animals commented out and lines like this added.

mobs:alias_mob("mobs_animal:sheep_white", "default:air")
I also used it to replace animals with mobs I was keeping and that seemed to work better than the "air" version.
mobs:alias_mob("petz:bee", "mobs_animal:chicken")
Ham-fisted, I know, but it worked well for me.

User avatar
Blockhead
Moderator
Posts: 2356
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Cleaner [cleaner]

by Blockhead » Post

A user on the Minetest Matrix today asked about this mod:
Hello,
Are ore nodes different from other nodes such as wood or dirt ?
I am asking because in the "cleaner" mod, removing them is "unsafe".
After investigating the source, my response was
Blockhead wrote: Cleaner's "remove ore" function (/remove_ore or Lua cleaner.remove_ore() removes the ore spawns from the world generation, it doesn't remove any nodes

This could be unsafe because it could be detrimental to gameplay or since it removes table entries from minetest.registered_ores that other mods might have a reference to.
I hope this helps anyone who is wondering about this part of the mod.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

RobotLuanti123
Member
Posts: 14
Joined: Sat Jan 11, 2025 21:34

Re: [Mod] Cleaner [cleaner]

by RobotLuanti123 » Post

Is there a way to clean out the unknown node blocks off the entire world? Because I'm using the .json file and it seems to just be erasing bits and pieces here and there and not the nodes away from the whole world.

User avatar
Blockhead
Moderator
Posts: 2356
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Cleaner [cleaner]

by Blockhead » Post

RobotLuanti123 wrote:
Tue Jan 28, 2025 23:40
Is there a way to clean out the unknown node blocks off the entire world? Because I'm using the .json file and it seems to just be erasing bits and pieces here and there and not the nodes away from the whole world.
The way this mod works is at the in-game level, where when the requested nodes are loaded into the world, they get removed. You need a solution that runs on the whole world database at once. I've tried looking for a tool like that - I could have sworn sorcerykid had something - but all I could really find is something that doesn't act on a fundamentally different basis, namely, Server Cleaner, which additionally can clean up excess players.

The basic idea is an external tool that connects to the world database, deserialises every mapblock that has the relevant nodes in it, replaces them, reserialises the mapblock, and writes it back to the database. The tool also needs to support the database backend used, which isn't 100% guaranteed to be SQLite for some servers, and it needs to support zstd compression for recent worlds – 5.5.0 moved from deflate to zstd.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply