• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedCrafting / #479011800

31 Aug 2025 01:00PM UTC coverage: 24.876% (-0.3%) from 25.162%
#479011800

push

github

rubensworks
Add Attuned Crafting Interface

1 of 277 new or added lines in 7 files covered. (0.36%)

113 existing lines in 4 files now uncovered.

750 of 3015 relevant lines covered (24.88%)

0.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/cyclops/integratedcrafting/core/part/PartTypeInterfaceCraftingBase.java
1
package org.cyclops.integratedcrafting.core.part;
2

3
import com.google.common.collect.Lists;
4
import net.minecraft.core.Direction;
5
import net.minecraft.nbt.CompoundTag;
6
import net.minecraft.nbt.ListTag;
7
import net.minecraft.nbt.Tag;
8
import net.minecraft.resources.ResourceLocation;
9
import net.minecraft.world.entity.player.Player;
10
import net.minecraft.world.item.ItemStack;
11
import net.minecraftforge.common.capabilities.Capability;
12
import net.minecraftforge.common.util.LazyOptional;
13
import org.cyclops.commoncapabilities.api.ingredient.IIngredientMatcher;
14
import org.cyclops.commoncapabilities.api.ingredient.IPrototypedIngredient;
15
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
16
import org.cyclops.commoncapabilities.api.ingredient.IngredientInstanceWrapper;
17
import org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage;
18
import org.cyclops.integratedcrafting.GeneralConfig;
19
import org.cyclops.integratedcrafting.api.crafting.CraftingJob;
20
import org.cyclops.integratedcrafting.api.crafting.CraftingJobStatus;
21
import org.cyclops.integratedcrafting.api.crafting.ICraftingInterface;
22
import org.cyclops.integratedcrafting.api.crafting.ICraftingResultsSink;
23
import org.cyclops.integratedcrafting.api.network.ICraftingNetwork;
24
import org.cyclops.integratedcrafting.capability.network.CraftingInterfaceConfig;
25
import org.cyclops.integratedcrafting.capability.network.CraftingNetworkConfig;
26
import org.cyclops.integratedcrafting.core.CraftingHelpers;
27
import org.cyclops.integratedcrafting.core.CraftingJobHandler;
28
import org.cyclops.integratedcrafting.core.CraftingProcessOverrides;
29
import org.cyclops.integratedcrafting.ingredient.storage.IngredientComponentStorageSlottedInsertProxy;
30
import org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext;
31
import org.cyclops.integrateddynamics.api.network.INetwork;
32
import org.cyclops.integrateddynamics.api.network.INetworkIngredientsChannel;
33
import org.cyclops.integrateddynamics.api.network.IPartNetwork;
34
import org.cyclops.integrateddynamics.api.network.IPositionedAddonsNetworkIngredients;
35
import org.cyclops.integrateddynamics.api.part.PartPos;
36
import org.cyclops.integrateddynamics.api.part.PartTarget;
37
import org.cyclops.integrateddynamics.api.part.PrioritizedPartPos;
38
import org.cyclops.integrateddynamics.capability.network.PositionedAddonsNetworkIngredientsHandlerConfig;
39
import org.cyclops.integrateddynamics.core.helper.NetworkHelpers;
40
import org.cyclops.integrateddynamics.core.part.PartStateBase;
41

42
import javax.annotation.Nullable;
43
import java.util.Iterator;
44
import java.util.List;
45
import java.util.ListIterator;
46
import java.util.Map;
47

48
/**
49
 * Base logic for parts that do crafting interfacing.
50
 * @author rubensworks
51
 */
52
public abstract class PartTypeInterfaceCraftingBase<P extends PartTypeInterfaceCraftingBase<P, S>, S extends PartTypeInterfaceCraftingBase.State<P, S>> extends PartTypeCraftingBase<P, S> {
53

54
    public PartTypeInterfaceCraftingBase(String name) {
NEW
55
        super(name);
×
NEW
56
    }
×
57

58
    @Override
59
    public void afterNetworkReAlive(INetwork network, IPartNetwork partNetwork, PartTarget target, S state) {
NEW
60
        super.afterNetworkReAlive(network, partNetwork, target, state);
×
NEW
61
        addTargetToNetwork(network, target, state, true);
×
NEW
62
    }
×
63

64
    @Override
65
    public void onNetworkRemoval(INetwork network, IPartNetwork partNetwork, PartTarget target, S state) {
NEW
66
        super.onNetworkRemoval(network, partNetwork, target, state);
×
NEW
67
        removeTargetFromNetwork(network, target.getTarget(), state);
×
NEW
68
    }
×
69

70
    @Override
71
    public void onNetworkAddition(INetwork network, IPartNetwork partNetwork, PartTarget target, S state) {
NEW
72
        super.onNetworkAddition(network, partNetwork, target, state);
×
NEW
73
        addTargetToNetwork(network, target, state, true);
×
NEW
74
    }
×
75

76
    @Override
77
    public void setPriorityAndChannel(INetwork network, IPartNetwork partNetwork, PartTarget target, S state, int priority, int channel) {
78
        // We need to do this because the crafting network is not automagically aware of the priority changes,
79
        // so we have to re-add it.
NEW
80
        removeTargetFromNetwork(network, target.getTarget(), state);
×
NEW
81
        super.setPriorityAndChannel(network, partNetwork, target, state, priority, channel);
×
NEW
82
        addTargetToNetwork(network, target, state, false);
×
NEW
83
    }
×
84

85
    protected Capability<ICraftingNetwork> getNetworkCapability() {
NEW
86
        return CraftingNetworkConfig.CAPABILITY;
×
87
    }
88

89
    protected void addTargetToNetwork(INetwork network, PartTarget pos, S state, boolean initialize) {
NEW
90
        network.getCapability(getNetworkCapability())
×
NEW
91
                .ifPresent(craftingNetwork -> {
×
NEW
92
                    int channelCrafting = state.getChannelCrafting();
×
NEW
93
                    state.setTarget(pos);
×
NEW
94
                    state.setNetworks(network, craftingNetwork, NetworkHelpers.getPartNetworkChecked(network), channelCrafting, ValueDeseralizationContext.of(pos.getCenter().getPos().getLevel(true)), initialize);
×
NEW
95
                    state.setShouldAddToCraftingNetwork(true);
×
NEW
96
                });
×
NEW
97
    }
×
98

99
    protected void removeTargetFromNetwork(INetwork network, PartPos pos, S state) {
NEW
100
        ICraftingNetwork craftingNetwork = state.getCraftingNetwork();
×
NEW
101
        if (craftingNetwork != null) {
×
NEW
102
            network.getCapability(getNetworkCapability())
×
NEW
103
                    .ifPresent(n -> n.removeCraftingInterface(state.getChannelCrafting(), state));
×
104
        }
NEW
105
        state.setNetworks(null, null, null, -1, null, false);
×
NEW
106
        state.setTarget(null);
×
NEW
107
    }
×
108

109
    @Override
110
    public boolean isUpdate(S state) {
NEW
111
        return true;
×
112
    }
113

114
    @Override
115
    public int getMinimumUpdateInterval(S state) {
NEW
116
        return state.getDefaultUpdateInterval();
×
117
    }
118

119
    @Nullable
120
    protected static <T, M> IngredientInstanceWrapper<T, M> insertIntoNetwork(IngredientInstanceWrapper<T, M> wrapper,
121
                                                                              INetwork network, int channel) {
NEW
122
        IPositionedAddonsNetworkIngredients<T, M> storageNetwork = wrapper.getComponent()
×
NEW
123
                .getCapability(PositionedAddonsNetworkIngredientsHandlerConfig.CAPABILITY)
×
NEW
124
                .map(n -> (IPositionedAddonsNetworkIngredients<T, M>) n.getStorage(network).orElse(null))
×
NEW
125
                .orElse(null);
×
NEW
126
        if (storageNetwork != null) {
×
NEW
127
            IIngredientComponentStorage<T, M> storage = storageNetwork.getChannel(channel);
×
NEW
128
            T remaining = storage.insert(wrapper.getInstance(), false);
×
NEW
129
            if (wrapper.getComponent().getMatcher().isEmpty(remaining)) {
×
NEW
130
                return null;
×
131
            } else {
NEW
132
                return new IngredientInstanceWrapper<>(wrapper.getComponent(), remaining);
×
133
            }
134
        }
NEW
135
        return wrapper;
×
136
    }
137

138
    @Override
139
    public void update(INetwork network, IPartNetwork partNetwork, PartTarget target, S state) {
NEW
140
        super.update(network, partNetwork, target, state);
×
141

142
        // Init network data in part state if it has not been done yet.
143
        // This can occur when the part chunk is being reloaded.
NEW
144
        if (state.getCraftingNetwork() == null) {
×
NEW
145
            addTargetToNetwork(network, target, state, false);
×
146
        }
147

NEW
148
        int channel = state.getChannelCrafting();
×
149

150
        // Update the network data in the part state
NEW
151
        if (state.shouldAddToCraftingNetwork()) {
×
NEW
152
            ICraftingNetwork craftingNetwork = network.getCapability(getNetworkCapability()).orElse(null);
×
NEW
153
            craftingNetwork.addCraftingInterface(channel, state);
×
NEW
154
            state.setShouldAddToCraftingNetwork(false);
×
155
        }
156

157
        // Push any pending output ingredients into the network
NEW
158
        state.flushInventoryOutputBuffer(network);
×
159

160
        // Block job ticking if there still are outputs in our crafting result buffer.
NEW
161
        if (state.getInventoryOutputBuffer().isEmpty()) {
×
162
            // Tick the job handler
NEW
163
            PartPos targetPos = state.getTarget().getTarget();
×
NEW
164
            state.getCraftingJobHandler().update(network, channel, targetPos);
×
165
        }
NEW
166
    }
×
167

168
    @Override
169
    public void addDrops(PartTarget target, S state, List<ItemStack> itemStacks, boolean dropMainElement, boolean saveState) {
170
        // Drop any remaining output ingredients (only items)
NEW
171
        for (IngredientInstanceWrapper<?, ?> ingredientInstanceWrapper : state.getInventoryOutputBuffer()) {
×
NEW
172
            if (ingredientInstanceWrapper.getComponent() == IngredientComponent.ITEMSTACK) {
×
NEW
173
                itemStacks.add((ItemStack) ingredientInstanceWrapper.getInstance());
×
174
            }
NEW
175
        }
×
NEW
176
        state.getInventoryOutputBuffer().clear();
×
177

NEW
178
        super.addDrops(target, state, itemStacks, dropMainElement, saveState);
×
NEW
179
    }
×
180

181
    public static abstract class State<P extends PartTypeInterfaceCraftingBase<P, S>, S extends PartTypeInterfaceCraftingBase.State<P, S>>
182
            extends PartStateBase<P> implements ICraftingInterface, ICraftingResultsSink {
183

184
        private final CraftingJobHandler craftingJobHandler;
185
        private final List<IngredientInstanceWrapper<?, ?>> inventoryOutputBuffer;
186

NEW
187
        private int channelCrafting = 0;
×
NEW
188
        private PartTarget target = null;
×
NEW
189
        protected INetwork network = null;
×
NEW
190
        protected IPartNetwork partNetwork = null;
×
NEW
191
        protected ICraftingNetwork craftingNetwork = null;
×
NEW
192
        private int channel = -1;
×
193
        protected ValueDeseralizationContext valueDeseralizationContext;
NEW
194
        private boolean shouldAddToCraftingNetwork = false;
×
195
        protected Player lastPlayer;
196

NEW
197
        public State() {
×
NEW
198
            this.craftingJobHandler = new CraftingJobHandler(1, true,
×
NEW
199
                    CraftingProcessOverrides.REGISTRY.getCraftingProcessOverrides(), this);
×
NEW
200
            this.inventoryOutputBuffer = Lists.newArrayList();
×
NEW
201
        }
×
202

203
        @Override
204
        public void writeToNBT(CompoundTag tag) {
NEW
205
            super.writeToNBT(tag);
×
206

NEW
207
            ListTag instanceTags = new ListTag();
×
NEW
208
            for (IngredientInstanceWrapper instanceWrapper : inventoryOutputBuffer) {
×
NEW
209
                CompoundTag instanceTag = new CompoundTag();
×
NEW
210
                instanceTag.putString("component", IngredientComponent.REGISTRY.getKey(instanceWrapper.getComponent()).toString());
×
NEW
211
                instanceTag.put("instance", instanceWrapper.getComponent().getSerializer().serializeInstance(instanceWrapper.getInstance()));
×
NEW
212
                instanceTags.add(instanceTag);
×
NEW
213
            }
×
NEW
214
            tag.put("inventoryOutputBuffer", instanceTags);
×
215

NEW
216
            this.craftingJobHandler.writeToNBT(tag);
×
NEW
217
            tag.putInt("channelCrafting", channelCrafting);
×
NEW
218
        }
×
219

220
        @Override
221
        public void readFromNBT(ValueDeseralizationContext valueDeseralizationContext, CompoundTag tag) {
NEW
222
            super.readFromNBT(valueDeseralizationContext, tag);
×
223

NEW
224
            this.inventoryOutputBuffer.clear();
×
NEW
225
            for (Tag instanceTagRaw : tag.getList("inventoryOutputBuffer", Tag.TAG_COMPOUND)) {
×
NEW
226
                CompoundTag instanceTag = (CompoundTag) instanceTagRaw;
×
NEW
227
                String componentName = instanceTag.getString("component");
×
NEW
228
                IngredientComponent<?, ?> component = IngredientComponent.REGISTRY.getValue(new ResourceLocation(componentName));
×
NEW
229
                this.inventoryOutputBuffer.add(new IngredientInstanceWrapper(component,
×
NEW
230
                        component.getSerializer().deserializeInstance(instanceTag.get("instance"))));
×
NEW
231
            }
×
232

NEW
233
            this.craftingJobHandler.readFromNBT(tag);
×
NEW
234
            this.channelCrafting = tag.getInt("channelCrafting");
×
NEW
235
        }
×
236

237
        @Override
238
        protected int getDefaultUpdateInterval() {
NEW
239
            return GeneralConfig.minCraftingInterfaceUpdateFreq;
×
240
        }
241

242
        public void setChannelCrafting(int channelCrafting) {
NEW
243
            if (this.channelCrafting != channelCrafting) {
×
244
                // Unregister from the network
NEW
245
                if (craftingNetwork != null) {
×
NEW
246
                    craftingNetwork.removeCraftingInterface(this.channelCrafting, this);
×
247
                }
248

249
                // Update the channel
NEW
250
                this.channelCrafting = channelCrafting;
×
251

252
                // Re-register to the network
NEW
253
                if (craftingNetwork != null) {
×
NEW
254
                    craftingNetwork.addCraftingInterface(this.channelCrafting, this);
×
255
                }
256

NEW
257
                sendUpdate();
×
258
            }
NEW
259
        }
×
260

261
        public int getChannelCrafting() {
NEW
262
            return channelCrafting;
×
263
        }
264

265
        public void setTarget(PartTarget target) {
NEW
266
            this.target = target;
×
NEW
267
        }
×
268

269
        public PartTarget getTarget() {
NEW
270
            return target;
×
271
        }
272

273
        public void setNetworks(@Nullable INetwork network, @Nullable ICraftingNetwork craftingNetwork,
274
                                @Nullable IPartNetwork partNetwork, int channel,
275
                                @Nullable ValueDeseralizationContext valueDeseralizationContext,
276
                                boolean initialize) {
NEW
277
            this.network = network;
×
NEW
278
            this.craftingNetwork = craftingNetwork;
×
NEW
279
            this.partNetwork = partNetwork;
×
NEW
280
            this.channel = channel;
×
NEW
281
            this.valueDeseralizationContext = valueDeseralizationContext;
×
NEW
282
            reloadRecipes(initialize);
×
NEW
283
            if (network != null) {
×
NEW
284
                this.getCraftingJobHandler().reRegisterObservers(network);
×
285
            }
NEW
286
        }
×
287

288
        public void reloadRecipes(boolean initialize) {
289
            // Do nothing
NEW
290
        }
×
291

292
        public void setLastPlayer(Player lastPlayer) {
NEW
293
            this.lastPlayer = lastPlayer;
×
NEW
294
        }
×
295

296
        public ICraftingNetwork getCraftingNetwork() {
NEW
297
            return craftingNetwork;
×
298
        }
299

300
        @Override
301
        public int getChannel() {
NEW
302
            return channel;
×
303
        }
304

305
        @Override
306
        public boolean canScheduleCraftingJobs() {
NEW
307
            return getCraftingJobHandler().canScheduleCraftingJobs();
×
308
        }
309

310
        @Override
311
        public void scheduleCraftingJob(CraftingJob craftingJob) {
NEW
312
            getCraftingJobHandler().scheduleCraftingJob(craftingJob);
×
NEW
313
        }
×
314

315
        @Override
316
        public int getCraftingJobsCount() {
NEW
317
            return this.craftingJobHandler.getAllCraftingJobs().size();
×
318
        }
319

320
        @Override
321
        public Iterator<CraftingJob> getCraftingJobs() {
NEW
322
            return this.craftingJobHandler.getAllCraftingJobs().values().iterator();
×
323
        }
324

325
        @Override
326
        public List<Map<IngredientComponent<?, ?>, List<IPrototypedIngredient<?, ?>>>> getPendingCraftingJobOutputs(int craftingJobId) {
NEW
327
            List<Map<IngredientComponent<?, ?>, List<IPrototypedIngredient<?, ?>>>> pending = this.craftingJobHandler.getProcessingCraftingJobsPendingIngredients().get(craftingJobId);
×
NEW
328
            if (pending == null) {
×
NEW
329
                pending = Lists.newArrayList();
×
330
            }
NEW
331
            return pending;
×
332
        }
333

334
        @Override
335
        public CraftingJobStatus getCraftingJobStatus(ICraftingNetwork network, int channel, int craftingJobId) {
NEW
336
            return craftingJobHandler.getCraftingJobStatus(network, channel, craftingJobId);
×
337
        }
338

339
        @Override
340
        public void cancelCraftingJob(int channel, int craftingJobId) {
NEW
341
            craftingJobHandler.markCraftingJobFinished(craftingJobId);
×
NEW
342
        }
×
343

344
        @Override
345
        public PrioritizedPartPos getPosition() {
NEW
346
            return PrioritizedPartPos.of(getTarget().getCenter(), getPriority());
×
347
        }
348

349
        public CraftingJobHandler getCraftingJobHandler() {
NEW
350
            return craftingJobHandler;
×
351
        }
352

353
        public boolean shouldAddToCraftingNetwork() {
NEW
354
            return shouldAddToCraftingNetwork;
×
355
        }
356

357
        public void setShouldAddToCraftingNetwork(boolean shouldAddToCraftingNetwork) {
NEW
358
            this.shouldAddToCraftingNetwork = shouldAddToCraftingNetwork;
×
NEW
359
        }
×
360

361
        public List<IngredientInstanceWrapper<?, ?>> getInventoryOutputBuffer() {
NEW
362
            return inventoryOutputBuffer;
×
363
        }
364

365
        @Override
366
        public <T> LazyOptional<T> getCapability(Capability<T> capability, INetwork network, IPartNetwork partNetwork, PartTarget target) {
NEW
367
            if (capability == CraftingInterfaceConfig.CAPABILITY) {
×
NEW
368
                return LazyOptional.of(() -> this).cast();
×
369
            }
370

371
            // Expose the whole storage
NEW
372
            if (this.network != null) {
×
NEW
373
                IngredientComponent<?, ?> ingredientComponent = IngredientComponent.getIngredientComponentForStorageCapability(capability);
×
NEW
374
                if (ingredientComponent != null) {
×
NEW
375
                    T cap = wrapStorageCapability(capability, ingredientComponent);
×
NEW
376
                    if (cap != null) {
×
NEW
377
                        return LazyOptional.of(() -> cap);
×
378
                    }
379
                }
380
            }
381

NEW
382
            return super.getCapability(capability, network, partNetwork, target);
×
383
        }
384

385
        protected <C, T, M> C wrapStorageCapability(Capability<C> capability, IngredientComponent<T, M> ingredientComponent) {
NEW
386
            IIngredientComponentStorage<T, M> storage = CraftingHelpers.getNetworkStorage(this.network, this.channelCrafting,
×
387
                    ingredientComponent, false);
388

389
            // Don't allow extraction, only insertion
NEW
390
            storage = new IngredientComponentStorageSlottedInsertProxy<>(storage);
×
391

NEW
392
            return ingredientComponent.getStorageWrapperHandler(capability).wrapStorage(storage);
×
393
        }
394

395
        @Override
396
        public <T, M> void addResult(IngredientComponent<T, M> ingredientComponent, T instance) {
NEW
397
            this.getInventoryOutputBuffer().add(new IngredientInstanceWrapper<>(ingredientComponent, instance));
×
398

399
            // Try to flush buffer immediately
NEW
400
            if (this.network != null) {
×
NEW
401
                this.flushInventoryOutputBuffer(this.network);
×
402
            }
NEW
403
        }
×
404

405
        public void setIngredientComponentTargetSideOverride(IngredientComponent<?, ?> ingredientComponent, Direction side) {
NEW
406
            if (getTarget().getTarget().getSide() == side) {
×
NEW
407
                craftingJobHandler.setIngredientComponentTarget(ingredientComponent, null);
×
408
            } else {
NEW
409
                craftingJobHandler.setIngredientComponentTarget(ingredientComponent, side);
×
410
            }
NEW
411
            sendUpdate();
×
NEW
412
        }
×
413

414
        public Direction getIngredientComponentTargetSideOverride(IngredientComponent<?, ?> ingredientComponent) {
NEW
415
            Direction side = craftingJobHandler.getIngredientComponentTarget(ingredientComponent);
×
NEW
416
            if (side == null) {
×
NEW
417
                side = getTarget().getTarget().getSide();
×
418
            }
NEW
419
            return side;
×
420
        }
421

422
        public void flushInventoryOutputBuffer(INetwork network) {
423
            // Try to insert each ingredient in the buffer into the network.
NEW
424
            boolean changed = false;
×
NEW
425
            ListIterator<IngredientInstanceWrapper<?, ?>> outputBufferIt = this.getInventoryOutputBuffer().listIterator();
×
NEW
426
            while (outputBufferIt.hasNext()) {
×
NEW
427
                IngredientInstanceWrapper<?, ?> oldWrapper = outputBufferIt.next();
×
428

429
                // Force observation before insertion (see #98 on why this is necessary)
NEW
430
                this.forceObservationOnInsertable(oldWrapper);
×
431

NEW
432
                IngredientInstanceWrapper<?, ?> newWrapper = insertIntoNetwork(oldWrapper,
×
NEW
433
                        network, this.getChannelCrafting());
×
NEW
434
                if (newWrapper != oldWrapper) {
×
NEW
435
                    changed = true;
×
436
                }
NEW
437
                if (newWrapper == null) {
×
NEW
438
                    outputBufferIt.remove();
×
439
                } else {
NEW
440
                    outputBufferIt.set(newWrapper);
×
441
                }
NEW
442
            }
×
443

444
            // If at least one ingredient was inserted, force a sync observer update in the network.
NEW
445
            if (changed) {
×
NEW
446
                CraftingHelpers.beforeCalculateCraftingJobs(network, getChannelCrafting());
×
447
            }
NEW
448
        }
×
449

450
        /**
451
         * Iterate over all positions that *could* accept the given instance,
452
         * and force an observation over them.
453
         *
454
         * This is necessary to ensure that we have the latest state indexed right before insertion.
455
         * This allows us to force another observation right after the insertion,
456
         * which will guarantee that we will track the expected diff events as result.
457
         *
458
         * @param oldWrapper The ingredient to attempt to insert (simulated).
459
         * @param <T> Ingredient type.
460
         * @param <M> Match flags.
461
         */
462
        protected <T, M> void forceObservationOnInsertable(IngredientInstanceWrapper<T, M> oldWrapper) {
NEW
463
            IIngredientMatcher<T, M> matcher = oldWrapper.getComponent().getMatcher();
×
NEW
464
            IPositionedAddonsNetworkIngredients<T, M> ingredientsNetwork = CraftingHelpers.getIngredientsNetwork(network, oldWrapper.getComponent()).orElse(null);
×
NEW
465
            if (ingredientsNetwork != null) {
×
NEW
466
                boolean marked = false;
×
NEW
467
                INetworkIngredientsChannel<?, ?> ingredientsNetworkChannel = ingredientsNetwork.getChannelInternal(this.getChannelCrafting());
×
NEW
468
                T instance = oldWrapper.getInstance();
×
NEW
469
                for (PartPos position : ingredientsNetworkChannel.findNonFullPositions()) {
×
NEW
470
                    T instanceOut = ingredientsNetwork.getPositionedStorage(position).insert(instance, true);
×
NEW
471
                    if (!matcher.matchesExactly(instanceOut, instance)) {
×
NEW
472
                        marked = true;
×
NEW
473
                        instance = instanceOut;
×
NEW
474
                        ingredientsNetwork.scheduleObservationForced(this.getChannelCrafting(), position);
×
NEW
475
                        if (matcher.isEmpty(instance)) {
×
NEW
476
                            break;
×
477
                        }
478
                    }
NEW
479
                }
×
480

NEW
481
                if (marked || ingredientsNetwork.isObservationForcedPending(channel)) {
×
NEW
482
                    ingredientsNetwork.runObserverSync();
×
483
                }
484
            }
NEW
485
        }
×
486

487
    }
488

489
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc