@@ -89,9 +89,9 @@ public IMessage onMessage(final CpacketMEMonitorableAction message, final Messag
8989 final ItemStack ch = h .copy ();
9090 ch .setCount (1 );
9191 if (message .type == FLUID ) {
92- player .server .addScheduledTask (() -> fluidWork (message , ch , grid , source , h , player ));
92+ player .server .addScheduledTask (() -> fluidWork (message , ch , grid , source , player ));
9393 } else if (ModAndClassUtil .GAS && message .type == GAS && h .getItem () instanceof final IGasItem ig ) {
94- player .server .addScheduledTask (() -> gasWork (message , ig , ch , grid , source , h , player ));
94+ player .server .addScheduledTask (() -> gasWork (message , ig , ch , grid , source , player ));
9595 }
9696 } else {
9797 if (message .type == FLUID_OPERATE ) {
@@ -105,6 +105,7 @@ private static void fluidOperateWork(final CpacketMEMonitorableAction message, f
105105 if (bucket == null ) {
106106 bucket = AEItemStack .fromItemStack (new ItemStack (Items .BUCKET ));
107107 }
108+ if (!player .inventory .getItemStack ().isEmpty ()) return ;
108109 final FluidStack fluid ;
109110 if (!message .obj .isEmpty ()) {
110111 final var i = new ItemStack (message .obj );
@@ -136,7 +137,9 @@ private static void fluidOperateWork(final CpacketMEMonitorableAction message, f
136137 fluidStorage .extractItems (aeFluid , Actionable .MODULATE , source );
137138 }
138139
139- private static void fluidWork (final CpacketMEMonitorableAction message , final ItemStack ch , final IStorageGrid grid , final IActionSource source , final ItemStack h , final EntityPlayerMP player ) {
140+ private static void fluidWork (final CpacketMEMonitorableAction message , final ItemStack ch , final IStorageGrid grid , final IActionSource source , final EntityPlayerMP player ) {
141+ final var h = player .inventory .getItemStack ();
142+ if (!ItemStack .areItemsEqual (ch , h ) || !ItemStack .areItemStackTagsEqual (ch , h ) || h .isEmpty ()) return ;
140143 boolean drain = false ;
141144 final IFluidHandlerItem fh = FluidUtil .getFluidHandler (ch );
142145 if (fh == null ) return ;
@@ -178,7 +181,9 @@ private static void fluidWork(final CpacketMEMonitorableAction message, final It
178181
179182 @ Unique
180183 @ Optional .Method (modid = "mekeng" )
181- private static void gasWork (final CpacketMEMonitorableAction message , final IGasItem ig , final ItemStack ch , final IStorageGrid grid , final IActionSource source , final ItemStack h , final EntityPlayerMP player ) {
184+ private static void gasWork (final CpacketMEMonitorableAction message , final IGasItem ig , final ItemStack ch , final IStorageGrid grid , final IActionSource source , final EntityPlayerMP player ) {
185+ final var h = player .inventory .getItemStack ();
186+ if (!ItemStack .areItemsEqual (ch , h ) || !ItemStack .areItemStackTagsEqual (ch , h ) || h .isEmpty ()) return ;
182187 boolean drain = false ;
183188 final var allGas = ig .getGas (ch );
184189 final var allAmount = allGas == null ? 0 : allGas .amount ;
0 commit comments