Package packets

Examples of packets.SPacket


   * To be called when an entity has to be unloaded
   */
  public void removeEntity(Entity entity) {
    if(entities.containsKey(entity.geteid())) {
      entities.remove(entity.geteid());
      SPacket p = new S0x1D(entity);
      getWorldState().connectionManager().sendPacketToAll(p);
    }
   
  }
View Full Code Here


  }
 
 
 
  private void informEntityAnimation(Entity entity) {
    SPacket p = new S0x12(entity);
    getWorldState().connectionManager().sendPacketToAllOthers(p, entity);
  }
View Full Code Here

  }
 
 
  private void informEntityMetadata(Entity entity) {
    System.out.println("GOING TO SEND ENTITYMETADATA");
    SPacket p = new S0x28(entity);   
    System.out.println("INFORMING OTHERS!");
    getWorldState().connectionManager().sendPacketToAll(p);
  }
View Full Code Here

    int dX = newLocation.x - oldLocation.x;
    int dY = newLocation.y - oldLocation.y;
    int dZ = newLocation.z - oldLocation.z;
   
    //relative movement
    SPacket p = new S0x21(entity, (byte) dX, (byte) dY, (byte) dZ);

   
   
//    SPacket p = new SPacket(0x22);
//    p.addInt(entity.geteid());
View Full Code Here

 
  /**
   * TODO: PLAYERMANAGER ???
   */
  public void informEntityChangedItem(Entity entity) {
    SPacket p = new S0x05((Player) entity);
    getWorldState().connectionManager().sendPacketToAllOthers(p, entity);
   
  }
View Full Code Here

   * @param z
   * @param player
   * @throws MCConnectionException
   */
  private void sendInitColumn(int x, int z, Player player) throws MCConnectionException {
    SPacket p = new S0x32(x, z, true);
    state.connectionManager().sendPacketTo(player, p);
    setPlayerHasLoadedColumn(player, x, z);
  }
View Full Code Here

    r = ArrayMerge.mergeBytes(r, block_skylight);
    r = ArrayMerge.mergeBytes(r, block_addarray);
    r = ArrayMerge.mergeBytes(r, biome_addarray);   
   
 
    SPacket p = new S0x33(x, z, true, bitmask, bitmaskaddarray, r);
    System.out.println("L: "+r.length);
    state.connectionManager().sendPacketTo(player, p);
   
  }
View Full Code Here

   
    /**
     * Reply some server information :)
     */
    SPacket s = new S0x01(player);
    conn.send(s);
       
    //returning:
    //  ENTITY ID    (Int)
    //  EMPTY STRING  (BB)
View Full Code Here

    } catch (IOException e) {}
  }

 
  public void disconnect(String message) {
    SPacket x = new S0xFF(message);
    try {
      this.send(x);
      Thread.sleep(100);
    }
    catch (MCConnectionException e) {}
View Full Code Here

    this.conn = conn;
  }
 
  @Override
  public void run() {
    SPacket ping = new S0x00(1);
   
    while(true) {
      try {
        Thread.sleep(25000);
        conn.send(ping);
View Full Code Here

TOP

Related Classes of packets.SPacket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.