public void write(SpoutOutputStream output) throws IOException {
   if (reset) {
     output.writeString(resetString);
     return;
   }
   output.writeString(textureURL);
   output.writeString(texturePlugin);
   PacketUtil.writeDoubleArray(output, xPos);
   PacketUtil.writeDoubleArray(output, yPos);
   PacketUtil.writeDoubleArray(output, zPos);
   PacketUtil.writeDoubleArray(output, textXPos);
   PacketUtil.writeDoubleArray(output, textYPos);
   output.writeFloat(lowXBound);
   output.writeFloat(lowYBound);
   output.writeFloat(lowZBound);
   output.writeFloat(highXBound);
   output.writeFloat(highYBound);
   output.writeFloat(highZBound);
   output.writeFloat(maxBrightness);
   output.writeFloat(minBrightness);
   output.writeInt(renderPass);
   PacketUtil.writeIntArray(output, lightSourceXOffset);
   PacketUtil.writeIntArray(output, lightSourceYOffset);
   PacketUtil.writeIntArray(output, lightSourceZOffset);
 }
Esempio n. 2
0
 @Override
 public void writeData(SpoutOutputStream output) throws IOException {
   output.writeInt(customId);
   output.writeString(getName());
   output.writeString(getPlugin().getDescription().getName());
   output.writeString(getTexture());
 }
 @Override
 public void writeData(SpoutOutputStream output) throws IOException {
   if (text.length() > Short.MAX_VALUE) {
     text = text.substring(0, Short.MAX_VALUE - 1);
   }
   output.writeString(text);
 }
 @Override
 public void writeData(SpoutOutputStream output) throws IOException {
   output.writeString(text);
   output.writeDouble(location.getX());
   output.writeDouble(location.getY());
   output.writeDouble(location.getZ());
   output.writeFloat(scale);
   output.writeInt(duration);
   output.writeDouble(movement.getX());
   output.writeDouble(movement.getY());
   output.writeDouble(movement.getZ());
 }
Esempio n. 5
0
 @Override
 public void write(SpoutOutputStream stream) {
   stream.writeString(name);
   stream.writeString(shortName);
   stream.writeInt(typeInt);
   stream.writeInt(amount);
   stream.writeInt(startAmount);
   stream.writeInt(explosionSize);
   stream.writeInt(timeBeforeExplosion);
   stream.writeInt(damage);
   stream.writeInt(stunTime);
   stream.writeUUID(uuid);
   RushMe.getInstance().getLogger().debugLog(Level.INFO, "Read PacketGrenadeUpdate.  Atributes:");
   RushMe.getInstance()
       .getLogger()
       .debugLog(
           Level.INFO,
           "Name = "
               + name
               + ";ShortName = "
               + shortName
               + ";TypeInt = "
               + typeInt
               + ";Type = "
               + type
               + ";Amount = "
               + amount
               + ";StartAmount = "
               + startAmount
               + ";ExplosionSize = "
               + explosionSize
               + ";TimeBeforeExplosion = "
               + timeBeforeExplosion
               + ";Damage = "
               + damage
               + ";StunTime = "
               + stunTime
               + ";UUID = "
               + uuid);
 }
  @Override
  public void writeData(SpoutOutputStream output) throws IOException {
    super.writeData(output);
    output.writeInt(stack.getTypeId());
    output.writeShort((short) stack.getAmount());
    output.writeShort(stack.getDurability());
    output.writeInt(depth);
    output.writeBoolean(renderAmount);

    if (stack.hasItemMeta() && stack.getItemMeta().hasDisplayName()) {
      output.writeBoolean(true);
      output.writeString(stack.getItemMeta().getDisplayName());
    } else {
      output.writeBoolean(false);
    }

    if (stack.hasItemMeta() && stack.getItemMeta().hasLore()) {
      output.writeBoolean(true);
      output.writeInt(stack.getItemMeta().getLore().size());
      for (String l : stack.getItemMeta().getLore()) {
        output.writeString(l);
      }
    } else {
      output.writeBoolean(false);
    }

    if (stack.hasItemMeta() && stack.getItemMeta().hasEnchants()) {
      output.writeBoolean(true);
      output.writeInt(stack.getItemMeta().getEnchants().size());
      for (Entry e : stack.getItemMeta().getEnchants().entrySet()) {
        output.writeInt(((Enchantment) e.getKey()).getId());
        output.writeInt((Integer) e.getValue());
      }
    } else {
      output.writeBoolean(false);
    }
  }
 @Override
 public void writeData(SpoutOutputStream output) throws IOException {
   output.writeInt(id);
   output.writeShort(data);
   output.writeString(name);
 }
 public void writeReset(SpoutOutputStream output) throws IOException {
   output.writeString(resetString);
 }