Check hash here

This commit is contained in:
Raoul Van den Berge
2016-11-30 17:43:10 +01:00
parent d64966f2a3
commit 949218ce94
2 changed files with 2 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ public final class RSUtils {
buf.writeInt(Item.getIdFromItem(stack.getItem())); buf.writeInt(Item.getIdFromItem(stack.getItem()));
buf.writeInt(stack.getCount()); buf.writeInt(stack.getCount());
buf.writeInt(stack.getItemDamage()); buf.writeInt(stack.getItemDamage());
ByteBufUtils.writeTag(buf, stack.getTagCompound()); ByteBufUtils.writeTag(buf, stack.getItem().getNBTShareTag(stack));
buf.writeInt(API.instance().getItemStackHashCode(stack)); buf.writeInt(API.instance().getItemStackHashCode(stack));
buf.writeBoolean(network.hasPattern(stack)); buf.writeBoolean(network.hasPattern(stack));
buf.writeBoolean(displayCraftText); buf.writeBoolean(displayCraftText);

View File

@@ -3,7 +3,6 @@ package com.raoulvdberge.refinedstorage.network;
import com.raoulvdberge.refinedstorage.RSUtils; import com.raoulvdberge.refinedstorage.RSUtils;
import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPattern; import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPattern;
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster; import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid; import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
import com.raoulvdberge.refinedstorage.gui.grid.stack.ClientStackItem; import com.raoulvdberge.refinedstorage.gui.grid.stack.ClientStackItem;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
@@ -68,7 +67,7 @@ public class MessageGridItemUpdate implements IMessage, IMessageHandler<MessageG
if (item.doesDisplayCraftText()) { if (item.doesDisplayCraftText()) {
// This is an output from a pattern being sent. Only add it if it hasn't been added before. // This is an output from a pattern being sent. Only add it if it hasn't been added before.
for (ClientStackItem otherItem : GuiGrid.ITEMS.get(item.getStack().getItem())) { for (ClientStackItem otherItem : GuiGrid.ITEMS.get(item.getStack().getItem())) {
if (API.instance().getComparer().isEqualNoQuantity(item.getStack(), otherItem.getStack())) { if (item.getHash() == otherItem.getHash()) {
canAdd = false; canAdd = false;
break; break;