Examples of SpoutPacket


Examples of org.getspout.spoutapi.packet.SpoutPacket

    }

    protected void sendPacket() {
      List<Player> players = world.getPlayers();
      if (xCoords.size() > 6) {
        SpoutPacket packet;
        if (xCoords.size() > 128) {
          int chunkX = xCoords.get(0) >> 4;
          int chunkZ = zCoords.get(0) >> 4;
          packet = new PacketCustomBlockChunkOverride(SpoutManager.getChunkDataManager().getCustomBlockIds(world, chunkX, chunkZ), SpoutManager.getChunkDataManager().getCustomBlockData(world, chunkX, chunkZ),chunkX, chunkZ);
        } else {
          packet = new PacketCustomMultiBlockOverride(xCoords, yCoords, zCoords, typeIds, data);
        }

        for (Player player : players) {
          if (player instanceof SpoutCraftPlayer) {
            SpoutCraftPlayer spc = (SpoutCraftPlayer) player;
            if (spc.isSpoutCraftEnabled()) {
              spc.sendPacket(packet);
            }
          }
        }
      } else {
        for (int i = 0; i < xCoords.size(); i++) {
          SpoutPacket packet = new PacketCustomBlockOverride(xCoords.get(i), yCoords.get(i), zCoords.get(i), typeIds.get(i), data.get(i));
          for (Player player : players) {
            if (player instanceof SpoutCraftPlayer) {
              SpoutCraftPlayer spc = (SpoutCraftPlayer) player;
              if (spc.isSpoutCraftEnabled()) {
                spc.sendPacket(packet);
View Full Code Here

Examples of org.getspout.spoutapi.packet.SpoutPacket

    org.getspout.spoutapi.material.Block block = MaterialData.getBlock(id, data);
    if (block != null) {
      cachedBlockData = null;
      HashSet<org.getspout.spoutapi.material.Block> toUpdate = new HashSet<org.getspout.spoutapi.material.Block>(1);
      toUpdate.add(block);
      SpoutPacket updatePacket = new PacketBlockData(toUpdate);
      for (SpoutPlayer player : SpoutManager.getOnlinePlayers()) {
        if (player.isSpoutCraftEnabled()) {
          player.sendPacket(updatePacket);
        }
      }
View Full Code Here

Examples of org.spoutcraft.client.packet.SpoutPacket

  public static void onTick() {
    synchronized(instance.decompressed) {
      Iterator<CompressablePacket> i = instance.decompressed.iterator();
      while (i.hasNext()) {
        SpoutPacket packet = i.next();
        try {
          SpoutClient.getHandle().mcProfiler.startSection(packet.getPacketType().name());
          packet.run(SpoutClient.getHandle().thePlayer.entityId);
          i.remove();
        } catch (Exception e) {
          System.out.println("------------------------");
          System.out.println("Unexpected Exception: " + packet.getPacketType());
          e.printStackTrace();
          System.out.println("------------------------");
        } finally {
          SpoutClient.getHandle().mcProfiler.endSection();
        }
View Full Code Here

Examples of org.spoutcraft.client.packet.SpoutPacket

    ScreenType display = ScreenUtil.getType(screen);

    if (notify && thePlayer != null && theWorld != null) {
      // Screen closed
      SpoutPacket packet = null;
      Screen widget = null;
      if (this.currentScreen != null && screen == null) {
        packet = new PacketScreenAction(ScreenAction.Close, ScreenUtil.getType(this.currentScreen));
        widget = currentScreen.getScreen();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.