Ejemplo n.º 1
0
  @Override
  public void writeSpawnData(ByteBuf buffer) {
    buffer.writeInt(spiderType.getId());

    if (owner != null) {
      buffer.writeLong(owner.getMostSignificantBits());
      buffer.writeLong(owner.getLeastSignificantBits());
    }
  }
Ejemplo n.º 2
0
  @Override
  public void readSpawnData(ByteBuf buffer) {
    spiderType = EnumSpiderType.byId(buffer.readInt());

    try {
      owner = new UUID(buffer.readLong(), buffer.readLong());
    } catch (IndexOutOfBoundsException e) {
      // Ignore.
    }
  }
Ejemplo n.º 3
0
 @Override
 public void readEntityFromNBT(NBTTagCompound nbt) {
   super.readEntityFromNBT(nbt);
   spiderType = EnumSpiderType.byId(nbt.getInteger("spiderType"));
   abilityCounter = nbt.getInteger("abilityCounter");
   abilityThreshold = nbt.getInteger("abilityThreshold");
   killsUntilLevelUp = nbt.getInteger("killsUntilLevelUp");
   owner = new UUID(nbt.getLong("ownerMSB"), nbt.getLong("ownerLSB"));
   final NBTTagList tagList = nbt.getTagList("inventory", 10);
   inventory.loadInventoryFromNBT(tagList);
 }
Ejemplo n.º 4
0
 @Override
 public void writeEntityToNBT(NBTTagCompound nbt) {
   super.writeEntityToNBT(nbt);
   nbt.setInteger("spiderType", spiderType.getId());
   nbt.setInteger("abilityCounter", abilityCounter);
   nbt.setInteger("abilityThreshold", abilityThreshold);
   nbt.setInteger("killsUntilLevelUp", killsUntilLevelUp);
   nbt.setLong("ownerMSB", owner.getMostSignificantBits());
   nbt.setLong("ownerLSB", owner.getLeastSignificantBits());
   nbt.setTag("inventory", inventory.saveInventoryToNBT());
 }
Ejemplo n.º 5
0
 @Override
 public String getCommandSenderName() {
   return spiderType.getFriendlyName() + " Spider";
 }