Getting closer on proper inventory syncing in the Transmutation Tablet
This commit is contained in:
parent
98c3c85d06
commit
fc2c7b6cde
|
@ -282,13 +282,12 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
||||||
{
|
{
|
||||||
super.onPickupFromSlot(entityPlayer, itemStack);
|
super.onPickupFromSlot(entityPlayer, itemStack);
|
||||||
|
|
||||||
Set<ItemStack> knownTransmutations = TransmutationKnowledgeRegistry.getInstance().getPlayersKnownTransmutations(ItemHelper.getOwnerUUID(itemStack));
|
this.containerTransmutationTablet.inventoryTransmutationTablet = new InventoryTransmutationTablet();
|
||||||
this.containerTransmutationTablet.inventoryTransmutationTablet = new InventoryTransmutationTablet(knownTransmutations);
|
|
||||||
this.containerTransmutationTablet.updateInventory();
|
this.containerTransmutationTablet.updateInventory();
|
||||||
|
|
||||||
if (!this.tileEntityTransmutationTablet.getWorldObj().isRemote && itemStack != null && itemStack.getItem() instanceof ItemAlchemicalTome && ItemHelper.hasOwnerUUID(itemStack))
|
if (!this.tileEntityTransmutationTablet.getWorldObj().isRemote && itemStack != null && itemStack.getItem() instanceof ItemAlchemicalTome && ItemHelper.hasOwnerUUID(itemStack))
|
||||||
{
|
{
|
||||||
PacketHandler.INSTANCE.sendToAllAround(new MessageTransmutationKnowledgeUpdate(knownTransmutations), new NetworkRegistry.TargetPoint(this.tileEntityTransmutationTablet.getWorldObj().provider.dimensionId, (double) this.tileEntityTransmutationTablet.xCoord, (double) this.tileEntityTransmutationTablet.yCoord, (double) this.tileEntityTransmutationTablet.zCoord, 5d));
|
PacketHandler.INSTANCE.sendToAllAround(new MessageTransmutationKnowledgeUpdate(), new NetworkRegistry.TargetPoint(this.tileEntityTransmutationTablet.getWorldObj().provider.dimensionId, (double) this.tileEntityTransmutationTablet.xCoord, (double) this.tileEntityTransmutationTablet.yCoord, (double) this.tileEntityTransmutationTablet.zCoord, 5d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +324,7 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
||||||
@Override
|
@Override
|
||||||
public boolean canTakeStack(EntityPlayer entityPlayer)
|
public boolean canTakeStack(EntityPlayer entityPlayer)
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.pahimar.ee3.network.message;
|
||||||
import com.pahimar.ee3.inventory.ContainerTransmutationTablet;
|
import com.pahimar.ee3.inventory.ContainerTransmutationTablet;
|
||||||
import com.pahimar.ee3.knowledge.TransmutationKnowledge;
|
import com.pahimar.ee3.knowledge.TransmutationKnowledge;
|
||||||
import com.pahimar.ee3.util.CompressionHelper;
|
import com.pahimar.ee3.util.CompressionHelper;
|
||||||
|
import com.pahimar.ee3.util.LogHelper;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
@ -19,6 +20,7 @@ public class MessageTransmutationKnowledgeUpdate implements IMessage, IMessageHa
|
||||||
|
|
||||||
public MessageTransmutationKnowledgeUpdate()
|
public MessageTransmutationKnowledgeUpdate()
|
||||||
{
|
{
|
||||||
|
this.transmutationKnowledge = new TransmutationKnowledge();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageTransmutationKnowledgeUpdate(Collection<ItemStack> knownTransmutationsCollection)
|
public MessageTransmutationKnowledgeUpdate(Collection<ItemStack> knownTransmutationsCollection)
|
||||||
|
@ -32,6 +34,8 @@ public class MessageTransmutationKnowledgeUpdate implements IMessage, IMessageHa
|
||||||
byte[] compressedString = null;
|
byte[] compressedString = null;
|
||||||
int readableBytes = buf.readInt();
|
int readableBytes = buf.readInt();
|
||||||
|
|
||||||
|
LogHelper.info(readableBytes);
|
||||||
|
|
||||||
if (readableBytes > 0)
|
if (readableBytes > 0)
|
||||||
{
|
{
|
||||||
compressedString = buf.readBytes(readableBytes).array();
|
compressedString = buf.readBytes(readableBytes).array();
|
||||||
|
|
Loading…
Reference in a new issue