Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
24d8a465a4
|
|
@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||||
loom.platform = forge
|
loom.platform = forge
|
||||||
|
|
||||||
# Mod properties
|
# Mod properties
|
||||||
mod_version = 1.5.0
|
mod_version = 1.5.0-fix
|
||||||
maven_group = com.extendedae_plus
|
maven_group = com.extendedae_plus
|
||||||
archives_name = extendedae_plus
|
archives_name = extendedae_plus
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,8 @@ public abstract class ContainerPatternEncodingTermMenuMixin implements IActionHo
|
||||||
if (!(this.epp$player instanceof ServerPlayer sp)) {
|
if (!(this.epp$player instanceof ServerPlayer sp)) {
|
||||||
return; // 仅服务器执行
|
return; // 仅服务器执行
|
||||||
}
|
}
|
||||||
if (!this.eap$consumeShiftUploadFlag()) {
|
if (this.eap$consumeShiftUploadFlag()) {
|
||||||
return; // 未按下 Shift,不自动上传
|
return; // 按下 Shift,不自动上传
|
||||||
}
|
}
|
||||||
var menu = (PatternEncodingTermMenu) (Object) this;
|
var menu = (PatternEncodingTermMenu) (Object) this;
|
||||||
if (menu.getMode() != EncodingMode.CRAFTING
|
if (menu.getMode() != EncodingMode.CRAFTING
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import appeng.crafting.pattern.AESmithingTablePattern;
|
||||||
import appeng.crafting.pattern.AEStonecuttingPattern;
|
import appeng.crafting.pattern.AEStonecuttingPattern;
|
||||||
import appeng.menu.me.items.PatternEncodingTermMenu;
|
import appeng.menu.me.items.PatternEncodingTermMenu;
|
||||||
import appeng.menu.slot.RestrictedInputSlot;
|
import appeng.menu.slot.RestrictedInputSlot;
|
||||||
|
import com.extendedae_plus.content.matrix.PatternCorePlusBlockEntity;
|
||||||
import com.extendedae_plus.content.matrix.UploadCoreBlockEntity;
|
import com.extendedae_plus.content.matrix.UploadCoreBlockEntity;
|
||||||
import com.extendedae_plus.mixin.ae2.accessor.PatternEncodingTermMenuAccessor;
|
import com.extendedae_plus.mixin.ae2.accessor.PatternEncodingTermMenuAccessor;
|
||||||
import com.glodblock.github.extendedae.common.me.matrix.ClusterAssemblerMatrix;
|
import com.glodblock.github.extendedae.common.me.matrix.ClusterAssemblerMatrix;
|
||||||
|
|
@ -97,6 +98,8 @@ public final class MatrixUploadUtil {
|
||||||
try {
|
try {
|
||||||
// 获取网络中所有 Pattern Tile
|
// 获取网络中所有 Pattern Tile
|
||||||
Set<TileAssemblerMatrixPattern> allTiles = grid.getMachines(TileAssemblerMatrixPattern.class);
|
Set<TileAssemblerMatrixPattern> allTiles = grid.getMachines(TileAssemblerMatrixPattern.class);
|
||||||
|
Set<PatternCorePlusBlockEntity> myAllTiles = grid.getMachines(PatternCorePlusBlockEntity.class);
|
||||||
|
|
||||||
// 用 Set 记录已经扫描过的集群,避免重复调用 clusterHasSingleUploadCore
|
// 用 Set 记录已经扫描过的集群,避免重复调用 clusterHasSingleUploadCore
|
||||||
Set<ClusterAssemblerMatrix> scannedClusters = new HashSet<>();
|
Set<ClusterAssemblerMatrix> scannedClusters = new HashSet<>();
|
||||||
|
|
||||||
|
|
@ -116,6 +119,24 @@ public final class MatrixUploadUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (PatternCorePlusBlockEntity myTile : myAllTiles) {
|
||||||
|
if (myTile == null || !myTile.isFormed() || !myTile.getMainNode().isActive()) continue;
|
||||||
|
|
||||||
|
ClusterAssemblerMatrix cluster = myTile.getCluster();
|
||||||
|
if (cluster == null) continue;
|
||||||
|
|
||||||
|
// 如果该集群已经扫描过,或者该集群含 UploadCore,则处理 tile
|
||||||
|
if (scannedClusters.contains(cluster) || clusterHasSingleUploadCore(cluster)) {
|
||||||
|
scannedClusters.add(cluster); // 标记为已扫描
|
||||||
|
|
||||||
|
InternalInventory inv = myTile.getExposedInventory();
|
||||||
|
if (inv != null) {
|
||||||
|
result.add(inv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Throwable ignored) {}
|
} catch (Throwable ignored) {}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -126,9 +147,17 @@ public final class MatrixUploadUtil {
|
||||||
private static boolean matrixContainsPattern(@NotNull List<InternalInventory> inventories, @NotNull ItemStack pattern) {
|
private static boolean matrixContainsPattern(@NotNull List<InternalInventory> inventories, @NotNull ItemStack pattern) {
|
||||||
for (InternalInventory inv : inventories) {
|
for (InternalInventory inv : inventories) {
|
||||||
if (inv == null) continue;
|
if (inv == null) continue;
|
||||||
|
ItemStack patternCopy = pattern.copy();
|
||||||
|
if (patternCopy.getTag() != null) {
|
||||||
|
patternCopy.getTag().remove("encodePlayer");
|
||||||
|
}
|
||||||
for (int i = 0; i < inv.size(); i++) {
|
for (int i = 0; i < inv.size(); i++) {
|
||||||
ItemStack s = inv.getStackInSlot(i);
|
ItemStack s = inv.getStackInSlot(i);
|
||||||
if (!s.isEmpty() && ItemStack.isSameItemSameTags(s, pattern)) {
|
ItemStack sCopy = s.copy();
|
||||||
|
if (sCopy.getTag() != null) {
|
||||||
|
sCopy.getTag().remove("encodePlayer");
|
||||||
|
}
|
||||||
|
if (!s.isEmpty() && ItemStack.isSameItemSameTags(sCopy, patternCopy)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user