修修修
This commit is contained in:
parent
4ca02b923c
commit
9b2e8f38da
|
|
@ -101,6 +101,10 @@ dependencies {
|
|||
|
||||
//jec
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -4,21 +4,32 @@ import appeng.blockentity.crafting.CraftingBlockEntity;
|
|||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
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;
|
||||
|
||||
@Mixin(value = CraftingCPUCluster.class, remap = false)
|
||||
public abstract class CraftingCPUClusterMixin {
|
||||
// Redirect the second call (ordinal=1) to getAcceleratorThreads in addBlockEntity,
|
||||
// which is used for the per-block <=16 validation in AE2. We return 1 so the check always passes.
|
||||
// 1) 提升“单方块线程上限”的常量,避免抛出 IAE 的 IllegalArgumentException
|
||||
@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(
|
||||
method = "addBlockEntity(Lappeng/blockentity/crafting/CraftingBlockEntity;)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lappeng/blockentity/crafting/CraftingBlockEntity;getAcceleratorThreads()I",
|
||||
ordinal = 1
|
||||
target = "Lappeng/blockentity/crafting/CraftingBlockEntity;getAcceleratorThreads()I"
|
||||
)
|
||||
)
|
||||
private int extendedae_plus$onGetThreadsForLimitCheck(CraftingBlockEntity te) {
|
||||
return 1;
|
||||
// 返回原始线程数,确保总并行单元不被错误下限
|
||||
return te.getAcceleratorThreads();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user