-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crafting large numbers of items at once freezes the game #6
Comments
Does fastworkbench fix the problem, ain't there a fabric version |
if the game continues to lag even with that mod, tell me |
With FastBench for Fabric on a vanilla crafting table, I get the following results:
|
iitemstack bad iritat |
no u |
not sure how to practically fix this without breaking a bunch of mods, either iitemstack will do it or a fapi addition is gonna need to be added |
The problem is that fixing this would require rewriting a good portion of the crafting system and would be extremely likely to break mods. |
yeah what I would do is prevent items from stacking over a certain number in the crafting table |
fixed via setting max stack size in crafting inventory to 64 |
small amendment @Mixin(CraftingInventory.class)
public abstract class CraftingInventoryMixin_LimitStackSize implements Inventory {
private static final int STACC_SIZE_LIMIT;
static {
if(FabricLoader.getInstance().isModLoaded("fastbench")) {
STACC_SIZE_LIMIT = 1_000_000;
} else {
STACC_SIZE_LIMIT = 1_000;
}
}
@Override
public int getMaxCountPerStack() {
return STACC_SIZE_LIMIT;
}
} |
Minecraft 1.16.1
Stacc 1.16.1 4
In 1.15.2, I tried crafting 100,000 Stone Pickaxes and it caused the server to freeze for about 30 seconds. Then I tried crafting 1,000,000 Iron Blocks and it caused the server to freeze for a few minutes.
In 1.16.1, I tried crafting 100,000 Oak Logs and it caused the server to freeze for about 25 seconds (
24544ms
from the log).These freezes are most likely because the game rescans the entire recipe registry for each and every item to be crafted, instead of caching and first checking the most recently used recipe (similar to how FastWorkbench and FastFurnace does it).
By similar logic, the following also holds true:
Repairing a diamond helmet with a very large negative durability with a maxed-out stack of diamonds freezes the game for a few minutes. To reproduce:
/give @p diamond_helmet{Damage:1000000000)
and/give @p diamond 1000000000
Large numbers of trades at once may freeze the game for a few seconds to minutes. To reproduce:
summon villager ~ ~ ~ {VillagerData:{level:99,profession:"minecraft:armorer",type:"minecraft:desert"},Offers:{Recipes:[{maxUses:2147483647,priceMultiplier:0f,buy:{id:"minecraft:stone",Count:1b},sell:{id:"minecraft:dirt",Count:1b}}]}}
and/give @p stone 1000000000
The text was updated successfully, but these errors were encountered: