fix:默认样板不翻倍,避免导致未进行适配的供应器无法发配材料。去掉对高级ae的样板供应器翻倍支持
This commit is contained in:
parent
2547cd1abd
commit
d9e0a720e1
|
|
@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.Unique;
|
|||
@Mixin(value = AEProcessingPattern.class, remap = false)
|
||||
public class AEProcessingPatternMixin implements SmartDoublingAwarePattern {
|
||||
@Unique
|
||||
private boolean eap$allowScaling = true; // 默认允许缩放
|
||||
private boolean eap$allowScaling = false; // 默认不允许缩放
|
||||
|
||||
@Override
|
||||
public boolean eap$allowScaling() {
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
package com.extendedae_plus.mixin.ae2.autopattern.adaptation;
|
||||
|
||||
import appeng.api.crafting.IPatternDetails;
|
||||
import com.extendedae_plus.content.ScaledProcessingPattern;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Pseudo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**适配
|
||||
* Redirect PatternProviderLogic.pushPattern 中对 List.contains 的调用,
|
||||
* 在遇到缩放样板时回退匹配到原始样板实例。
|
||||
*/
|
||||
@Pseudo
|
||||
@Mixin(targets = "net.pedroksl.advanced_ae.common.logic.AdvPatternProviderLogic", remap = false)
|
||||
public class AdvPatternProviderLogicContainsRedirectMixin {
|
||||
|
||||
@Redirect(method = "pushPattern",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Ljava/util/List;contains(Ljava/lang/Object;)Z")
|
||||
)
|
||||
private boolean eap$patternsContains(List<?> list, Object o) {
|
||||
try {
|
||||
if (o instanceof ScaledProcessingPattern scaled) {
|
||||
IPatternDetails base = scaled.getOriginal();
|
||||
if (base != null && list.indexOf(base) != -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// 使用 indexOf 避免再次触发对 List.contains 的 redirect(防止递归)
|
||||
return list.indexOf(o) != -1;
|
||||
} catch (Throwable t) {
|
||||
return list.indexOf(o) != -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user