与主分支1.21.1-1.4.3合并
This commit is contained in:
parent
0e29be2eff
commit
fb9bf5315a
|
|
@ -12,7 +12,7 @@ loaderVersion="[1,)" #mandatory
|
||||||
|
|
||||||
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
||||||
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
||||||
license="All Rights Reserved"
|
license="LGPL-3.0-or-later"
|
||||||
|
|
||||||
# A URL to refer people to when problems occur with this mod
|
# A URL to refer people to when problems occur with this mod
|
||||||
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
|
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
|
||||||
|
|
@ -42,11 +42,10 @@ displayName="ExtendedAE-Plus" #mandatory
|
||||||
#credits="" #optional
|
#credits="" #optional
|
||||||
|
|
||||||
# A text field displayed in the mod UI
|
# A text field displayed in the mod UI
|
||||||
authors="YourNameHere, OtherNameHere" #optional
|
authors="GaLicn, XianYuFish001" #optional
|
||||||
|
|
||||||
# The description text for the mod (multi line!) (#mandatory)
|
# The description text for the mod (multi line!) (#mandatory)
|
||||||
description='''Example mod description.
|
description=''''''
|
||||||
Newline characters can be used and will be replaced properly.'''
|
|
||||||
|
|
||||||
# The [[mixins]] block allows you to declare your mixin config to FML so that it gets loaded.
|
# The [[mixins]] block allows you to declare your mixin config to FML so that it gets loaded.
|
||||||
[[mixins]]
|
[[mixins]]
|
||||||
|
|
@ -96,6 +95,13 @@ config="extendedae_plus.mixins.json"
|
||||||
ordering="AFTER"
|
ordering="AFTER"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
|
|
||||||
|
[[dependencies.extendedae_plus]]
|
||||||
|
modId="expandedae"
|
||||||
|
type="discouraged"
|
||||||
|
versionRange="*"
|
||||||
|
ordering="AFTER"
|
||||||
|
side="BOTH"
|
||||||
|
|
||||||
# Features are specific properties of the game environment, that you may want to declare you require. This example declares
|
# Features are specific properties of the game environment, that you may want to declare you require. This example declares
|
||||||
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
|
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
|
||||||
# stop your mod loading on the server for example.
|
# stop your mod loading on the server for example.
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@ import appeng.block.AEBaseEntityBlock;
|
||||||
import appeng.blockentity.crafting.CraftingBlockEntity;
|
import appeng.blockentity.crafting.CraftingBlockEntity;
|
||||||
import appeng.items.parts.PartModelsHelper;
|
import appeng.items.parts.PartModelsHelper;
|
||||||
import com.extendedae_plus.ae.api.storage.InfinityBigIntegerCellHandler;
|
import com.extendedae_plus.ae.api.storage.InfinityBigIntegerCellHandler;
|
||||||
import com.extendedae_plus.ae.api.storage.InfinityBigIntegerCellInventory;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
|
||||||
import com.extendedae_plus.init.*;
|
import com.extendedae_plus.init.*;
|
||||||
import com.extendedae_plus.util.storage.InfinityStorageManager;
|
import com.extendedae_plus.util.storage.InfinityStorageManager;
|
||||||
import com.mojang.logging.LogUtils;
|
import com.mojang.logging.LogUtils;
|
||||||
|
|
@ -20,6 +19,7 @@ import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.bus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.neoforged.fml.ModContainer;
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.neoforged.fml.common.Mod;
|
import net.neoforged.fml.common.Mod;
|
||||||
|
import net.neoforged.fml.config.ModConfig;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
import net.neoforged.neoforge.event.server.ServerStartedEvent;
|
import net.neoforged.neoforge.event.server.ServerStartedEvent;
|
||||||
|
|
@ -47,10 +47,10 @@ public class ExtendedAEPlus {
|
||||||
NeoForge.EVENT_BUS.register(this);
|
NeoForge.EVENT_BUS.register(this);
|
||||||
NeoForge.EVENT_BUS.addListener(ExtendedAEPlus::onServerStarted);
|
NeoForge.EVENT_BUS.addListener(ExtendedAEPlus::onServerStarted);
|
||||||
NeoForge.EVENT_BUS.addListener(ExtendedAEPlus::onServerStopped);
|
NeoForge.EVENT_BUS.addListener(ExtendedAEPlus::onServerStopped);
|
||||||
// 注册配置:接入自定义的 ModConfigs
|
// 注册配置:接入自定义的 EAEPConfig
|
||||||
modContainer.registerConfig(ModConfig.Type.COMMON, ModConfigs.COMMON_SPEC, "extendedae_plus-common.toml");
|
modContainer.registerConfig(ModConfig.Type.COMMON, EAEPConfig.COMMON_SPEC, "extendedae_plus-common.toml");
|
||||||
modContainer.registerConfig(ModConfig.Type.CLIENT, ModConfigs.CLIENT_SPEC, "extendedae_plus-client.toml");
|
modContainer.registerConfig(ModConfig.Type.CLIENT, EAEPConfig.CLIENT_SPEC, "extendedae_plus-client.toml");
|
||||||
modContainer.registerConfig(ModConfig.Type.SERVER, ModConfigs.SERVER_SPEC, "extendedae_plus-server.toml");
|
modContainer.registerConfig(ModConfig.Type.SERVER, EAEPConfig.SERVER_SPEC, "extendedae_plus-server.toml");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceLocation id(String path) {
|
public static ResourceLocation id(String path) {
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,14 @@ import appeng.items.materials.UpgradeCardItem;
|
||||||
import net.minecraft.core.component.DataComponents;
|
import net.minecraft.core.component.DataComponents;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.component.CustomData;
|
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
import net.minecraft.world.item.TooltipFlag;
|
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResultHolder;
|
import net.minecraft.world.InteractionResultHolder;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.TooltipFlag;
|
||||||
|
import net.minecraft.world.item.component.CustomData;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import appeng.menu.implementations.UpgradeableMenu;
|
||||||
import appeng.menu.slot.OptionalFakeSlot;
|
import appeng.menu.slot.OptionalFakeSlot;
|
||||||
import com.extendedae_plus.ae.parts.EntitySpeedTickerPart;
|
import com.extendedae_plus.ae.parts.EntitySpeedTickerPart;
|
||||||
import com.extendedae_plus.ae.screen.EntitySpeedTickerScreen;
|
import com.extendedae_plus.ae.screen.EntitySpeedTickerScreen;
|
||||||
import com.extendedae_plus.config.ModConfigs;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
import com.extendedae_plus.init.ModMenuTypes;
|
import com.extendedae_plus.init.ModMenuTypes;
|
||||||
import com.extendedae_plus.util.entitySpeed.ConfigParsingUtils;
|
import com.extendedae_plus.util.entitySpeed.ConfigParsingUtils;
|
||||||
|
|
@ -133,8 +133,8 @@ public class EntitySpeedTickerMenu extends UpgradeableMenu<EntitySpeedTickerPart
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String blockId = net.minecraft.core.registries.BuiltInRegistries.BLOCK.getKey(target.getBlockState().getBlock()).toString();
|
String blockId = net.minecraft.core.registries.BuiltInRegistries.BLOCK.getKey(target.getBlockState().getBlock()).toString();
|
||||||
this.multiplier = ConfigParsingUtils.getMultiplierForBlock(blockId, ModConfigs.ENTITY_TICKER_MULTIPLIERS.get());
|
this.multiplier = ConfigParsingUtils.getMultiplierForBlock(blockId, EAEPConfig.ENTITY_TICKER_MULTIPLIERS.get());
|
||||||
this.targetBlacklisted = ConfigParsingUtils.isBlockBlacklisted(blockId, ModConfigs.ENTITY_TICKER_BLACK_LIST.get());
|
this.targetBlacklisted = ConfigParsingUtils.isBlockBlacklisted(blockId, EAEPConfig.ENTITY_TICKER_BLACK_LIST.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -157,7 +157,7 @@ public class EntitySpeedTickerMenu extends UpgradeableMenu<EntitySpeedTickerPart
|
||||||
* 客户端刷新界面。
|
* 客户端刷新界面。
|
||||||
*/
|
*/
|
||||||
private void refreshClientGui() {
|
private void refreshClientGui() {
|
||||||
if (Minecraft.getInstance().screen instanceof EntitySpeedTickerScreen screen) {
|
if (Minecraft.getInstance().screen instanceof EntitySpeedTickerScreen<?> screen) {
|
||||||
screen.refreshGui();
|
screen.refreshGui();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import appeng.parts.PartModel;
|
||||||
import appeng.parts.automation.UpgradeablePart;
|
import appeng.parts.automation.UpgradeablePart;
|
||||||
import com.extendedae_plus.ExtendedAEPlus;
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
import com.extendedae_plus.ae.menu.EntitySpeedTickerMenu;
|
import com.extendedae_plus.ae.menu.EntitySpeedTickerMenu;
|
||||||
import com.extendedae_plus.config.ModConfigs;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
import com.extendedae_plus.init.ModMenuTypes;
|
import com.extendedae_plus.init.ModMenuTypes;
|
||||||
import com.extendedae_plus.util.entitySpeed.ConfigParsingUtils;
|
import com.extendedae_plus.util.entitySpeed.ConfigParsingUtils;
|
||||||
|
|
@ -210,7 +210,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka
|
||||||
}
|
}
|
||||||
|
|
||||||
String blockId = BuiltInRegistries.BLOCK.getKey(blockEntity.getBlockState().getBlock()).toString();
|
String blockId = BuiltInRegistries.BLOCK.getKey(blockEntity.getBlockState().getBlock()).toString();
|
||||||
if (ConfigParsingUtils.isBlockBlacklisted(blockId, ModConfigs.ENTITY_TICKER_BLACK_LIST.get())) {
|
if (ConfigParsingUtils.isBlockBlacklisted(blockId, EAEPConfig.ENTITY_TICKER_BLACK_LIST.get())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -268,7 +268,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka
|
||||||
*/
|
*/
|
||||||
private double calculateRequiredPower(int speed, String blockId) {
|
private double calculateRequiredPower(int speed, String blockId) {
|
||||||
int energyCardCount = getUpgrades().getInstalledUpgrades(AEItems.ENERGY_CARD);
|
int energyCardCount = getUpgrades().getInstalledUpgrades(AEItems.ENERGY_CARD);
|
||||||
double multiplier = ConfigParsingUtils.getMultiplierForBlock(blockId, ModConfigs.ENTITY_TICKER_MULTIPLIERS.get());
|
double multiplier = ConfigParsingUtils.getMultiplierForBlock(blockId, EAEPConfig.ENTITY_TICKER_MULTIPLIERS.get());
|
||||||
return PowerUtils.computeFinalPowerForProduct(speed, energyCardCount) * multiplier;
|
return PowerUtils.computeFinalPowerForProduct(speed, energyCardCount) * multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,7 +282,7 @@ public class EntitySpeedTickerPart extends UpgradeablePart implements IGridTicka
|
||||||
MEStorage storage = getMainNode().getGrid().getStorageService().getInventory();
|
MEStorage storage = getMainNode().getGrid().getStorageService().getInventory();
|
||||||
IActionSource source = IActionSource.ofMachine(this);
|
IActionSource source = IActionSource.ofMachine(this);
|
||||||
boolean appFluxLoaded = ModList.get().isLoaded("appflux");
|
boolean appFluxLoaded = ModList.get().isLoaded("appflux");
|
||||||
boolean preferDiskEnergy = appFluxLoaded && ModConfigs.PRIORITIZE_DISK_ENERGY.get();
|
boolean preferDiskEnergy = appFluxLoaded && EAEPConfig.PRIORITIZE_DISK_ENERGY.get();
|
||||||
|
|
||||||
// 如果 appflux 存在且优先磁盘能量,尝试提取 FE 能量
|
// 如果 appflux 存在且优先磁盘能量,尝试提取 FE 能量
|
||||||
if (appFluxLoaded && preferDiskEnergy) {
|
if (appFluxLoaded && preferDiskEnergy) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.extendedae_plus.ae.definitions.upgrades.EntitySpeedCardItem;
|
||||||
import com.extendedae_plus.ae.menu.EntitySpeedTickerMenu;
|
import com.extendedae_plus.ae.menu.EntitySpeedTickerMenu;
|
||||||
import com.extendedae_plus.ae.screen.EntitySpeedTickerScreen;
|
import com.extendedae_plus.ae.screen.EntitySpeedTickerScreen;
|
||||||
import com.extendedae_plus.client.render.crafting.EPlusCraftingCubeModelProvider;
|
import com.extendedae_plus.client.render.crafting.EPlusCraftingCubeModelProvider;
|
||||||
|
import com.extendedae_plus.client.screen.GlobalProviderModesScreen;
|
||||||
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
||||||
import com.extendedae_plus.hooks.BuiltInModelHooks;
|
import com.extendedae_plus.hooks.BuiltInModelHooks;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
|
|
@ -61,17 +62,7 @@ public final class ClientProxy {
|
||||||
// 菜单 -> 屏幕 绑定(显式 ScreenConstructor,避免泛型推断问题)
|
// 菜单 -> 屏幕 绑定(显式 ScreenConstructor,避免泛型推断问题)
|
||||||
event.register(
|
event.register(
|
||||||
ModMenuTypes.NETWORK_PATTERN_CONTROLLER.get(),
|
ModMenuTypes.NETWORK_PATTERN_CONTROLLER.get(),
|
||||||
new net.minecraft.client.gui.screens.MenuScreens.ScreenConstructor<
|
GlobalProviderModesScreen::new
|
||||||
com.extendedae_plus.menu.NetworkPatternControllerMenu,
|
|
||||||
com.extendedae_plus.client.screen.GlobalProviderModesScreen>() {
|
|
||||||
@Override
|
|
||||||
public com.extendedae_plus.client.screen.GlobalProviderModesScreen create(
|
|
||||||
com.extendedae_plus.menu.NetworkPatternControllerMenu menu,
|
|
||||||
net.minecraft.world.entity.player.Inventory inv,
|
|
||||||
net.minecraft.network.chat.Component title) {
|
|
||||||
return new com.extendedae_plus.client.screen.GlobalProviderModesScreen(menu, inv, title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@EventBusSubscriber(modid = ExtendedAEPlus.MODID, value = Dist.CLIENT)
|
||||||
public final class InputEvents {
|
public final class InputEvents {
|
||||||
private InputEvents() {}
|
private InputEvents() {}
|
||||||
|
|
||||||
|
|
@ -56,7 +57,9 @@ public final class InputEvents {
|
||||||
if (event.getKeyCode() == GLFW.GLFW_KEY_F) {
|
if (event.getKeyCode() == GLFW.GLFW_KEY_F) {
|
||||||
// 仅当鼠标确实悬停在 JEI 配料上时触发
|
// 仅当鼠标确实悬停在 JEI 配料上时触发
|
||||||
// 大概会在一格有多个(?)stack的时候出bug, 但是真的会有那种时候吗?
|
// 大概会在一格有多个(?)stack的时候出bug, 但是真的会有那种时候吗?
|
||||||
String name = RecipeViewerHelper.getHoveredStacks().getFirst().what().getDisplayName().getString();
|
GenericStack stack = RecipeViewerHelper.getHoveredStacks().getFirst();
|
||||||
|
if (stack == null) return;
|
||||||
|
String name = stack.what().getDisplayName().getString();
|
||||||
|
|
||||||
// 写入 AE2 终端的搜索框
|
// 写入 AE2 终端的搜索框
|
||||||
var screen = Minecraft.getInstance().screen;
|
var screen = Minecraft.getInstance().screen;
|
||||||
|
|
|
||||||
|
|
@ -30,21 +30,21 @@ public class EPlusCraftingCubeModelProvider
|
||||||
private static final List<Material> MATERIALS = new ArrayList<>();
|
private static final List<Material> MATERIALS = new ArrayList<>();
|
||||||
|
|
||||||
//将环形边框与基础发光底图放在本模组命名空间
|
//将环形边框与基础发光底图放在本模组命名空间
|
||||||
protected static final Material RING_CORNER = texture(ExtendedAEPlus.MODID, "ring_corner");
|
protected static final Material RING_CORNER = texture("ring_corner");
|
||||||
protected static final Material RING_SIDE_HOR = texture(ExtendedAEPlus.MODID, "ring_side_hor");
|
protected static final Material RING_SIDE_HOR = texture("ring_side_hor");
|
||||||
protected static final Material RING_SIDE_VER = texture(ExtendedAEPlus.MODID, "ring_side_ver");
|
protected static final Material RING_SIDE_VER = texture("ring_side_ver");
|
||||||
protected static final Material LIGHT_BASE = texture(ExtendedAEPlus.MODID, "light_base");
|
protected static final Material LIGHT_BASE = texture("light_base");
|
||||||
|
|
||||||
// 亮面贴图(formed 时使用)
|
// 亮面贴图(formed 时使用)
|
||||||
protected static final Material ACCELERATOR_4X_LIGHT = texture(ExtendedAEPlus.MODID,
|
protected static final Material ACCELERATOR_4X_LIGHT = texture(
|
||||||
"4x_accelerator_light");
|
"4x_accelerator_light");
|
||||||
protected static final Material ACCELERATOR_16X_LIGHT = texture(ExtendedAEPlus.MODID,
|
protected static final Material ACCELERATOR_16X_LIGHT = texture(
|
||||||
"16x_accelerator_light");
|
"16x_accelerator_light");
|
||||||
protected static final Material ACCELERATOR_64X_LIGHT = texture(ExtendedAEPlus.MODID,
|
protected static final Material ACCELERATOR_64X_LIGHT = texture(
|
||||||
"64x_accelerator_light");
|
"64x_accelerator_light");
|
||||||
protected static final Material ACCELERATOR_256X_LIGHT = texture(ExtendedAEPlus.MODID,
|
protected static final Material ACCELERATOR_256X_LIGHT = texture(
|
||||||
"256x_accelerator_light");
|
"256x_accelerator_light");
|
||||||
protected static final Material ACCELERATOR_1024X_LIGHT = texture(ExtendedAEPlus.MODID,
|
protected static final Material ACCELERATOR_1024X_LIGHT = texture(
|
||||||
"1024x_accelerator_light");
|
"1024x_accelerator_light");
|
||||||
|
|
||||||
public EPlusCraftingCubeModelProvider(EPlusCraftingUnitType type) {
|
public EPlusCraftingCubeModelProvider(EPlusCraftingUnitType type) {
|
||||||
|
|
@ -80,9 +80,9 @@ public class EPlusCraftingCubeModelProvider
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Material texture(String namespace, String name) {
|
private static Material texture(String name) {
|
||||||
var mat = new Material(TextureAtlas.LOCATION_BLOCKS,
|
var mat = new Material(TextureAtlas.LOCATION_BLOCKS,
|
||||||
ResourceLocation.fromNamespaceAndPath(namespace, "block/crafting/" + name));
|
ResourceLocation.fromNamespaceAndPath(ExtendedAEPlus.MODID, "block/crafting/" + name));
|
||||||
MATERIALS.add(mat);
|
MATERIALS.add(mat);
|
||||||
return mat;
|
return mat;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -249,8 +249,6 @@ public class ProviderSelectScreen extends Screen {
|
||||||
long id = ids.get(i);
|
long id = ids.get(i);
|
||||||
int slots = emptySlots.get(i);
|
int slots = emptySlots.get(i);
|
||||||
Group g = nameMap.computeIfAbsent(name, k -> new Group());
|
Group g = nameMap.computeIfAbsent(name, k -> new Group());
|
||||||
// if (!i18nKey.isBlank() && !keyMap.containsKey(i18nKey))
|
|
||||||
// keyMap.put(i18nKey, name);
|
|
||||||
g.count++;
|
g.count++;
|
||||||
g.totalSlots += Math.max(0, slots);
|
g.totalSlots += Math.max(0, slots);
|
||||||
// 挑选空位最多的作为代表 id;若并列,保留先到者
|
// 挑选空位最多的作为代表 id;若并列,保留先到者
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package com.extendedae_plus.compat;
|
package com.extendedae_plus.compat;
|
||||||
|
|
||||||
import appeng.client.gui.implementations.PatternProviderScreen;
|
import appeng.client.gui.implementations.PatternProviderScreen;
|
||||||
import appeng.client.gui.widgets.UpgradesPanel;
|
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AppliedFlux 兼容性处理工具类
|
* AppliedFlux 兼容性处理工具类
|
||||||
|
|
@ -18,13 +16,10 @@ public final class AppliedFluxCompat {
|
||||||
*/
|
*/
|
||||||
public static boolean hasAppliedFluxUpgradePanel(PatternProviderScreen<?> screen) {
|
public static boolean hasAppliedFluxUpgradePanel(PatternProviderScreen<?> screen) {
|
||||||
// 如果AppliedFlux未加载,肯定没有其升级面板
|
// 如果AppliedFlux未加载,肯定没有其升级面板
|
||||||
if (!UpgradeSlotCompat.shouldUseLowPriorityMode()) {
|
return UpgradeSlotCompat.shouldUseLowPriorityMode();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果 AppliedFlux 加载了,假设它会添加升级面板
|
// 如果 AppliedFlux 加载了,假设它会添加升级面板
|
||||||
// 这是一个保守的假设,避免冲突
|
// 这是一个保守的假设,避免冲突
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.extendedae_plus.compat;
|
package com.extendedae_plus.compat;
|
||||||
|
|
||||||
import net.neoforged.fml.loading.FMLLoader;
|
|
||||||
import net.neoforged.fml.ModList;
|
import net.neoforged.fml.ModList;
|
||||||
|
|
||||||
public final class UpgradeSlotCompat {
|
public final class UpgradeSlotCompat {
|
||||||
|
|
@ -35,8 +34,6 @@ public final class UpgradeSlotCompat {
|
||||||
Class.forName("com.glodblock.github.appflux.mixins.MixinPatternProviderScreen");
|
Class.forName("com.glodblock.github.appflux.mixins.MixinPatternProviderScreen");
|
||||||
APPFLUX_PATTERN_PROVIDER_MIXIN_ACTIVE = true;
|
APPFLUX_PATTERN_PROVIDER_MIXIN_ACTIVE = true;
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
APPFLUX_PATTERN_PROVIDER_MIXIN_ACTIVE = false;
|
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
APPFLUX_PATTERN_PROVIDER_MIXIN_ACTIVE = false;
|
APPFLUX_PATTERN_PROVIDER_MIXIN_ACTIVE = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,25 @@
|
||||||
package com.extendedae_plus.config;
|
package com.extendedae_plus.config;
|
||||||
|
|
||||||
import com.extendedae_plus.util.GetKey;
|
|
||||||
import net.neoforged.neoforge.common.ModConfigSpec;
|
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||||
|
|
||||||
public final class ModConfig {
|
import java.util.List;
|
||||||
|
|
||||||
|
public final class EAEPConfig {
|
||||||
// Common 配置
|
// Common 配置
|
||||||
public static final ModConfigSpec COMMON_SPEC;
|
public static final ModConfigSpec COMMON_SPEC;
|
||||||
public static final ModConfigSpec.IntValue PAGE_MULTIPLIER;
|
public static final ModConfigSpec.IntValue PAGE_MULTIPLIER;
|
||||||
public static final ModConfigSpec.BooleanValue OVERRIDE_AE2WT_PICKING;
|
public static final ModConfigSpec.BooleanValue OVERRIDE_AE2WT_PICKING;
|
||||||
|
public static final ModConfigSpec.BooleanValue INDEPENDENT_UPLOADING_BUTTON;
|
||||||
|
|
||||||
// Client 配置
|
// Client 配置
|
||||||
public static final ModConfigSpec CLIENT_SPEC;
|
public static final ModConfigSpec CLIENT_SPEC;
|
||||||
public static final ModConfigSpec.BooleanValue SHOW_ENCODER_PATTERN_PLAYER;
|
public static final ModConfigSpec.BooleanValue SHOW_ENCODER_PATTERN_PLAYER;
|
||||||
public static final ModConfigSpec.BooleanValue PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT;
|
public static final ModConfigSpec.BooleanValue PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT;
|
||||||
public static final ModConfigSpec.BooleanValue PRIORITIZE_DISK_ENERGY;
|
public static final ModConfigSpec.BooleanValue PRIORITIZE_DISK_ENERGY;
|
||||||
public static final ModConfigSpec.BooleanValue INDEPENDENT_UPLOADING_BUTTON;
|
|
||||||
|
|
||||||
// Server 配置
|
// Server 配置
|
||||||
public static final ModConfigSpec SERVER_SPEC;
|
public static final ModConfigSpec SERVER_SPEC;
|
||||||
|
public static final ModConfigSpec.BooleanValue NEEDS_UPLOADING_CORE;
|
||||||
public static final ModConfigSpec.BooleanValue PROVIDER_ROUND_ROBIN_ENABLE;
|
public static final ModConfigSpec.BooleanValue PROVIDER_ROUND_ROBIN_ENABLE;
|
||||||
public static final ModConfigSpec.IntValue SMART_SCALING_MAX_MULTIPLIER;
|
public static final ModConfigSpec.IntValue SMART_SCALING_MAX_MULTIPLIER;
|
||||||
public static final ModConfigSpec.IntValue CRAFTING_PAUSE_THRESHOLD;
|
public static final ModConfigSpec.IntValue CRAFTING_PAUSE_THRESHOLD;
|
||||||
|
|
@ -30,7 +32,6 @@ public final class ModConfig {
|
||||||
static {
|
static {
|
||||||
// Common 配置
|
// Common 配置
|
||||||
ModConfigSpec.Builder commonBuilder = new ModConfigSpec.Builder();
|
ModConfigSpec.Builder commonBuilder = new ModConfigSpec.Builder();
|
||||||
commonBuilder.push("common");
|
|
||||||
PAGE_MULTIPLIER = commonBuilder
|
PAGE_MULTIPLIER = commonBuilder
|
||||||
.comment(
|
.comment(
|
||||||
"扩展样板供应器总槽位容量的倍率",
|
"扩展样板供应器总槽位容量的倍率",
|
||||||
|
|
@ -39,18 +40,16 @@ public final class ModConfig {
|
||||||
)
|
)
|
||||||
.defineInRange("pageMultiplier", 1, 1, 64);
|
.defineInRange("pageMultiplier", 1, 1, 64);
|
||||||
OVERRIDE_AE2WT_PICKING = commonBuilder
|
OVERRIDE_AE2WT_PICKING = commonBuilder
|
||||||
.translation(new GetKey(GetKey.CONFIG)
|
|
||||||
.addStr("override_ae2wt_picking").buildRaw())
|
|
||||||
.comment("是否覆盖AE2WT使用中键从终端选取方块的逻辑",
|
.comment("是否覆盖AE2WT使用中键从终端选取方块的逻辑",
|
||||||
"开启后选取方块的数量将不被限制在32个",
|
"开启后选取方块的数量将不被限制在32个")
|
||||||
"(不建议使用,在EMI环境下可能出现奇怪bug)")
|
|
||||||
.define("overrideAE2WTPicking", false);
|
.define("overrideAE2WTPicking", false);
|
||||||
commonBuilder.pop();
|
INDEPENDENT_UPLOADING_BUTTON = commonBuilder
|
||||||
|
.comment("启用后,在样板编码终端会出现一个独立的按钮用于上传样板")
|
||||||
|
.define("independentUploadingButton", false);
|
||||||
COMMON_SPEC = commonBuilder.build();
|
COMMON_SPEC = commonBuilder.build();
|
||||||
|
|
||||||
// Client 配置
|
// Client 配置
|
||||||
ModConfigSpec.Builder clientBuilder = new ModConfigSpec.Builder();
|
ModConfigSpec.Builder clientBuilder = new ModConfigSpec.Builder();
|
||||||
clientBuilder.push("client");
|
|
||||||
SHOW_ENCODER_PATTERN_PLAYER = clientBuilder
|
SHOW_ENCODER_PATTERN_PLAYER = clientBuilder
|
||||||
.comment(
|
.comment(
|
||||||
"是否显示样板编码玩家",
|
"是否显示样板编码玩家",
|
||||||
|
|
@ -61,12 +60,6 @@ public final class ModConfig {
|
||||||
"样板终端默认是否显示槽位",
|
"样板终端默认是否显示槽位",
|
||||||
"影响进入界面时SlotsRow的默认可见性,仅影响客户端显示")
|
"影响进入界面时SlotsRow的默认可见性,仅影响客户端显示")
|
||||||
.define("patternTerminalShowSlotsDefault", true);
|
.define("patternTerminalShowSlotsDefault", true);
|
||||||
INDEPENDENT_UPLOADING_BUTTON = builder
|
|
||||||
.translation(new GetKey(GetKey.CONFIG)
|
|
||||||
.addStr("independence_uploading_button").buildRaw())
|
|
||||||
.comment("启用后,在样板编码终端会出现一个独立的按钮用于上传样板")
|
|
||||||
.define("independentUploadingButton", false);
|
|
||||||
clientBuilder.pop();
|
|
||||||
CLIENT_SPEC = clientBuilder.build();
|
CLIENT_SPEC = clientBuilder.build();
|
||||||
|
|
||||||
// Server 配置
|
// Server 配置
|
||||||
|
|
@ -142,8 +135,11 @@ public final class ModConfig {
|
||||||
)
|
)
|
||||||
.define("prioritizeDiskEnergy", true);
|
.define("prioritizeDiskEnergy", true);
|
||||||
serverBuilder.pop();
|
serverBuilder.pop();
|
||||||
|
NEEDS_UPLOADING_CORE = serverBuilder
|
||||||
|
.comment("启用后, 样板只能被上传到装有上传核心的装配矩阵")
|
||||||
|
.define("needsUploadingCore", true);
|
||||||
SERVER_SPEC = serverBuilder.build();
|
SERVER_SPEC = serverBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private ModConfig() {}
|
private EAEPConfig() {}
|
||||||
}
|
}
|
||||||
|
|
@ -9,8 +9,6 @@ import appeng.crafting.pattern.AEProcessingPattern;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -37,10 +35,10 @@ public final class ScaledProcessingPattern implements IPatternDetails {
|
||||||
) {
|
) {
|
||||||
this.original = Objects.requireNonNull(original);
|
this.original = Objects.requireNonNull(original);
|
||||||
this.definition = Objects.requireNonNull(definition);
|
this.definition = Objects.requireNonNull(definition);
|
||||||
this.sparseInputs = Collections.unmodifiableList(new ArrayList<>(Objects.requireNonNull(sparseInputs)));
|
this.sparseInputs = List.copyOf(Objects.requireNonNull(sparseInputs));
|
||||||
this.sparseOutputs = Collections.unmodifiableList(new ArrayList<>(Objects.requireNonNull(sparseOutputs)));
|
this.sparseOutputs = List.copyOf(Objects.requireNonNull(sparseOutputs));
|
||||||
this.inputs = Objects.requireNonNull(inputs);
|
this.inputs = Objects.requireNonNull(inputs);
|
||||||
this.condensedOutputs = Collections.unmodifiableList(new ArrayList<>(Objects.requireNonNull(condensedOutputs)));
|
this.condensedOutputs = List.copyOf(Objects.requireNonNull(condensedOutputs));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------- API 实现 -------------------- */
|
/* -------------------- API 实现 -------------------- */
|
||||||
|
|
@ -74,7 +72,7 @@ public final class ScaledProcessingPattern implements IPatternDetails {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GenericStack getPrimaryOutput() {
|
public GenericStack getPrimaryOutput() {
|
||||||
if (!condensedOutputs.isEmpty()) return condensedOutputs.get(0);
|
if (!condensedOutputs.isEmpty()) return condensedOutputs.getFirst();
|
||||||
return original.getPrimaryOutput();
|
return original.getPrimaryOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.extendedae_plus.content.matrix;
|
||||||
import com.glodblock.github.extendedae.common.me.matrix.ClusterAssemblerMatrix;
|
import com.glodblock.github.extendedae.common.me.matrix.ClusterAssemblerMatrix;
|
||||||
import com.glodblock.github.extendedae.common.tileentities.matrix.TileAssemblerMatrixFunction;
|
import com.glodblock.github.extendedae.common.tileentities.matrix.TileAssemblerMatrixFunction;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -13,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
public class UploadCoreBlockEntity extends TileAssemblerMatrixFunction {
|
public class UploadCoreBlockEntity extends TileAssemblerMatrixFunction {
|
||||||
|
|
||||||
public UploadCoreBlockEntity(BlockPos pos, BlockState state) {
|
public UploadCoreBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super((BlockEntityType<?>) com.extendedae_plus.init.ModBlockEntities.UPLOAD_CORE_BE.get(), pos, state);
|
super(com.extendedae_plus.init.ModBlockEntities.UPLOAD_CORE_BE.get(), pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock {
|
||||||
player.displayClientMessage(Component.literal("频道:" + te.getFrequency()), true);
|
player.displayClientMessage(Component.literal("频道:" + te.getFrequency()), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ItemInteractionResult.sidedSuccess(level.isClientSide);
|
|
||||||
} else {
|
} else {
|
||||||
if (te.isLocked()) {
|
if (te.isLocked()) {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
|
|
@ -95,8 +94,8 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
player.displayClientMessage(Component.literal(te.isMasterMode() ? "模式:主端" : "模式:从端"), true);
|
player.displayClientMessage(Component.literal(te.isMasterMode() ? "模式:主端" : "模式:从端"), true);
|
||||||
}
|
}
|
||||||
return ItemInteractionResult.sidedSuccess(level.isClientSide);
|
|
||||||
}
|
}
|
||||||
|
return ItemInteractionResult.sidedSuccess(level.isClientSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -120,7 +119,6 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock {
|
||||||
player.displayClientMessage(Component.literal("频道:" + te.getFrequency()), true);
|
player.displayClientMessage(Component.literal("频道:" + te.getFrequency()), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return InteractionResult.sidedSuccess(level.isClientSide);
|
|
||||||
} else {
|
} else {
|
||||||
if (te.isLocked()) {
|
if (te.isLocked()) {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
|
|
@ -132,8 +130,8 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock {
|
||||||
if (!level.isClientSide) {
|
if (!level.isClientSide) {
|
||||||
player.displayClientMessage(Component.literal(te.isMasterMode() ? "模式:主端" : "模式:从端"), true);
|
player.displayClientMessage(Component.literal(te.isMasterMode() ? "模式:主端" : "模式:从端"), true);
|
||||||
}
|
}
|
||||||
return InteractionResult.sidedSuccess(level.isClientSide);
|
|
||||||
}
|
}
|
||||||
|
return InteractionResult.sidedSuccess(level.isClientSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@ import java.util.Objects;
|
||||||
*/
|
*/
|
||||||
public class WirelessTransceiverBlockEntity extends AEBaseBlockEntity implements IWirelessEndpoint, IInWorldGridNodeHost {
|
public class WirelessTransceiverBlockEntity extends AEBaseBlockEntity implements IWirelessEndpoint, IInWorldGridNodeHost {
|
||||||
|
|
||||||
private IManagedGridNode managedNode;
|
private final IManagedGridNode managedNode;
|
||||||
|
|
||||||
private long frequency = 1L;
|
private long frequency = 1L;
|
||||||
private boolean masterMode = false;
|
private boolean masterMode = false;
|
||||||
private boolean locked = false;
|
private boolean locked = false;
|
||||||
|
|
||||||
private WirelessMasterLink masterLink;
|
private final WirelessMasterLink masterLink;
|
||||||
private WirelessSlaveLink slaveLink;
|
private final WirelessSlaveLink slaveLink;
|
||||||
|
|
||||||
public WirelessTransceiverBlockEntity(BlockPos pos, BlockState state) {
|
public WirelessTransceiverBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(ModBlockEntities.WIRELESS_TRANSCEIVER_BE.get(), pos, state);
|
super(ModBlockEntities.WIRELESS_TRANSCEIVER_BE.get(), pos, state);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ import appeng.blockentity.crafting.CraftingBlockEntity;
|
||||||
import com.extendedae_plus.ExtendedAEPlus;
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
import com.extendedae_plus.content.controller.NetworkPatternControllerBlockEntity;
|
import com.extendedae_plus.content.controller.NetworkPatternControllerBlockEntity;
|
||||||
import com.extendedae_plus.content.matrix.UploadCoreBlockEntity;
|
import com.extendedae_plus.content.matrix.UploadCoreBlockEntity;
|
||||||
import appeng.blockentity.crafting.CraftingBlockEntity;
|
import com.extendedae_plus.content.wireless.WirelessTransceiverBlockEntity;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ import appeng.block.crafting.CraftingUnitBlock;
|
||||||
import com.extendedae_plus.ExtendedAEPlus;
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
||||||
import com.extendedae_plus.content.matrix.UploadCoreBlock;
|
import com.extendedae_plus.content.matrix.UploadCoreBlock;
|
||||||
import appeng.block.crafting.CraftingUnitBlock;
|
import com.extendedae_plus.content.wireless.WirelessTransceiverBlock;
|
||||||
import appeng.blockentity.crafting.CraftingBlockEntity;
|
|
||||||
import appeng.core.definitions.AEBlockEntities;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
import net.minecraft.world.level.material.MapColor;
|
import net.minecraft.world.level.material.MapColor;
|
||||||
|
|
@ -42,37 +40,27 @@ public final class ModBlocks {
|
||||||
// Crafting Accelerators (reuse MAE2 textures/models)
|
// Crafting Accelerators (reuse MAE2 textures/models)
|
||||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_4x = BLOCKS.register(
|
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_4x = BLOCKS.register(
|
||||||
"4x_crafting_accelerator",
|
"4x_crafting_accelerator",
|
||||||
() -> {
|
() -> new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_4x)
|
||||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_4x);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_16x = BLOCKS.register(
|
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_16x = BLOCKS.register(
|
||||||
"16x_crafting_accelerator",
|
"16x_crafting_accelerator",
|
||||||
() -> {
|
() -> new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_16x)
|
||||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_16x);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_64x = BLOCKS.register(
|
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_64x = BLOCKS.register(
|
||||||
"64x_crafting_accelerator",
|
"64x_crafting_accelerator",
|
||||||
() -> {
|
() -> new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_64x)
|
||||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_64x);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_256x = BLOCKS.register(
|
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_256x = BLOCKS.register(
|
||||||
"256x_crafting_accelerator",
|
"256x_crafting_accelerator",
|
||||||
() -> {
|
() -> new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_256x)
|
||||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_256x);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_1024x = BLOCKS.register(
|
public static final DeferredBlock<CraftingUnitBlock> ACCELERATOR_1024x = BLOCKS.register(
|
||||||
"1024x_crafting_accelerator",
|
"1024x_crafting_accelerator",
|
||||||
() -> {
|
() -> new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_1024x)
|
||||||
return new CraftingUnitBlock(EPlusCraftingUnitType.ACCELERATOR_1024x);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// 装配矩阵上传核心方块
|
// 装配矩阵上传核心方块
|
||||||
|
|
|
||||||
|
|
@ -184,13 +184,11 @@ public final class JeiRuntimeProxy {
|
||||||
if (createMethod != null) {
|
if (createMethod != null) {
|
||||||
Object bookmark = createMethod.invoke(null, typed, ingredientManager);
|
Object bookmark = createMethod.invoke(null, typed, ingredientManager);
|
||||||
if (bookmark != null) {
|
if (bookmark != null) {
|
||||||
list.add((IngredientBookmark) bookmark);
|
list.add((IngredientBookmark<?>) bookmark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable ignored) {}
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +35,7 @@ public class ModJeiPlugin implements IModPlugin {
|
||||||
registration.registerSubtypeInterpreter(
|
registration.registerSubtypeInterpreter(
|
||||||
VanillaTypes.ITEM_STACK,
|
VanillaTypes.ITEM_STACK,
|
||||||
com.extendedae_plus.init.ModItems.ENTITY_SPEED_CARD.get(),
|
com.extendedae_plus.init.ModItems.ENTITY_SPEED_CARD.get(),
|
||||||
new ISubtypeInterpreter<ItemStack>() {
|
new ISubtypeInterpreter<>() {
|
||||||
@Override
|
@Override
|
||||||
public @NotNull Object getSubtypeData(@NotNull ItemStack ingredient, @NotNull UidContext context) {
|
public @NotNull Object getSubtypeData(@NotNull ItemStack ingredient, @NotNull UidContext context) {
|
||||||
// 返回你想让 JEI 区分子类型的数据,这里用 multiplier
|
// 返回你想让 JEI 区分子类型的数据,这里用 multiplier
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.extendedae_plus.menu.host;
|
||||||
import appeng.helpers.WirelessTerminalMenuHost;
|
import appeng.helpers.WirelessTerminalMenuHost;
|
||||||
import appeng.items.tools.powered.WirelessTerminalItem;
|
import appeng.items.tools.powered.WirelessTerminalItem;
|
||||||
import appeng.menu.ISubMenu;
|
import appeng.menu.ISubMenu;
|
||||||
import appeng.menu.locator.ItemMenuHostLocator;
|
|
||||||
import com.extendedae_plus.menu.locator.CuriosItemLocator;
|
import com.extendedae_plus.menu.locator.CuriosItemLocator;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
@ -25,7 +24,7 @@ public class CuriosWirelessTerminalMenuHost extends WirelessTerminalMenuHost<Wir
|
||||||
int curiosIndex,
|
int curiosIndex,
|
||||||
java.util.function.BiConsumer<Player, ISubMenu> returnToMainMenu) {
|
java.util.function.BiConsumer<Player, ISubMenu> returnToMainMenu) {
|
||||||
super((WirelessTerminalItem) itemStack.getItem(), player,
|
super((WirelessTerminalItem) itemStack.getItem(), player,
|
||||||
(ItemMenuHostLocator) new CuriosItemLocator(curiosSlotId, curiosIndex),
|
new CuriosItemLocator(curiosSlotId, curiosIndex),
|
||||||
returnToMainMenu);
|
returnToMainMenu);
|
||||||
this.curiosHandler = curiosHandler;
|
this.curiosHandler = curiosHandler;
|
||||||
this.curiosIndex = curiosIndex;
|
this.curiosIndex = curiosIndex;
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
// 0) AE2 原生:若是 WirelessTerminalItem,先尝试其原生 Host(与背包一致)
|
// 0) AE2 原生:若是 WirelessTerminalItem,先尝试其原生 Host(与背包一致)
|
||||||
if (it0.getItem() instanceof appeng.items.tools.powered.WirelessTerminalItem wtAe2) {
|
if (it0.getItem() instanceof appeng.items.tools.powered.WirelessTerminalItem wtAe2) {
|
||||||
var aeHost = wtAe2.getMenuHost(player, this, null);
|
var aeHost = wtAe2.getMenuHost(player, this, null);
|
||||||
if (aeHost != null && hostInterface.isInstance(aeHost)) {
|
if (hostInterface.isInstance(aeHost)) {
|
||||||
try { return hostInterface.cast(aeHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(aeHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost2 = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost2(wtAe2, player, this,
|
var subHost2 = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost2(wtAe2, player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost2); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost2); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,19 +46,19 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
if (def0 != null) {
|
if (def0 != null) {
|
||||||
WTMenuHost wtHost = def0.wTMenuHostFactory().create(def0.item(), player, this,
|
WTMenuHost wtHost = def0.wTMenuHostFactory().create(def0.item(), player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
if (wtHost != null && hostInterface.isInstance(wtHost)) {
|
if (hostInterface.isInstance(wtHost)) {
|
||||||
try { return hostInterface.cast(wtHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(wtHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(def0.item(), player, this,
|
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(def0.item(), player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
} else if (it0.getItem() instanceof de.mari_023.ae2wtlib.api.terminal.ItemWT wtItem0) {
|
} else if (it0.getItem() instanceof de.mari_023.ae2wtlib.api.terminal.ItemWT wtItem0) {
|
||||||
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(wtItem0, player, this,
|
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(wtItem0, player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 额外兜底:尝试使用 WTDefinition.of(it0)(可能在 ofOrNull 为 null 时仍可获取)
|
// 额外兜底:尝试使用 WTDefinition.of(it0)(可能在 ofOrNull 为 null 时仍可获取)
|
||||||
|
|
@ -67,9 +67,9 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
if (defStrict != null && "appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if (defStrict != null && "appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(defStrict.item(), player, this,
|
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(defStrict.item(), player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -86,13 +86,13 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
// 0) AE2 原生:若是 WirelessTerminalItem,先尝试其原生 Host(与背包一致)
|
// 0) AE2 原生:若是 WirelessTerminalItem,先尝试其原生 Host(与背包一致)
|
||||||
if (it.getItem() instanceof appeng.items.tools.powered.WirelessTerminalItem wtAe2) {
|
if (it.getItem() instanceof appeng.items.tools.powered.WirelessTerminalItem wtAe2) {
|
||||||
var aeHost = wtAe2.getMenuHost(player, this, null);
|
var aeHost = wtAe2.getMenuHost(player, this, null);
|
||||||
if (aeHost != null && hostInterface.isInstance(aeHost)) {
|
if (hostInterface.isInstance(aeHost)) {
|
||||||
try { return hostInterface.cast(aeHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(aeHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost2 = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost2(wtAe2, player, this,
|
var subHost2 = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost2(wtAe2, player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost2); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost2); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,14 +101,14 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
WTMenuHost wtHost = def.wTMenuHostFactory().create(
|
WTMenuHost wtHost = def.wTMenuHostFactory().create(
|
||||||
def.item(), player, this,
|
def.item(), player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
if (wtHost != null && hostInterface.isInstance(wtHost)) {
|
if (hostInterface.isInstance(wtHost)) {
|
||||||
try { return hostInterface.cast(wtHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(wtHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
// 桥接 ISubMenuHost
|
// 桥接 ISubMenuHost
|
||||||
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(def.item(), player, this,
|
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(def.item(), player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 2) def==null,但物品是 wtlib 的 ItemWT:直接桥接 ISubMenuHost
|
// 2) def==null,但物品是 wtlib 的 ItemWT:直接桥接 ISubMenuHost
|
||||||
|
|
@ -116,7 +116,7 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if ("appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(wtItem, player, this,
|
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(wtItem, player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 再次兜底:尝试 WTDefinition.of(it) 强制获取
|
// 再次兜底:尝试 WTDefinition.of(it) 强制获取
|
||||||
|
|
@ -125,9 +125,9 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
if (defStrict2 != null && "appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
if (defStrict2 != null && "appeng.api.storage.ISubMenuHost".equals(hostInterface.getName())) {
|
||||||
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(defStrict2.item(), player, this,
|
var subHost = new com.extendedae_plus.menu.host.CuriosWTSubMenuHost(defStrict2.item(), player, this,
|
||||||
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
(p, sub) -> MenuOpener.open(MEStorageMenu.WIRELESS_TYPE, p, this));
|
||||||
try { return hostInterface.cast(subHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(subHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -136,15 +136,15 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
// 3) 回退:AE2 原生无线终端(IMenuItem)
|
// 3) 回退:AE2 原生无线终端(IMenuItem)
|
||||||
if (it.getItem() instanceof WirelessTerminalItem) {
|
if (it.getItem() instanceof WirelessTerminalItem) {
|
||||||
if (it.getItem() instanceof IMenuItem guiItem) {
|
if (it.getItem() instanceof IMenuItem guiItem) {
|
||||||
ItemMenuHost menuHost = guiItem.getMenuHost(player, this, null);
|
ItemMenuHost<?> menuHost = guiItem.getMenuHost(player, this, null);
|
||||||
if (menuHost != null && hostInterface.isInstance(menuHost)) {
|
if (hostInterface.isInstance(menuHost)) {
|
||||||
try { return hostInterface.cast(menuHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(menuHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (it.getItem() instanceof IMenuItem guiItem) {
|
} else if (it.getItem() instanceof IMenuItem guiItem) {
|
||||||
ItemMenuHost menuHost = guiItem.getMenuHost(player, this, null);
|
ItemMenuHost<?> menuHost = guiItem.getMenuHost(player, this, null);
|
||||||
if (menuHost != null && hostInterface.isInstance(menuHost)) {
|
if (hostInterface.isInstance(menuHost)) {
|
||||||
try { return hostInterface.cast(menuHost); } catch (Throwable t) { }
|
try { return hostInterface.cast(menuHost); } catch (Throwable ignored) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -164,8 +164,7 @@ public record CuriosItemLocator(String slotId, int index) implements ItemMenuHos
|
||||||
ICuriosItemHandler handler = opt.get();
|
ICuriosItemHandler handler = opt.get();
|
||||||
ICurioStacksHandler stacksHandler = handler.getCurios().get(slotId);
|
ICurioStacksHandler stacksHandler = handler.getCurios().get(slotId);
|
||||||
if (stacksHandler != null) {
|
if (stacksHandler != null) {
|
||||||
ItemStack s = stacksHandler.getStacks().getStackInSlot(index);
|
return stacksHandler.getStacks().getStackInSlot(index);
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class ExtendedAEPlusMixinPlugin implements IMixinConfigPlugin {
|
||||||
if (!isJeiPresent()) {
|
if (!isJeiPresent()) {
|
||||||
// Disable all JEI package mixins and any mixins that reference JEI-only helpers
|
// Disable all JEI package mixins and any mixins that reference JEI-only helpers
|
||||||
if (mixinClassName.startsWith("com.extendedae_plus.mixin.jei")) return false;
|
if (mixinClassName.startsWith("com.extendedae_plus.mixin.jei")) return false;
|
||||||
if (mixinClassName.equals("com.extendedae_plus.mixin.ae2.menu.CraftConfirmMenuGoBackMixin")) return false;
|
return !mixinClassName.equals("com.extendedae_plus.mixin.ae2.menu.CraftConfirmMenuGoBackMixin");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.extendedae_plus.mixin;
|
package com.extendedae_plus.mixin;
|
||||||
|
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.network.PickFromWirelessC2SPacket;
|
import com.extendedae_plus.network.PickFromWirelessC2SPacket;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.player.LocalPlayer;
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
|
|
@ -27,7 +27,7 @@ public class PickFromWirelessMixin {
|
||||||
|
|
||||||
@Inject(method = "pickBlock", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "pickBlock", at = @At("HEAD"), cancellable = true)
|
||||||
private void onPickBlock(CallbackInfo ci) {
|
private void onPickBlock(CallbackInfo ci) {
|
||||||
if (ModConfig.OVERRIDE_AE2WT_PICKING.getAsBoolean() && eaep$overridePicking())
|
if (EAEPConfig.OVERRIDE_AE2WT_PICKING.getAsBoolean() && eaep$overridePicking())
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.extendedae_plus.mixin.ae2;
|
package com.extendedae_plus.mixin.ae2;
|
||||||
|
|
||||||
import appeng.crafting.CraftingCalculation;
|
import appeng.crafting.CraftingCalculation;
|
||||||
import com.extendedae_plus.config.ModConfigs;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.Constant;
|
import org.spongepowered.asm.mixin.injection.Constant;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||||
|
|
@ -16,6 +16,6 @@ public abstract class CraftingCalculationMixin {
|
||||||
// 增大此值可以减少 wait/notify 的频率(提升吞吐量但降低响应速度)。
|
// 增大此值可以减少 wait/notify 的频率(提升吞吐量但降低响应速度)。
|
||||||
@ModifyConstant(method = "handlePausing", constant = @Constant(intValue = 100))
|
@ModifyConstant(method = "handlePausing", constant = @Constant(intValue = 100))
|
||||||
private int modifyIncTimeThreshold(int original) {
|
private int modifyIncTimeThreshold(int original) {
|
||||||
return ModConfigs.CRAFTING_PAUSE_THRESHOLD.get();
|
return EAEPConfig.CRAFTING_PAUSE_THRESHOLD.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.extendedae_plus.mixin.ae2;
|
package com.extendedae_plus.mixin.ae2;
|
||||||
|
|
||||||
import appeng.crafting.pattern.EncodedPatternItem;
|
import appeng.crafting.pattern.EncodedPatternItem;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.core.component.DataComponents;
|
import net.minecraft.core.component.DataComponents;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
@ -21,7 +21,7 @@ public class EncodedPatternItemMixin {
|
||||||
// 客户端:在 HoverText 显示样板的编码玩家
|
// 客户端:在 HoverText 显示样板的编码玩家
|
||||||
@Inject(method = "appendHoverText", at = @At("TAIL"))
|
@Inject(method = "appendHoverText", at = @At("TAIL"))
|
||||||
public void epp$appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> lines, TooltipFlag advancedTooltips, CallbackInfo ci){
|
public void epp$appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> lines, TooltipFlag advancedTooltips, CallbackInfo ci){
|
||||||
if (ModConfigs.SHOW_ENCODER_PATTERN_PLAYER.get()) {
|
if (EAEPConfig.SHOW_ENCODER_PATTERN_PLAYER.get()) {
|
||||||
var customData = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY);
|
var customData = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY);
|
||||||
var tag = customData.copyTag();
|
var tag = customData.copyTag();
|
||||||
if (tag.contains("encodePlayer")) {
|
if (tag.contains("encodePlayer")) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import appeng.crafting.CraftingTreeProcess;
|
||||||
import appeng.crafting.pattern.AEProcessingPattern;
|
import appeng.crafting.pattern.AEProcessingPattern;
|
||||||
import appeng.me.service.CraftingService;
|
import appeng.me.service.CraftingService;
|
||||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.content.ScaledProcessingPattern;
|
import com.extendedae_plus.content.ScaledProcessingPattern;
|
||||||
import com.extendedae_plus.util.PatternScaler;
|
import com.extendedae_plus.util.PatternScaler;
|
||||||
import com.extendedae_plus.util.RequestedAmountHolder;
|
import com.extendedae_plus.util.RequestedAmountHolder;
|
||||||
|
|
@ -59,7 +59,7 @@ public abstract class CraftingTreeProcessMixin {
|
||||||
|
|
||||||
// 根据配置决定是否在 provider 间轮询分配请求量(默认开启)
|
// 根据配置决定是否在 provider 间轮询分配请求量(默认开启)
|
||||||
long perProvider = 1L;
|
long perProvider = 1L;
|
||||||
if (!ModConfig.PROVIDER_ROUND_ROBIN_ENABLE.get()) {
|
if (!EAEPConfig.PROVIDER_ROUND_ROBIN_ENABLE.get()) {
|
||||||
// 关闭轮询:直接使用完整请求量,不需要查询 provider 列表
|
// 关闭轮询:直接使用完整请求量,不需要查询 provider 列表
|
||||||
perProvider = requested;
|
perProvider = requested;
|
||||||
if (perProvider <= 0) perProvider = 1L;
|
if (perProvider <= 0) perProvider = 1L;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ import com.extendedae_plus.network.CraftingMonitorJumpC2SPacket;
|
||||||
import com.extendedae_plus.network.CraftingMonitorOpenProviderC2SPacket;
|
import com.extendedae_plus.network.CraftingMonitorOpenProviderC2SPacket;
|
||||||
import com.extendedae_plus.util.GuiUtil;
|
import com.extendedae_plus.util.GuiUtil;
|
||||||
import com.glodblock.github.extendedae.client.gui.GuiExPatternProvider;
|
import com.glodblock.github.extendedae.client.gui.GuiExPatternProvider;
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import com.extendedae_plus.mixin.accessor.AbstractContainerScreenAccessor;
|
||||||
import com.extendedae_plus.mixin.accessor.ScreenAccessor;
|
import com.extendedae_plus.mixin.accessor.ScreenAccessor;
|
||||||
import com.extendedae_plus.network.InterfaceAdjustConfigAmountC2SPacket;
|
import com.extendedae_plus.network.InterfaceAdjustConfigAmountC2SPacket;
|
||||||
import com.glodblock.github.extendedae.client.button.ActionEPPButton;
|
import com.glodblock.github.extendedae.client.button.ActionEPPButton;
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.world.inventory.Slot;
|
import net.minecraft.world.inventory.Slot;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|
@ -76,7 +75,7 @@ public abstract class InterfaceScreenMixin<T extends AEBaseMenu> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册到渲染与交互列表
|
// 注册到渲染与交互列表
|
||||||
var accessor = (ScreenAccessor) (Object) this;
|
var accessor = (ScreenAccessor) this;
|
||||||
if (!accessor.eap$getRenderables().contains(eap$divideBy2Button)) accessor.eap$getRenderables().add(eap$divideBy2Button);
|
if (!accessor.eap$getRenderables().contains(eap$divideBy2Button)) accessor.eap$getRenderables().add(eap$divideBy2Button);
|
||||||
if (!accessor.eap$getChildren().contains(eap$divideBy2Button)) accessor.eap$getChildren().add(eap$divideBy2Button);
|
if (!accessor.eap$getChildren().contains(eap$divideBy2Button)) accessor.eap$getChildren().add(eap$divideBy2Button);
|
||||||
if (!accessor.eap$getRenderables().contains(eap$x2Button)) accessor.eap$getRenderables().add(eap$x2Button);
|
if (!accessor.eap$getRenderables().contains(eap$x2Button)) accessor.eap$getRenderables().add(eap$x2Button);
|
||||||
|
|
@ -98,7 +97,7 @@ public abstract class InterfaceScreenMixin<T extends AEBaseMenu> {
|
||||||
if (!eap$isSupportedInterfaceScreen()) {
|
if (!eap$isSupportedInterfaceScreen()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var accessor = (ScreenAccessor) (Object) this;
|
var accessor = (ScreenAccessor) this;
|
||||||
if (eap$divideBy2Button != null && !accessor.eap$getRenderables().contains(eap$divideBy2Button)) {
|
if (eap$divideBy2Button != null && !accessor.eap$getRenderables().contains(eap$divideBy2Button)) {
|
||||||
accessor.eap$getRenderables().add(eap$divideBy2Button);
|
accessor.eap$getRenderables().add(eap$divideBy2Button);
|
||||||
accessor.eap$getChildren().add(eap$divideBy2Button);
|
accessor.eap$getChildren().add(eap$divideBy2Button);
|
||||||
|
|
@ -124,10 +123,10 @@ public abstract class InterfaceScreenMixin<T extends AEBaseMenu> {
|
||||||
accessor.eap$getChildren().add(eap$x10Button);
|
accessor.eap$getChildren().add(eap$x10Button);
|
||||||
}
|
}
|
||||||
|
|
||||||
int curLeft = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getLeftPos();
|
int curLeft = ((AbstractContainerScreenAccessor<?>) this).eap$getLeftPos();
|
||||||
int curTop = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getTopPos();
|
int curTop = ((AbstractContainerScreenAccessor<?>) this).eap$getTopPos();
|
||||||
int curImgW = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getImageWidth();
|
int curImgW = ((AbstractContainerScreenAccessor<?>) this).eap$getImageWidth();
|
||||||
int curImgH = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getImageHeight();
|
int curImgH = ((AbstractContainerScreenAccessor<?>) this).eap$getImageHeight();
|
||||||
if (curLeft != eap$lastLeftPos || curTop != eap$lastTopPos || curImgW != eap$lastImageWidth || curImgH != eap$lastImageHeight) {
|
if (curLeft != eap$lastLeftPos || curTop != eap$lastTopPos || curImgW != eap$lastImageWidth || curImgH != eap$lastImageHeight) {
|
||||||
eap$lastLeftPos = curLeft;
|
eap$lastLeftPos = curLeft;
|
||||||
eap$lastTopPos = curTop;
|
eap$lastTopPos = curTop;
|
||||||
|
|
@ -144,7 +143,7 @@ public abstract class InterfaceScreenMixin<T extends AEBaseMenu> {
|
||||||
if (!eap$isSupportedInterfaceScreen()) {
|
if (!eap$isSupportedInterfaceScreen()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Slot hovered = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getHoveredSlot();
|
Slot hovered = ((AbstractContainerScreenAccessor<?>) this).eap$getHoveredSlot();
|
||||||
var screen = (AEBaseScreen<?>) (Object) this;
|
var screen = (AEBaseScreen<?>) (Object) this;
|
||||||
var menu = screen.getMenu();
|
var menu = screen.getMenu();
|
||||||
if (!(menu instanceof appeng.menu.implementations.InterfaceMenu interfaceMenu)) {
|
if (!(menu instanceof appeng.menu.implementations.InterfaceMenu interfaceMenu)) {
|
||||||
|
|
@ -217,9 +216,9 @@ public abstract class InterfaceScreenMixin<T extends AEBaseMenu> {
|
||||||
@Unique
|
@Unique
|
||||||
private void eap$relayoutButtons() {
|
private void eap$relayoutButtons() {
|
||||||
try {
|
try {
|
||||||
int leftPos = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getLeftPos();
|
int leftPos = ((AbstractContainerScreenAccessor<?>) this).eap$getLeftPos();
|
||||||
int topPos = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getTopPos();
|
int topPos = ((AbstractContainerScreenAccessor<?>) this).eap$getTopPos();
|
||||||
int imageWidth = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getImageWidth();
|
int imageWidth = ((AbstractContainerScreenAccessor<?>) this).eap$getImageWidth();
|
||||||
int bx = leftPos + imageWidth + 1;
|
int bx = leftPos + imageWidth + 1;
|
||||||
int by = topPos + 70;
|
int by = topPos + 70;
|
||||||
int spacing = 22;
|
int spacing = 22;
|
||||||
|
|
@ -238,7 +237,7 @@ public abstract class InterfaceScreenMixin<T extends AEBaseMenu> {
|
||||||
if (!(((Object) this) instanceof InterfaceScreen)) {
|
if (!(((Object) this) instanceof InterfaceScreen)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Slot hovered = ((AbstractContainerScreenAccessor<?>) (Object) this).eap$getHoveredSlot();
|
Slot hovered = ((AbstractContainerScreenAccessor<?>) this).eap$getHoveredSlot();
|
||||||
if (hovered == null) {
|
if (hovered == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@ package com.extendedae_plus.mixin.ae2.client.gui;
|
||||||
|
|
||||||
import appeng.client.gui.widgets.ActionButton;
|
import appeng.client.gui.widgets.ActionButton;
|
||||||
import appeng.core.localization.ButtonToolTips;
|
import appeng.core.localization.ButtonToolTips;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.util.GetKey;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
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;
|
||||||
|
|
@ -12,16 +11,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(ActionButton.class)
|
@Mixin(ActionButton.class)
|
||||||
public class MixinActionButton {
|
public class MixinActionButton {
|
||||||
// @ModifyVariable(method = "buildMessage", at = @At("STORE"))
|
|
||||||
// private static String eaep$modifyEncodeButtonTooltips(String value) {
|
|
||||||
// if ()
|
|
||||||
// }
|
|
||||||
@Inject(method = "buildMessage", at = @At("TAIL"), cancellable = true)
|
@Inject(method = "buildMessage", at = @At("TAIL"), cancellable = true)
|
||||||
private void eaep$modifyButtonTooltips(ButtonToolTips displayName,
|
private void eaep$modifyButtonTooltips(ButtonToolTips displayName,
|
||||||
ButtonToolTips displayValue,
|
ButtonToolTips displayValue,
|
||||||
CallbackInfoReturnable<Component> cir) {
|
CallbackInfoReturnable<Component> cir) {
|
||||||
if (displayValue == ButtonToolTips.EncodeDescription && !ModConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean())
|
if (displayValue == ButtonToolTips.EncodeDescription && !EAEPConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean())
|
||||||
cir.setReturnValue(cir.getReturnValue().copy().append(
|
cir.setReturnValue(cir.getReturnValue().copy().append(
|
||||||
new GetKey(GetKey.TOOLTIP).addStr("encode_button_description").build()));
|
Component.translatable("tooltip.extendedae_plus.encode_button.upload_pattern")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import appeng.client.gui.me.items.PatternEncodingTermScreen;
|
||||||
import appeng.client.gui.style.ScreenStyle;
|
import appeng.client.gui.style.ScreenStyle;
|
||||||
import appeng.client.gui.style.WidgetStyle;
|
import appeng.client.gui.style.WidgetStyle;
|
||||||
import appeng.client.gui.widgets.IconButton;
|
import appeng.client.gui.widgets.IconButton;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.mixin.accessor.AbstractContainerScreenAccessor;
|
import com.extendedae_plus.mixin.accessor.AbstractContainerScreenAccessor;
|
||||||
import com.extendedae_plus.mixin.accessor.ScreenAccessor;
|
import com.extendedae_plus.mixin.accessor.ScreenAccessor;
|
||||||
import com.extendedae_plus.mixin.ae2.accessor.AEBaseScreenAccessor;
|
import com.extendedae_plus.mixin.ae2.accessor.AEBaseScreenAccessor;
|
||||||
|
|
@ -37,7 +37,7 @@ public abstract class PatternEncodingTermScreenMixin {
|
||||||
private void eap$addUploadButton(CallbackInfo ci) {
|
private void eap$addUploadButton(CallbackInfo ci) {
|
||||||
// 仅在图样编码终端界面中添加按钮
|
// 仅在图样编码终端界面中添加按钮
|
||||||
if (!(((Object) this) instanceof PatternEncodingTermScreen)) return;
|
if (!(((Object) this) instanceof PatternEncodingTermScreen)) return;
|
||||||
if (!ModConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean()) return;
|
if (!EAEPConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean()) return;
|
||||||
// 复用已存在的按钮实例,避免重复创建
|
// 复用已存在的按钮实例,避免重复创建
|
||||||
if (eap$uploadBtn == null) {
|
if (eap$uploadBtn == null) {
|
||||||
eap$uploadBtn = new IconButton(btn -> PacketDistributor
|
eap$uploadBtn = new IconButton(btn -> PacketDistributor
|
||||||
|
|
@ -141,7 +141,7 @@ public abstract class PatternEncodingTermScreenMixin {
|
||||||
@Inject(method = "containerTick", at = @At("TAIL"), remap = false)
|
@Inject(method = "containerTick", at = @At("TAIL"), remap = false)
|
||||||
private void eap$ensureUploadButton(CallbackInfo ci) {
|
private void eap$ensureUploadButton(CallbackInfo ci) {
|
||||||
if (!(((Object) this) instanceof PatternEncodingTermScreen &&
|
if (!(((Object) this) instanceof PatternEncodingTermScreen &&
|
||||||
ModConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean()))
|
EAEPConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean()))
|
||||||
return;
|
return;
|
||||||
if (eap$uploadBtn == null) {
|
if (eap$uploadBtn == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.extendedae_plus.mixin.ae2.compat;
|
package com.extendedae_plus.mixin.ae2.compat;
|
||||||
|
|
||||||
import appeng.api.networking.IManagedGridNode;
|
|
||||||
import appeng.api.networking.IGridConnection;
|
import appeng.api.networking.IGridConnection;
|
||||||
|
import appeng.api.networking.IManagedGridNode;
|
||||||
import appeng.api.networking.security.IActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
import appeng.api.upgrades.IUpgradeInventory;
|
||||||
import appeng.api.upgrades.IUpgradeableObject;
|
import appeng.api.upgrades.IUpgradeableObject;
|
||||||
|
|
@ -9,13 +9,13 @@ import appeng.api.upgrades.UpgradeInventories;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
||||||
import com.extendedae_plus.ae.items.ChannelCardItem;
|
import com.extendedae_plus.ae.items.ChannelCardItem;
|
||||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
|
||||||
import com.extendedae_plus.bridge.CompatUpgradeProvider;
|
import com.extendedae_plus.bridge.CompatUpgradeProvider;
|
||||||
|
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||||
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
|
import com.extendedae_plus.util.ExtendedAELogger;
|
||||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||||
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
|
@ -110,7 +110,7 @@ public abstract class PatternProviderLogicCompatMixin implements CompatUpgradePr
|
||||||
// 这里我们先记录一下,实际的检查会在tick中进行
|
// 这里我们先记录一下,实际的检查会在tick中进行
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -230,20 +230,20 @@ public abstract class PatternProviderLogicCompatMixin implements CompatUpgradePr
|
||||||
}
|
}
|
||||||
|
|
||||||
// 双重保险:如果主要方式失败,尝试备用方式
|
// 双重保险:如果主要方式失败,尝试备用方式
|
||||||
if (upgrades == null || !eap$hasChannelCard(upgrades)) {
|
if (!eap$hasChannelCard(upgrades)) {
|
||||||
|
|
||||||
if (UpgradeSlotCompat.shouldEnableUpgradeSlots()) {
|
if (UpgradeSlotCompat.shouldEnableUpgradeSlots()) {
|
||||||
// 如果我们的槽无频道卡,尝试检查是否有AppliedFlux的槽
|
// 如果我们的槽无频道卡,尝试检查是否有AppliedFlux的槽
|
||||||
try {
|
try {
|
||||||
IUpgradeInventory backupUpgrades = eap$getAppliedFluxUpgrades();
|
IUpgradeInventory backupUpgrades = eap$getAppliedFluxUpgrades();
|
||||||
if (backupUpgrades != null && eap$hasChannelCard(backupUpgrades)) {
|
if (eap$hasChannelCard(backupUpgrades)) {
|
||||||
upgrades = backupUpgrades;
|
upgrades = backupUpgrades;
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 如果AppliedFlux的槽无频道卡,尝试我们的兼容槽
|
// 如果AppliedFlux的槽无频道卡,尝试我们的兼容槽
|
||||||
if (this.eap$compatUpgrades != null && eap$hasChannelCard(this.eap$compatUpgrades)) {
|
if (eap$hasChannelCard(this.eap$compatUpgrades)) {
|
||||||
upgrades = this.eap$compatUpgrades;
|
upgrades = this.eap$compatUpgrades;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -347,7 +347,7 @@ public abstract class PatternProviderLogicCompatMixin implements CompatUpgradePr
|
||||||
// 安装了AppliedFlux时,定期检查升级槽变化
|
// 安装了AppliedFlux时,定期检查升级槽变化
|
||||||
try {
|
try {
|
||||||
IUpgradeInventory afUpgrades = eap$getAppliedFluxUpgrades();
|
IUpgradeInventory afUpgrades = eap$getAppliedFluxUpgrades();
|
||||||
if (afUpgrades != null && eap$hasChannelCard(afUpgrades)) {
|
if (eap$hasChannelCard(afUpgrades)) {
|
||||||
// 检查频道是否发生变化
|
// 检查频道是否发生变化
|
||||||
for (ItemStack stack : afUpgrades) {
|
for (ItemStack stack : afUpgrades) {
|
||||||
if (!stack.isEmpty() && stack.getItem() == ModItems.CHANNEL_CARD.get()) {
|
if (!stack.isEmpty() && stack.getItem() == ModItems.CHANNEL_CARD.get()) {
|
||||||
|
|
@ -366,7 +366,7 @@ public abstract class PatternProviderLogicCompatMixin implements CompatUpgradePr
|
||||||
eap$compatHasInitialized = false;
|
eap$compatHasInitialized = false;
|
||||||
eap$compatInitializeChannelLink();
|
eap$compatInitializeChannelLink();
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -395,7 +395,7 @@ public abstract class PatternProviderLogicCompatMixin implements CompatUpgradePr
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
IUpgradeInventory afUpgrades = eap$getAppliedFluxUpgrades();
|
IUpgradeInventory afUpgrades = eap$getAppliedFluxUpgrades();
|
||||||
if (afUpgrades != null && eap$hasChannelCard(afUpgrades)) {
|
if (eap$hasChannelCard(afUpgrades)) {
|
||||||
// 槽中有频道卡,保持tick以尽快完成连接
|
// 槽中有频道卡,保持tick以尽快完成连接
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -404,7 +404,7 @@ public abstract class PatternProviderLogicCompatMixin implements CompatUpgradePr
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 未安装 AppliedFlux:当存在频道卡但连接尚未建立时保持tick
|
// 未安装 AppliedFlux:当存在频道卡但连接尚未建立时保持tick
|
||||||
if (this.eap$compatUpgrades != null && eap$hasChannelCard(this.eap$compatUpgrades)) {
|
if (eap$hasChannelCard(this.eap$compatUpgrades)) {
|
||||||
if (eap$compatLink == null || !eap$compatLink.isConnected()) {
|
if (eap$compatLink == null || !eap$compatLink.isConnected()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||||
import com.extendedae_plus.wireless.endpoint.InterfaceNodeEndpointImpl;
|
import com.extendedae_plus.wireless.endpoint.InterfaceNodeEndpointImpl;
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
import net.minecraft.server.level.ServerLevel;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.extendedae_plus.mixin.ae2.helpers;
|
||||||
|
|
||||||
import appeng.api.networking.IManagedGridNode;
|
import appeng.api.networking.IManagedGridNode;
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
import appeng.api.upgrades.IUpgradeInventory;
|
||||||
import appeng.api.upgrades.IUpgradeableObject;
|
|
||||||
import appeng.api.upgrades.UpgradeInventories;
|
import appeng.api.upgrades.UpgradeInventories;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
||||||
|
|
@ -19,8 +18,8 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -75,7 +74,7 @@ public abstract class PatternProviderLogicUpgradesMixin {
|
||||||
Field f = this.getClass().getDeclaredField("af_upgrades");
|
Field f = this.getClass().getDeclaredField("af_upgrades");
|
||||||
f.setAccessible(true);
|
f.setAccessible(true);
|
||||||
existingUpgrades = (IUpgradeInventory) f.get(this);
|
existingUpgrades = (IUpgradeInventory) f.get(this);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingUpgrades != null && existingUpgrades != UpgradeInventories.empty()) {
|
if (existingUpgrades != null && existingUpgrades != UpgradeInventories.empty()) {
|
||||||
|
|
@ -108,15 +107,14 @@ public abstract class PatternProviderLogicUpgradesMixin {
|
||||||
Field f = this.getClass().getDeclaredField("af_upgrades");
|
Field f = this.getClass().getDeclaredField("af_upgrades");
|
||||||
f.setAccessible(true);
|
f.setAccessible(true);
|
||||||
f.set(this, this.eap$upgrades);
|
f.set(this, this.eap$upgrades);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.eap$upgradesInitialized = true;
|
|
||||||
} else {
|
} else {
|
||||||
// AppliedFlux 或其他模组已经提供了足够的槽位
|
// AppliedFlux 或其他模组已经提供了足够的槽位
|
||||||
this.eap$upgrades = existingUpgrades;
|
this.eap$upgrades = existingUpgrades;
|
||||||
this.eap$upgradesInitialized = true;
|
|
||||||
}
|
}
|
||||||
|
this.eap$upgradesInitialized = true;
|
||||||
} else {
|
} else {
|
||||||
// AppliedFlux 还没初始化升级槽,或者出了问题,我们创建默认的
|
// AppliedFlux 还没初始化升级槽,或者出了问题,我们创建默认的
|
||||||
this.eap$upgrades = UpgradeInventories.forMachine(
|
this.eap$upgrades = UpgradeInventories.forMachine(
|
||||||
|
|
@ -129,7 +127,7 @@ public abstract class PatternProviderLogicUpgradesMixin {
|
||||||
Field f = this.getClass().getDeclaredField("af_upgrades");
|
Field f = this.getClass().getDeclaredField("af_upgrades");
|
||||||
f.setAccessible(true);
|
f.setAccessible(true);
|
||||||
f.set(this, this.eap$upgrades);
|
f.set(this, this.eap$upgrades);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
this.eap$upgradesInitialized = true;
|
this.eap$upgradesInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +162,7 @@ public abstract class PatternProviderLogicUpgradesMixin {
|
||||||
afMethod.invoke(this);
|
afMethod.invoke(this);
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
// AppliedFlux 的方法不存在,这是正常的
|
// AppliedFlux 的方法不存在,这是正常的
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package com.extendedae_plus.mixin.ae2.menu;
|
package com.extendedae_plus.mixin.ae2.menu;
|
||||||
|
|
||||||
|
import appeng.api.upgrades.IUpgradeInventory;
|
||||||
import appeng.menu.AEBaseMenu;
|
import appeng.menu.AEBaseMenu;
|
||||||
import appeng.menu.SlotSemantics;
|
import appeng.menu.SlotSemantics;
|
||||||
import appeng.menu.implementations.PatternProviderMenu;
|
import appeng.menu.implementations.PatternProviderMenu;
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
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.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,7 @@ public abstract class ContainerPatternEncodingTermMenuMixin implements IActionHo
|
||||||
private void eap$writeEncodePlayerToPattern(CallbackInfoReturnable<ItemStack> cir) {
|
private void eap$writeEncodePlayerToPattern(CallbackInfoReturnable<ItemStack> cir) {
|
||||||
ItemStack itemStack = cir.getReturnValue();
|
ItemStack itemStack = cir.getReturnValue();
|
||||||
if (itemStack != null && !itemStack.isEmpty()) {
|
if (itemStack != null && !itemStack.isEmpty()) {
|
||||||
CustomData.update(DataComponents.CUSTOM_DATA, itemStack, tag -> {
|
CustomData.update(DataComponents.CUSTOM_DATA, itemStack, tag -> tag.putString("encodePlayer", this.epp$player.getGameProfile().getName()));
|
||||||
tag.putString("encodePlayer", this.epp$player.getGameProfile().getName());
|
|
||||||
});
|
|
||||||
cir.setReturnValue(itemStack);
|
cir.setReturnValue(itemStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import appeng.menu.me.crafting.CraftingPlanSummary;
|
||||||
import appeng.menu.me.crafting.CraftingPlanSummaryEntry;
|
import appeng.menu.me.crafting.CraftingPlanSummaryEntry;
|
||||||
import com.extendedae_plus.integration.RecipeViewer.RecipeViewerHelper;
|
import com.extendedae_plus.integration.RecipeViewer.RecipeViewerHelper;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.neoforged.fml.ModList;
|
|
||||||
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.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ import appeng.menu.AEBaseMenu;
|
||||||
import appeng.menu.ToolboxMenu;
|
import appeng.menu.ToolboxMenu;
|
||||||
import appeng.menu.implementations.InterfaceMenu;
|
import appeng.menu.implementations.InterfaceMenu;
|
||||||
import com.extendedae_plus.bridge.IUpgradableMenu;
|
import com.extendedae_plus.bridge.IUpgradableMenu;
|
||||||
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
|
||||||
import com.extendedae_plus.bridge.CompatUpgradeProvider;
|
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
import net.minecraft.world.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
import net.minecraft.world.inventory.MenuType;
|
import net.minecraft.world.inventory.MenuType;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public abstract class MEStorageMenuMixin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
var acc = (MEStorageMenuAccessor) (Object) self;
|
var acc = (MEStorageMenuAccessor) self;
|
||||||
IConfigManager server = acc.getServerCM();
|
IConfigManager server = acc.getServerCM();
|
||||||
IConfigManager client = acc.getClientCM();
|
IConfigManager client = acc.getClientCM();
|
||||||
if (server == null || client == null) {
|
if (server == null || client == null) {
|
||||||
|
|
@ -75,7 +75,7 @@ public abstract class MEStorageMenuMixin {
|
||||||
}
|
}
|
||||||
Class<? extends Enum<?>> enumClass = sv.getDeclaringClass();
|
Class<? extends Enum<?>> enumClass = sv.getDeclaringClass();
|
||||||
Object[] constants = enumClass.getEnumConstants();
|
Object[] constants = enumClass.getEnumConstants();
|
||||||
if (constants == null || constants.length == 0) {
|
if (constants == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (Object c : constants) {
|
for (Object c : constants) {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import appeng.menu.me.items.PatternEncodingTermMenu;
|
||||||
import appeng.menu.slot.RestrictedInputSlot;
|
import appeng.menu.slot.RestrictedInputSlot;
|
||||||
import appeng.parts.encoding.EncodingMode;
|
import appeng.parts.encoding.EncodingMode;
|
||||||
import com.extendedae_plus.client.PatternEncodingTermMenuMixinHelper;
|
import com.extendedae_plus.client.PatternEncodingTermMenuMixinHelper;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.mixin.ae2.accessor.MEStorageMenuAccessor;
|
import com.extendedae_plus.mixin.ae2.accessor.MEStorageMenuAccessor;
|
||||||
import com.extendedae_plus.network.C2SPacketEncodeFinished;
|
import com.extendedae_plus.network.C2SPacketEncodeFinished;
|
||||||
import com.extendedae_plus.util.ExtendedAEPatternUploadUtil;
|
import com.extendedae_plus.util.ExtendedAEPatternUploadUtil;
|
||||||
|
|
@ -171,7 +171,7 @@ public abstract class PatternEncodingTermMenuMixin implements PatternEncodingTer
|
||||||
|
|
||||||
@Inject(method = "encode", at = @At("TAIL"))
|
@Inject(method = "encode", at = @At("TAIL"))
|
||||||
private void eaep$onEncode(CallbackInfo ci) {
|
private void eaep$onEncode(CallbackInfo ci) {
|
||||||
if (ModConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean()) return;
|
if (EAEPConfig.INDEPENDENT_UPLOADING_BUTTON.getAsBoolean()) return;
|
||||||
var self = (PatternEncodingTermMenu) (Object) this;
|
var self = (PatternEncodingTermMenu) (Object) this;
|
||||||
if (self.isClientSide()) return;
|
if (self.isClientSide()) return;
|
||||||
if (!eaep$isCtrlPressed) return;
|
if (!eaep$isCtrlPressed) return;
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,9 @@ import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
||||||
import appeng.menu.AEBaseMenu;
|
import appeng.menu.AEBaseMenu;
|
||||||
import appeng.menu.ToolboxMenu;
|
import appeng.menu.ToolboxMenu;
|
||||||
import appeng.menu.implementations.PatternProviderMenu;
|
import appeng.menu.implementations.PatternProviderMenu;
|
||||||
|
import com.extendedae_plus.bridge.CompatUpgradeProvider;
|
||||||
import com.extendedae_plus.bridge.IUpgradableMenu;
|
import com.extendedae_plus.bridge.IUpgradableMenu;
|
||||||
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
import com.extendedae_plus.compat.UpgradeSlotCompat;
|
||||||
import com.extendedae_plus.bridge.CompatUpgradeProvider;
|
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
|
||||||
import appeng.api.upgrades.IUpgradeableObject;
|
|
||||||
import net.minecraft.world.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
import net.minecraft.world.inventory.MenuType;
|
import net.minecraft.world.inventory.MenuType;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
|
@ -19,7 +17,6 @@ import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
|
|
||||||
@Mixin(value = PatternProviderMenu.class, priority = 2000, remap = false)
|
@Mixin(value = PatternProviderMenu.class, priority = 2000, remap = false)
|
||||||
public abstract class PatternProviderMenuUpgradesMixin extends AEBaseMenu implements IUpgradableMenu {
|
public abstract class PatternProviderMenuUpgradesMixin extends AEBaseMenu implements IUpgradableMenu {
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,14 @@ package com.extendedae_plus.mixin.ae2.parts.automation;
|
||||||
import appeng.api.networking.security.IActionHost;
|
import appeng.api.networking.security.IActionHost;
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
import appeng.api.upgrades.IUpgradeInventory;
|
||||||
import appeng.api.upgrades.IUpgradeableObject;
|
import appeng.api.upgrades.IUpgradeableObject;
|
||||||
import appeng.helpers.InterfaceLogicHost;
|
|
||||||
import appeng.parts.automation.IOBusPart;
|
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.ae.items.ChannelCardItem;
|
||||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
|
import com.extendedae_plus.util.ExtendedAELogger;
|
||||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||||
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
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.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
@ -103,7 +101,7 @@ public abstract class IOBusPartChannelCardMixin implements InterfaceWirelessLink
|
||||||
if (eap$link == null) {
|
if (eap$link == null) {
|
||||||
var endpoint = new GenericNodeEndpointImpl(
|
var endpoint = new GenericNodeEndpointImpl(
|
||||||
() -> ((appeng.parts.AEBasePart)(Object)this).getHost().getBlockEntity(),
|
() -> ((appeng.parts.AEBasePart)(Object)this).getHost().getBlockEntity(),
|
||||||
() -> ((IActionHost)(Object)this).getActionableNode()
|
() -> ((IActionHost) this).getActionableNode()
|
||||||
);
|
);
|
||||||
eap$link = new WirelessSlaveLink(endpoint);
|
eap$link = new WirelessSlaveLink(endpoint);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,13 @@ import appeng.api.networking.security.IActionHost;
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
import appeng.api.upgrades.IUpgradeInventory;
|
||||||
import appeng.api.upgrades.IUpgradeableObject;
|
import appeng.api.upgrades.IUpgradeableObject;
|
||||||
import appeng.parts.storagebus.StorageBusPart;
|
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.ae.items.ChannelCardItem;
|
||||||
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
import com.extendedae_plus.bridge.InterfaceWirelessLinkBridge;
|
||||||
import com.extendedae_plus.init.ModItems;
|
import com.extendedae_plus.init.ModItems;
|
||||||
|
import com.extendedae_plus.util.ExtendedAELogger;
|
||||||
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
import com.extendedae_plus.wireless.WirelessSlaveLink;
|
||||||
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
import com.extendedae_plus.wireless.endpoint.GenericNodeEndpointImpl;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
@ -99,7 +98,7 @@ public abstract class StorageBusPartChannelCardMixin implements InterfaceWireles
|
||||||
if (eap$link == null) {
|
if (eap$link == null) {
|
||||||
var endpoint = new GenericNodeEndpointImpl(
|
var endpoint = new GenericNodeEndpointImpl(
|
||||||
() -> ((appeng.parts.AEBasePart)(Object)this).getHost().getBlockEntity(),
|
() -> ((appeng.parts.AEBasePart)(Object)this).getHost().getBlockEntity(),
|
||||||
() -> ((IActionHost)(Object)this).getActionableNode()
|
() -> ((IActionHost) this).getActionableNode()
|
||||||
);
|
);
|
||||||
eap$link = new WirelessSlaveLink(endpoint);
|
eap$link = new WirelessSlaveLink(endpoint);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public abstract class HighlightButtonMixin {
|
||||||
if (posEqual && faceEqual) {
|
if (posEqual && faceEqual) {
|
||||||
// 选中当前供应器:使用 mixin 新增的 setter(通过反射调用以兼容编译期)
|
// 选中当前供应器:使用 mixin 新增的 setter(通过反射调用以兼容编译期)
|
||||||
try {
|
try {
|
||||||
long serverId = (long) entry.getKey();
|
long serverId = entry.getKey();
|
||||||
var setter = terminal.getClass().getMethod("setCurrentlyChoicePatternProvider", long.class);
|
var setter = terminal.getClass().getMethod("setCurrentlyChoicePatternProvider", long.class);
|
||||||
setter.setAccessible(true);
|
setter.setAccessible(true);
|
||||||
setter.invoke(terminal, serverId);
|
setter.invoke(terminal, serverId);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import appeng.menu.SlotSemantics;
|
||||||
import appeng.menu.slot.AppEngSlot;
|
import appeng.menu.slot.AppEngSlot;
|
||||||
import com.extendedae_plus.NewIcon;
|
import com.extendedae_plus.NewIcon;
|
||||||
import com.extendedae_plus.api.ExPatternButtonsAccessor;
|
import com.extendedae_plus.api.ExPatternButtonsAccessor;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.network.ScalePatternsC2SPacket;
|
import com.extendedae_plus.network.ScalePatternsC2SPacket;
|
||||||
import com.glodblock.github.extendedae.client.button.ActionEPPButton;
|
import com.glodblock.github.extendedae.client.button.ActionEPPButton;
|
||||||
import com.glodblock.github.extendedae.client.gui.GuiExPatternProvider;
|
import com.glodblock.github.extendedae.client.gui.GuiExPatternProvider;
|
||||||
|
|
@ -65,7 +65,7 @@ public abstract class GuiExPatternProviderMixin extends PatternProviderScreen<Co
|
||||||
private int getMaxPage() {
|
private int getMaxPage() {
|
||||||
// 优先使用配置倍数
|
// 优先使用配置倍数
|
||||||
try {
|
try {
|
||||||
int cfg = ModConfig.PAGE_MULTIPLIER.get();
|
int cfg = EAEPConfig.PAGE_MULTIPLIER.get();
|
||||||
if (cfg > 1) return cfg;
|
if (cfg > 1) return cfg;
|
||||||
} catch (Throwable ignored) {}
|
} catch (Throwable ignored) {}
|
||||||
try {
|
try {
|
||||||
|
|
@ -124,7 +124,7 @@ public abstract class GuiExPatternProviderMixin extends PatternProviderScreen<Co
|
||||||
// 计算并下发 maxPage(配置优先,其次按槽位总数计算)
|
// 计算并下发 maxPage(配置优先,其次按槽位总数计算)
|
||||||
int totalSlots = this.getMenu().getSlots(SlotSemantics.ENCODED_PATTERN).size();
|
int totalSlots = this.getMenu().getSlots(SlotSemantics.ENCODED_PATTERN).size();
|
||||||
int cfgPages = 1;
|
int cfgPages = 1;
|
||||||
try { cfgPages = Math.max(1, ModConfig.PAGE_MULTIPLIER.get()); } catch (Throwable ignored) {}
|
try { cfgPages = Math.max(1, EAEPConfig.PAGE_MULTIPLIER.get()); } catch (Throwable ignored) {}
|
||||||
int calcPages = Math.max(1, (int) Math.ceil(totalSlots / (double) SLOTS_PER_PAGE));
|
int calcPages = Math.max(1, (int) Math.ceil(totalSlots / (double) SLOTS_PER_PAGE));
|
||||||
int desiredMaxPage = Math.max(cfgPages, calcPages);
|
int desiredMaxPage = Math.max(cfgPages, calcPages);
|
||||||
LOGGER.info("[EAP] GuiExPatternProvider init: totalSlots={}, cfgPages={}, calcPages={}, desiredMaxPage={}", totalSlots, cfgPages, calcPages, desiredMaxPage);
|
LOGGER.info("[EAP] GuiExPatternProvider init: totalSlots={}, cfgPages={}, calcPages={}, desiredMaxPage={}", totalSlots, cfgPages, calcPages, desiredMaxPage);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import appeng.client.gui.me.patternaccess.PatternContainerRecord;
|
||||||
import appeng.client.gui.style.ScreenStyle;
|
import appeng.client.gui.style.ScreenStyle;
|
||||||
import appeng.client.gui.widgets.IconButton;
|
import appeng.client.gui.widgets.IconButton;
|
||||||
import appeng.menu.AEBaseMenu;
|
import appeng.menu.AEBaseMenu;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.mixin.extendedae.accessor.GuiExPatternTerminalAccessor;
|
import com.extendedae_plus.mixin.extendedae.accessor.GuiExPatternTerminalAccessor;
|
||||||
import com.extendedae_plus.network.OpenProviderUiC2SPacket;
|
import com.extendedae_plus.network.OpenProviderUiC2SPacket;
|
||||||
import com.extendedae_plus.util.GuiUtil;
|
import com.extendedae_plus.util.GuiUtil;
|
||||||
|
|
@ -246,7 +246,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
CallbackInfo ci) {
|
CallbackInfo ci) {
|
||||||
// 根据配置初始化默认显示/隐藏状态
|
// 根据配置初始化默认显示/隐藏状态
|
||||||
try {
|
try {
|
||||||
this.eap$showSlots = ModConfig.PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT.get();
|
this.eap$showSlots = EAEPConfig.PATTERN_TERMINAL_SHOW_SLOTS_DEFAULT.get();
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
// 创建切换槽位显示的按钮
|
// 创建切换槽位显示的按钮
|
||||||
|
|
@ -261,11 +261,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
refreshMethod = this.getClass().getDeclaredMethod("refreshList");
|
refreshMethod = this.getClass().getDeclaredMethod("refreshList");
|
||||||
} catch (NoSuchMethodException e1) {
|
} catch (NoSuchMethodException e1) {
|
||||||
// 如果当前类没有,尝试在父类中查找
|
// 如果当前类没有,尝试在父类中查找
|
||||||
try {
|
|
||||||
refreshMethod = this.getClass().getSuperclass().getDeclaredMethod("refreshList");
|
refreshMethod = this.getClass().getSuperclass().getDeclaredMethod("refreshList");
|
||||||
} catch (NoSuchMethodException e2) {
|
|
||||||
throw e2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshMethod.setAccessible(true);
|
refreshMethod.setAccessible(true);
|
||||||
|
|
@ -376,11 +372,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
rowsField = this.getClass().getDeclaredField("rows");
|
rowsField = this.getClass().getDeclaredField("rows");
|
||||||
} catch (NoSuchFieldException e1) {
|
} catch (NoSuchFieldException e1) {
|
||||||
// 如果当前类没有,尝试在父类中查找
|
// 如果当前类没有,尝试在父类中查找
|
||||||
try {
|
|
||||||
rowsField = this.getClass().getSuperclass().getDeclaredField("rows");
|
rowsField = this.getClass().getSuperclass().getDeclaredField("rows");
|
||||||
} catch (NoSuchFieldException e2) {
|
|
||||||
throw e2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
rowsField.setAccessible(true);
|
rowsField.setAccessible(true);
|
||||||
java.util.ArrayList<?> rows = (java.util.ArrayList<?>) rowsField.get(this);
|
java.util.ArrayList<?> rows = (java.util.ArrayList<?>) rowsField.get(this);
|
||||||
|
|
@ -392,11 +384,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
highlightBtnsField = this.getClass().getDeclaredField("highlightBtns");
|
highlightBtnsField = this.getClass().getDeclaredField("highlightBtns");
|
||||||
} catch (NoSuchFieldException e1) {
|
} catch (NoSuchFieldException e1) {
|
||||||
// 如果当前类没有,尝试在父类中查找
|
// 如果当前类没有,尝试在父类中查找
|
||||||
try {
|
|
||||||
highlightBtnsField = this.getClass().getSuperclass().getDeclaredField("highlightBtns");
|
highlightBtnsField = this.getClass().getSuperclass().getDeclaredField("highlightBtns");
|
||||||
} catch (NoSuchFieldException e2) {
|
|
||||||
throw e2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
highlightBtnsField.setAccessible(true);
|
highlightBtnsField.setAccessible(true);
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
@ -434,7 +422,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
|
|
||||||
// 移除多余的行
|
// 移除多余的行
|
||||||
while (rows.size() > newIndex) {
|
while (rows.size() > newIndex) {
|
||||||
rows.remove(rows.size() - 1);
|
rows.removeLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新highlightBtns
|
// 更新highlightBtns
|
||||||
|
|
@ -449,11 +437,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
resetScrollbarMethod = this.getClass().getDeclaredMethod("resetScrollbar");
|
resetScrollbarMethod = this.getClass().getDeclaredMethod("resetScrollbar");
|
||||||
} catch (NoSuchMethodException e1) {
|
} catch (NoSuchMethodException e1) {
|
||||||
// 如果当前类没有,尝试在父类中查找
|
// 如果当前类没有,尝试在父类中查找
|
||||||
try {
|
|
||||||
resetScrollbarMethod = this.getClass().getSuperclass().getDeclaredMethod("resetScrollbar");
|
resetScrollbarMethod = this.getClass().getSuperclass().getDeclaredMethod("resetScrollbar");
|
||||||
} catch (NoSuchMethodException e2) {
|
|
||||||
throw e2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resetScrollbarMethod.setAccessible(true);
|
resetScrollbarMethod.setAccessible(true);
|
||||||
|
|
@ -516,9 +500,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
|
|
||||||
Button btn = eap$openUIButtons.get(rowIndex);
|
Button btn = eap$openUIButtons.get(rowIndex);
|
||||||
if (btn == null) {
|
if (btn == null) {
|
||||||
btn = Button.builder(Component.literal("UI"), (b) -> {
|
btn = Button.builder(Component.literal("UI"), (b) -> eap$tryOpenProviderUI(rowIndex)).size(14, 12).build();
|
||||||
eap$tryOpenProviderUI(rowIndex);
|
|
||||||
}).size(14, 12).build();
|
|
||||||
btn.setTooltip(Tooltip.create(Component.literal("打开该供应器目标容器的界面")));
|
btn.setTooltip(Tooltip.create(Component.literal("打开该供应器目标容器的界面")));
|
||||||
eap$openUIButtons.put(rowIndex, btn);
|
eap$openUIButtons.put(rowIndex, btn);
|
||||||
this.addRenderableWidget(btn);
|
this.addRenderableWidget(btn);
|
||||||
|
|
@ -578,7 +560,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
if (ms instanceof Set<?> s) {
|
if (ms instanceof Set<?> s) {
|
||||||
// 原始是 Set<ItemStack>
|
// 原始是 Set<ItemStack>
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Set<ItemStack> cast = (Set<ItemStack>) (Set<?>) s;
|
Set<ItemStack> cast = (Set<ItemStack>) s;
|
||||||
matchedStack = cast;
|
matchedStack = cast;
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException ignored) {
|
} catch (NoSuchFieldException ignored) {
|
||||||
|
|
@ -589,7 +571,7 @@ public abstract class GuiExPatternTerminalMixin extends AEBaseScreen<AEBaseMenu>
|
||||||
Object mp = fMp.get(this);
|
Object mp = fMp.get(this);
|
||||||
if (mp instanceof Set<?> s) {
|
if (mp instanceof Set<?> s) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Set<PatternContainerRecord> cast = (Set<PatternContainerRecord>) (Set<?>) s;
|
Set<PatternContainerRecord> cast = (Set<PatternContainerRecord>) s;
|
||||||
matchedProvider = cast;
|
matchedProvider = cast;
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException ignored) {
|
} catch (NoSuchFieldException ignored) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.extendedae_plus.mixin.extendedae.common;
|
package com.extendedae_plus.mixin.extendedae.common;
|
||||||
|
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.glodblock.github.extendedae.common.parts.PartExPatternProvider;
|
import com.glodblock.github.extendedae.common.parts.PartExPatternProvider;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Pseudo;
|
import org.spongepowered.asm.mixin.Pseudo;
|
||||||
|
|
@ -20,7 +20,7 @@ public abstract class PartExPatternProviderMixin {
|
||||||
index = 2
|
index = 2
|
||||||
)
|
)
|
||||||
private int eap$multiplyCapacity(int original) {
|
private int eap$multiplyCapacity(int original) {
|
||||||
int mult = ModConfig.PAGE_MULTIPLIER.get();
|
int mult = EAEPConfig.PAGE_MULTIPLIER.get();
|
||||||
if (mult < 1) mult = 1;
|
if (mult < 1) mult = 1;
|
||||||
if (mult > 64) mult = 64;
|
if (mult > 64) mult = 64;
|
||||||
return Math.max(1, original) * mult;
|
return Math.max(1, original) * mult;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.extendedae_plus.mixin.extendedae.common;
|
package com.extendedae_plus.mixin.extendedae.common;
|
||||||
|
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.glodblock.github.extendedae.common.tileentities.TileExPatternProvider;
|
import com.glodblock.github.extendedae.common.tileentities.TileExPatternProvider;
|
||||||
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;
|
||||||
|
|
@ -18,7 +18,7 @@ public abstract class TileExPatternProviderMixin {
|
||||||
index = 2
|
index = 2
|
||||||
)
|
)
|
||||||
private int eap$multiplyCapacity(int original) {
|
private int eap$multiplyCapacity(int original) {
|
||||||
int mult = ModConfig.PAGE_MULTIPLIER.get();
|
int mult = EAEPConfig.PAGE_MULTIPLIER.get();
|
||||||
if (mult < 1) mult = 1;
|
if (mult < 1) mult = 1;
|
||||||
if (mult > 64) mult = 64;
|
if (mult > 64) mult = 64;
|
||||||
return Math.max(1, original) * mult;
|
return Math.max(1, original) * mult;
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ public abstract class ContainerExPatternProviderMixin extends PatternProviderMen
|
||||||
if (scale <= 0) return;
|
if (scale <= 0) return;
|
||||||
for (var slot : this.getSlots(SlotSemantics.ENCODED_PATTERN)) {
|
for (var slot : this.getSlots(SlotSemantics.ENCODED_PATTERN)) {
|
||||||
var stack = slot.getItem();
|
var stack = slot.getItem();
|
||||||
if (stack.getItem() instanceof EncodedPatternItem pattern) {
|
if (stack.getItem() instanceof EncodedPatternItem<?>) {
|
||||||
var detail = PatternDetailsHelper.decodePattern(stack, this.getPlayer().level());
|
var detail = PatternDetailsHelper.decodePattern(stack, this.getPlayer().level());
|
||||||
if (detail instanceof AEProcessingPattern process) {
|
if (detail instanceof AEProcessingPattern process) {
|
||||||
var input = process.getSparseInputs(); // List<GenericStack>
|
var input = process.getSparseInputs(); // List<GenericStack>
|
||||||
|
|
@ -116,7 +116,6 @@ public abstract class ContainerExPatternProviderMixin extends PatternProviderMen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
for (var stack : stacks) {
|
for (var stack : stacks) {
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
|
|
@ -126,8 +125,8 @@ public abstract class ContainerExPatternProviderMixin extends PatternProviderMen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||||
|
|
||||||
@Mixin(BoMScreen.class)
|
@Mixin(BoMScreen.class)
|
||||||
public abstract class MixinBoMScreen {
|
public abstract class MixinBoMScreen {
|
||||||
@Inject(method = "mouseClicked", at = @At("HEAD"))
|
@Inject(method = "mouseClicked", at = @At("HEAD"), cancellable = true)
|
||||||
private void onMouseClick(double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
|
private void onMouseClick(double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if (!(button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE && Screen.hasControlDown())) return;
|
if (!(button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE && Screen.hasControlDown())) return;
|
||||||
try {
|
try {
|
||||||
|
|
@ -94,5 +94,6 @@ public abstract class MixinBoMScreen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
|
cir.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import appeng.api.stacks.AEKey;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
import appeng.helpers.patternprovider.PatternProviderLogicHost;
|
||||||
import appeng.me.service.CraftingService;
|
import appeng.me.service.CraftingService;
|
||||||
import appeng.menu.AEBaseMenu;
|
|
||||||
import appeng.menu.locator.MenuLocators;
|
import appeng.menu.locator.MenuLocators;
|
||||||
import appeng.menu.me.crafting.CraftingCPUMenu;
|
import appeng.menu.me.crafting.CraftingCPUMenu;
|
||||||
import appeng.parts.AEBasePart;
|
import appeng.parts.AEBasePart;
|
||||||
|
|
@ -69,7 +68,7 @@ public class CraftingMonitorOpenProviderC2SPacket implements CustomPacketPayload
|
||||||
|
|
||||||
// 通过菜单的 target(可能是 BlockEntity/Part/ItemHost),按 IActionHost 获取 Grid
|
// 通过菜单的 target(可能是 BlockEntity/Part/ItemHost),按 IActionHost 获取 Grid
|
||||||
IGrid grid = null;
|
IGrid grid = null;
|
||||||
Object target = ((AEBaseMenu) menu).getTarget();
|
Object target = menu.getTarget();
|
||||||
if (target instanceof IActionHost host && host.getActionableNode() != null) {
|
if (target instanceof IActionHost host && host.getActionableNode() != null) {
|
||||||
grid = host.getActionableNode().getGrid();
|
grid = host.getActionableNode().getGrid();
|
||||||
}
|
}
|
||||||
|
|
@ -128,8 +127,8 @@ public class CraftingMonitorOpenProviderC2SPacket implements CustomPacketPayload
|
||||||
|
|
||||||
// 最后发送高亮包,保证界面已打开
|
// 最后发送高亮包,保证界面已打开
|
||||||
var outs = pattern.getOutputs();
|
var outs = pattern.getOutputs();
|
||||||
if (outs != null && !outs.isEmpty() && outs.get(0) != null) {
|
if (outs != null && !outs.isEmpty() && outs.getFirst() != null) {
|
||||||
AEKey key = outs.get(0).what();
|
AEKey key = outs.getFirst().what();
|
||||||
player.connection.send(new SetPatternHighlightS2CPacket(key, true));
|
player.connection.send(new SetPatternHighlightS2CPacket(key, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,8 +141,8 @@ public class GlobalToggleProviderModesC2SPacket implements CustomPacketPayload {
|
||||||
try {
|
try {
|
||||||
Class<?> cls = Class.forName(className);
|
Class<?> cls = Class.forName(className);
|
||||||
// 收集全部与在线两类机器
|
// 收集全部与在线两类机器
|
||||||
Set<?> all = grid.getMachines((Class) cls);
|
Set<?> all = grid.getMachines((Class<?>) cls);
|
||||||
Set<?> active = grid.getActiveMachines((Class) cls);
|
Set<?> active = grid.getActiveMachines((Class<?>) cls);
|
||||||
for (Object o : all) addLogicIfPresent(out, o);
|
for (Object o : all) addLogicIfPresent(out, o);
|
||||||
for (Object o : active) addLogicIfPresent(out, o);
|
for (Object o : active) addLogicIfPresent(out, o);
|
||||||
} catch (Throwable ignored) {}
|
} catch (Throwable ignored) {}
|
||||||
|
|
|
||||||
|
|
@ -70,15 +70,14 @@ public class InterfaceAdjustConfigAmountC2SPacket implements CustomPacketPayload
|
||||||
int factor = Math.max(1, msg.factor);
|
int factor = Math.max(1, msg.factor);
|
||||||
long next;
|
long next;
|
||||||
if (msg.divide) {
|
if (msg.divide) {
|
||||||
if (factor <= 1) continue;
|
if (factor == 1) continue;
|
||||||
if (current % factor != 0) continue;
|
if (current % factor != 0) continue;
|
||||||
next = current / factor;
|
next = current / factor;
|
||||||
if (next < 1) next = 1;
|
|
||||||
} else {
|
} else {
|
||||||
if (factor <= 1) continue;
|
if (factor == 1) continue;
|
||||||
next = current * factor;
|
next = current * factor;
|
||||||
if (next < 1) next = 1;
|
|
||||||
}
|
}
|
||||||
|
if (next < 1) next = 1;
|
||||||
|
|
||||||
GenericStack newStack = new GenericStack(st.what(), next);
|
GenericStack newStack = new GenericStack(st.what(), next);
|
||||||
config.setStack(idx, newStack);
|
config.setStack(idx, newStack);
|
||||||
|
|
@ -92,16 +91,15 @@ public class InterfaceAdjustConfigAmountC2SPacket implements CustomPacketPayload
|
||||||
long next;
|
long next;
|
||||||
if (msg.divide) {
|
if (msg.divide) {
|
||||||
// 只能整除,且至少为 1
|
// 只能整除,且至少为 1
|
||||||
if (factor <= 1) return;
|
if (factor == 1) return;
|
||||||
if (current % factor != 0) return; // 不能整除则跳过
|
if (current % factor != 0) return; // 不能整除则跳过
|
||||||
next = current / factor;
|
next = current / factor;
|
||||||
if (next < 1) next = 1;
|
|
||||||
} else {
|
} else {
|
||||||
// 倍增,至少为 1
|
// 倍增,至少为 1
|
||||||
if (factor <= 1) return;
|
if (factor == 1) return;
|
||||||
next = current * factor;
|
next = current * factor;
|
||||||
if (next < 1) next = 1;
|
|
||||||
}
|
}
|
||||||
|
if (next < 1) next = 1;
|
||||||
|
|
||||||
// 应用
|
// 应用
|
||||||
GenericStack newStack = new GenericStack(stack.what(), next);
|
GenericStack newStack = new GenericStack(stack.what(), next);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import appeng.menu.implementations.PatternAccessTermMenu;
|
||||||
import appeng.menu.me.items.PatternEncodingTermMenu;
|
import appeng.menu.me.items.PatternEncodingTermMenu;
|
||||||
import appeng.util.inv.FilteredInternalInventory;
|
import appeng.util.inv.FilteredInternalInventory;
|
||||||
import appeng.util.inv.filter.IAEItemFilter;
|
import appeng.util.inv.filter.IAEItemFilter;
|
||||||
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.mixin.ae2.accessor.PatternEncodingTermMenuAccessor;
|
import com.extendedae_plus.mixin.ae2.accessor.PatternEncodingTermMenuAccessor;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
@ -280,13 +281,6 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
if (key == null) return null;
|
if (key == null) return null;
|
||||||
// 先查别名(按 path 匹配)
|
// 先查别名(按 path 匹配)
|
||||||
// 别名替换放在init做, 提前别名的次序
|
// 别名替换放在init做, 提前别名的次序
|
||||||
// String alias = CUSTOM_ALIASES.get(key.getPath().toLowerCase());
|
|
||||||
// if (alias != null && !alias.isBlank()) return alias;
|
|
||||||
// 再查完整ID映射
|
|
||||||
// String custom = CUSTOM_NAMES.get(key);
|
|
||||||
// if (custom != null && !custom.isBlank()) {
|
|
||||||
// return custom;
|
|
||||||
// }
|
|
||||||
return key.getPath();
|
return key.getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,7 +417,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取已编码槽位的物品
|
// 读取已编码槽位的物品
|
||||||
var encodedSlot = ((PatternEncodingTermMenuAccessor) (Object) menu)
|
var encodedSlot = ((PatternEncodingTermMenuAccessor) menu)
|
||||||
.eap$getEncodedPatternSlot();
|
.eap$getEncodedPatternSlot();
|
||||||
ItemStack stack = encodedSlot.getItem();
|
ItemStack stack = encodedSlot.getItem();
|
||||||
if (stack.isEmpty() || !PatternDetailsHelper.isEncodedPattern(stack)) {
|
if (stack.isEmpty() || !PatternDetailsHelper.isEncodedPattern(stack)) {
|
||||||
|
|
@ -462,7 +456,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
player.sendSystemMessage(Component.literal("ExtendedAE Plus: 装配矩阵已存在相同样板,已跳过上传并返还空白样板"));
|
player.sendSystemMessage(Component.literal("ExtendedAE Plus: 装配矩阵已存在相同样板,已跳过上传并返还空白样板"));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
var accessor = (PatternEncodingTermMenuAccessor) (Object) menu;
|
var accessor = (PatternEncodingTermMenuAccessor) menu;
|
||||||
var blankSlot = accessor.eap$getBlankPatternSlot();
|
var blankSlot = accessor.eap$getBlankPatternSlot();
|
||||||
ItemStack blanks = AEItems.BLANK_PATTERN.stack(stack.getCount());
|
ItemStack blanks = AEItems.BLANK_PATTERN.stack(stack.getCount());
|
||||||
if (blankSlot != null && blankSlot.mayPlace(blanks)) {
|
if (blankSlot != null && blankSlot.mayPlace(blanks)) {
|
||||||
|
|
@ -548,7 +542,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
}
|
}
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -575,7 +569,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
// 1.21 暂不检查聚合能力视图,能力系统适配后再补充
|
// 1.21 暂不检查聚合能力视图,能力系统适配后再补充
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1032,7 +1026,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
if (player == null || menu == null) {
|
if (player == null || menu == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var encodedSlot = ((PatternEncodingTermMenuAccessor) (Object) menu)
|
var encodedSlot = ((PatternEncodingTermMenuAccessor) menu)
|
||||||
.eap$getEncodedPatternSlot();
|
.eap$getEncodedPatternSlot();
|
||||||
ItemStack stack = encodedSlot.getItem();
|
ItemStack stack = encodedSlot.getItem();
|
||||||
if (stack.isEmpty() || !PatternDetailsHelper.isEncodedPattern(stack)) {
|
if (stack.isEmpty() || !PatternDetailsHelper.isEncodedPattern(stack)) {
|
||||||
|
|
@ -1166,7 +1160,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
var container = list.get(index);
|
var container = list.get(index);
|
||||||
if (container == null) return false;
|
if (container == null) return false;
|
||||||
|
|
||||||
var encodedSlot = ((PatternEncodingTermMenuAccessor) (Object) menu)
|
var encodedSlot = ((PatternEncodingTermMenuAccessor) menu)
|
||||||
.eap$getEncodedPatternSlot();
|
.eap$getEncodedPatternSlot();
|
||||||
ItemStack stack = encodedSlot.getItem();
|
ItemStack stack = encodedSlot.getItem();
|
||||||
if (stack.isEmpty() || !PatternDetailsHelper.isEncodedPattern(stack)) {
|
if (stack.isEmpty() || !PatternDetailsHelper.isEncodedPattern(stack)) {
|
||||||
|
|
@ -1213,6 +1207,7 @@ public class ExtendedAEPatternUploadUtil {
|
||||||
* 传入任意属于该集群的 Tile(如 Pattern/Crafter/Frame 等)。
|
* 传入任意属于该集群的 Tile(如 Pattern/Crafter/Frame 等)。
|
||||||
*/
|
*/
|
||||||
private static boolean clusterHasSingleUploadCore(com.glodblock.github.extendedae.common.tileentities.matrix.TileAssemblerMatrixBase any) {
|
private static boolean clusterHasSingleUploadCore(com.glodblock.github.extendedae.common.tileentities.matrix.TileAssemblerMatrixBase any) {
|
||||||
|
if (!EAEPConfig.NEEDS_UPLOADING_CORE.getAsBoolean()) return true;
|
||||||
try {
|
try {
|
||||||
if (any == null || any.getCluster() == null) return false;
|
if (any == null || any.getCluster() == null) return false;
|
||||||
int cores = 0;
|
int cores = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
package com.extendedae_plus.util;
|
|
||||||
|
|
||||||
import com.extendedae_plus.ExtendedAEPlus;
|
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
import net.neoforged.neoforge.fluids.FluidType;
|
|
||||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
|
||||||
import net.neoforged.neoforge.registries.DeferredItem;
|
|
||||||
|
|
||||||
public class GetKey {
|
|
||||||
private final String keyType;
|
|
||||||
private String mainDescription = ExtendedAEPlus.MODID;
|
|
||||||
private String additionalKey = ".";
|
|
||||||
private Object[] args;
|
|
||||||
|
|
||||||
public static final String CTAB = "ctab";
|
|
||||||
public static final String GUI = "gui";
|
|
||||||
public static final String MESSAGE = "message";
|
|
||||||
public static final String CONFIG = "config";
|
|
||||||
public static final String TOOLTIP = "tooltip";
|
|
||||||
|
|
||||||
public GetKey() {
|
|
||||||
this.keyType = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey(String keyType) {
|
|
||||||
this.keyType = keyType.toLowerCase() + '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey(DeferredItem<?> item) {
|
|
||||||
this.keyType = "";
|
|
||||||
this.mainDescription = item.asItem().getDescriptionId().toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey(DeferredHolder<FluidType, ?> fluid) {
|
|
||||||
this.keyType = "";
|
|
||||||
this.mainDescription = fluid.get().getDescriptionId().toLowerCase();
|
|
||||||
this.additionalKey = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey item(ItemStack item) {
|
|
||||||
this.mainDescription = item.getDescriptionId().toLowerCase();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey item(Item item) {
|
|
||||||
this.mainDescription = item.getDescriptionId().toLowerCase();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey item(DeferredItem<?> item) {
|
|
||||||
this.mainDescription = item.asItem().getDescriptionId().toLowerCase();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey addStr(String additionalKey) {
|
|
||||||
if (!this.additionalKey.endsWith("."))
|
|
||||||
this.additionalKey += ".";
|
|
||||||
this.additionalKey += additionalKey;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetKey obj(Object... args) {
|
|
||||||
this.args = args;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String buildRaw() {
|
|
||||||
return keyType + mainDescription + additionalKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Component build() {
|
|
||||||
if (args == null) return Component.translatable(keyType + mainDescription + additionalKey);
|
|
||||||
return Component.translatable(keyType + mainDescription + additionalKey, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescriptionID(ItemStack itemStack) {
|
|
||||||
return "item.fish_things." + BuiltInRegistries.ITEM.getKey(itemStack.getItem()).getPath();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class GuiUtil {
|
||||||
if (outputs == null || outputs.isEmpty()) {
|
if (outputs == null || outputs.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
GenericStack out = outputs.get(0);
|
GenericStack out = outputs.getFirst();
|
||||||
long amount = out.amount();
|
long amount = out.amount();
|
||||||
long perUnit = out.what().getAmountPerUnit();
|
long perUnit = out.what().getAmountPerUnit();
|
||||||
if (amount <= 0 || perUnit <= 0) {
|
if (amount <= 0 || perUnit <= 0) {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class NumberFormatUtil {
|
||||||
private static String formatDecimal(double value, String suffix) {
|
private static String formatDecimal(double value, String suffix) {
|
||||||
// 对于接近整数的值,使用整数显示
|
// 对于接近整数的值,使用整数显示
|
||||||
if (Math.abs(value - Math.round(value)) < 0.001) {
|
if (Math.abs(value - Math.round(value)) < 0.001) {
|
||||||
return String.valueOf(Math.round(value)) + suffix;
|
return Math.round(value) + suffix;
|
||||||
} else {
|
} else {
|
||||||
// 使用一位小数显示,去掉末尾 .0
|
// 使用一位小数显示,去掉末尾 .0
|
||||||
String formatted = String.format("%.1f", value).replaceAll("\\.0$", "");
|
String formatted = String.format("%.1f", value).replaceAll("\\.0$", "");
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import appeng.api.stacks.AEKey;
|
||||||
import appeng.api.stacks.GenericStack;
|
import appeng.api.stacks.GenericStack;
|
||||||
import appeng.helpers.patternprovider.PatternProviderLogic;
|
import appeng.helpers.patternprovider.PatternProviderLogic;
|
||||||
import com.extendedae_plus.mixin.ae2.accessor.PatternProviderLogicAccessor;
|
import com.extendedae_plus.mixin.ae2.accessor.PatternProviderLogicAccessor;
|
||||||
import com.mojang.logging.LogUtils;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
@ -143,7 +142,7 @@ public class PatternProviderDataUtil {
|
||||||
if (outputs.isEmpty()) {
|
if (outputs.isEmpty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return outputs.get(0).getAmount();
|
return outputs.getFirst().getAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -250,7 +249,7 @@ public class PatternProviderDataUtil {
|
||||||
if (patternDetails != null) {
|
if (patternDetails != null) {
|
||||||
patternDataList.add(new PatternData(patternDetails, patternStack, i));
|
patternDataList.add(new PatternData(patternDetails, patternStack, i));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -570,7 +569,7 @@ public class PatternProviderDataUtil {
|
||||||
if (d != null && d.getDefinition().equals(targetDefinition)) {
|
if (d != null && d.getDefinition().equals(targetDefinition)) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -667,7 +666,6 @@ public class PatternProviderDataUtil {
|
||||||
if (!canScalePatternExtendedAEStyle(originalPattern, scaleFactor)) {
|
if (!canScalePatternExtendedAEStyle(originalPattern, scaleFactor)) {
|
||||||
errors.add("槽位 " + i + ": 样板数量无法按指定比例缩放");
|
errors.add("槽位 " + i + ": 样板数量无法按指定比例缩放");
|
||||||
failedPatterns++;
|
failedPatterns++;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -687,7 +685,7 @@ public class PatternProviderDataUtil {
|
||||||
try {
|
try {
|
||||||
// 解码原始样板
|
// 解码原始样板
|
||||||
IPatternDetails originalPattern = PatternDetailsHelper.decodePattern(patternStack, level);
|
IPatternDetails originalPattern = PatternDetailsHelper.decodePattern(patternStack, level);
|
||||||
if (originalPattern == null || !isPatternScalable(originalPattern)) {
|
if (!isPatternScalable(originalPattern)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ public class PatternProviderUIHelper {
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
Screen currentScreen = mc.screen;
|
Screen currentScreen = mc.screen;
|
||||||
|
|
||||||
if (currentScreen instanceof PatternProviderScreen patternScreen) {
|
if (currentScreen instanceof PatternProviderScreen<?> patternScreen) {
|
||||||
PatternProviderMenu menu = (PatternProviderMenu) patternScreen.getMenu();
|
PatternProviderMenu menu = patternScreen.getMenu();
|
||||||
|
|
||||||
// 通过反射安全地访问protected字段
|
// 通过反射安全地访问protected字段
|
||||||
try {
|
try {
|
||||||
|
|
@ -53,11 +53,11 @@ public class PatternProviderUIHelper {
|
||||||
*
|
*
|
||||||
* @return PatternProviderScreen对象,如果当前没有打开样板供应器界面则返回null
|
* @return PatternProviderScreen对象,如果当前没有打开样板供应器界面则返回null
|
||||||
*/
|
*/
|
||||||
public static PatternProviderScreen getCurrentPatternProviderScreen() {
|
public static PatternProviderScreen<?> getCurrentPatternProviderScreen() {
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
Screen currentScreen = mc.screen;
|
Screen currentScreen = mc.screen;
|
||||||
|
|
||||||
if (currentScreen instanceof PatternProviderScreen patternScreen) {
|
if (currentScreen instanceof PatternProviderScreen<?> patternScreen) {
|
||||||
return patternScreen;
|
return patternScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import appeng.api.stacks.AEKey;
|
||||||
import appeng.api.stacks.GenericStack;
|
import appeng.api.stacks.GenericStack;
|
||||||
import appeng.crafting.pattern.AEProcessingPattern;
|
import appeng.crafting.pattern.AEProcessingPattern;
|
||||||
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
import com.extendedae_plus.api.SmartDoublingAwarePattern;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.content.ScaledProcessingPattern;
|
import com.extendedae_plus.content.ScaledProcessingPattern;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -34,7 +34,7 @@ public final class PatternScaler {
|
||||||
int targetOutIndex = -1;
|
int targetOutIndex = -1;
|
||||||
for (int i = 0; i < baseOutputs.size(); i++) {
|
for (int i = 0; i < baseOutputs.size(); i++) {
|
||||||
var out = baseOutputs.get(i);
|
var out = baseOutputs.get(i);
|
||||||
if (out != null && target != null && out.what() != null && out.what().equals(target)) {
|
if (out != null && out.what() != null && out.what().equals(target)) {
|
||||||
targetOutIndex = i;
|
targetOutIndex = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -59,11 +59,11 @@ public final class PatternScaler {
|
||||||
long multiplier = 1L;
|
long multiplier = 1L;
|
||||||
if (requestedAmount > 0) {
|
if (requestedAmount > 0) {
|
||||||
long needed = requestedAmount / perOperationTarget + ((requestedAmount % perOperationTarget) == 0 ? 0 : 1);
|
long needed = requestedAmount / perOperationTarget + ((requestedAmount % perOperationTarget) == 0 ? 0 : 1);
|
||||||
multiplier = needed <= 1L ? 1L : needed;
|
multiplier = Math.max(needed, 1L);
|
||||||
}
|
}
|
||||||
// 应用配置的最大倍数上限(0 表示不限制)
|
// 应用配置的最大倍数上限(0 表示不限制)
|
||||||
try {
|
try {
|
||||||
int maxMul = ModConfig.SMART_SCALING_MAX_MULTIPLIER.get();
|
int maxMul = EAEPConfig.SMART_SCALING_MAX_MULTIPLIER.get();
|
||||||
if (maxMul > 0 && multiplier > maxMul) {
|
if (maxMul > 0 && multiplier > maxMul) {
|
||||||
multiplier = maxMul;
|
multiplier = maxMul;
|
||||||
}
|
}
|
||||||
|
|
@ -85,8 +85,7 @@ public final class PatternScaler {
|
||||||
|
|
||||||
// 构建压缩输出(List)
|
// 构建压缩输出(List)
|
||||||
List<GenericStack> scaledCondensedOutputs = new ArrayList<>(baseOutputs.size());
|
List<GenericStack> scaledCondensedOutputs = new ArrayList<>(baseOutputs.size());
|
||||||
for (int i = 0; i < baseOutputs.size(); i++) {
|
for (GenericStack out : baseOutputs) {
|
||||||
GenericStack out = baseOutputs.get(i);
|
|
||||||
if (out != null) {
|
if (out != null) {
|
||||||
scaledCondensedOutputs.add(new GenericStack(out.what(), out.amount() * multiplier));
|
scaledCondensedOutputs.add(new GenericStack(out.what(), out.amount() * multiplier));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -96,8 +95,7 @@ public final class PatternScaler {
|
||||||
|
|
||||||
// 构建稀疏表示(List,直接按 multiplier 放大)
|
// 构建稀疏表示(List,直接按 multiplier 放大)
|
||||||
List<GenericStack> scaledSparseInputs = new ArrayList<>(baseSparseInputs.size());
|
List<GenericStack> scaledSparseInputs = new ArrayList<>(baseSparseInputs.size());
|
||||||
for (int i = 0; i < baseSparseInputs.size(); i++) {
|
for (GenericStack in : baseSparseInputs) {
|
||||||
var in = baseSparseInputs.get(i);
|
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
scaledSparseInputs.add(new GenericStack(in.what(), in.amount() * multiplier));
|
scaledSparseInputs.add(new GenericStack(in.what(), in.amount() * multiplier));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -105,8 +103,7 @@ public final class PatternScaler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<GenericStack> scaledSparseOutputs = new ArrayList<>(baseSparseOutputs.size());
|
List<GenericStack> scaledSparseOutputs = new ArrayList<>(baseSparseOutputs.size());
|
||||||
for (int i = 0; i < baseSparseOutputs.size(); i++) {
|
for (GenericStack out : baseSparseOutputs) {
|
||||||
var out = baseSparseOutputs.get(i);
|
|
||||||
if (out != null) {
|
if (out != null) {
|
||||||
scaledSparseOutputs.add(new GenericStack(out.what(), out.amount() * multiplier));
|
scaledSparseOutputs.add(new GenericStack(out.what(), out.amount() * multiplier));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.extendedae_plus.util.entitySpeed;
|
||||||
|
|
||||||
import appeng.api.upgrades.IUpgradeInventory;
|
import appeng.api.upgrades.IUpgradeInventory;
|
||||||
import com.extendedae_plus.ae.definitions.upgrades.EntitySpeedCardItem;
|
import com.extendedae_plus.ae.definitions.upgrades.EntitySpeedCardItem;
|
||||||
import com.extendedae_plus.config.ModConfigs;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -63,7 +63,7 @@ public final class PowerUtils {
|
||||||
*/
|
*/
|
||||||
public static double computeFinalPowerForProduct(long product, int energyCardCount) {
|
public static double computeFinalPowerForProduct(long product, int energyCardCount) {
|
||||||
if (product <= 1L) return 0.0;
|
if (product <= 1L) return 0.0;
|
||||||
double base = ModConfigs.ENTITY_TICKER_COST.get();
|
double base = EAEPConfig.ENTITY_TICKER_COST.get();
|
||||||
double log2 = Math.log(product) / Math.log(2.0);
|
double log2 = Math.log(product) / Math.log(2.0);
|
||||||
double raw;
|
double raw;
|
||||||
if (product == 2L) {
|
if (product == 2L) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.extendedae_plus.wireless;
|
package com.extendedae_plus.wireless;
|
||||||
|
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
@ -63,7 +63,7 @@ public final class WirelessMasterRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean useGlobal() {
|
private static boolean useGlobal() {
|
||||||
return ModConfig.WIRELESS_CROSS_DIM_ENABLE.get();
|
return EAEPConfig.WIRELESS_CROSS_DIM_ENABLE.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
private record Key(ResourceKey<Level> dim, long freq) {
|
private record Key(ResourceKey<Level> dim, long freq) {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@ import appeng.api.networking.GridHelper;
|
||||||
import appeng.api.networking.IGridConnection;
|
import appeng.api.networking.IGridConnection;
|
||||||
import appeng.api.networking.IGridNode;
|
import appeng.api.networking.IGridNode;
|
||||||
import appeng.me.service.helpers.ConnectionWrapper;
|
import appeng.me.service.helpers.ConnectionWrapper;
|
||||||
import com.extendedae_plus.config.ModConfig;
|
import com.extendedae_plus.config.EAEPConfig;
|
||||||
import com.extendedae_plus.util.ExtendedAELogger;
|
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -13,7 +12,7 @@ import java.util.Objects;
|
||||||
/**
|
/**
|
||||||
* 从收发器连接器:
|
* 从收发器连接器:
|
||||||
* - 通过频率查找同维度主收发器;
|
* - 通过频率查找同维度主收发器;
|
||||||
* - 校验距离(<= ModConfigs.WIRELESS_MAX_RANGE);
|
* - 校验距离(<= EAEPConfig.WIRELESS_MAX_RANGE);
|
||||||
* - 动态创建/销毁 AE2 连接(GridConnection),实现“一主多从”。
|
* - 动态创建/销毁 AE2 连接(GridConnection),实现“一主多从”。
|
||||||
*/
|
*/
|
||||||
public class WirelessSlaveLink {
|
public class WirelessSlaveLink {
|
||||||
|
|
@ -66,12 +65,12 @@ public class WirelessSlaveLink {
|
||||||
shutdown = false;
|
shutdown = false;
|
||||||
distance = 0.0D;
|
distance = 0.0D;
|
||||||
|
|
||||||
boolean crossDim = ModConfig.WIRELESS_CROSS_DIM_ENABLE.get();
|
boolean crossDim = EAEPConfig.WIRELESS_CROSS_DIM_ENABLE.get();
|
||||||
if (master != null && !master.isEndpointRemoved() && (crossDim || master.getServerLevel() == level)) {
|
if (master != null && !master.isEndpointRemoved() && (crossDim || master.getServerLevel() == level)) {
|
||||||
if (!crossDim) {
|
if (!crossDim) {
|
||||||
distance = Math.sqrt(master.getBlockPos().distSqr(host.getBlockPos()));
|
distance = Math.sqrt(master.getBlockPos().distSqr(host.getBlockPos()));
|
||||||
}
|
}
|
||||||
double maxRange = ModConfig.WIRELESS_MAX_RANGE.get();
|
double maxRange = EAEPConfig.WIRELESS_MAX_RANGE.get();
|
||||||
if (crossDim || distance <= maxRange) {
|
if (crossDim || distance <= maxRange) {
|
||||||
// 保持/建立连接
|
// 保持/建立连接
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
"tooltip.extendedae_plus.infinity_biginteger_cell.summon2": "§b—§4A §dUni§cverse §eWith§ain §6A §bSin§5gle §9Point",
|
"tooltip.extendedae_plus.infinity_biginteger_cell.summon2": "§b—§4A §dUni§cverse §eWith§ain §6A §bSin§5gle §9Point",
|
||||||
"tooltip.extendedae_plus.entity_speed_card.multiplier": "Multiplier: %s",
|
"tooltip.extendedae_plus.entity_speed_card.multiplier": "Multiplier: %s",
|
||||||
"tooltip.extendedae_plus.entity_speed_card.max": "Maximum Effect: %s Times",
|
"tooltip.extendedae_plus.entity_speed_card.max": "Maximum Effect: %s Times",
|
||||||
|
"tooltip.extendedae_plus.encode_button.upload_pattern": "\n§a[Ctrl] §7Upload patterns",
|
||||||
|
|
||||||
"block.extendedae_plus.wireless_transceiver": "Wireless Transceiver",
|
"block.extendedae_plus.wireless_transceiver": "Wireless Transceiver",
|
||||||
"block.extendedae_plus.4x_crafting_accelerator": "4x Crafting Accelerator",
|
"block.extendedae_plus.4x_crafting_accelerator": "4x Crafting Accelerator",
|
||||||
|
|
@ -74,20 +75,17 @@
|
||||||
"extendedae_plus.tooltip.frequency": "Frequency: %d",
|
"extendedae_plus.tooltip.frequency": "Frequency: %d",
|
||||||
"extendedae_plus.tooltip.master_mode": "Mode: %s",
|
"extendedae_plus.tooltip.master_mode": "Mode: %s",
|
||||||
"extendedae_plus.tooltip.locked": "Lock Status: %s",
|
"extendedae_plus.tooltip.locked": "Lock Status: %s",
|
||||||
"tooltip.extendedae_plus.encode_button_description": "\n§a[Ctrl] §7Upload patterns",
|
|
||||||
|
|
||||||
"screen.extendedae_plus.title": "ExtendedAE Plus Configuration",
|
"screen.extendedae_plus.title": "ExtendedAE Plus Configuration",
|
||||||
"config.extendedae_plus": "ExtendedAE Plus",
|
"config.extendedae_plus": "ExtendedAE Plus",
|
||||||
|
|
||||||
"extendedae_plus.configuration.common": "Common Configuration",
|
|
||||||
"extendedae_plus.configuration.pageMultiplier": "Pattern Provider Slot Multiplier",
|
"extendedae_plus.configuration.pageMultiplier": "Pattern Provider Slot Multiplier",
|
||||||
"extendedae_plus.configuration.pageMultiplier_with_range": "Pattern Provider Slot Multiplier (1-64)",
|
"extendedae_plus.configuration.pageMultiplier_with_range": "Pattern Provider Slot Multiplier (1-64)",
|
||||||
"extendedae_plus.configuration.override_ae2wt_picking": "Override AE2WT Picking",
|
"extendedae_plus.configuration.overrideAE2WTPicking": "Override AE2WT Picking",
|
||||||
|
|
||||||
"extendedae_plus.configuration.client": "Display Configuration",
|
|
||||||
"extendedae_plus.configuration.showEncoderPatternPlayer": "Show Pattern Encoder Player",
|
"extendedae_plus.configuration.showEncoderPatternPlayer": "Show Pattern Encoder Player",
|
||||||
"extendedae_plus.configuration.patternTerminalShowSlotsDefault": "Pattern Terminal Show Slots by Default",
|
"extendedae_plus.configuration.patternTerminalShowSlotsDefault": "Pattern Terminal Show Slots by Default",
|
||||||
"extendedae_plus.configuration.independence_uploading_button": "Independence Upload Button",
|
"extendedae_plus.configuration.independentUploadingButton": "Independent Upload Button",
|
||||||
|
|
||||||
|
|
||||||
"extendedae_plus.configuration.ae": "AE2 Configuration",
|
"extendedae_plus.configuration.ae": "AE2 Configuration",
|
||||||
|
|
@ -105,6 +103,7 @@
|
||||||
"extendedae_plus.configuration.entityTickerBlackList": "Entity Ticker Blacklist",
|
"extendedae_plus.configuration.entityTickerBlackList": "Entity Ticker Blacklist",
|
||||||
"extendedae_plus.configuration.entityTickerMultipliers": "Entity Ticker Extra Cost Multipliers",
|
"extendedae_plus.configuration.entityTickerMultipliers": "Entity Ticker Extra Cost Multipliers",
|
||||||
"extendedae_plus.configuration.prioritizeDiskEnergy": "Prioritize FE energy from disk (requires Applied Flux)",
|
"extendedae_plus.configuration.prioritizeDiskEnergy": "Prioritize FE energy from disk (requires Applied Flux)",
|
||||||
|
"extendedae_plus.configuration.needsUploadingCore": "Needs Upload Core",
|
||||||
|
|
||||||
"extendedae_plus.configuration.state_on": "On",
|
"extendedae_plus.configuration.state_on": "On",
|
||||||
"extendedae_plus.configuration.state_off": "Off"
|
"extendedae_plus.configuration.state_off": "Off"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
"tooltip.extendedae_plus.infinity_biginteger_cell.summon2": "§b——§4方§d寸§c之§e间§a, §6自§b有§5千§9寰",
|
"tooltip.extendedae_plus.infinity_biginteger_cell.summon2": "§b——§4方§d寸§c之§e间§a, §6自§b有§5千§9寰",
|
||||||
"tooltip.extendedae_plus.entity_speed_card.multiplier": "乘数: %s",
|
"tooltip.extendedae_plus.entity_speed_card.multiplier": "乘数: %s",
|
||||||
"tooltip.extendedae_plus.entity_speed_card.max": "最大生效: %s 倍",
|
"tooltip.extendedae_plus.entity_speed_card.max": "最大生效: %s 倍",
|
||||||
"tooltip.extendedae_plus.encode_button_description": "\n§a[Ctrl] §7上传样板",
|
"tooltip.extendedae_plus.encode_button.upload_pattern": "\n§a[Ctrl] §7上传样板",
|
||||||
|
|
||||||
"block.extendedae_plus.wireless_transceiver": "无线收发器",
|
"block.extendedae_plus.wireless_transceiver": "无线收发器",
|
||||||
"block.extendedae_plus.4x_crafting_accelerator": "4x并行处理单元",
|
"block.extendedae_plus.4x_crafting_accelerator": "4x并行处理单元",
|
||||||
|
|
@ -79,15 +79,13 @@
|
||||||
"screen.extendedae_plus.title": "ExtendedAE Plus 配置",
|
"screen.extendedae_plus.title": "ExtendedAE Plus 配置",
|
||||||
"config.extendedae_plus": "ExtendedAE Plus",
|
"config.extendedae_plus": "ExtendedAE Plus",
|
||||||
|
|
||||||
"extendedae_plus.configuration.common": "通用配置",
|
|
||||||
"extendedae_plus.configuration.pageMultiplier": "扩展样板供应器槽位倍率",
|
"extendedae_plus.configuration.pageMultiplier": "扩展样板供应器槽位倍率",
|
||||||
"extendedae_plus.configuration.pageMultiplier_with_range": "扩展样板供应器槽位倍率 (1-64)",
|
"extendedae_plus.configuration.pageMultiplier_with_range": "扩展样板供应器槽位倍率 (1-64)",
|
||||||
"extendedae_plus.configuration.override_ae2wt_picking": "覆盖AE2WT选取",
|
"extendedae_plus.configuration.overrideAE2WTPicking": "覆盖AE2WT选取",
|
||||||
|
|
||||||
"extendedae_plus.configuration.client": "显示配置",
|
|
||||||
"extendedae_plus.configuration.showEncoderPatternPlayer": "显示样板编码玩家",
|
"extendedae_plus.configuration.showEncoderPatternPlayer": "显示样板编码玩家",
|
||||||
"extendedae_plus.configuration.patternTerminalShowSlotsDefault": "样板终端默认显示槽位",
|
"extendedae_plus.configuration.patternTerminalShowSlotsDefault": "样板终端默认显示槽位",
|
||||||
"extendedae_plus.configuration.independence_uploading_button": "独立上传按钮",
|
"extendedae_plus.configuration.independentUploadingButton": "独立上传按钮",
|
||||||
|
|
||||||
"extendedae_plus.configuration.ae": "AE2配置",
|
"extendedae_plus.configuration.ae": "AE2配置",
|
||||||
"extendedae_plus.configuration.craftingPauseThreshold": "AE合成计算暂停检查阈值",
|
"extendedae_plus.configuration.craftingPauseThreshold": "AE合成计算暂停检查阈值",
|
||||||
|
|
@ -104,6 +102,7 @@
|
||||||
"extendedae_plus.configuration.entityTickerBlackList": "实体加速器黑名单",
|
"extendedae_plus.configuration.entityTickerBlackList": "实体加速器黑名单",
|
||||||
"extendedae_plus.configuration.entityTickerMultipliers": "实体加速器额外消耗倍率",
|
"extendedae_plus.configuration.entityTickerMultipliers": "实体加速器额外消耗倍率",
|
||||||
"extendedae_plus.configuration.prioritizeDiskEnergy": "优先从磁盘提取FE能量(仅当Applied Flux模组存在时生效)",
|
"extendedae_plus.configuration.prioritizeDiskEnergy": "优先从磁盘提取FE能量(仅当Applied Flux模组存在时生效)",
|
||||||
|
"extendedae_plus.configuration.needsUploadingCore": "需要装配矩阵上传核心",
|
||||||
|
|
||||||
"extendedae_plus.configuration.state_on": "开",
|
"extendedae_plus.configuration.state_on": "开",
|
||||||
"extendedae_plus.configuration.state_off": "关"
|
"extendedae_plus.configuration.state_off": "关"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user