Guest User

Untitled

a guest
Sep 21st, 2016
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. package melonslise.runicinscription.common.network;
  2.  
  3. import cpw.mods.fml.common.network.simpleimpl.IMessage;
  4. import io.netty.buffer.ByteBuf;
  5.  
  6. public class MessageGrid implements IMessage
  7. {
  8.     private boolean grid;
  9.     private int posX;
  10.     private int posY;
  11.    
  12.     public MessageGrid(boolean grid, int posX, int posY)
  13.     {
  14.         this.grid = grid;
  15.         this.posX = posX;
  16.         this.posY = posY;
  17.     }
  18.    
  19.     @Override
  20.     public void fromBytes(ByteBuf buf)
  21.     {
  22.         buf.writeBoolean(grid);
  23.         buf.writeInt(posX);
  24.         buf.writeInt(posY);
  25.     }
  26.  
  27.     @Override
  28.     public void toBytes(ByteBuf buf)
  29.     {
  30.         grid = buf.readBoolean();
  31.         posX = buf.readInt();
  32.         posY = buf.readInt();
  33.     }
  34.    
  35.     public boolean getGrid()
  36.     {
  37.         return this.grid;
  38.     }
  39.    
  40.     public int getPosX()
  41.     {
  42.         return this.posX;
  43.     }
  44.    
  45.     public int getPosY()
  46.     {
  47.         return this.posY;
  48.     }
  49. }
Add Comment
Please, Sign In to add comment