规范接口类命名及结构
This commit is contained in:
parent
47c4b2cab9
commit
e1bd547590
|
|
@ -1,6 +1,6 @@
|
|||
package com.extendedae_plus.api;
|
||||
|
||||
public interface AdvancedBlockingHolder {
|
||||
public interface IAdvancedBlocking {
|
||||
boolean eap$getAdvancedBlocking();
|
||||
void eap$setAdvancedBlocking(boolean value);
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ package com.extendedae_plus.api;
|
|||
/**
|
||||
* 由 {@code GuiExPatternProviderMixin} 实现,用于从通用的 Screen Mixin 中更新按钮布局。
|
||||
*/
|
||||
public interface ExPatternButtonsAccessor {
|
||||
public interface IExPatternButtonsAccessor {
|
||||
/**
|
||||
* 在每帧调用以维护扩展样板供应器右侧按钮的可见性、重注册(窗口尺寸变化)与定位。
|
||||
*/
|
||||
|
|
@ -3,6 +3,6 @@ package com.extendedae_plus.api;
|
|||
/**
|
||||
* 由 GuiExPatternProviderMixin 实现,用于在客户端侧提供当前页号,避免反射读取 AE2 内部字段失败。
|
||||
*/
|
||||
public interface ExPatternPageAccessor {
|
||||
public interface IExPatternPageAccessor {
|
||||
int eap$getCurrentPage();
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
package com.extendedae_plus.api;
|
||||
|
||||
public interface PatternProviderMenuAdvancedSync {
|
||||
public interface IPatternProviderMenuAdvancedSync {
|
||||
boolean eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package com.extendedae_plus.api;
|
||||
|
||||
public interface PatternProviderMenuDoublingSync {
|
||||
boolean eap$getSmartDoublingSynced();
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package com.extendedae_plus.api;
|
||||
|
||||
public interface SmartDoublingAwarePattern {
|
||||
boolean eap$allowScaling();
|
||||
void eap$setAllowScaling(boolean allow);
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package com.extendedae_plus.api;
|
||||
|
||||
public interface SmartDoublingHolder {
|
||||
boolean eap$getSmartDoubling();
|
||||
void eap$setSmartDoubling(boolean value);
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.extendedae_plus.bridge;
|
||||
package com.extendedae_plus.api.bridge;
|
||||
|
||||
/**
|
||||
* 非 mixin 包下的桥接接口,供 mixin 进行 instanceof 检测和回调。
|
||||
*/
|
||||
public interface InterfaceWirelessLinkBridge {
|
||||
public interface IInterfaceWirelessLinkBridge {
|
||||
void eap$updateWirelessLink();
|
||||
|
||||
/**
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.extendedae_plus.bridge;
|
||||
package com.extendedae_plus.api.bridge;
|
||||
|
||||
import appeng.api.upgrades.IUpgradeInventory;
|
||||
import appeng.menu.ToolboxMenu;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.extendedae_plus.api.smartDoubling;
|
||||
|
||||
public interface IPatternProviderMenuDoublingSync {
|
||||
boolean eap$getSmartDoublingSynced();
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package com.extendedae_plus.api.smartDoubling;
|
||||
|
||||
public interface ISmartDoublingAwarePattern {
|
||||
boolean eap$allowScaling();
|
||||
void eap$setAllowScaling(boolean allow);
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package com.extendedae_plus.api.smartDoubling;
|
||||
|
||||
public interface ISmartDoublingHolder {
|
||||
boolean eap$getSmartDoubling();
|
||||
void eap$setSmartDoubling(boolean value);
|
||||
}
|
||||
|
|
@ -5,9 +5,9 @@ import appeng.api.config.YesNo;
|
|||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.style.ScreenStyle;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import com.extendedae_plus.api.ExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.PatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.PatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.IExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.IPatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.smartDoubling.IPatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.init.ModNetwork;
|
||||
import com.extendedae_plus.network.ToggleAdvancedBlockingC2SPacket;
|
||||
import com.extendedae_plus.network.ToggleSmartDoublingC2SPacket;
|
||||
|
|
@ -52,7 +52,7 @@ public abstract class AdvPatternProviderScreenMixin extends AEBaseScreen<AdvPatt
|
|||
private void eap$initAdvancedBlocking(AdvPatternProviderMenu menu, Inventory playerInventory, Component title, ScreenStyle style, CallbackInfo ci) {
|
||||
// 使用 @GuiSync 初始化
|
||||
try {
|
||||
if (menu instanceof PatternProviderMenuAdvancedSync sync) {
|
||||
if (menu instanceof IPatternProviderMenuAdvancedSync sync) {
|
||||
this.eap$AdvancedBlockingEnabled = sync.eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -85,7 +85,7 @@ public abstract class AdvPatternProviderScreenMixin extends AEBaseScreen<AdvPatt
|
|||
|
||||
// 智能翻倍按钮:与高级阻挡同款样式,点击仅发送C2S,状态由@GuiSync驱动
|
||||
try {
|
||||
if (menu instanceof PatternProviderMenuDoublingSync sync2) {
|
||||
if (menu instanceof IPatternProviderMenuDoublingSync sync2) {
|
||||
this.eap$SmartDoublingEnabled = sync2.eap$getSmartDoublingSynced();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -119,7 +119,7 @@ public abstract class AdvPatternProviderScreenMixin extends AEBaseScreen<AdvPatt
|
|||
private void eap$updateAdvancedBlocking(CallbackInfo ci) {
|
||||
if (this.eap$AdvancedBlockingToggle != null) {
|
||||
boolean desired = this.eap$AdvancedBlockingEnabled;
|
||||
if (this.menu instanceof PatternProviderMenuAdvancedSync sync) {
|
||||
if (this.menu instanceof IPatternProviderMenuAdvancedSync sync) {
|
||||
desired = sync.eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
this.eap$AdvancedBlockingEnabled = desired;
|
||||
|
|
@ -128,7 +128,7 @@ public abstract class AdvPatternProviderScreenMixin extends AEBaseScreen<AdvPatt
|
|||
|
||||
if (this.eap$SmartDoublingToggle != null) {
|
||||
boolean desired2 = this.eap$SmartDoublingEnabled;
|
||||
if (this.menu instanceof PatternProviderMenuDoublingSync sync2) {
|
||||
if (this.menu instanceof IPatternProviderMenuDoublingSync sync2) {
|
||||
desired2 = sync2.eap$getSmartDoublingSynced();
|
||||
}
|
||||
this.eap$SmartDoublingEnabled = desired2;
|
||||
|
|
@ -137,7 +137,7 @@ public abstract class AdvPatternProviderScreenMixin extends AEBaseScreen<AdvPatt
|
|||
|
||||
if ((Object) this instanceof GuiExPatternProvider) {
|
||||
try {
|
||||
((ExPatternButtonsAccessor) this).eap$updateButtonsLayout();
|
||||
((IExPatternButtonsAccessor) this).eap$updateButtonsLayout();
|
||||
} catch (Throwable t) {
|
||||
LOGGER.debug("[EAP] updateButtonsLayout skipped: {}", t.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import appeng.api.config.YesNo;
|
|||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.style.ScreenStyle;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import com.extendedae_plus.api.ExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.PatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.PatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.IExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.IPatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.smartDoubling.IPatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.init.ModNetwork;
|
||||
import com.extendedae_plus.network.ToggleAdvancedBlockingC2SPacket;
|
||||
import com.extendedae_plus.network.ToggleSmartDoublingC2SPacket;
|
||||
|
|
@ -52,7 +52,7 @@ public abstract class SmallAdvPatternProviderScreenMixin extends AEBaseScreen<Sm
|
|||
private void eap$initAdvancedBlocking(SmallAdvPatternProviderMenu menu, Inventory playerInventory, Component title, ScreenStyle style, CallbackInfo ci) {
|
||||
// 使用 @GuiSync 初始化
|
||||
try {
|
||||
if (menu instanceof PatternProviderMenuAdvancedSync sync) {
|
||||
if (menu instanceof IPatternProviderMenuAdvancedSync sync) {
|
||||
this.eap$AdvancedBlockingEnabled = sync.eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -85,7 +85,7 @@ public abstract class SmallAdvPatternProviderScreenMixin extends AEBaseScreen<Sm
|
|||
|
||||
// 智能翻倍按钮:与高级阻挡同款样式,点击仅发送C2S,状态由@GuiSync驱动
|
||||
try {
|
||||
if (menu instanceof PatternProviderMenuDoublingSync sync2) {
|
||||
if (menu instanceof IPatternProviderMenuDoublingSync sync2) {
|
||||
this.eap$SmartDoublingEnabled = sync2.eap$getSmartDoublingSynced();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -119,7 +119,7 @@ public abstract class SmallAdvPatternProviderScreenMixin extends AEBaseScreen<Sm
|
|||
private void eap$updateAdvancedBlocking(CallbackInfo ci) {
|
||||
if (this.eap$AdvancedBlockingToggle != null) {
|
||||
boolean desired = this.eap$AdvancedBlockingEnabled;
|
||||
if (this.menu instanceof PatternProviderMenuAdvancedSync sync) {
|
||||
if (this.menu instanceof IPatternProviderMenuAdvancedSync sync) {
|
||||
desired = sync.eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
this.eap$AdvancedBlockingEnabled = desired;
|
||||
|
|
@ -128,7 +128,7 @@ public abstract class SmallAdvPatternProviderScreenMixin extends AEBaseScreen<Sm
|
|||
|
||||
if (this.eap$SmartDoublingToggle != null) {
|
||||
boolean desired2 = this.eap$SmartDoublingEnabled;
|
||||
if (this.menu instanceof PatternProviderMenuDoublingSync sync2) {
|
||||
if (this.menu instanceof IPatternProviderMenuDoublingSync sync2) {
|
||||
desired2 = sync2.eap$getSmartDoublingSynced();
|
||||
}
|
||||
this.eap$SmartDoublingEnabled = desired2;
|
||||
|
|
@ -137,7 +137,7 @@ public abstract class SmallAdvPatternProviderScreenMixin extends AEBaseScreen<Sm
|
|||
|
||||
if ((Object) this instanceof GuiExPatternProvider) {
|
||||
try {
|
||||
((ExPatternButtonsAccessor) this).eap$updateButtonsLayout();
|
||||
((IExPatternButtonsAccessor) this).eap$updateButtonsLayout();
|
||||
} catch (Throwable t) {
|
||||
LOGGER.debug("[EAP] updateButtonsLayout skipped: {}", t.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import appeng.api.crafting.IPatternDetails.IInput;
|
|||
import appeng.api.stacks.AEKey;
|
||||
import appeng.api.stacks.GenericStack;
|
||||
import appeng.helpers.patternprovider.PatternProviderTarget;
|
||||
import com.extendedae_plus.api.AdvancedBlockingHolder;
|
||||
import com.extendedae_plus.api.IAdvancedBlocking;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.pedroksl.advanced_ae.common.logic.AdvPatternProviderLogic;
|
||||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import java.util.Collections;
|
||||
|
||||
@Mixin(value = AdvPatternProviderLogic.class, remap = false)
|
||||
public class AdvPatternProviderLogicAdvancedMixin implements AdvancedBlockingHolder {
|
||||
public class AdvPatternProviderLogicAdvancedMixin implements IAdvancedBlocking {
|
||||
@Unique
|
||||
private static final String EAP_ADV_BLOCKING_KEY = "eap_advanced_blocking";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ package com.extendedae_plus.mixin.advancedae.helpers;
|
|||
|
||||
import appeng.api.crafting.IPatternDetails;
|
||||
import appeng.crafting.pattern.AEProcessingPattern;
|
||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.SmartDoublingHolder;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingHolder;
|
||||
import com.extendedae_plus.mixin.advancedae.accessor.AdvPatternProviderLogicPatternsAccessor;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
|
@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(value = AdvPatternProviderLogic.class, remap = false)
|
||||
public class AdvPatternProviderLogicDoublingMixin implements SmartDoublingHolder {
|
||||
public class AdvPatternProviderLogicDoublingMixin implements ISmartDoublingHolder {
|
||||
@Unique
|
||||
private static final String EAP_SMART_DOUBLING_KEY = "eap_smart_doubling";
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ public class AdvPatternProviderLogicDoublingMixin implements SmartDoublingHolder
|
|||
try {
|
||||
var list = ((AdvPatternProviderLogicPatternsAccessor) this).eap$patterns();
|
||||
for (IPatternDetails details : list) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof SmartDoublingAwarePattern aware) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof ISmartDoublingAwarePattern aware) {
|
||||
aware.eap$setAllowScaling(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ public class AdvPatternProviderLogicDoublingMixin implements SmartDoublingHolder
|
|||
var list = ((AdvPatternProviderLogicPatternsAccessor) this).eap$patterns();
|
||||
boolean allow = this.eap$smartDoubling;
|
||||
for (IPatternDetails details : list) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof SmartDoublingAwarePattern aware) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof ISmartDoublingAwarePattern aware) {
|
||||
aware.eap$setAllowScaling(allow);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ package com.extendedae_plus.mixin.advancedae.menu;
|
|||
|
||||
import appeng.menu.AEBaseMenu;
|
||||
import appeng.menu.guisync.GuiSync;
|
||||
import com.extendedae_plus.api.AdvancedBlockingHolder;
|
||||
import com.extendedae_plus.api.PatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.IAdvancedBlocking;
|
||||
import com.extendedae_plus.api.IPatternProviderMenuAdvancedSync;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.pedroksl.advanced_ae.common.logic.AdvPatternProviderLogic;
|
||||
|
|
@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(AdvPatternProviderMenu.class)
|
||||
public abstract class AdvPatternProviderMenuAdvancedMixin implements PatternProviderMenuAdvancedSync {
|
||||
public abstract class AdvPatternProviderMenuAdvancedMixin implements IPatternProviderMenuAdvancedSync {
|
||||
@Final
|
||||
@Shadow(remap = false)
|
||||
protected AdvPatternProviderLogic logic;
|
||||
|
|
@ -33,7 +33,7 @@ public abstract class AdvPatternProviderMenuAdvancedMixin implements PatternProv
|
|||
// 避免@Shadow父类方法,改用公共API:AEBaseMenu#isClientSide()
|
||||
if (!((AEBaseMenu) (Object) this).isClientSide()) {
|
||||
var l = this.logic;
|
||||
if (l instanceof AdvancedBlockingHolder holder) {
|
||||
if (l instanceof IAdvancedBlocking holder) {
|
||||
this.eap$AdvancedBlocking = holder.eap$getAdvancedBlocking();
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ public abstract class AdvPatternProviderMenuAdvancedMixin implements PatternProv
|
|||
private void eap$initAdvancedSync_Public(int id, Inventory playerInventory, AdvPatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof AdvancedBlockingHolder holder) {
|
||||
if (l instanceof IAdvancedBlocking holder) {
|
||||
this.eap$AdvancedBlocking = holder.eap$getAdvancedBlocking();
|
||||
}
|
||||
} catch (Throwable ignored) {}
|
||||
|
|
@ -55,7 +55,7 @@ public abstract class AdvPatternProviderMenuAdvancedMixin implements PatternProv
|
|||
private void eap$initAdvancedSync_Protected(MenuType menuType, int id, Inventory playerInventory, AdvPatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof AdvancedBlockingHolder holder) {
|
||||
if (l instanceof IAdvancedBlocking holder) {
|
||||
this.eap$AdvancedBlocking = holder.eap$getAdvancedBlocking();
|
||||
}
|
||||
} catch (Throwable ignored) {}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ package com.extendedae_plus.mixin.advancedae.menu;
|
|||
|
||||
import appeng.menu.AEBaseMenu;
|
||||
import appeng.menu.guisync.GuiSync;
|
||||
import com.extendedae_plus.api.PatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.SmartDoublingHolder;
|
||||
import com.extendedae_plus.api.smartDoubling.IPatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingHolder;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.pedroksl.advanced_ae.common.logic.AdvPatternProviderLogic;
|
||||
|
|
@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(AdvPatternProviderMenu.class)
|
||||
public abstract class AdvPatternProviderMenuDoublingMixin implements PatternProviderMenuDoublingSync {
|
||||
public abstract class AdvPatternProviderMenuDoublingMixin implements IPatternProviderMenuDoublingSync {
|
||||
@Final
|
||||
@Shadow(remap = false)
|
||||
protected AdvPatternProviderLogic logic;
|
||||
|
|
@ -31,7 +31,7 @@ public abstract class AdvPatternProviderMenuDoublingMixin implements PatternProv
|
|||
private void eap$syncSmartDoubling(CallbackInfo ci) {
|
||||
if (!((AEBaseMenu) (Object) this).isClientSide()) {
|
||||
var l = this.logic;
|
||||
if (l instanceof SmartDoublingHolder holder) {
|
||||
if (l instanceof ISmartDoublingHolder holder) {
|
||||
this.eap$SmartDoubling = holder.eap$getSmartDoubling();
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ public abstract class AdvPatternProviderMenuDoublingMixin implements PatternProv
|
|||
private void eap$initSmartSync_Public(int id, Inventory playerInventory, AdvPatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof SmartDoublingHolder holder) {
|
||||
if (l instanceof ISmartDoublingHolder holder) {
|
||||
this.eap$SmartDoubling = holder.eap$getSmartDoubling();
|
||||
}
|
||||
} catch (Throwable ignored) {}
|
||||
|
|
@ -51,7 +51,7 @@ public abstract class AdvPatternProviderMenuDoublingMixin implements PatternProv
|
|||
private void eap$initSmartSync_Protected(MenuType menuType, int id, Inventory playerInventory, AdvPatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof SmartDoublingHolder holder) {
|
||||
if (l instanceof ISmartDoublingHolder holder) {
|
||||
this.eap$SmartDoubling = holder.eap$getSmartDoubling();
|
||||
}
|
||||
} catch (Throwable ignored) {}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package com.extendedae_plus.mixin.ae2;
|
||||
|
||||
import appeng.crafting.pattern.AEProcessingPattern;
|
||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingAwarePattern;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
@Mixin(value = AEProcessingPattern.class, remap = false)
|
||||
public class AEProcessingPatternMixin implements SmartDoublingAwarePattern {
|
||||
public class AEProcessingPatternMixin implements ISmartDoublingAwarePattern {
|
||||
@Unique
|
||||
private boolean eap$allowScaling = false; // 默认不允许缩放
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import appeng.crafting.CraftingTreeNode;
|
|||
import appeng.crafting.CraftingTreeProcess;
|
||||
import appeng.crafting.pattern.AEProcessingPattern;
|
||||
import appeng.me.service.CraftingService;
|
||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.config.ModConfig;
|
||||
import com.extendedae_plus.content.ScaledProcessingPattern;
|
||||
import com.extendedae_plus.util.PatternScaler;
|
||||
|
|
@ -41,7 +41,7 @@ public abstract class CraftingTreeProcessMixin {
|
|||
// 若传入的 details 已经是缩放样板,且原始样板不允许缩放,则直接解包为原始样板
|
||||
if (details instanceof ScaledProcessingPattern sp) {
|
||||
var proc0 = sp.getOriginal();
|
||||
if (proc0 instanceof SmartDoublingAwarePattern aware0 && !aware0.eap$allowScaling()) {
|
||||
if (proc0 instanceof ISmartDoublingAwarePattern aware0 && !aware0.eap$allowScaling()) {
|
||||
return proc0;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ public abstract class CraftingTreeProcessMixin {
|
|||
if (!(details instanceof AEProcessingPattern proc)) return original;
|
||||
|
||||
// 若样板标记为不允许缩放,则直接跳过
|
||||
if (proc instanceof SmartDoublingAwarePattern aware && !aware.eap$allowScaling()) {
|
||||
if (proc instanceof ISmartDoublingAwarePattern aware && !aware.eap$allowScaling()) {
|
||||
return original;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import appeng.client.gui.style.ScreenStyle;
|
|||
import appeng.client.gui.style.Text;
|
||||
import appeng.client.gui.style.TextAlignment;
|
||||
import appeng.menu.slot.AppEngSlot;
|
||||
import com.extendedae_plus.api.ExPatternPageAccessor;
|
||||
import com.extendedae_plus.api.IExPatternPageAccessor;
|
||||
import com.extendedae_plus.content.ClientPatternHighlightStore;
|
||||
import com.extendedae_plus.init.ModNetwork;
|
||||
import com.extendedae_plus.network.CraftingMonitorJumpC2SPacket;
|
||||
|
|
@ -274,7 +274,7 @@ public abstract class AEBaseScreenMixin {
|
|||
|
||||
int cur = 1;
|
||||
int max = 1;
|
||||
if (self instanceof ExPatternPageAccessor accessor) {
|
||||
if (self instanceof IExPatternPageAccessor accessor) {
|
||||
cur = Math.max(0, accessor.eap$getCurrentPage()) + 1;
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import appeng.client.gui.implementations.PatternProviderScreen;
|
|||
import appeng.client.gui.style.ScreenStyle;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.api.ExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.PatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.PatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.IExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.IPatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.smartDoubling.IPatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.init.ModNetwork;
|
||||
import com.extendedae_plus.network.ToggleAdvancedBlockingC2SPacket;
|
||||
import com.extendedae_plus.network.ToggleSmartDoublingC2SPacket;
|
||||
|
|
@ -52,7 +52,7 @@ public abstract class PatternProviderScreenMixin<C extends PatternProviderMenu>
|
|||
private void eap$initAdvancedBlocking(C menu, Inventory playerInventory, Component title, ScreenStyle style, CallbackInfo ci) {
|
||||
// 使用 @GuiSync 初始化
|
||||
try {
|
||||
if (menu instanceof PatternProviderMenuAdvancedSync sync) {
|
||||
if (menu instanceof IPatternProviderMenuAdvancedSync sync) {
|
||||
this.eap$AdvancedBlockingEnabled = sync.eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -85,7 +85,7 @@ public abstract class PatternProviderScreenMixin<C extends PatternProviderMenu>
|
|||
|
||||
// 智能翻倍按钮:与高级阻挡同款样式,点击仅发送C2S,状态由@GuiSync驱动
|
||||
try {
|
||||
if (menu instanceof PatternProviderMenuDoublingSync sync2) {
|
||||
if (menu instanceof IPatternProviderMenuDoublingSync sync2) {
|
||||
this.eap$SmartDoublingEnabled = sync2.eap$getSmartDoublingSynced();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -119,7 +119,7 @@ public abstract class PatternProviderScreenMixin<C extends PatternProviderMenu>
|
|||
private void eap$updateAdvancedBlocking(CallbackInfo ci) {
|
||||
if (this.eap$AdvancedBlockingToggle != null) {
|
||||
boolean desired = this.eap$AdvancedBlockingEnabled;
|
||||
if (this.menu instanceof PatternProviderMenuAdvancedSync sync) {
|
||||
if (this.menu instanceof IPatternProviderMenuAdvancedSync sync) {
|
||||
desired = sync.eap$getAdvancedBlockingSynced();
|
||||
}
|
||||
this.eap$AdvancedBlockingEnabled = desired;
|
||||
|
|
@ -128,7 +128,7 @@ public abstract class PatternProviderScreenMixin<C extends PatternProviderMenu>
|
|||
|
||||
if (this.eap$SmartDoublingToggle != null) {
|
||||
boolean desired2 = this.eap$SmartDoublingEnabled;
|
||||
if (this.menu instanceof PatternProviderMenuDoublingSync sync2) {
|
||||
if (this.menu instanceof IPatternProviderMenuDoublingSync sync2) {
|
||||
desired2 = sync2.eap$getSmartDoublingSynced();
|
||||
}
|
||||
this.eap$SmartDoublingEnabled = desired2;
|
||||
|
|
@ -137,7 +137,7 @@ public abstract class PatternProviderScreenMixin<C extends PatternProviderMenu>
|
|||
|
||||
if ((Object) this instanceof GuiExPatternProvider) {
|
||||
try {
|
||||
((ExPatternButtonsAccessor) this).eap$updateButtonsLayout();
|
||||
((IExPatternButtonsAccessor) this).eap$updateButtonsLayout();
|
||||
} catch (Throwable t) {
|
||||
LOGGER.debug("[EAP] updateButtonsLayout skipped: {}", t.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import appeng.client.gui.widgets.UpgradesPanel;
|
|||
import appeng.core.localization.GuiText;
|
||||
import appeng.menu.SlotSemantics;
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.bridge.IUpgradableMenu;
|
||||
import com.extendedae_plus.api.bridge.IUpgradableMenu;
|
||||
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.extendedae_plus.mixin.ae2.client.gui;
|
|||
|
||||
import appeng.client.Point;
|
||||
import appeng.client.gui.layout.SlotGridLayout;
|
||||
import com.extendedae_plus.api.IExPatternPageAccessor;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
|
@ -32,7 +33,7 @@ public abstract class SlotGridLayoutMixin {
|
|||
// 读取实际当前页码:优先从 GUI accessor,其次反射容器,失败则为 0
|
||||
int currentPage = 0;
|
||||
try {
|
||||
if (screen instanceof com.extendedae_plus.api.ExPatternPageAccessor accessor) {
|
||||
if (screen instanceof IExPatternPageAccessor accessor) {
|
||||
currentPage = accessor.eap$getCurrentPage();
|
||||
} else {
|
||||
var menu = ((com.glodblock.github.extendedae.client.gui.GuiExPatternProvider) screen).getMenu();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import appeng.api.upgrades.UpgradeInventories;
|
|||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
||||
import com.extendedae_plus.ae.items.ChannelCardItem;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
||||
import com.extendedae_plus.init.ModItems;
|
||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
* 根据appflux是否存在来决定是否实现IUpgradeableObject接口
|
||||
*/
|
||||
@Mixin(value = PatternProviderLogic.class, priority = 500, remap = false)
|
||||
public abstract class PatternProviderLogicCompatMixin implements IUpgradeableObject, InterfaceWirelessLinkBridge {
|
||||
public abstract class PatternProviderLogicCompatMixin implements IUpgradeableObject, IInterfaceWirelessLinkBridge {
|
||||
|
||||
@Unique
|
||||
private IUpgradeInventory eap$compatUpgrades = UpgradeInventories.empty();
|
||||
|
|
|
|||
|
|
@ -4,11 +4,10 @@ import appeng.api.upgrades.IUpgradeInventory;
|
|||
import appeng.helpers.InterfaceLogic;
|
||||
import appeng.helpers.InterfaceLogicHost;
|
||||
import com.extendedae_plus.ae.items.ChannelCardItem;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.init.ModItems;
|
||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||
import com.extendedae_plus.wireless.endpoint.InterfaceNodeEndpointImpl;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
|
@ -18,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(InterfaceLogic.class)
|
||||
public abstract class InterfaceLogicChannelCardMixin implements InterfaceWirelessLinkBridge {
|
||||
public abstract class InterfaceLogicChannelCardMixin implements IInterfaceWirelessLinkBridge {
|
||||
|
||||
@Shadow(remap = false) public abstract IUpgradeInventory getUpgrades();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.extendedae_plus.bridge;
|
||||
package com.extendedae_plus.api.bridge;
|
||||
|
||||
/**
|
||||
* 旧名兼容:已迁移到非 mixin 包,避免 Mixin 处理器禁止直接引用。
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.extendedae_plus.mixin.ae2.helpers;
|
||||
|
||||
import appeng.helpers.InterfaceLogic;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.util.ExtendedAELogger;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
|
@ -29,7 +28,7 @@ public abstract class InterfaceLogicTickerMixin {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this$0 instanceof InterfaceWirelessLinkBridge bridge) {
|
||||
if (this$0 instanceof IInterfaceWirelessLinkBridge bridge) {
|
||||
// 处理延迟初始化
|
||||
bridge.eap$handleDelayedInit();
|
||||
}
|
||||
|
|
@ -38,7 +37,7 @@ public abstract class InterfaceLogicTickerMixin {
|
|||
@Inject(method = "tickingRequest", at = @At("TAIL"), remap = false)
|
||||
private void eap$tickTail(appeng.api.networking.IGridNode node, int ticksSinceLastCall,
|
||||
CallbackInfoReturnable<appeng.api.networking.ticking.TickRateModulation> cir) {
|
||||
if (this$0 instanceof InterfaceWirelessLinkBridge bridge) {
|
||||
if (this$0 instanceof IInterfaceWirelessLinkBridge bridge) {
|
||||
bridge.eap$updateWirelessLink();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import appeng.api.stacks.AEKey;
|
|||
import appeng.api.stacks.GenericStack;
|
||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||
import appeng.helpers.patternprovider.PatternProviderTarget;
|
||||
import com.extendedae_plus.api.AdvancedBlockingHolder;
|
||||
import com.extendedae_plus.api.IAdvancedBlocking;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import java.util.Collections;
|
||||
|
||||
@Mixin(value = PatternProviderLogic.class, remap = false)
|
||||
public class PatternProviderLogicAdvancedMixin implements AdvancedBlockingHolder {
|
||||
public class PatternProviderLogicAdvancedMixin implements IAdvancedBlocking {
|
||||
@Unique
|
||||
private static final String EAP_ADV_BLOCKING_KEY = "eap_advanced_blocking";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package com.extendedae_plus.mixin.ae2.helpers;
|
|||
import appeng.api.crafting.IPatternDetails;
|
||||
import appeng.crafting.pattern.AEProcessingPattern;
|
||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.SmartDoublingHolder;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingHolder;
|
||||
import com.extendedae_plus.mixin.ae2.accessor.PatternProviderLogicPatternsAccessor;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
|
@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(value = PatternProviderLogic.class, remap = false)
|
||||
public class PatternProviderLogicDoublingMixin implements SmartDoublingHolder {
|
||||
public class PatternProviderLogicDoublingMixin implements ISmartDoublingHolder {
|
||||
@Unique
|
||||
private static final String EAP_SMART_DOUBLING_KEY = "eap_smart_doubling";
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ public class PatternProviderLogicDoublingMixin implements SmartDoublingHolder {
|
|||
try {
|
||||
var list = ((PatternProviderLogicPatternsAccessor) this).eap$patterns();
|
||||
for (IPatternDetails details : list) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof SmartDoublingAwarePattern aware) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof ISmartDoublingAwarePattern aware) {
|
||||
aware.eap$setAllowScaling(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ public class PatternProviderLogicDoublingMixin implements SmartDoublingHolder {
|
|||
var list = ((PatternProviderLogicPatternsAccessor) this).eap$patterns();
|
||||
boolean allow = this.eap$smartDoubling;
|
||||
for (IPatternDetails details : list) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof SmartDoublingAwarePattern aware) {
|
||||
if (details instanceof AEProcessingPattern proc && proc instanceof ISmartDoublingAwarePattern aware) {
|
||||
aware.eap$setAllowScaling(allow);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.extendedae_plus.mixin.ae2.helpers.patternprovider;
|
||||
|
||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
|
@ -27,7 +27,7 @@ public abstract class PatternProviderLogicTickerMixin {
|
|||
if (node != null && node.getLevel() != null && node.getLevel().isClientSide) {
|
||||
return;
|
||||
}
|
||||
if (this$0 instanceof InterfaceWirelessLinkBridge bridge) {
|
||||
if (this$0 instanceof IInterfaceWirelessLinkBridge bridge) {
|
||||
bridge.eap$handleDelayedInit();
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ public abstract class PatternProviderLogicTickerMixin {
|
|||
@Inject(method = "tickingRequest", at = @At("TAIL"))
|
||||
private void eap$tickTail(appeng.api.networking.IGridNode node, int ticksSinceLastCall,
|
||||
CallbackInfoReturnable<appeng.api.networking.ticking.TickRateModulation> cir) {
|
||||
if (this$0 instanceof InterfaceWirelessLinkBridge bridge) {
|
||||
if (this$0 instanceof IInterfaceWirelessLinkBridge bridge) {
|
||||
bridge.eap$updateWirelessLink();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
|||
import appeng.menu.AEBaseMenu;
|
||||
import appeng.menu.guisync.GuiSync;
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.api.AdvancedBlockingHolder;
|
||||
import com.extendedae_plus.api.PatternProviderMenuAdvancedSync;
|
||||
import com.extendedae_plus.api.IAdvancedBlocking;
|
||||
import com.extendedae_plus.api.IPatternProviderMenuAdvancedSync;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import static com.extendedae_plus.util.ExtendedAELogger.LOGGER;
|
||||
|
||||
@Mixin(PatternProviderMenu.class)
|
||||
public abstract class PatternProviderMenuAdvancedMixin implements PatternProviderMenuAdvancedSync {
|
||||
public abstract class PatternProviderMenuAdvancedMixin implements IPatternProviderMenuAdvancedSync {
|
||||
@Final
|
||||
@Shadow(remap = false)
|
||||
protected PatternProviderLogic logic;
|
||||
|
|
@ -35,7 +35,7 @@ public abstract class PatternProviderMenuAdvancedMixin implements PatternProvide
|
|||
// 避免@Shadow父类方法,改用公共API:AEBaseMenu#isClientSide()
|
||||
if (!((AEBaseMenu) (Object) this).isClientSide()) {
|
||||
var l = this.logic;
|
||||
if (l instanceof AdvancedBlockingHolder holder) {
|
||||
if (l instanceof IAdvancedBlocking holder) {
|
||||
this.eap$AdvancedBlocking = holder.eap$getAdvancedBlocking();
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ public abstract class PatternProviderMenuAdvancedMixin implements PatternProvide
|
|||
private void eap$initAdvancedSync_Public(int id, Inventory playerInventory, PatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof AdvancedBlockingHolder holder) {
|
||||
if (l instanceof IAdvancedBlocking holder) {
|
||||
this.eap$AdvancedBlocking = holder.eap$getAdvancedBlocking();
|
||||
}
|
||||
} catch (Throwable ignored) {}
|
||||
|
|
@ -57,7 +57,7 @@ public abstract class PatternProviderMenuAdvancedMixin implements PatternProvide
|
|||
private void eap$initAdvancedSync_Protected(MenuType<? extends PatternProviderMenu> menuType, int id, Inventory playerInventory, PatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof AdvancedBlockingHolder holder) {
|
||||
if (l instanceof IAdvancedBlocking holder) {
|
||||
this.eap$AdvancedBlocking = holder.eap$getAdvancedBlocking();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
|||
import appeng.menu.AEBaseMenu;
|
||||
import appeng.menu.guisync.GuiSync;
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.api.PatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.SmartDoublingHolder;
|
||||
import com.extendedae_plus.api.smartDoubling.IPatternProviderMenuDoublingSync;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingHolder;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import static com.extendedae_plus.util.ExtendedAELogger.LOGGER;
|
||||
|
||||
@Mixin(PatternProviderMenu.class)
|
||||
public abstract class PatternProviderMenuDoublingMixin implements PatternProviderMenuDoublingSync {
|
||||
public abstract class PatternProviderMenuDoublingMixin implements IPatternProviderMenuDoublingSync {
|
||||
@Final
|
||||
@Shadow(remap = false)
|
||||
protected PatternProviderLogic logic;
|
||||
|
|
@ -33,7 +33,7 @@ public abstract class PatternProviderMenuDoublingMixin implements PatternProvide
|
|||
private void eap$syncSmartDoubling(CallbackInfo ci) {
|
||||
if (!((AEBaseMenu) (Object) this).isClientSide()) {
|
||||
var l = this.logic;
|
||||
if (l instanceof SmartDoublingHolder holder) {
|
||||
if (l instanceof ISmartDoublingHolder holder) {
|
||||
this.eap$SmartDoubling = holder.eap$getSmartDoubling();
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ public abstract class PatternProviderMenuDoublingMixin implements PatternProvide
|
|||
private void eap$initSmartSync_Public(int id, Inventory playerInventory, PatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof SmartDoublingHolder holder) {
|
||||
if (l instanceof ISmartDoublingHolder holder) {
|
||||
this.eap$SmartDoubling = holder.eap$getSmartDoubling();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -55,7 +55,7 @@ public abstract class PatternProviderMenuDoublingMixin implements PatternProvide
|
|||
private void eap$initSmartSync_Protected(MenuType<? extends PatternProviderMenu> menuType, int id, Inventory playerInventory, PatternProviderLogicHost host, CallbackInfo ci) {
|
||||
try {
|
||||
var l = this.logic;
|
||||
if (l instanceof SmartDoublingHolder holder) {
|
||||
if (l instanceof ISmartDoublingHolder holder) {
|
||||
this.eap$SmartDoubling = holder.eap$getSmartDoubling();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
|||
import appeng.menu.AEBaseMenu;
|
||||
import appeng.menu.ToolboxMenu;
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.bridge.IUpgradableMenu;
|
||||
import com.extendedae_plus.api.bridge.IUpgradableMenu;
|
||||
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.extendedae_plus.mixin.ae2.parts;
|
||||
|
||||
import appeng.parts.AEBasePart;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
@ -18,8 +18,8 @@ public class AEBasePartClientSyncMixin {
|
|||
@Inject(method = "writeToStream", at = @At("TAIL"))
|
||||
private void eap$writeWirelessState(FriendlyByteBuf data, CallbackInfo ci) {
|
||||
// 检查是否实现了无线链接桥接接口
|
||||
if (this instanceof InterfaceWirelessLinkBridge) {
|
||||
InterfaceWirelessLinkBridge bridge = (InterfaceWirelessLinkBridge) this;
|
||||
if (this instanceof IInterfaceWirelessLinkBridge) {
|
||||
IInterfaceWirelessLinkBridge bridge = (IInterfaceWirelessLinkBridge) this;
|
||||
// 同步无线连接状态到客户端
|
||||
boolean connected = false;
|
||||
try {
|
||||
|
|
@ -44,8 +44,8 @@ public class AEBasePartClientSyncMixin {
|
|||
boolean connected = data.readBoolean();
|
||||
|
||||
// 检查是否实现了无线链接桥接接口
|
||||
if (this instanceof InterfaceWirelessLinkBridge) {
|
||||
InterfaceWirelessLinkBridge bridge = (InterfaceWirelessLinkBridge) this;
|
||||
if (this instanceof IInterfaceWirelessLinkBridge) {
|
||||
IInterfaceWirelessLinkBridge bridge = (IInterfaceWirelessLinkBridge) this;
|
||||
try {
|
||||
// 更新客户端状态
|
||||
bridge.eap$setClientWirelessState(connected);
|
||||
|
|
|
|||
|
|
@ -3,16 +3,14 @@ package com.extendedae_plus.mixin.ae2.parts.automation;
|
|||
import appeng.api.networking.security.IActionHost;
|
||||
import appeng.api.upgrades.IUpgradeInventory;
|
||||
import appeng.api.upgrades.IUpgradeableObject;
|
||||
import appeng.helpers.InterfaceLogicHost;
|
||||
import appeng.parts.automation.IOBusPart;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import com.extendedae_plus.util.ExtendedAELogger;
|
||||
import com.extendedae_plus.ae.items.ChannelCardItem;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.init.ModItems;
|
||||
import com.extendedae_plus.util.ExtendedAELogger;
|
||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
@ -23,7 +21,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
* 给 AE2 的 I/O 总线注入频道卡联动:在升级变更时读取频道并更新无线链接。
|
||||
*/
|
||||
@Mixin(value = IOBusPart.class, remap = false)
|
||||
public abstract class IOBusPartChannelCardMixin implements InterfaceWirelessLinkBridge, IUpgradeableObject {
|
||||
public abstract class IOBusPartChannelCardMixin implements IInterfaceWirelessLinkBridge, IUpgradeableObject {
|
||||
|
||||
@Unique
|
||||
private WirelessSlaveLink eap$link;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.extendedae_plus.mixin.ae2.parts.automation;
|
|||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.parts.automation.IOBusPart;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
|
@ -17,7 +17,7 @@ public abstract class IOBusPartTickerChannelCardMixin {
|
|||
|
||||
@Inject(method = "tickingRequest", at = @At("TAIL"))
|
||||
private void eap$tickTail(IGridNode node, int ticksSinceLastCall, CallbackInfoReturnable<TickRateModulation> cir) {
|
||||
if (this instanceof InterfaceWirelessLinkBridge bridge) {
|
||||
if (this instanceof IInterfaceWirelessLinkBridge bridge) {
|
||||
bridge.eap$updateWirelessLink();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@ import appeng.api.networking.security.IActionHost;
|
|||
import appeng.api.upgrades.IUpgradeInventory;
|
||||
import appeng.api.upgrades.IUpgradeableObject;
|
||||
import appeng.parts.storagebus.StorageBusPart;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import com.extendedae_plus.util.ExtendedAELogger;
|
||||
import com.extendedae_plus.ae.items.ChannelCardItem;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.init.ModItems;
|
||||
import com.extendedae_plus.util.ExtendedAELogger;
|
||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
@ -23,7 +22,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
* 给 AE2 的存储总线注入频道卡联动:在升级变更时读取频道并更新无线链接。
|
||||
*/
|
||||
@Mixin(value = StorageBusPart.class, remap = false)
|
||||
public abstract class StorageBusPartChannelCardMixin implements InterfaceWirelessLinkBridge, IUpgradeableObject {
|
||||
public abstract class StorageBusPartChannelCardMixin implements IInterfaceWirelessLinkBridge, IUpgradeableObject {
|
||||
|
||||
@Unique
|
||||
private WirelessSlaveLink eap$link;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.extendedae_plus.mixin.ae2.parts.storagebus;
|
|||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.parts.storagebus.StorageBusPart;
|
||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||
import com.extendedae_plus.api.bridge.IInterfaceWirelessLinkBridge;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
|
@ -17,7 +17,7 @@ public abstract class StorageBusPartTickerChannelCardMixin {
|
|||
|
||||
@Inject(method = "tickingRequest", at = @At("TAIL"))
|
||||
private void eap$tickTail(IGridNode node, int ticksSinceLastCall, CallbackInfoReturnable<TickRateModulation> cir) {
|
||||
if (this instanceof InterfaceWirelessLinkBridge bridge) {
|
||||
if (this instanceof IInterfaceWirelessLinkBridge bridge) {
|
||||
bridge.eap$updateWirelessLink();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ import appeng.client.gui.implementations.PatternProviderScreen;
|
|||
import appeng.client.gui.style.ScreenStyle;
|
||||
import appeng.menu.SlotSemantics;
|
||||
import com.extendedae_plus.NewIcon;
|
||||
import com.extendedae_plus.api.ExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.IExPatternButtonsAccessor;
|
||||
import com.extendedae_plus.api.IExPatternPageAccessor;
|
||||
import com.extendedae_plus.config.ModConfig;
|
||||
import com.glodblock.github.extendedae.client.button.ActionEPPButton;
|
||||
import com.glodblock.github.extendedae.client.gui.GuiExPatternProvider;
|
||||
|
|
@ -26,7 +27,7 @@ import java.lang.reflect.Method;
|
|||
import static com.extendedae_plus.util.ExtendedAELogger.LOGGER;
|
||||
|
||||
@Mixin(GuiExPatternProvider.class)
|
||||
public abstract class GuiExPatternProviderMixin extends PatternProviderScreen<ContainerExPatternProvider> implements ExPatternButtonsAccessor, com.extendedae_plus.api.ExPatternPageAccessor {
|
||||
public abstract class GuiExPatternProviderMixin extends PatternProviderScreen<ContainerExPatternProvider> implements IExPatternButtonsAccessor, IExPatternPageAccessor {
|
||||
|
||||
@Unique
|
||||
ScreenStyle eap$screenStyle;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import appeng.blockentity.crafting.PatternProviderBlockEntity;
|
|||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
||||
import appeng.parts.crafting.PatternProviderPart;
|
||||
import com.extendedae_plus.api.AdvancedBlockingHolder;
|
||||
import com.extendedae_plus.api.SmartDoublingHolder;
|
||||
import com.extendedae_plus.api.IAdvancedBlocking;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingHolder;
|
||||
import com.extendedae_plus.content.controller.NetworkPatternControllerBlockEntity;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
|
|
@ -16,15 +16,15 @@ import net.minecraft.network.chat.Component;
|
|||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* C2S:全网批量切换样板供应器的三种模式:
|
||||
* - 阻挡模式(AE2 内置 BLOCKING_MODE 设置)
|
||||
* - 高级阻挡模式(AdvancedBlockingHolder mixin)
|
||||
* - 智能翻倍模式(SmartDoublingHolder mixin)
|
||||
* - 高级阻挡模式(IAdvancedBlocking mixin)
|
||||
* - 智能翻倍模式(ISmartDoublingHolder mixin)
|
||||
*
|
||||
* 负载为三个操作码(各1字节),分别对应:blocking、advancedBlocking、smartDoubling。
|
||||
*/
|
||||
|
|
@ -173,14 +173,14 @@ public class GlobalToggleProviderModesC2SPacket {
|
|||
}
|
||||
}
|
||||
// 2) 高级阻挡(mixin 接口)
|
||||
if (msg.opAdvancedBlocking != Op.NOOP && logic instanceof AdvancedBlockingHolder adv) {
|
||||
if (msg.opAdvancedBlocking != Op.NOOP && logic instanceof IAdvancedBlocking adv) {
|
||||
boolean current = adv.eap$getAdvancedBlocking();
|
||||
boolean target = computeTarget(current, msg.opAdvancedBlocking);
|
||||
adv.eap$setAdvancedBlocking(target);
|
||||
changed = changed || (current != target);
|
||||
}
|
||||
// 3) 智能翻倍(mixin 接口)
|
||||
if (msg.opSmartDoubling != Op.NOOP && logic instanceof SmartDoublingHolder sd) {
|
||||
if (msg.opSmartDoubling != Op.NOOP && logic instanceof ISmartDoublingHolder sd) {
|
||||
boolean current = sd.eap$getSmartDoubling();
|
||||
boolean target = computeTarget(current, msg.opSmartDoubling);
|
||||
sd.eap$setSmartDoubling(target);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.extendedae_plus.network;
|
|||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.api.AdvancedBlockingHolder;
|
||||
import com.extendedae_plus.api.IAdvancedBlocking;
|
||||
import com.extendedae_plus.mixin.advancedae.accessor.AdvPatternProviderMenuAdvancedAccessor;
|
||||
import com.extendedae_plus.mixin.ae2.accessor.PatternProviderMenuAdvancedAccessor;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
|
|
@ -36,7 +36,7 @@ public class ToggleAdvancedBlockingC2SPacket {
|
|||
if (containerMenu instanceof PatternProviderMenu menu) {
|
||||
var accessor = (PatternProviderMenuAdvancedAccessor) menu;
|
||||
var logic = accessor.eap$logic();
|
||||
if (logic instanceof AdvancedBlockingHolder holder) {
|
||||
if (logic instanceof IAdvancedBlocking holder) {
|
||||
boolean current = holder.eap$getAdvancedBlocking();
|
||||
boolean next = !current;
|
||||
holder.eap$setAdvancedBlocking(next);
|
||||
|
|
@ -48,7 +48,7 @@ public class ToggleAdvancedBlockingC2SPacket {
|
|||
}else if (containerMenu instanceof AdvPatternProviderMenu menu){
|
||||
var accessor = (AdvPatternProviderMenuAdvancedAccessor) menu;
|
||||
var logic = accessor.eap$logic();
|
||||
if (logic instanceof AdvancedBlockingHolder holder) {
|
||||
if (logic instanceof IAdvancedBlocking holder) {
|
||||
boolean current = holder.eap$getAdvancedBlocking();
|
||||
boolean next = !current;
|
||||
holder.eap$setAdvancedBlocking(next);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.extendedae_plus.network;
|
||||
|
||||
import appeng.menu.implementations.PatternProviderMenu;
|
||||
import com.extendedae_plus.api.SmartDoublingHolder;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingHolder;
|
||||
import com.extendedae_plus.mixin.advancedae.accessor.AdvPatternProviderMenuAdvancedAccessor;
|
||||
import com.extendedae_plus.mixin.ae2.accessor.PatternProviderMenuAdvancedAccessor;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
|
|
@ -33,7 +33,7 @@ public class ToggleSmartDoublingC2SPacket {
|
|||
if (containerMenu instanceof PatternProviderMenu menu) {
|
||||
var accessor = (PatternProviderMenuAdvancedAccessor) menu;
|
||||
var logic = accessor.eap$logic();
|
||||
if (logic instanceof SmartDoublingHolder holder) {
|
||||
if (logic instanceof ISmartDoublingHolder holder) {
|
||||
boolean current = holder.eap$getSmartDoubling();
|
||||
boolean next = !current;
|
||||
holder.eap$setSmartDoubling(next);
|
||||
|
|
@ -42,7 +42,7 @@ public class ToggleSmartDoublingC2SPacket {
|
|||
}else if (containerMenu instanceof AdvPatternProviderMenu menu){
|
||||
var accessor = (AdvPatternProviderMenuAdvancedAccessor) menu;
|
||||
var logic = accessor.eap$logic();
|
||||
if (logic instanceof SmartDoublingHolder holder) {
|
||||
if (logic instanceof ISmartDoublingHolder holder) {
|
||||
boolean current = holder.eap$getSmartDoubling();
|
||||
boolean next = !current;
|
||||
holder.eap$setSmartDoubling(next);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.extendedae_plus.util;
|
|||
import appeng.api.stacks.AEKey;
|
||||
import appeng.api.stacks.GenericStack;
|
||||
import appeng.crafting.pattern.AEProcessingPattern;
|
||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.api.smartDoubling.ISmartDoublingAwarePattern;
|
||||
import com.extendedae_plus.config.ModConfig;
|
||||
import com.extendedae_plus.content.ScaledProcessingPattern;
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ public final class PatternScaler {
|
|||
if (target == null) throw new IllegalArgumentException("target");
|
||||
|
||||
// 双保险:若样板标记为不允许缩放,直接放弃缩放(返回 null 表示调用方应保持原样板)
|
||||
if (base instanceof SmartDoublingAwarePattern aware && !aware.eap$allowScaling()) {
|
||||
if (base instanceof ISmartDoublingAwarePattern aware && !aware.eap$allowScaling()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user