Skip to content

Commit ec4ee58

Browse files
author
Circulate233
committed
修复一些问题,可能?
1 parent b9ec78d commit ec4ee58

7 files changed

Lines changed: 55 additions & 26 deletions

File tree

src/main/java/com/glodblock/github/coremod/CoreModHooks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public static InventoryCrafting wrapCraftingBuffer(final InventoryCrafting inv)
7676
}
7777

7878
public static InventoryCrafting wrapCraftingBuffer(final Container container, final int width, final int height) {
79+
final int s = width > 3 ? 10 : 3;
7980
return new FluidConvertingInventoryCrafting(container, width, height);
8081
}
8182

src/main/java/com/glodblock/github/coremod/mixin/ae2/MixinCraftingCPUCluster.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.spongepowered.asm.mixin.injection.At;
2929
import org.spongepowered.asm.mixin.injection.Redirect;
3030

31+
@SuppressWarnings({"rawtypes", "unchecked"})
3132
@Mixin(value = CraftingCPUCluster.class, remap = false)
3233
public abstract class MixinCraftingCPUCluster {
3334

src/main/java/com/glodblock/github/coremod/mixin/ae2/gui/MixinGuiCellWorkbench.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@
88
import appeng.items.storage.ItemViewCell;
99
import appeng.tile.misc.TileCellWorkbench;
1010
import appeng.util.item.AEItemStack;
11-
import com.glodblock.github.integration.jei.FluidPacketTarget;
1211
import com.glodblock.github.util.ModAndClassUtil;
1312
import com.glodblock.github.util.UtilClient;
14-
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
15-
import mezz.jei.api.gui.IGhostIngredientHandler;
1613
import net.minecraft.entity.player.InventoryPlayer;
17-
import net.minecraft.inventory.Slot;
1814
import org.spongepowered.asm.mixin.Final;
1915
import org.spongepowered.asm.mixin.Intrinsic;
2016
import org.spongepowered.asm.mixin.Mixin;
2117
import org.spongepowered.asm.mixin.Shadow;
2218

23-
import java.util.List;
24-
2519
@Mixin(value = GuiCellWorkbench.class, remap = false)
2620
public abstract class MixinGuiCellWorkbench extends GuiUpgradeable {
2721

@@ -47,18 +41,4 @@ protected void renderHoveredToolTip(final int mouseX, final int mouseY) {
4741
super.renderHoveredToolTip(mouseX, mouseY);
4842
}
4943

50-
@Intrinsic
51-
public List<IGhostIngredientHandler.Target<?>> getPhantomTargets(final Object ingredient) {
52-
if (((TileCellWorkbench) this.workbench.getTileEntity()).getCell() instanceof ItemViewCell) {
53-
final List<IGhostIngredientHandler.Target<?>> targets = new ObjectArrayList<>();
54-
for (final Slot slot : this.inventorySlots.inventorySlots) {
55-
if (slot instanceof SlotFake) {
56-
final IGhostIngredientHandler.Target<?> target = new FluidPacketTarget(getGuiLeft(), getGuiTop(), slot);
57-
targets.add(target);
58-
mapTargetSlot.putIfAbsent(target, slot);
59-
}
60-
}
61-
return targets;
62-
} else return super.getPhantomTargets(ingredient);
63-
}
6444
}

src/main/java/com/glodblock/github/coremod/mixin/ae2/gui/MixinGuiMEMonitorable.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ protected void handleMouseClick(final Slot slot, final int slotIdx, final int mo
7878
if (s.getAEStack() != null) {
7979
if (s.getAEStack().getItem() == FCItems.FLUID_DROP
8080
|| (ModAndClassUtil.GAS && s.getAEStack().getItem() == FCGasItems.GAS_DROP)) {
81-
if (mouseButton != 2
82-
&& !(mouseButton == 0
83-
&& (s.getAEStack().getStackSize() == 0 || isAltKeyDown()))
84-
) {
81+
if (mouseButton != 2 && (!s.getAEStack().isCraftable()
82+
|| !(mouseButton == 0 && (s.getAEStack().getStackSize() == 0 || isAltKeyDown())))) {
8583
if (s.getAEStack().getItem() == FCItems.FLUID_DROP) {
8684
final var shift = s.getAEStack().getDefinition().writeToNBT(new NBTTagCompound());
8785
shift.setBoolean("shift", isShiftKeyDown());
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.glodblock.github.coremod.mixin.jei;
2+
3+
import appeng.api.implementations.IUpgradeableHost;
4+
import appeng.client.gui.implementations.GuiCellWorkbench;
5+
import appeng.client.gui.implementations.GuiUpgradeable;
6+
import appeng.container.implementations.ContainerCellWorkbench;
7+
import appeng.container.slot.SlotFake;
8+
import appeng.items.storage.ItemViewCell;
9+
import appeng.tile.misc.TileCellWorkbench;
10+
import com.glodblock.github.integration.jei.FluidPacketTarget;
11+
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
12+
import mezz.jei.api.gui.IGhostIngredientHandler;
13+
import net.minecraft.entity.player.InventoryPlayer;
14+
import net.minecraft.inventory.Slot;
15+
import org.spongepowered.asm.mixin.Final;
16+
import org.spongepowered.asm.mixin.Intrinsic;
17+
import org.spongepowered.asm.mixin.Mixin;
18+
import org.spongepowered.asm.mixin.Shadow;
19+
20+
import java.util.List;
21+
22+
@Mixin(value = GuiCellWorkbench.class, remap = false)
23+
public abstract class MixinGuiCellWorkbench extends GuiUpgradeable {
24+
25+
@Shadow
26+
@Final
27+
private ContainerCellWorkbench workbench;
28+
29+
public MixinGuiCellWorkbench(InventoryPlayer inventoryPlayer, IUpgradeableHost te) {
30+
super(inventoryPlayer, te);
31+
}
32+
33+
@Intrinsic
34+
public List<IGhostIngredientHandler.Target<?>> getPhantomTargets(final Object ingredient) {
35+
if (((TileCellWorkbench) this.workbench.getTileEntity()).getCell() instanceof ItemViewCell) {
36+
final List<IGhostIngredientHandler.Target<?>> targets = new ObjectArrayList<>();
37+
for (final Slot slot : this.inventorySlots.inventorySlots) {
38+
if (slot instanceof SlotFake) {
39+
final IGhostIngredientHandler.Target<?> target = new FluidPacketTarget(getGuiLeft(), getGuiTop(), slot);
40+
targets.add(target);
41+
mapTargetSlot.putIfAbsent(target, slot);
42+
}
43+
}
44+
return targets;
45+
} else return super.getPhantomTargets(ingredient);
46+
}
47+
}

src/main/java/com/glodblock/github/coremod/mixin/thaumicenergistics/MixinGuiArcaneTerminal.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ protected void renderHoveredToolTip(final int mouseX, final int mouseY) {
8989
if (s.getAEStack() instanceof final IAEItemStack stack) {
9090
if (stack.getItem() == FCItems.FLUID_DROP
9191
|| (ModAndClassUtil.GAS && stack.getItem() == FCGasItems.GAS_DROP)) {
92-
if (mouseButton != 2 && !(mouseButton == 0 && stack.getStackSize() == 0)) {
92+
if (mouseButton != 2 && (!stack.isCraftable()
93+
|| !(mouseButton == 0 && (stack.getStackSize() == 0 || isAltKeyDown())))) {
9394
if (stack.getItem() == FCItems.FLUID_DROP) {
9495
final var shift = stack.getDefinition().writeToNBT(new NBTTagCompound());
9596
shift.setBoolean("shift", isShiftKeyDown());
@@ -105,7 +106,7 @@ protected void renderHoveredToolTip(final int mouseX, final int mouseY) {
105106

106107
@Unique
107108
@Optional.Method(modid = "mekeng")
108-
protected boolean mek$handleMouseClick(final SlotME s, final ItemStack h, final CallbackInfo ci) {
109+
protected boolean mek$handleMouseClick(final SlotME<?> s, final ItemStack h, final CallbackInfo ci) {
109110
final boolean g;
110111
if (s.getAEStack() != null) {
111112
if (s.getAEStack() instanceof final IAEItemStack stack) {

src/main/resources/mixins.ae2fc.jei.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"AccessorGhostIngredientDragManager",
1010
"AccessorIngredientListOverlay",
1111
"AccessorInputHandler",
12+
"MixinGuiCellWorkbench",
1213
"MixinGuiContainerWrapper",
1314
"MixinGuiScreenHelper"
1415
]

0 commit comments

Comments
 (0)