mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-17 02:45:29 +00:00
Allow bigger stack sizes to be dragged into pattern terminals (#39)
* update bs+deps * allow bigger stack sizes to be dragged into pattern terminals
This commit is contained in:
1 parent
4a166fe069
commit
fcf9e34846
6 files changed
+31
-28
No files matched your search
@@ -204,14 +204,13 @@ public class GuiEventHandler implements INEIGuiHandler {
|
||||
if (button == 0) {
|
||||
boolean areStackEqual = slotStack != null && slotStack.isItemEqual(copyStack)
|
||||
&& ItemStack.areItemStackTagsEqual(slotStack, copyStack);
|
||||
copyStack.stackSize = areStackEqual ? Math.min(slotStack.stackSize + copySize, 127)
|
||||
: Math.min(copySize, 127);
|
||||
copyStack.stackSize = areStackEqual ? slotStack.stackSize + copySize : copySize;
|
||||
sendPacket = true;
|
||||
} else if (button == 1) {
|
||||
boolean areStackEqual = slotStack != null && slotStack.isItemEqual(copyStack)
|
||||
&& ItemStack.areItemStackTagsEqual(slotStack, copyStack);
|
||||
if (areStackEqual) {
|
||||
copyStack.stackSize = Math.min(slotStack.stackSize + 1, 127);
|
||||
copyStack.stackSize = slotStack.stackSize;
|
||||
} else {
|
||||
copyStack.stackSize = slotStack == null ? 1 : copySize;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ import java.util.List;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import com.github.vfyjxf.nee.utils.ItemUtils;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
@@ -38,7 +41,7 @@ public class PacketSlotStackChange implements IMessage {
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
this.stack = ByteBufUtils.readItemStack(buf);
|
||||
this.stack = ItemUtils.loadItemStackFromNBT(ByteBufUtils.readTag(buf));
|
||||
int craftingSlotsSize = buf.readInt();
|
||||
this.craftingSlots = new ArrayList<>(craftingSlotsSize);
|
||||
for (int i = 0; i < craftingSlotsSize; i++) {
|
||||
@@ -49,7 +52,7 @@ public class PacketSlotStackChange implements IMessage {
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
ByteBufUtils.writeItemStack(buf, this.stack);
|
||||
ByteBufUtils.writeTag(buf, ItemUtils.writeItemStackToNBT(this.stack, new NBTTagCompound()));
|
||||
buf.writeInt(this.craftingSlots.size());
|
||||
for (Integer craftingSlot : this.craftingSlots) {
|
||||
buf.writeInt(craftingSlot);
|
||||
|
||||
Reference in new issue
Block a user