Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.happykiller.weightlimit.server.packet.packets;
- import com.happykiller.weightlimit.main.ModMain;
- import com.happykiller.weightlimit.server.packet.AbstractPacket;
- import io.netty.buffer.ByteBuf;
- import io.netty.channel.ChannelHandlerContext;
- import net.minecraft.entity.player.EntityPlayer;
- public class OpenGuiPacket extends AbstractPacket {
- private int id;
- public OpenGuiPacket(){}
- public OpenGuiPacket(int id) {
- this.id = id;
- }
- public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
- buffer.writeInt(id);
- }
- public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
- id = buffer.readInt();
- }
- public void handleClientSide(EntityPlayer player) {
- }
- public void handleServerSide(EntityPlayer player) {
- player.openGui(ModMain.instance, id, player.worldObj,(int)player.posX, (int)player.posY, (int)player.posZ);
- }
- }
Add Comment
Please, Sign In to add comment