Examples of ShortTag


Examples of org.jmule.core.edonkey.packet.tag.ShortTag

      InternalJKadManager _jkad_manager = (InternalJKadManager) JKadManagerSingleton.getInstance();
      ConfigurationManager config_manager = ConfigurationManagerSingleton.getInstance();
      TagList tagList = new TagList();
      tagList.addTag(new IntTag(JKadConstants.TAG_SOURCEIP, Convert.byteToInt(_jkad_manager.getIPAddress().getAddress())));
      try {
        tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEPORT, Convert.intToShort(config_manager.getTCP())));
      } catch (ConfigurationManagerException e) {
        e.printStackTrace();
        _jkad_manager.disconnect();
      }
      try {
        tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEUPORT, Convert.intToShort(config_manager.getUDP())));
      } catch (ConfigurationManagerException e) {
        e.printStackTrace();
        _jkad_manager.disconnect();
      }
      tagList.addTag(new IntTag(JKadConstants.TAG_FILESIZE, Convert.longToInt(file.length())));
View Full Code Here

Examples of org.jmule.core.edonkey.packet.tag.ShortTag

  public Source(ClientID clientID, IPAddress address, int udpPort, int tcpPort) {
    creationTime = System.currentTimeMillis();
    this.clientID = clientID;
    tagList = new TagList();
    tagList.addTag(new IntTag(JKadConstants.TAG_SOURCEIP,Convert.byteToInt(address.getAddress())));
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEPORT,Convert.intToShort(tcpPort)));
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEUPORT,Convert.intToShort(udpPort)));
  }
View Full Code Here

Examples of org.jmule.core.edonkey.packet.tag.ShortTag

    return (Integer)object;
  }

  public void setUDPPort(int udpPort) {
    tagList.removeTag(JKadConstants.TAG_SOURCEUPORT);
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEUPORT,Convert.intToShort(udpPort)));
  }
View Full Code Here

Examples of org.jmule.core.edonkey.packet.tag.ShortTag

    return (Integer)object;
  }

  public void setTCPPort(int tcpPort) {
    tagList.removeTag(JKadConstants.TAG_SOURCEPORT);
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEPORT,Convert.intToShort(tcpPort)));
  }
View Full Code Here

Examples of org.spout.nbt.ShortTag

    List<CompoundTag> enchantments = new ArrayList<CompoundTag>();
    if (nbtData.get("ench") instanceof ListTag<?>) {
      enchantments = new ArrayList<CompoundTag>(((ListTag<CompoundTag>) nbtData.get("ench")).getValue());
    }
    CompoundMap map = new CompoundMap();
    map.put(new ShortTag("id", (short) enchantment.getId()));
    map.put(new ShortTag("lvl", (short) powerLevel));
    enchantments.add(new CompoundTag(null, map));
    nbtData.put(new ListTag<CompoundTag>("ench", CompoundTag.class, enchantments));
    item.setNBTData(nbtData);
    return true;
  }
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.