mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 01:54:59 +00:00
Fix intercept dnd click from GT5 hook for AppEngGuiHandler
keyword `net.bdew.neiaddons.appeng.AppEngGuiHandler`
This commit is contained in:
2 files changed
+44
-11
No files matched your search
@@ -263,6 +263,19 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
}
|
||||
}
|
||||
this.input = null;
|
||||
for (int i = 0; i < this.cont.getRequestSlots().length; i++) {
|
||||
SlotFluidConvertingFake slot = this.cont.getRequestSlots()[i];
|
||||
ItemStack currentStack = this.cont.getPlayerInv().getItemStack();
|
||||
if (getSlotArea(slot).contains(xCoord, yCoord) && currentStack != null) {
|
||||
ItemStack itemStack = createLevelValues(currentStack.copy());
|
||||
itemStack.getTagCompound().setInteger(TLMTags.Index.tagName, i);
|
||||
slot.putStack(itemStack);
|
||||
NetworkHandler.instance.sendToServer(new PacketNEIDragClick(itemStack, slot.getSlotIndex()));
|
||||
this.updateAmount(slot.getSlotIndex(), itemStack.stackSize);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
@@ -354,17 +367,6 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
|
||||
@Override
|
||||
public boolean handleDragNDrop(GuiContainer gui, int mouseX, int mouseY, ItemStack draggedStack, int button) {
|
||||
for (int i = 0; i < this.cont.getRequestSlots().length; i++) {
|
||||
SlotFluidConvertingFake slot = this.cont.getRequestSlots()[i];
|
||||
if (getSlotArea(slot).contains(mouseX, mouseY)) {
|
||||
ItemStack itemStack = createLevelValues(draggedStack.copy());
|
||||
itemStack.getTagCompound().setInteger(TLMTags.Index.tagName, i);
|
||||
slot.putStack(itemStack);
|
||||
NetworkHandler.instance.sendToServer(new PacketNEIDragClick(itemStack, slot.getSlotIndex()));
|
||||
this.updateAmount(slot.getSlotIndex(), itemStack.stackSize);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (draggedStack != null) {
|
||||
draggedStack.stackSize = 0;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.glodblock.github.client.gui.GuiLevelTerminal;
|
||||
|
||||
@@ -307,6 +308,28 @@ public class SPacketLevelTerminalUpdate implements IMessage {
|
||||
int payloadSize = buf.readInt();
|
||||
try (ByteBufInputStream stream = new ByteBufInputStream(buf, payloadSize)) {
|
||||
NBTTagCompound payload = CompressedStreamTools.readCompressed(stream);
|
||||
int available = stream.available();
|
||||
if (available > 0) {
|
||||
byte[] left = new byte[available];
|
||||
int read = stream.read(left);
|
||||
if (AEConfig.instance.isFeatureEnabled(AEFeature.PacketLogging)) {
|
||||
AELog.info(
|
||||
"Unread bytes detected (" + read
|
||||
+ "): "
|
||||
+ Arrays.toString(left)
|
||||
+ " at "
|
||||
+ dim
|
||||
+ "#("
|
||||
+ x
|
||||
+ ":"
|
||||
+ y
|
||||
+ ":"
|
||||
+ z
|
||||
+ ")@"
|
||||
+ ForgeDirection.getOrientation(side));
|
||||
}
|
||||
}
|
||||
|
||||
if (payload.hasKey("self", NBT.TAG_COMPOUND)) {
|
||||
this.selfItemStack = ItemStack.loadItemStackFromNBT(payload.getCompoundTag("self"));
|
||||
}
|
||||
@@ -494,6 +517,14 @@ public class SPacketLevelTerminalUpdate implements IMessage {
|
||||
int payloadSize = buf.readInt();
|
||||
try (ByteBufInputStream stream = new ByteBufInputStream(buf, payloadSize)) {
|
||||
this.items = CompressedStreamTools.readCompressed(stream).getTagList("data", NBT.TAG_COMPOUND);
|
||||
int available = stream.available();
|
||||
if (available > 0) {
|
||||
byte[] left = new byte[available];
|
||||
int read = stream.read(left);
|
||||
if (AEConfig.instance.isFeatureEnabled(AEFeature.PacketLogging)) {
|
||||
AELog.info("Unread bytes detected (" + read + "): " + Arrays.toString(left));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user