Skip to content

Commit 8f226fa

Browse files
committed
一些问题的预防
1 parent 2f0d139 commit 8f226fa

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ show_testing_output = false
1515

1616
# Mod Information
1717
# HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/
18-
mod_version = 2.7.0-unofficial
18+
mod_version = 2.7.1-unofficial
1919
root_package = com.glodblock.github
2020
mod_id = ae2fc
2121
mod_name = AE2FluidCraft-Rework-Unofficial

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class MixinAEBaseGui {
1414

1515
@WrapOperation(method = "handleMouseClick", at = @At(value = "NEW", target = "(Lappeng/helpers/InventoryAction;IJ)Lappeng/core/sync/packets/PacketInventoryAction;", ordinal = 0, remap = false))
1616
protected PacketInventoryAction handleMouseClick(InventoryAction action, int slot, long id, Operation<PacketInventoryAction> original) {
17-
var newid = (long) Mouse.getEventButton();
17+
long newid = Mouse.getEventButton();
1818
if (newid == -1) {
1919
newid = Mouse.isButtonDown(0) ? 0 : 1;
2020
}
@@ -23,7 +23,7 @@ protected PacketInventoryAction handleMouseClick(InventoryAction action, int slo
2323

2424
@WrapOperation(method = "mouseClickMove", at = @At(value = "NEW", target = "(Lappeng/helpers/InventoryAction;IJ)Lappeng/core/sync/packets/PacketInventoryAction;", ordinal = 0, remap = false))
2525
protected PacketInventoryAction mouseClickMove(InventoryAction action, int slot, long id, Operation<PacketInventoryAction> original) {
26-
var newid = (long) Mouse.getEventButton();
26+
long newid = Mouse.getEventButton();
2727
if (newid == -1) {
2828
newid = Mouse.isButtonDown(0) ? 0 : 1;
2929
}

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,18 @@ protected void handleMouseClick(Slot slot, int slotIdx, int mouseButton, ClickTy
7878
if (s.getAEStack() != null) {
7979
if (s.getAEStack().getItem() == FCItems.FLUID_DROP
8080
|| (ModAndClassUtil.GAS && s.getAEStack().getItem() == FCGasItems.GAS_DROP)) {
81-
if (s.getAEStack().getItem() == FCItems.FLUID_DROP) {
82-
var shift = s.getAEStack().getDefinition().writeToNBT(new NBTTagCompound());
83-
shift.setBoolean("shift", isShiftKeyDown());
84-
FluidCraft.proxy.netHandler.sendToServer(new CpacketMEMonitorableAction
85-
(CpacketMEMonitorableAction.FLUID_OPERATE, shift));
81+
if (mouseButton != 2
82+
&& !(mouseButton == 0
83+
&& (s.getAEStack().getStackSize() == 0 || isAltKeyDown()))
84+
) {
85+
if (s.getAEStack().getItem() == FCItems.FLUID_DROP) {
86+
var shift = s.getAEStack().getDefinition().writeToNBT(new NBTTagCompound());
87+
shift.setBoolean("shift", isShiftKeyDown());
88+
FluidCraft.proxy.netHandler.sendToServer(new CpacketMEMonitorableAction
89+
(CpacketMEMonitorableAction.FLUID_OPERATE, shift));
90+
}
91+
return;
8692
}
87-
return;
8893
}
8994
}
9095
}

0 commit comments

Comments
 (0)