blob: c810efd0f8d8810f674c7836c035e17887b0ad97 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package darkknight.jewelrycraft.network;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import darkknight.jewelrycraft.JewelrycraftMod;
public class PacketKeyPressEvent implements IMessage, IMessageHandler<PacketKeyPressEvent, IMessage>
{
public int actionID;
public PacketKeyPressEvent(int id)
{
actionID = id;
}
public PacketKeyPressEvent()
{
}
@Override
public IMessage onMessage(PacketKeyPressEvent message, MessageContext ctx)
{
EntityPlayer sender = ctx.getServerHandler().playerEntity;
// Jewelry inventory
if (message.actionID == 0) sender.openGui(JewelrycraftMod.instance, 2, sender.worldObj, (int)sender.posX, (int)sender.posY, (int)sender.posZ);
return null;
}
@Override
public void fromBytes(ByteBuf buf)
{
actionID = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf)
{
buf.writeInt(actionID);
}
}
|