A recreation of clearlag for the SpongeAPI.
Tested on both api 5 and 6.
Downloads
Downloads are avaliable on the github page: [Link]
Source Code
Source code for CatClearLag is avaliable on Github.
Commands
/re <hostiles|all|living|xp> - Remove various types of entities.
/forcegc - Request garbage collection.
/laggychunks <tiles|entities> - Find the chunks with the most entities or tiles.
/unloadchunks - Unload all chunks.
/clwhitelist - Add an item to the item whitelist.
Permissions
catclearlag.command.removehostile - Use /re host.
catclearlag.command.removeentities - Use /re.
catclearlag.command.removeall - Use /re a.
catclearlag.command.removegitems - Use /re items.
catclearlag.command.forcegc - Use /forcegc.
catclearlag.command.laggychunks - Use /laggychunks.
catclearlag.command.unloadchunks - Use /unloadchunks.
catclearlag.command.whitelistitem - Use /clwhitelist.
If you store services, like the PaginationService, and then the provider changes later, youâre using an outdated service provider. Iâd recommend either not storing it locally and asking for it each time (maybe change the variable to a getter method), or changing the variable on a ChangeServiceProviderEvent.
Donât check against string IDs like in removeHostile; theyâre not guaranteed to have those IDs. Thatâs why the static fields exist, in EntityTypes.PLAYER.
MobEventHandler has a name suggesting hostile mobs, but that event will be called on every entity, up to and including Items. Maybe change the type of entity to Living?
Think its minutes for cleanup and in seconds for warnings.
I tried changing clean up to 30 minutes and making warnings 1740, 1770, 1790 but they always seemed to have a 10 minutes delay between them so made cleanup 10 minutes again and have a extra 10 second prior warning
Hi, can you add the feature to translate the phrases of your plugin, like the auto clear message?
Thabks in advance and congratulations for your nice job
I noticed the new item whitelisting config How does the adding items from other mods other than basic minecraft work? Iâve currently have:
whitelist=[
âminecraft:diamondâ,
âminecraft:redstoneâ,
âminecraft:quartzâ,
âappliedenergistics2:crystal_seed:0â,
âappliedenergistics2:crystal_seed:600â,
âappliedenergistics2:crystal_seed:1200â,
âappliedenergistics2:material:1â,
âappliedenergistics2:material:10â,
âappliedenergistics2:material:11â,
âappliedenergistics2:material:12â,
âappliedenergistics2:material:46â,
âappliedenergistics2:material:47â
]
But it doesnât seem to work for the ae2 items. Am I missing something?
Thatâs because data values arenât supported, due to the string being directly converted into an ItemType. In fact they arenât really supported anywhere in Sponge; you have to manually edit the memory in items and whatnot to turn a raw data value into something of any use.
Awesome plugin! I do have a suggestion. It would be really useful if your plugin had a command to unload chunks. Like with Bukkitâs ClearLagg, they had the command /lagg unloadchunks and it would clear âunnecessary chunks.â
I hope you implement something along this line, it would be incredibly useful.
Current problem with that is I am not quite sure how to find the chunks that âNeed to be unloadedâ, if I did do something like that I would have to find a way to do it, which I currently do not have time to do.