[1.12.2] Log spam when adding recipes to the crusher with CraftTweaker
Skaphegor opened this issue ยท 6 comments
Issue description:
I try to add new bio fuel recipes for Mekanism because of the lot of stuff added by many mods. There is a lot of spawn and warning although the overwriting is intended.
Steps to reproduce:
- Use this script: https://pastebin.com/7FmhCtPf
- Lauch the game
- Warning appears
Note that the sawmill recipes are actually doing the same without any warning.
Version (make sure you are on the latest version before reporting):
**Forge:**2796
Mekanism: 9.4.13.349
CraftTweaker: 4.13
CTLog: crafttweaker.log starting at line 2882 (was to large for paste.bin etc.)
Also have this issue. Except mine is the precision sawmill. Seem to wonder if its anything that already exists with mekanism and we want to override tmwhat mekanism has default
Looking at the script the reason the bio fuel is throwing a fit is if you look at like 38-39
for item in lilypad.items{
for item in fruit.items{
the first for loop doesn't get closed until line 65
mods.mekanism.crusher.addRecipe(item, <mekanism:biofuel>);
}
so it is adding the same recipes over and over again for every loop that is in the middle of it.
warning should be fixed by newer version of MTlib, not sure about the 0 recipes thing. If you can reproduce in a small CT script I can look into it
The issue with the 0 recipe thing is that describe()
is called before apply()
is called. So it "appears" to get spammed, as it shows up when there is no recipe matched to remove, or when a recipe is actually removed it hasn't been added to the list to be removed yet so it has a count of 0 in the logged message.
It can be fixed by overriding describe with an empty string (to make it so it doesn't print the normal describe method). You then need to manually call super.describe();
manually after adding it to the list of recipes to remove.
For the adding messages if you move your call to addRecipes()
to the constructor from overriding apply()
that should fix it for saying "added 0 recipes".
Thanks for the explanation, though this part doesnt quite make sense, as describe
is a getter lol
It can be fixed by overriding describe with an empty string (to make it so it doesn't print the normal describe method). You then need to manually call super.describe(); manually after adding it to the list of recipes to remove.
Hard to format on the phone but https://github.com/CraftTweaker/CraftTweaker/blob/1.12/CraftTweaker2-API/src/main/java/crafttweaker/runtime/CrTTweaker.java#L54 is where describe gets called automatically. Basically setting it to an empty string or null makes it not log automatically. That is also why I said to make sure to log the output of super.describe manually to info. Forgot to mention wrapping the super.describe call with logging to info