Reduce performance impact when building ingredient filter
This commit is contained in:
parent
dde3a3e517
commit
f24f63d6d9
|
|
@ -13,8 +13,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
|
||||
@Mixin(IngredientListElementFactory.class)
|
||||
public class IngredientListElementFactoryMixin {
|
||||
private static int ingredientNum = 0;
|
||||
@Inject(method = "addToBaseList", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/NonNullList;add(Ljava/lang/Object;)Z"), remap = false)
|
||||
private static void checkForInterrupt(NonNullList<IIngredientListElement<?>> baseList, IIngredientManager ingredientManager, IIngredientType ingredientType, CallbackInfo ci) {
|
||||
IAsyncJeiStarter.checkForLoadInterruption();
|
||||
if((ingredientNum++ % 100) == 0)
|
||||
IAsyncJeiStarter.checkForLoadInterruption();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user