Skip to content

Commit 38b8384

Browse files
committed
- item != item?
- 尝试改进 IC2 的线程调用。
1 parent 7dd6631 commit 38b8384

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ dependencies {
287287
implementation(rfg.deobf("curse.maven:lolasm-460609:5257348"))
288288
runtimeOnly(rfg.deobf("curse.maven:spark-361579:3245793"))
289289
compileOnly(rfg.deobf("curse.maven:dme-737252:5043404"))
290+
implementation(rfg.deobf("curse.maven:bountifulbaubles-313536:3568240"))
290291
}
291292

292293
// IDE Settings

src/main/java/github/kasuminova/stellarcore/mixin/ic2_energynet/MixinGridUpdater.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ void startTransferCalc(final CallbackInfo ci) {
9090
int tasks = grids.size();
9191
ForkJoinPool.commonPool().submit(() -> {
9292
int concurrency = Math.min(tasks, Math.max(Runtime.getRuntime().availableProcessors(), 2));
93-
IntStream.range(0, concurrency).forEach(i -> ForkJoinPool.commonPool().submit(() -> {
93+
IntStream.range(0, concurrency).parallel().forEach(i -> {
9494
Grid grid;
9595
while ((grid = calculateQueue.poll()) != null) {
9696
stellar_core$syncTaskQueue.offer(stellarCalculator.doParallelCalc(grid));
9797
}
98-
}));
98+
});
9999
});
100100

101101
stellar_core$executeSyncTasks(tasks, stellarCalculator, calculateQueue);

src/main/java/github/kasuminova/stellarcore/mixin/minecraft/itemstack/MixinItemStack.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ public abstract class MixinItemStack implements StellarItemStackCapLoader {
5252
@Shadow
5353
public abstract int getAnimationsToGo();
5454

55+
@Shadow
56+
public abstract Item getItem();
57+
5558
@Unique
5659
private ItemStackCapInitTask stellar_core$capInitTask = null;
5760

@@ -88,7 +91,7 @@ private void forgeInit() {
8891
@Override
8992
@SuppressWarnings("DataFlowIssue")
9093
public void stellar_core$initCap() {
91-
ICapabilityProvider provider = item.initCapabilities((ItemStack) (Object) this, this.capNBT);
94+
ICapabilityProvider provider = getItem().initCapabilities((ItemStack) (Object) this, this.capNBT);
9295
this.stellar_core$capabilities = ForgeEventFactory.gatherCapabilities((ItemStack) (Object) this, provider);
9396
}
9497

0 commit comments

Comments
 (0)