修修修
This commit is contained in:
parent
4ca02b923c
commit
9b2e8f38da
|
|
@ -101,6 +101,10 @@ dependencies {
|
||||||
|
|
||||||
//jec
|
//jec
|
||||||
modCompileOnly "curse.maven:just-enough-characters-250702:6680042"
|
modCompileOnly "curse.maven:just-enough-characters-250702:6680042"
|
||||||
|
|
||||||
|
//mae2
|
||||||
|
modRuntimeOnly "curse.maven:modern-ae2-additions-1028068:6342203"
|
||||||
|
modCompileOnly "curse.maven:modern-ae2-additions-1028068:6342203"
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|
|
||||||
|
|
@ -4,21 +4,32 @@ import appeng.blockentity.crafting.CraftingBlockEntity;
|
||||||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Constant;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
@Mixin(value = CraftingCPUCluster.class, remap = false)
|
@Mixin(value = CraftingCPUCluster.class, remap = false)
|
||||||
public abstract class CraftingCPUClusterMixin {
|
public abstract class CraftingCPUClusterMixin {
|
||||||
// Redirect the second call (ordinal=1) to getAcceleratorThreads in addBlockEntity,
|
// 1) 提升“单方块线程上限”的常量,避免抛出 IAE 的 IllegalArgumentException
|
||||||
// which is used for the per-block <=16 validation in AE2. We return 1 so the check always passes.
|
@ModifyConstant(
|
||||||
|
method = "addBlockEntity(Lappeng/blockentity/crafting/CraftingBlockEntity;)V",
|
||||||
|
constant = @Constant(intValue = 16)
|
||||||
|
)
|
||||||
|
private int extendedae_plus$raisePerUnitLimit(int original) {
|
||||||
|
// 放宽到极大值,完全取消单方块 16 线程的硬限制
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2) 保持统计使用原始线程值(若存在多处调用),不再返回固定 16
|
||||||
@Redirect(
|
@Redirect(
|
||||||
method = "addBlockEntity(Lappeng/blockentity/crafting/CraftingBlockEntity;)V",
|
method = "addBlockEntity(Lappeng/blockentity/crafting/CraftingBlockEntity;)V",
|
||||||
at = @At(
|
at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lappeng/blockentity/crafting/CraftingBlockEntity;getAcceleratorThreads()I",
|
target = "Lappeng/blockentity/crafting/CraftingBlockEntity;getAcceleratorThreads()I"
|
||||||
ordinal = 1
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
private int extendedae_plus$onGetThreadsForLimitCheck(CraftingBlockEntity te) {
|
private int extendedae_plus$onGetThreadsForLimitCheck(CraftingBlockEntity te) {
|
||||||
return 1;
|
// 返回原始线程数,确保总并行单元不被错误下限
|
||||||
|
return te.getAcceleratorThreads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user