コード例 #1
0
  @Override
  public void writeSpawnData(ByteBuf buffer) {
    buffer.writeInt(spiderType.getId());

    if (owner != null) {
      buffer.writeLong(owner.getMostSignificantBits());
      buffer.writeLong(owner.getLeastSignificantBits());
    }
  }
コード例 #2
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());
 }